Browse Source

Added support for events in the AST.

pull/1/head
triton 13 years ago
parent
commit
bb4085fc5f
  1. 5
      src/Bridge/ASTVisitor.cs
  2. 2
      src/Bridge/Class.cs
  3. 1
      src/Bridge/Declaration.cs
  4. 22
      src/Bridge/Event.cs
  5. 5
      src/Generator/Generators/CLI/CLIForwardRefeferencePrinter.cs
  6. 10
      src/Generator/Generators/CLI/CLIMarshal.cs
  7. 5
      src/Generator/Generators/CLI/CLITypePrinter.cs
  8. 5
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

5
src/Bridge/ASTVisitor.cs

@ -194,6 +194,11 @@ namespace Cxxi @@ -194,6 +194,11 @@ namespace Cxxi
return true;
}
public virtual bool VisitEvent(Event @event)
{
return true;
}
#endregion
}
}

2
src/Bridge/Class.cs

@ -82,6 +82,7 @@ namespace Cxxi @@ -82,6 +82,7 @@ namespace Cxxi
public List<Field> Fields;
public List<Property> Properties;
public List<Method> Methods;
public List<Event> Events;
// True if the record is a POD (Plain Old Data) type.
public bool IsPOD;
@ -107,6 +108,7 @@ namespace Cxxi @@ -107,6 +108,7 @@ namespace Cxxi
Fields = new List<Field>();
Properties = new List<Property>();
Methods = new List<Method>();
Events = new List<Event>();
NestedClasses = new List<Class>();
NestedEnums = new List<Enumeration>();
IsAbstract = false;

1
src/Bridge/Declaration.cs

@ -138,5 +138,6 @@ namespace Cxxi @@ -138,5 +138,6 @@ namespace Cxxi
T VisitFunctionTemplateDecl(FunctionTemplate template);
T VisitMacroDefinition(MacroDefinition macro);
T VisitNamespace(Namespace @namespace);
T VisitEvent(Event @event);
}
}

22
src/Bridge/Event.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
using System.Collections.Generic;
namespace Cxxi
{
public class Event : Declaration, ITypedDecl
{
public Event()
{
Parameters = new List<QualifiedType>();
}
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitEvent(this);
}
public Type Type { get { return QualifiedType.Type; } }
public QualifiedType QualifiedType { get; set; }
public List<QualifiedType> Parameters;
}
}

5
src/Generator/Generators/CLI/CLIForwardRefeferencePrinter.cs

@ -152,5 +152,10 @@ namespace Cxxi.Generators.CLI @@ -152,5 +152,10 @@ namespace Cxxi.Generators.CLI
{
throw new NotImplementedException();
}
public bool VisitEvent(Event @event)
{
throw new NotImplementedException();
}
}
}

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

@ -221,6 +221,11 @@ namespace Cxxi.Generators.CLI @@ -221,6 +221,11 @@ namespace Cxxi.Generators.CLI
throw new NotImplementedException();
}
public bool VisitEvent(Event @event)
{
throw new NotImplementedException();
}
public bool VisitDelegate(Delegate @delegate)
{
throw new NotImplementedException();
@ -543,6 +548,11 @@ namespace Cxxi.Generators.CLI @@ -543,6 +548,11 @@ namespace Cxxi.Generators.CLI
throw new NotImplementedException();
}
public bool VisitEvent(Event @event)
{
throw new NotImplementedException();
}
public bool VisitDelegate(Delegate @delegate)
{
throw new NotImplementedException();

5
src/Generator/Generators/CLI/CLITypePrinter.cs

@ -248,5 +248,10 @@ namespace Cxxi.Generators.CLI @@ -248,5 +248,10 @@ namespace Cxxi.Generators.CLI
{
throw new NotImplementedException();
}
public string VisitEvent(Event @event)
{
throw new NotImplementedException();
}
}
}

5
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -200,6 +200,11 @@ namespace Cxxi.Generators.CSharp @@ -200,6 +200,11 @@ namespace Cxxi.Generators.CSharp
throw new NotImplementedException();
}
public string VisitEvent(Event @event)
{
throw new NotImplementedException();
}
public string GetArgumentsString(FunctionType function, bool hasNames)
{
var arguments = function.Arguments;

Loading…
Cancel
Save