Browse Source

Updated the generator to be able to use the new parser.

pull/86/head
triton 12 years ago
parent
commit
ece5fb6e56
  1. 5
      src/Generator/Options.cs
  2. 2
      src/Generator/Passes/CleanUnitPass.cs
  3. 6
      src/Generator/Passes/GenerateAbstractImplementationsPass.cs
  4. 6
      src/Generator/Passes/GenerateInlinesCodePass.cs
  5. 2
      src/Generator/Utils/TestsUtils.cs

5
src/Generator/Options.cs

@ -5,6 +5,11 @@ using System.Text; @@ -5,6 +5,11 @@ using System.Text;
using CppSharp.AST;
using CppSharp.Generators;
#if !OLD_PARSER
using CppSharp.Parser;
using CppAbi = CppSharp.Parser.AST.CppAbi;
#endif
namespace CppSharp
{
public class DriverOptions

2
src/Generator/Passes/CleanUnitPass.cs

@ -25,7 +25,7 @@ namespace CppSharp.Passes @@ -25,7 +25,7 @@ namespace CppSharp.Passes
var includePath = filePath;
var shortestIncludePath = filePath;
foreach (var path in DriverOptions.IncludeDirs)
foreach (var path in DriverOptions.Parser.IncludeDirs)
{
int idx = filePath.IndexOf(path, System.StringComparison.Ordinal);
if (idx == -1) continue;

6
src/Generator/Passes/GenerateAbstractImplementationsPass.cs

@ -2,6 +2,10 @@ @@ -2,6 +2,10 @@
using System.Linq;
using CppSharp.AST;
#if !OLD_PARSER
using CppAbi = CppSharp.Parser.AST.CppAbi;
#endif
namespace CppSharp.Passes
{
/// <summary>
@ -125,7 +129,7 @@ namespace CppSharp.Passes @@ -125,7 +129,7 @@ namespace CppSharp.Passes
private void FillVTable(Class @class, IList<Method> abstractMethods, Class internalImplementation)
{
switch (Driver.Options.Abi)
switch (Driver.Options.Parser.Abi)
{
case CppAbi.Microsoft:
CreateVTableMS(@class, abstractMethods, internalImplementation);

6
src/Generator/Passes/GenerateInlinesCodePass.cs

@ -3,6 +3,10 @@ using System.IO; @@ -3,6 +3,10 @@ using System.IO;
using System.Text;
using CppSharp.AST;
#if !OLD_PARSER
using CppAbi = CppSharp.Parser.AST.CppAbi;
#endif
namespace CppSharp.Passes
{
public class GenerateInlinesCodePass : TranslationUnitPass
@ -33,7 +37,7 @@ namespace CppSharp.Passes @@ -33,7 +37,7 @@ namespace CppSharp.Passes
private void WriteInlinedSymbols()
{
switch (Driver.Options.Abi)
switch (Driver.Options.Parser.Abi)
{
case CppAbi.Microsoft:
var defBuilder = new StringBuilder("EXPORTS\r\n");

2
src/Generator/Utils/TestsUtils.cs

@ -37,7 +37,7 @@ namespace CppSharp.Utils @@ -37,7 +37,7 @@ namespace CppSharp.Utils
options.SharedLibraryName += ".dll";
var path = Path.GetFullPath("../../../tests/" + name);
options.IncludeDirs.Add(path);
options.Parser.IncludeDirs.Add(path);
if (!Directory.Exists(path))
{

Loading…
Cancel
Save