Browse Source

Added an unsupported type node to the AST.

pull/696/head
Joao Matos 9 years ago
parent
commit
76ce6c7836
  1. 11
      src/AST/ASTVisitor.cs
  2. 5
      src/AST/CppTypePrinter.cs
  3. 25
      src/AST/Type.cs
  4. 5
      src/Generator/Generators/CLI/CLITypePrinter.cs
  5. 5
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  6. 5
      src/Generator/Passes/CheckVirtualOverrideReturnCovariance.cs

11
src/AST/ASTVisitor.cs

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace CppSharp.AST
{
@ -278,6 +279,14 @@ namespace CppSharp.AST @@ -278,6 +279,14 @@ namespace CppSharp.AST
return true;
}
public bool VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals)
{
if (!VisitType(type, quals))
return false;
return true;
}
#endregion
#region Decl Visitors

5
src/AST/CppTypePrinter.cs

@ -229,6 +229,11 @@ namespace CppSharp.AST @@ -229,6 +229,11 @@ namespace CppSharp.AST
throw new NotImplementedException(string.Format("Unhandled .NET type: {0}", type.Type));
}
public string VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals)
{
return string.Empty;
}
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals)
{
throw new System.NotImplementedException();

25
src/AST/Type.cs

@ -1054,6 +1054,30 @@ namespace CppSharp.AST @@ -1054,6 +1054,30 @@ namespace CppSharp.AST
}
}
public class UnsupportedType : Type
{
public UnsupportedType()
{
}
public UnsupportedType(UnsupportedType type)
: base(type)
{
}
public string Description;
public override T Visit<T>(ITypeVisitor<T> visitor, TypeQualifiers quals = new TypeQualifiers())
{
return visitor.VisitUnsupportedType(this, quals);
}
public override object Clone()
{
return new UnsupportedType(this);
}
}
#region Primitives
/// <summary>
@ -1185,5 +1209,6 @@ namespace CppSharp.AST @@ -1185,5 +1209,6 @@ namespace CppSharp.AST
T VisitUnaryTransformType(UnaryTransformType unaryTransformType, TypeQualifiers quals);
T VisitVectorType(VectorType vectorType, TypeQualifiers quals);
T VisitCILType(CILType type, TypeQualifiers quals);
T VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals);
}
}

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

@ -340,6 +340,11 @@ namespace CppSharp.Generators.CLI @@ -340,6 +340,11 @@ namespace CppSharp.Generators.CLI
return VisitPrimitiveType(type);
}
public string VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals)
{
throw new NotImplementedException();
}
public string VisitDeclaration(Declaration decl, TypeQualifiers quals)
{
return VisitDeclaration(decl);

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

@ -842,6 +842,11 @@ namespace CppSharp.Generators.CSharp @@ -842,6 +842,11 @@ namespace CppSharp.Generators.CSharp
throw new NotImplementedException();
}
public CSharpTypePrinterResult VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals)
{
throw new NotImplementedException();
}
public CSharpTypePrinterResult VisitFunctionTemplateSpecializationDecl(FunctionTemplateSpecialization specialization)
{
throw new NotImplementedException();

5
src/Generator/Passes/CheckVirtualOverrideReturnCovariance.cs

@ -186,6 +186,11 @@ namespace CppSharp.Passes @@ -186,6 +186,11 @@ namespace CppSharp.Passes
return false;
}
public bool VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals)
{
return false;
}
public bool VisitDeclaration(Declaration decl)
{
return false;

Loading…
Cancel
Save