Browse Source

Added namespace walk support.

pull/1/head
triton 13 years ago
parent
commit
b8ebd27841
  1. 23
      src/Bridge/ASTVisitor.cs
  2. 1
      src/Bridge/Declaration.cs
  3. 3
      src/Bridge/Namespace.cs
  4. 10
      src/Generator/Generators/CLI/CLIHelpers.cs
  5. 11
      src/Generator/Generators/CLI/CLIMarshal.cs

23
src/Bridge/ASTVisitor.cs

@ -153,6 +153,29 @@ namespace Cxxi
return true; return true;
} }
public bool VisitNamespace(Namespace @namespace)
{
foreach (var decl in @namespace.Classes)
decl.Visit(this);
foreach (var decl in @namespace.Functions)
decl.Visit(this);
foreach (var decl in @namespace.Enums)
decl.Visit(this);
foreach (var decl in @namespace.Templates)
decl.Visit(this);
foreach (var decl in @namespace.Typedefs)
decl.Visit(this);
foreach (var decl in @namespace.Namespaces)
decl.Visit(this);
return true;
}
#endregion #endregion
} }
} }

1
src/Bridge/Declaration.cs

@ -131,5 +131,6 @@ namespace Cxxi
T VisitClassTemplateDecl(ClassTemplate template); T VisitClassTemplateDecl(ClassTemplate template);
T VisitFunctionTemplateDecl(FunctionTemplate template); T VisitFunctionTemplateDecl(FunctionTemplate template);
T VisitMacroDefinition(MacroDefinition macro); T VisitMacroDefinition(MacroDefinition macro);
T VisitNamespace(Namespace @namespace);
} }
} }

3
src/Bridge/Namespace.cs

@ -206,8 +206,7 @@ namespace Cxxi
public override T Visit<T>(IDeclVisitor<T> visitor) public override T Visit<T>(IDeclVisitor<T> visitor)
{ {
return default(T); return visitor.VisitNamespace(this);
//visitor.VisitNamespace(this);
} }
} }
} }

10
src/Generator/Generators/CLI/CLIHelpers.cs

@ -242,6 +242,11 @@ namespace Cxxi.Generators.CLI
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public string VisitNamespace(Namespace @namespace)
{
throw new NotImplementedException();
}
} }
public class CLIForwardRefeferencePrinter : IDeclVisitor<bool> public class CLIForwardRefeferencePrinter : IDeclVisitor<bool>
@ -353,6 +358,11 @@ namespace Cxxi.Generators.CLI
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool VisitNamespace(Namespace @namespace)
{
throw new NotImplementedException();
}
} }
#endregion #endregion

11
src/Generator/Generators/CLI/CLIMarshal.cs

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Text; using System.Text;
using Cxxi.Types; using Cxxi.Types;
@ -196,6 +197,11 @@ namespace Cxxi.Generators.CLI
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool VisitNamespace(Namespace @namespace)
{
throw new NotImplementedException();
}
public bool VisitDelegate(Delegate @delegate) public bool VisitDelegate(Delegate @delegate)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
@ -431,6 +437,11 @@ namespace Cxxi.Generators.CLI
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool VisitNamespace(Namespace @namespace)
{
throw new NotImplementedException();
}
public bool VisitDelegate(Delegate @delegate) public bool VisitDelegate(Delegate @delegate)
{ {
throw new NotImplementedException(); throw new NotImplementedException();

Loading…
Cancel
Save