Browse Source

Re-generated the AST bootstrap code with visitors and abstract classes.

pull/1192/head
Joao Matos 6 years ago committed by João Matos
parent
commit
a4ed8a5204
  1. 12
      src/AST/ASTVisitor.cs
  2. 301
      src/AST/Expr.cs
  3. 98
      src/AST/Stmt.cs
  4. 1232
      src/AST/StmtVisitor.cs

12
src/AST/ASTVisitor.cs

@ -43,7 +43,7 @@ namespace CppSharp.AST
/// this will visit all the nodes in a default way that should be useful /// this will visit all the nodes in a default way that should be useful
/// for a lot of applications. /// for a lot of applications.
/// </summary> /// </summary>
public abstract class AstVisitor : IAstVisitor<bool>, IAstVisited public abstract partial class AstVisitor : IAstVisitor<bool>, IAstVisited
{ {
public ISet<object> Visited { get; private set; } public ISet<object> Visited { get; private set; }
public AstVisitorOptions VisitOptions { get; private set; } public AstVisitorOptions VisitOptions { get; private set; }
@ -64,6 +64,11 @@ namespace CppSharp.AST
return !Visited.Add(decl); return !Visited.Add(decl);
} }
public bool AlreadyVisited(Stmt stmt)
{
return !Visited.Add(stmt);
}
#region Type Visitors #region Type Visitors
public virtual bool VisitType(Type type, TypeQualifiers quals) public virtual bool VisitType(Type type, TypeQualifiers quals)
@ -632,5 +637,10 @@ namespace CppSharp.AST
} }
#endregion #endregion
public virtual bool VisitStmt(Stmt stmt)
{
return !AlreadyVisited(stmt);
}
} }
} }

301
src/AST/Expr.cs

@ -224,7 +224,7 @@ namespace CppSharp.AST
PreferredAlignOf = 4 PreferredAlignOf = 4
} }
public partial class Expr : Stmt public abstract partial class Expr : Stmt
{ {
public enum LValueClassification public enum LValueClassification
{ {
@ -383,7 +383,7 @@ namespace CppSharp.AST
public bool HasPlaceholderType { get; set; } public bool HasPlaceholderType { get; set; }
} }
public partial class FullExpr : Expr public abstract partial class FullExpr : Expr
{ {
public FullExpr() public FullExpr()
{ {
@ -398,6 +398,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitConstantExpr(this);
} }
public partial class OpaqueValueExpr : Expr public partial class OpaqueValueExpr : Expr
@ -409,6 +412,9 @@ namespace CppSharp.AST
public bool IsUnique { get; set; } public bool IsUnique { get; set; }
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public Expr SourceExpr { get; set; } public Expr SourceExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitOpaqueValueExpr(this);
} }
public partial class DeclRefExpr : Expr public partial class DeclRefExpr : Expr
@ -429,6 +435,9 @@ namespace CppSharp.AST
public bool HasExplicitTemplateArgs { get; set; } public bool HasExplicitTemplateArgs { get; set; }
public uint NumTemplateArgs { get; set; } public uint NumTemplateArgs { get; set; }
public bool RefersToEnclosingVariableOrCapture { get; set; } public bool RefersToEnclosingVariableOrCapture { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDeclRefExpr(this);
} }
public partial class IntegerLiteral : Expr public partial class IntegerLiteral : Expr
@ -439,6 +448,9 @@ namespace CppSharp.AST
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public ulong Value { get; set; } public ulong Value { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitIntegerLiteral(this);
} }
public partial class FixedPointLiteral : Expr public partial class FixedPointLiteral : Expr
@ -449,6 +461,9 @@ namespace CppSharp.AST
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public ulong Value { get; set; } public ulong Value { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitFixedPointLiteral(this);
} }
public partial class CharacterLiteral : Expr public partial class CharacterLiteral : Expr
@ -469,6 +484,9 @@ namespace CppSharp.AST
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public CharacterLiteral.CharacterKind Kind { get; set; } public CharacterLiteral.CharacterKind Kind { get; set; }
public uint Value { get; set; } public uint Value { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCharacterLiteral(this);
} }
public partial class FloatingLiteral : Expr public partial class FloatingLiteral : Expr
@ -480,6 +498,9 @@ namespace CppSharp.AST
public bool Exact { get; set; } public bool Exact { get; set; }
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public double ValueAsApproximateDouble { get; set; } public double ValueAsApproximateDouble { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitFloatingLiteral(this);
} }
public partial class ImaginaryLiteral : Expr public partial class ImaginaryLiteral : Expr
@ -489,6 +510,9 @@ namespace CppSharp.AST
} }
public Expr SubExpr { get; set; } public Expr SubExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitImaginaryLiteral(this);
} }
public partial class StringLiteral : Expr public partial class StringLiteral : Expr
@ -521,6 +545,9 @@ namespace CppSharp.AST
public bool ContainsNonAscii { get; set; } public bool ContainsNonAscii { get; set; }
public bool ContainsNonAsciiOrNull { get; set; } public bool ContainsNonAsciiOrNull { get; set; }
public uint NumConcatenated { get; set; } public uint NumConcatenated { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitStringLiteral(this);
} }
public partial class PredefinedExpr : Expr public partial class PredefinedExpr : Expr
@ -547,6 +574,9 @@ namespace CppSharp.AST
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public PredefinedExpr.IdentKind identKind { get; set; } public PredefinedExpr.IdentKind identKind { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitPredefinedExpr(this);
} }
public partial class ParenExpr : Expr public partial class ParenExpr : Expr
@ -558,6 +588,9 @@ namespace CppSharp.AST
public Expr SubExpr { get; set; } public Expr SubExpr { get; set; }
public SourceLocation LParen { get; set; } public SourceLocation LParen { get; set; }
public SourceLocation RParen { get; set; } public SourceLocation RParen { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitParenExpr(this);
} }
public partial class UnaryOperator : Expr public partial class UnaryOperator : Expr
@ -576,6 +609,9 @@ namespace CppSharp.AST
public bool IsDecrementOp { get; set; } public bool IsDecrementOp { get; set; }
public bool IsIncrementDecrementOp { get; set; } public bool IsIncrementDecrementOp { get; set; }
public bool IsArithmeticOp { get; set; } public bool IsArithmeticOp { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitUnaryOperator(this);
} }
public partial class OffsetOfExpr : Expr public partial class OffsetOfExpr : Expr
@ -588,6 +624,9 @@ namespace CppSharp.AST
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public uint NumComponents { get; set; } public uint NumComponents { get; set; }
public uint NumExpressions { get; set; } public uint NumExpressions { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitOffsetOfExpr(this);
} }
public partial class UnaryExprOrTypeTraitExpr : Expr public partial class UnaryExprOrTypeTraitExpr : Expr
@ -603,6 +642,9 @@ namespace CppSharp.AST
public QualifiedType ArgumentType { get; set; } public QualifiedType ArgumentType { get; set; }
public Expr ArgumentExpr { get; set; } public Expr ArgumentExpr { get; set; }
public QualifiedType TypeOfArgument { get; set; } public QualifiedType TypeOfArgument { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitUnaryExprOrTypeTraitExpr(this);
} }
public partial class ArraySubscriptExpr : Expr public partial class ArraySubscriptExpr : Expr
@ -616,6 +658,9 @@ namespace CppSharp.AST
public SourceLocation RBracketLoc { get; set; } public SourceLocation RBracketLoc { get; set; }
public Expr Base { get; set; } public Expr Base { get; set; }
public Expr Idx { get; set; } public Expr Idx { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitArraySubscriptExpr(this);
} }
public partial class CallExpr : Expr public partial class CallExpr : Expr
@ -633,6 +678,9 @@ namespace CppSharp.AST
public uint NumCommas { get; set; } public uint NumCommas { get; set; }
public uint BuiltinCallee { get; set; } public uint BuiltinCallee { get; set; }
public bool IsCallToStdMove { get; set; } public bool IsCallToStdMove { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCallExpr(this);
} }
public partial class MemberExpr : Expr public partial class MemberExpr : Expr
@ -654,6 +702,9 @@ namespace CppSharp.AST
public uint NumTemplateArgs { get; set; } public uint NumTemplateArgs { get; set; }
public SourceLocation OperatorLoc { get; set; } public SourceLocation OperatorLoc { get; set; }
public bool IsImplicitAccess { get; set; } public bool IsImplicitAccess { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitMemberExpr(this);
} }
public partial class CompoundLiteralExpr : Expr public partial class CompoundLiteralExpr : Expr
@ -665,9 +716,12 @@ namespace CppSharp.AST
public Expr Initializer { get; set; } public Expr Initializer { get; set; }
public bool FileScope { get; set; } public bool FileScope { get; set; }
public SourceLocation LParenLoc { get; set; } public SourceLocation LParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCompoundLiteralExpr(this);
} }
public partial class CastExpr : Expr public abstract partial class CastExpr : Expr
{ {
public CastExpr() public CastExpr()
{ {
@ -694,9 +748,12 @@ namespace CppSharp.AST
} }
public bool IsPartOfExplicitCast { get; set; } public bool IsPartOfExplicitCast { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitImplicitCastExpr(this);
} }
public partial class ExplicitCastExpr : CastExpr public abstract partial class ExplicitCastExpr : CastExpr
{ {
public ExplicitCastExpr() public ExplicitCastExpr()
{ {
@ -713,6 +770,9 @@ namespace CppSharp.AST
public SourceLocation LParenLoc { get; set; } public SourceLocation LParenLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCStyleCastExpr(this);
} }
public partial class BinaryOperator : Expr public partial class BinaryOperator : Expr
@ -740,6 +800,9 @@ namespace CppSharp.AST
public bool IsShiftAssignOp { get; set; } public bool IsShiftAssignOp { get; set; }
public bool IsFPContractableWithinStatement { get; set; } public bool IsFPContractableWithinStatement { get; set; }
public bool IsFEnvAccessOn { get; set; } public bool IsFEnvAccessOn { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitBinaryOperator(this);
} }
public partial class CompoundAssignOperator : BinaryOperator public partial class CompoundAssignOperator : BinaryOperator
@ -750,9 +813,12 @@ namespace CppSharp.AST
public QualifiedType ComputationLHSType { get; set; } public QualifiedType ComputationLHSType { get; set; }
public QualifiedType ComputationResultType { get; set; } public QualifiedType ComputationResultType { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCompoundAssignOperator(this);
} }
public partial class AbstractConditionalOperator : Expr public abstract partial class AbstractConditionalOperator : Expr
{ {
public AbstractConditionalOperator() public AbstractConditionalOperator()
{ {
@ -773,6 +839,9 @@ namespace CppSharp.AST
public Expr LHS { get; set; } public Expr LHS { get; set; }
public Expr RHS { get; set; } public Expr RHS { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitConditionalOperator(this);
} }
public partial class BinaryConditionalOperator : AbstractConditionalOperator public partial class BinaryConditionalOperator : AbstractConditionalOperator
@ -783,6 +852,9 @@ namespace CppSharp.AST
public Expr Common { get; set; } public Expr Common { get; set; }
public OpaqueValueExpr OpaqueValue { get; set; } public OpaqueValueExpr OpaqueValue { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitBinaryConditionalOperator(this);
} }
public partial class AddrLabelExpr : Expr public partial class AddrLabelExpr : Expr
@ -793,6 +865,9 @@ namespace CppSharp.AST
public SourceLocation AmpAmpLoc { get; set; } public SourceLocation AmpAmpLoc { get; set; }
public SourceLocation LabelLoc { get; set; } public SourceLocation LabelLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitAddrLabelExpr(this);
} }
public partial class StmtExpr : Expr public partial class StmtExpr : Expr
@ -804,6 +879,9 @@ namespace CppSharp.AST
public CompoundStmt SubStmt { get; set; } public CompoundStmt SubStmt { get; set; }
public SourceLocation LParenLoc { get; set; } public SourceLocation LParenLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitStmtExpr(this);
} }
public partial class ShuffleVectorExpr : Expr public partial class ShuffleVectorExpr : Expr
@ -815,6 +893,9 @@ namespace CppSharp.AST
public SourceLocation BuiltinLoc { get; set; } public SourceLocation BuiltinLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public uint NumSubExprs { get; set; } public uint NumSubExprs { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitShuffleVectorExpr(this);
} }
public partial class ConvertVectorExpr : Expr public partial class ConvertVectorExpr : Expr
@ -826,6 +907,9 @@ namespace CppSharp.AST
public Expr SrcExpr { get; set; } public Expr SrcExpr { get; set; }
public SourceLocation BuiltinLoc { get; set; } public SourceLocation BuiltinLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitConvertVectorExpr(this);
} }
public partial class ChooseExpr : Expr public partial class ChooseExpr : Expr
@ -842,6 +926,9 @@ namespace CppSharp.AST
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public bool IsConditionDependent { get; set; } public bool IsConditionDependent { get; set; }
public Expr ChosenSubExpr { get; set; } public Expr ChosenSubExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitChooseExpr(this);
} }
public partial class GNUNullExpr : Expr public partial class GNUNullExpr : Expr
@ -851,6 +938,9 @@ namespace CppSharp.AST
} }
public SourceLocation TokenLocation { get; set; } public SourceLocation TokenLocation { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitGNUNullExpr(this);
} }
public partial class VAArgExpr : Expr public partial class VAArgExpr : Expr
@ -863,6 +953,9 @@ namespace CppSharp.AST
public bool IsMicrosoftABI { get; set; } public bool IsMicrosoftABI { get; set; }
public SourceLocation BuiltinLoc { get; set; } public SourceLocation BuiltinLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitVAArgExpr(this);
} }
public partial class InitListExpr : Expr public partial class InitListExpr : Expr
@ -883,6 +976,9 @@ namespace CppSharp.AST
public bool IsSemanticForm { get; set; } public bool IsSemanticForm { get; set; }
public InitListExpr SemanticForm { get; set; } public InitListExpr SemanticForm { get; set; }
public bool IsSyntacticForm { get; set; } public bool IsSyntacticForm { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitInitListExpr(this);
} }
public partial class DesignatedInitExpr : Expr public partial class DesignatedInitExpr : Expr
@ -930,6 +1026,9 @@ namespace CppSharp.AST
public bool UsesGNUSyntax { get; set; } public bool UsesGNUSyntax { get; set; }
public uint NumSubExprs { get; set; } public uint NumSubExprs { get; set; }
public SourceRange DesignatorsSourceRange { get; set; } public SourceRange DesignatorsSourceRange { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDesignatedInitExpr(this);
} }
public partial class NoInitExpr : Expr public partial class NoInitExpr : Expr
@ -938,6 +1037,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitNoInitExpr(this);
} }
public partial class DesignatedInitUpdateExpr : Expr public partial class DesignatedInitUpdateExpr : Expr
@ -948,6 +1050,9 @@ namespace CppSharp.AST
public Expr Base { get; set; } public Expr Base { get; set; }
public InitListExpr Updater { get; set; } public InitListExpr Updater { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDesignatedInitUpdateExpr(this);
} }
public partial class ArrayInitLoopExpr : Expr public partial class ArrayInitLoopExpr : Expr
@ -958,6 +1063,9 @@ namespace CppSharp.AST
public OpaqueValueExpr CommonExpr { get; set; } public OpaqueValueExpr CommonExpr { get; set; }
public Expr SubExpr { get; set; } public Expr SubExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitArrayInitLoopExpr(this);
} }
public partial class ArrayInitIndexExpr : Expr public partial class ArrayInitIndexExpr : Expr
@ -966,6 +1074,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitArrayInitIndexExpr(this);
} }
public partial class ImplicitValueInitExpr : Expr public partial class ImplicitValueInitExpr : Expr
@ -974,6 +1085,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitImplicitValueInitExpr(this);
} }
public partial class ParenListExpr : Expr public partial class ParenListExpr : Expr
@ -985,6 +1099,9 @@ namespace CppSharp.AST
public uint NumExprs { get; set; } public uint NumExprs { get; set; }
public SourceLocation LParenLoc { get; set; } public SourceLocation LParenLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitParenListExpr(this);
} }
public partial class GenericSelectionExpr : Expr public partial class GenericSelectionExpr : Expr
@ -1001,6 +1118,9 @@ namespace CppSharp.AST
public bool IsResultDependent { get; set; } public bool IsResultDependent { get; set; }
public uint ResultIndex { get; set; } public uint ResultIndex { get; set; }
public Expr ResultExpr { get; set; } public Expr ResultExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitGenericSelectionExpr(this);
} }
public partial class ExtVectorElementExpr : Expr public partial class ExtVectorElementExpr : Expr
@ -1014,6 +1134,9 @@ namespace CppSharp.AST
public uint NumElements { get; set; } public uint NumElements { get; set; }
public bool ContainsDuplicateElements { get; set; } public bool ContainsDuplicateElements { get; set; }
public bool IsArrow { get; set; } public bool IsArrow { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitExtVectorElementExpr(this);
} }
public partial class BlockExpr : Expr public partial class BlockExpr : Expr
@ -1024,6 +1147,9 @@ namespace CppSharp.AST
public SourceLocation CaretLocation { get; set; } public SourceLocation CaretLocation { get; set; }
public Stmt Body { get; set; } public Stmt Body { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitBlockExpr(this);
} }
public partial class AsTypeExpr : Expr public partial class AsTypeExpr : Expr
@ -1035,6 +1161,9 @@ namespace CppSharp.AST
public Expr SrcExpr { get; set; } public Expr SrcExpr { get; set; }
public SourceLocation BuiltinLoc { get; set; } public SourceLocation BuiltinLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitAsTypeExpr(this);
} }
public partial class PseudoObjectExpr : Expr public partial class PseudoObjectExpr : Expr
@ -1047,6 +1176,9 @@ namespace CppSharp.AST
public uint ResultExprIndex { get; set; } public uint ResultExprIndex { get; set; }
public Expr ResultExpr { get; set; } public Expr ResultExpr { get; set; }
public uint NumSemanticExprs { get; set; } public uint NumSemanticExprs { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitPseudoObjectExpr(this);
} }
public partial class AtomicExpr : Expr public partial class AtomicExpr : Expr
@ -1120,6 +1252,9 @@ namespace CppSharp.AST
public bool IsOpenCL { get; set; } public bool IsOpenCL { get; set; }
public SourceLocation BuiltinLoc { get; set; } public SourceLocation BuiltinLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitAtomicExpr(this);
} }
public partial class TypoExpr : Expr public partial class TypoExpr : Expr
@ -1128,6 +1263,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitTypoExpr(this);
} }
public partial class CXXOperatorCallExpr : CallExpr public partial class CXXOperatorCallExpr : CallExpr
@ -1141,6 +1279,9 @@ namespace CppSharp.AST
public bool IsInfixBinaryOp { get; set; } public bool IsInfixBinaryOp { get; set; }
public SourceLocation OperatorLoc { get; set; } public SourceLocation OperatorLoc { get; set; }
public bool IsFPContractableWithinStatement { get; set; } public bool IsFPContractableWithinStatement { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXOperatorCallExpr(this);
} }
public partial class CXXMemberCallExpr : CallExpr public partial class CXXMemberCallExpr : CallExpr
@ -1151,6 +1292,9 @@ namespace CppSharp.AST
public Expr ImplicitObjectArgument { get; set; } public Expr ImplicitObjectArgument { get; set; }
public Method MethodDecl { get; set; } public Method MethodDecl { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXMemberCallExpr(this);
} }
public partial class CUDAKernelCallExpr : CallExpr public partial class CUDAKernelCallExpr : CallExpr
@ -1160,9 +1304,12 @@ namespace CppSharp.AST
} }
public CallExpr Config { get; set; } public CallExpr Config { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCUDAKernelCallExpr(this);
} }
public partial class CXXNamedCastExpr : ExplicitCastExpr public abstract partial class CXXNamedCastExpr : ExplicitCastExpr
{ {
public CXXNamedCastExpr() public CXXNamedCastExpr()
{ {
@ -1180,6 +1327,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXStaticCastExpr(this);
} }
public partial class CXXDynamicCastExpr : CXXNamedCastExpr public partial class CXXDynamicCastExpr : CXXNamedCastExpr
@ -1189,6 +1339,9 @@ namespace CppSharp.AST
} }
public bool IsAlwaysNull { get; set; } public bool IsAlwaysNull { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXDynamicCastExpr(this);
} }
public partial class CXXReinterpretCastExpr : CXXNamedCastExpr public partial class CXXReinterpretCastExpr : CXXNamedCastExpr
@ -1197,6 +1350,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXReinterpretCastExpr(this);
} }
public partial class CXXConstCastExpr : CXXNamedCastExpr public partial class CXXConstCastExpr : CXXNamedCastExpr
@ -1205,6 +1361,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXConstCastExpr(this);
} }
public partial class UserDefinedLiteral : CallExpr public partial class UserDefinedLiteral : CallExpr
@ -1232,6 +1391,9 @@ namespace CppSharp.AST
public UserDefinedLiteral.LiteralOperatorKind literalOperatorKind { get; set; } public UserDefinedLiteral.LiteralOperatorKind literalOperatorKind { get; set; }
public Expr CookedLiteral { get; set; } public Expr CookedLiteral { get; set; }
public SourceLocation UDSuffixLoc { get; set; } public SourceLocation UDSuffixLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitUserDefinedLiteral(this);
} }
public partial class CXXBoolLiteralExpr : Expr public partial class CXXBoolLiteralExpr : Expr
@ -1242,6 +1404,9 @@ namespace CppSharp.AST
public bool Value { get; set; } public bool Value { get; set; }
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXBoolLiteralExpr(this);
} }
public partial class CXXNullPtrLiteralExpr : Expr public partial class CXXNullPtrLiteralExpr : Expr
@ -1251,6 +1416,9 @@ namespace CppSharp.AST
} }
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXNullPtrLiteralExpr(this);
} }
public partial class CXXStdInitializerListExpr : Expr public partial class CXXStdInitializerListExpr : Expr
@ -1260,6 +1428,9 @@ namespace CppSharp.AST
} }
public Expr SubExpr { get; set; } public Expr SubExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXStdInitializerListExpr(this);
} }
public partial class CXXTypeidExpr : Expr public partial class CXXTypeidExpr : Expr
@ -1271,6 +1442,9 @@ namespace CppSharp.AST
public Expr ExprOperand { get; set; } public Expr ExprOperand { get; set; }
public bool IsPotentiallyEvaluated { get; set; } public bool IsPotentiallyEvaluated { get; set; }
public bool IsTypeOperand { get; set; } public bool IsTypeOperand { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXTypeidExpr(this);
} }
public partial class MSPropertyRefExpr : Expr public partial class MSPropertyRefExpr : Expr
@ -1283,6 +1457,9 @@ namespace CppSharp.AST
public Expr BaseExpr { get; set; } public Expr BaseExpr { get; set; }
public bool IsArrow { get; set; } public bool IsArrow { get; set; }
public SourceLocation MemberLoc { get; set; } public SourceLocation MemberLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitMSPropertyRefExpr(this);
} }
public partial class MSPropertySubscriptExpr : Expr public partial class MSPropertySubscriptExpr : Expr
@ -1294,6 +1471,9 @@ namespace CppSharp.AST
public SourceLocation RBracketLoc { get; set; } public SourceLocation RBracketLoc { get; set; }
public Expr Base { get; set; } public Expr Base { get; set; }
public Expr Idx { get; set; } public Expr Idx { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitMSPropertySubscriptExpr(this);
} }
public partial class CXXUuidofExpr : Expr public partial class CXXUuidofExpr : Expr
@ -1305,6 +1485,9 @@ namespace CppSharp.AST
public Expr ExprOperand { get; set; } public Expr ExprOperand { get; set; }
public string UuidStr { get; set; } public string UuidStr { get; set; }
public bool IsTypeOperand { get; set; } public bool IsTypeOperand { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXUuidofExpr(this);
} }
public partial class CXXThisExpr : Expr public partial class CXXThisExpr : Expr
@ -1315,6 +1498,9 @@ namespace CppSharp.AST
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public bool Implicit { get; set; } public bool Implicit { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXThisExpr(this);
} }
public partial class CXXThrowExpr : Expr public partial class CXXThrowExpr : Expr
@ -1326,6 +1512,9 @@ namespace CppSharp.AST
public Expr SubExpr { get; set; } public Expr SubExpr { get; set; }
public SourceLocation ThrowLoc { get; set; } public SourceLocation ThrowLoc { get; set; }
public bool IsThrownVariableInScope { get; set; } public bool IsThrownVariableInScope { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXThrowExpr(this);
} }
public partial class CXXDefaultArgExpr : Expr public partial class CXXDefaultArgExpr : Expr
@ -1336,6 +1525,9 @@ namespace CppSharp.AST
public Expr Expr { get; set; } public Expr Expr { get; set; }
public SourceLocation UsedLocation { get; set; } public SourceLocation UsedLocation { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXDefaultArgExpr(this);
} }
public partial class CXXDefaultInitExpr : Expr public partial class CXXDefaultInitExpr : Expr
@ -1346,6 +1538,9 @@ namespace CppSharp.AST
public Field Field { get; set; } public Field Field { get; set; }
public Expr Expr { get; set; } public Expr Expr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXDefaultInitExpr(this);
} }
public partial class CXXBindTemporaryExpr : Expr public partial class CXXBindTemporaryExpr : Expr
@ -1355,6 +1550,9 @@ namespace CppSharp.AST
} }
public Expr SubExpr { get; set; } public Expr SubExpr { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXBindTemporaryExpr(this);
} }
public partial class CXXConstructExpr : Expr public partial class CXXConstructExpr : Expr
@ -1380,6 +1578,9 @@ namespace CppSharp.AST
public bool RequiresZeroInitialization { get; set; } public bool RequiresZeroInitialization { get; set; }
public SourceRange ParenOrBraceRange { get; set; } public SourceRange ParenOrBraceRange { get; set; }
public uint NumArgs { get; set; } public uint NumArgs { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXConstructExpr(this);
} }
public partial class CXXInheritedCtorInitExpr : Expr public partial class CXXInheritedCtorInitExpr : Expr
@ -1391,6 +1592,9 @@ namespace CppSharp.AST
public bool ConstructsVBase { get; set; } public bool ConstructsVBase { get; set; }
public bool InheritedFromVBase { get; set; } public bool InheritedFromVBase { get; set; }
public SourceLocation Location { get; set; } public SourceLocation Location { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXInheritedCtorInitExpr(this);
} }
public partial class CXXFunctionalCastExpr : ExplicitCastExpr public partial class CXXFunctionalCastExpr : ExplicitCastExpr
@ -1402,6 +1606,9 @@ namespace CppSharp.AST
public SourceLocation LParenLoc { get; set; } public SourceLocation LParenLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public bool IsListInitialization { get; set; } public bool IsListInitialization { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXFunctionalCastExpr(this);
} }
public partial class CXXTemporaryObjectExpr : CXXConstructExpr public partial class CXXTemporaryObjectExpr : CXXConstructExpr
@ -1410,6 +1617,9 @@ namespace CppSharp.AST
{ {
} }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXTemporaryObjectExpr(this);
} }
public partial class LambdaExpr : Expr public partial class LambdaExpr : Expr
@ -1428,6 +1638,9 @@ namespace CppSharp.AST
public bool IsMutable { get; set; } public bool IsMutable { get; set; }
public bool HasExplicitParameters { get; set; } public bool HasExplicitParameters { get; set; }
public bool HasExplicitResultType { get; set; } public bool HasExplicitResultType { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitLambdaExpr(this);
} }
public partial class CXXScalarValueInitExpr : Expr public partial class CXXScalarValueInitExpr : Expr
@ -1437,6 +1650,9 @@ namespace CppSharp.AST
} }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXScalarValueInitExpr(this);
} }
public partial class CXXNewExpr : Expr public partial class CXXNewExpr : Expr
@ -1470,6 +1686,9 @@ namespace CppSharp.AST
public Expr Initializer { get; set; } public Expr Initializer { get; set; }
public CXXConstructExpr ConstructExpr { get; set; } public CXXConstructExpr ConstructExpr { get; set; }
public SourceRange DirectInitRange { get; set; } public SourceRange DirectInitRange { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXNewExpr(this);
} }
public partial class CXXDeleteExpr : Expr public partial class CXXDeleteExpr : Expr
@ -1484,6 +1703,9 @@ namespace CppSharp.AST
public Function OperatorDelete { get; set; } public Function OperatorDelete { get; set; }
public Expr Argument { get; set; } public Expr Argument { get; set; }
public QualifiedType DestroyedType { get; set; } public QualifiedType DestroyedType { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXDeleteExpr(this);
} }
public partial class CXXPseudoDestructorExpr : Expr public partial class CXXPseudoDestructorExpr : Expr
@ -1500,6 +1722,9 @@ namespace CppSharp.AST
public SourceLocation TildeLoc { get; set; } public SourceLocation TildeLoc { get; set; }
public QualifiedType DestroyedType { get; set; } public QualifiedType DestroyedType { get; set; }
public SourceLocation DestroyedTypeLoc { get; set; } public SourceLocation DestroyedTypeLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXPseudoDestructorExpr(this);
} }
public partial class TypeTraitExpr : Expr public partial class TypeTraitExpr : Expr
@ -1510,6 +1735,9 @@ namespace CppSharp.AST
public bool Value { get; set; } public bool Value { get; set; }
public uint NumArgs { get; set; } public uint NumArgs { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitTypeTraitExpr(this);
} }
public partial class ArrayTypeTraitExpr : Expr public partial class ArrayTypeTraitExpr : Expr
@ -1521,6 +1749,9 @@ namespace CppSharp.AST
public QualifiedType QueriedType { get; set; } public QualifiedType QueriedType { get; set; }
public ulong Value { get; set; } public ulong Value { get; set; }
public Expr DimensionExpression { get; set; } public Expr DimensionExpression { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitArrayTypeTraitExpr(this);
} }
public partial class ExpressionTraitExpr : Expr public partial class ExpressionTraitExpr : Expr
@ -1531,9 +1762,12 @@ namespace CppSharp.AST
public Expr QueriedExpression { get; set; } public Expr QueriedExpression { get; set; }
public bool Value { get; set; } public bool Value { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitExpressionTraitExpr(this);
} }
public partial class OverloadExpr : Expr public abstract partial class OverloadExpr : Expr
{ {
public partial class FindResult public partial class FindResult
{ {
@ -1565,6 +1799,9 @@ namespace CppSharp.AST
public bool RequiresADL { get; set; } public bool RequiresADL { get; set; }
public bool IsOverloaded { get; set; } public bool IsOverloaded { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitUnresolvedLookupExpr(this);
} }
public partial class DependentScopeDeclRefExpr : Expr public partial class DependentScopeDeclRefExpr : Expr
@ -1580,6 +1817,9 @@ namespace CppSharp.AST
public bool HasTemplateKeyword { get; set; } public bool HasTemplateKeyword { get; set; }
public bool HasExplicitTemplateArgs { get; set; } public bool HasExplicitTemplateArgs { get; set; }
public uint NumTemplateArgs { get; set; } public uint NumTemplateArgs { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDependentScopeDeclRefExpr(this);
} }
public partial class ExprWithCleanups : FullExpr public partial class ExprWithCleanups : FullExpr
@ -1590,6 +1830,9 @@ namespace CppSharp.AST
public uint NumObjects { get; set; } public uint NumObjects { get; set; }
public bool CleanupsHaveSideEffects { get; set; } public bool CleanupsHaveSideEffects { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitExprWithCleanups(this);
} }
public partial class CXXUnresolvedConstructExpr : Expr public partial class CXXUnresolvedConstructExpr : Expr
@ -1604,6 +1847,9 @@ namespace CppSharp.AST
public QualifiedType TypeAsWritten { get; set; } public QualifiedType TypeAsWritten { get; set; }
public bool IsListInitialization { get; set; } public bool IsListInitialization { get; set; }
public uint ArgSize { get; set; } public uint ArgSize { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXUnresolvedConstructExpr(this);
} }
public partial class CXXDependentScopeMemberExpr : Expr public partial class CXXDependentScopeMemberExpr : Expr
@ -1625,6 +1871,9 @@ namespace CppSharp.AST
public bool HasTemplateKeyword { get; set; } public bool HasTemplateKeyword { get; set; }
public bool HasExplicitTemplateArgs { get; set; } public bool HasExplicitTemplateArgs { get; set; }
public uint NumTemplateArgs { get; set; } public uint NumTemplateArgs { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXDependentScopeMemberExpr(this);
} }
public partial class UnresolvedMemberExpr : OverloadExpr public partial class UnresolvedMemberExpr : OverloadExpr
@ -1640,6 +1889,9 @@ namespace CppSharp.AST
public bool IsArrow { get; set; } public bool IsArrow { get; set; }
public SourceLocation OperatorLoc { get; set; } public SourceLocation OperatorLoc { get; set; }
public SourceLocation MemberLoc { get; set; } public SourceLocation MemberLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitUnresolvedMemberExpr(this);
} }
public partial class CXXNoexceptExpr : Expr public partial class CXXNoexceptExpr : Expr
@ -1650,6 +1902,9 @@ namespace CppSharp.AST
public Expr Operand { get; set; } public Expr Operand { get; set; }
public bool Value { get; set; } public bool Value { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXNoexceptExpr(this);
} }
public partial class PackExpansionExpr : Expr public partial class PackExpansionExpr : Expr
@ -1660,6 +1915,9 @@ namespace CppSharp.AST
public Expr Pattern { get; set; } public Expr Pattern { get; set; }
public SourceLocation EllipsisLoc { get; set; } public SourceLocation EllipsisLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitPackExpansionExpr(this);
} }
public partial class SizeOfPackExpr : Expr public partial class SizeOfPackExpr : Expr
@ -1674,6 +1932,9 @@ namespace CppSharp.AST
public Declaration Pack { get; set; } public Declaration Pack { get; set; }
public uint PackLength { get; set; } public uint PackLength { get; set; }
public bool IsPartiallySubstituted { get; set; } public bool IsPartiallySubstituted { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSizeOfPackExpr(this);
} }
public partial class SubstNonTypeTemplateParmExpr : Expr public partial class SubstNonTypeTemplateParmExpr : Expr
@ -1684,6 +1945,9 @@ namespace CppSharp.AST
public SourceLocation NameLoc { get; set; } public SourceLocation NameLoc { get; set; }
public Expr Replacement { get; set; } public Expr Replacement { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSubstNonTypeTemplateParmExpr(this);
} }
public partial class SubstNonTypeTemplateParmPackExpr : Expr public partial class SubstNonTypeTemplateParmPackExpr : Expr
@ -1694,6 +1958,9 @@ namespace CppSharp.AST
public SourceLocation ParameterPackLocation { get; set; } public SourceLocation ParameterPackLocation { get; set; }
public TemplateArgument ArgumentPack { get; set; } public TemplateArgument ArgumentPack { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSubstNonTypeTemplateParmPackExpr(this);
} }
public partial class FunctionParmPackExpr : Expr public partial class FunctionParmPackExpr : Expr
@ -1704,6 +1971,9 @@ namespace CppSharp.AST
public SourceLocation ParameterPackLocation { get; set; } public SourceLocation ParameterPackLocation { get; set; }
public uint NumExpansions { get; set; } public uint NumExpansions { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitFunctionParmPackExpr(this);
} }
public partial class MaterializeTemporaryExpr : Expr public partial class MaterializeTemporaryExpr : Expr
@ -1724,6 +1994,9 @@ namespace CppSharp.AST
public Expr TemporaryExpr { get; set; } public Expr TemporaryExpr { get; set; }
public uint ManglingNumber { get; set; } public uint ManglingNumber { get; set; }
public bool IsBoundToLvalueReference { get; set; } public bool IsBoundToLvalueReference { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitMaterializeTemporaryExpr(this);
} }
public partial class CXXFoldExpr : Expr public partial class CXXFoldExpr : Expr
@ -1740,9 +2013,12 @@ namespace CppSharp.AST
public Expr Init { get; set; } public Expr Init { get; set; }
public SourceLocation EllipsisLoc { get; set; } public SourceLocation EllipsisLoc { get; set; }
public BinaryOperatorKind Operator { get; set; } public BinaryOperatorKind Operator { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXFoldExpr(this);
} }
public partial class CoroutineSuspendExpr : Expr public abstract partial class CoroutineSuspendExpr : Expr
{ {
internal enum SubExpr internal enum SubExpr
{ {
@ -1773,6 +2049,9 @@ namespace CppSharp.AST
public bool IsImplicit { get; set; } public bool IsImplicit { get; set; }
public Expr Operand { get; set; } public Expr Operand { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCoawaitExpr(this);
} }
public partial class DependentCoawaitExpr : Expr public partial class DependentCoawaitExpr : Expr
@ -1784,6 +2063,9 @@ namespace CppSharp.AST
public Expr Operand { get; set; } public Expr Operand { get; set; }
public UnresolvedLookupExpr OperatorCoawaitLookup { get; set; } public UnresolvedLookupExpr OperatorCoawaitLookup { get; set; }
public SourceLocation KeywordLoc { get; set; } public SourceLocation KeywordLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDependentCoawaitExpr(this);
} }
public partial class CoyieldExpr : CoroutineSuspendExpr public partial class CoyieldExpr : CoroutineSuspendExpr
@ -1793,5 +2075,8 @@ namespace CppSharp.AST
} }
public Expr Operand { get; set; } public Expr Operand { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCoyieldExpr(this);
} }
} }

98
src/AST/Stmt.cs

@ -140,7 +140,7 @@ namespace CppSharp.AST
WhileStmt = 196, WhileStmt = 196,
} }
public partial class Stmt public abstract partial class Stmt
{ {
public Stmt() public Stmt()
{ {
@ -149,6 +149,8 @@ namespace CppSharp.AST
public SourceRange SourceRange { get; set; } public SourceRange SourceRange { get; set; }
public SourceLocation EndLoc { get; set; } public SourceLocation EndLoc { get; set; }
public Stmt StripLabelLikeStatements { get; set; } public Stmt StripLabelLikeStatements { get; set; }
public abstract T Visit<T>(IStmtVisitor<T> visitor);
} }
public partial class DeclStmt : Stmt public partial class DeclStmt : Stmt
@ -160,6 +162,9 @@ namespace CppSharp.AST
public List<Declaration> Decls { get; private set; } = new List<Declaration>(); public List<Declaration> Decls { get; private set; } = new List<Declaration>();
public bool IsSingleDecl { get; set; } public bool IsSingleDecl { get; set; }
public Declaration SingleDecl { get; set; } public Declaration SingleDecl { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDeclStmt(this);
} }
public partial class NullStmt : Stmt public partial class NullStmt : Stmt
@ -170,6 +175,9 @@ namespace CppSharp.AST
public SourceLocation SemiLoc { get; set; } public SourceLocation SemiLoc { get; set; }
public bool HasLeadingEmptyMacro { get; set; } public bool HasLeadingEmptyMacro { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitNullStmt(this);
} }
public partial class CompoundStmt : Stmt public partial class CompoundStmt : Stmt
@ -185,9 +193,12 @@ namespace CppSharp.AST
public Stmt BodyBack { get; set; } public Stmt BodyBack { get; set; }
public SourceLocation LBracLoc { get; set; } public SourceLocation LBracLoc { get; set; }
public SourceLocation RBracLoc { get; set; } public SourceLocation RBracLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCompoundStmt(this);
} }
public partial class SwitchCase : Stmt public abstract partial class SwitchCase : Stmt
{ {
public SwitchCase() public SwitchCase()
{ {
@ -209,6 +220,9 @@ namespace CppSharp.AST
public Expr LHS { get; set; } public Expr LHS { get; set; }
public Expr RHS { get; set; } public Expr RHS { get; set; }
public bool CaseStmtIsGNURange { get; set; } public bool CaseStmtIsGNURange { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCaseStmt(this);
} }
public partial class DefaultStmt : SwitchCase public partial class DefaultStmt : SwitchCase
@ -218,6 +232,9 @@ namespace CppSharp.AST
} }
public SourceLocation DefaultLoc { get; set; } public SourceLocation DefaultLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDefaultStmt(this);
} }
public partial class LabelStmt : Stmt public partial class LabelStmt : Stmt
@ -229,6 +246,9 @@ namespace CppSharp.AST
public SourceLocation IdentLoc { get; set; } public SourceLocation IdentLoc { get; set; }
public Stmt SubStmt { get; set; } public Stmt SubStmt { get; set; }
public string Name { get; set; } public string Name { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitLabelStmt(this);
} }
public partial class AttributedStmt : Stmt public partial class AttributedStmt : Stmt
@ -239,6 +259,9 @@ namespace CppSharp.AST
public SourceLocation AttrLoc { get; set; } public SourceLocation AttrLoc { get; set; }
public Stmt SubStmt { get; set; } public Stmt SubStmt { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitAttributedStmt(this);
} }
public partial class IfStmt : Stmt public partial class IfStmt : Stmt
@ -259,6 +282,9 @@ namespace CppSharp.AST
public bool HasElseStorage { get; set; } public bool HasElseStorage { get; set; }
public DeclStmt ConditionVariableDeclStmt { get; set; } public DeclStmt ConditionVariableDeclStmt { get; set; }
public bool IsObjCAvailabilityCheck { get; set; } public bool IsObjCAvailabilityCheck { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitIfStmt(this);
} }
public partial class SwitchStmt : Stmt public partial class SwitchStmt : Stmt
@ -275,6 +301,9 @@ namespace CppSharp.AST
public bool HasVarStorage { get; set; } public bool HasVarStorage { get; set; }
public DeclStmt ConditionVariableDeclStmt { get; set; } public DeclStmt ConditionVariableDeclStmt { get; set; }
public bool IsAllEnumCasesCovered { get; set; } public bool IsAllEnumCasesCovered { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSwitchStmt(this);
} }
public partial class WhileStmt : Stmt public partial class WhileStmt : Stmt
@ -288,6 +317,9 @@ namespace CppSharp.AST
public SourceLocation WhileLoc { get; set; } public SourceLocation WhileLoc { get; set; }
public bool HasVarStorage { get; set; } public bool HasVarStorage { get; set; }
public DeclStmt ConditionVariableDeclStmt { get; set; } public DeclStmt ConditionVariableDeclStmt { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitWhileStmt(this);
} }
public partial class DoStmt : Stmt public partial class DoStmt : Stmt
@ -301,6 +333,9 @@ namespace CppSharp.AST
public SourceLocation DoLoc { get; set; } public SourceLocation DoLoc { get; set; }
public SourceLocation WhileLoc { get; set; } public SourceLocation WhileLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitDoStmt(this);
} }
public partial class ForStmt : Stmt public partial class ForStmt : Stmt
@ -317,6 +352,9 @@ namespace CppSharp.AST
public SourceLocation LParenLoc { get; set; } public SourceLocation LParenLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public DeclStmt ConditionVariableDeclStmt { get; set; } public DeclStmt ConditionVariableDeclStmt { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitForStmt(this);
} }
public partial class GotoStmt : Stmt public partial class GotoStmt : Stmt
@ -327,6 +365,9 @@ namespace CppSharp.AST
public SourceLocation GotoLoc { get; set; } public SourceLocation GotoLoc { get; set; }
public SourceLocation LabelLoc { get; set; } public SourceLocation LabelLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitGotoStmt(this);
} }
public partial class IndirectGotoStmt : Stmt public partial class IndirectGotoStmt : Stmt
@ -338,6 +379,9 @@ namespace CppSharp.AST
public SourceLocation GotoLoc { get; set; } public SourceLocation GotoLoc { get; set; }
public SourceLocation StarLoc { get; set; } public SourceLocation StarLoc { get; set; }
public Expr Target { get; set; } public Expr Target { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitIndirectGotoStmt(this);
} }
public partial class ContinueStmt : Stmt public partial class ContinueStmt : Stmt
@ -347,6 +391,9 @@ namespace CppSharp.AST
} }
public SourceLocation ContinueLoc { get; set; } public SourceLocation ContinueLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitContinueStmt(this);
} }
public partial class BreakStmt : Stmt public partial class BreakStmt : Stmt
@ -356,6 +403,9 @@ namespace CppSharp.AST
} }
public SourceLocation BreakLoc { get; set; } public SourceLocation BreakLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitBreakStmt(this);
} }
public partial class ReturnStmt : Stmt public partial class ReturnStmt : Stmt
@ -366,9 +416,12 @@ namespace CppSharp.AST
public Expr RetValue { get; set; } public Expr RetValue { get; set; }
public SourceLocation ReturnLoc { get; set; } public SourceLocation ReturnLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitReturnStmt(this);
} }
public partial class AsmStmt : Stmt public abstract partial class AsmStmt : Stmt
{ {
public AsmStmt() public AsmStmt()
{ {
@ -411,6 +464,9 @@ namespace CppSharp.AST
} }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitGCCAsmStmt(this);
} }
public partial class MSAsmStmt : AsmStmt public partial class MSAsmStmt : AsmStmt
@ -423,6 +479,9 @@ namespace CppSharp.AST
public bool HasBraces { get; set; } public bool HasBraces { get; set; }
public uint NumAsmToks { get; set; } public uint NumAsmToks { get; set; }
public string AsmString { get; set; } public string AsmString { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitMSAsmStmt(this);
} }
public partial class SEHExceptStmt : Stmt public partial class SEHExceptStmt : Stmt
@ -434,6 +493,9 @@ namespace CppSharp.AST
public SourceLocation ExceptLoc { get; set; } public SourceLocation ExceptLoc { get; set; }
public Expr FilterExpr { get; set; } public Expr FilterExpr { get; set; }
public CompoundStmt Block { get; set; } public CompoundStmt Block { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSEHExceptStmt(this);
} }
public partial class SEHFinallyStmt : Stmt public partial class SEHFinallyStmt : Stmt
@ -444,6 +506,9 @@ namespace CppSharp.AST
public SourceLocation FinallyLoc { get; set; } public SourceLocation FinallyLoc { get; set; }
public CompoundStmt Block { get; set; } public CompoundStmt Block { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSEHFinallyStmt(this);
} }
public partial class SEHTryStmt : Stmt public partial class SEHTryStmt : Stmt
@ -458,6 +523,9 @@ namespace CppSharp.AST
public Stmt Handler { get; set; } public Stmt Handler { get; set; }
public SEHExceptStmt ExceptHandler { get; set; } public SEHExceptStmt ExceptHandler { get; set; }
public SEHFinallyStmt FinallyHandler { get; set; } public SEHFinallyStmt FinallyHandler { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSEHTryStmt(this);
} }
public partial class SEHLeaveStmt : Stmt public partial class SEHLeaveStmt : Stmt
@ -467,6 +535,9 @@ namespace CppSharp.AST
} }
public SourceLocation LeaveLoc { get; set; } public SourceLocation LeaveLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitSEHLeaveStmt(this);
} }
public partial class CapturedStmt : Stmt public partial class CapturedStmt : Stmt
@ -500,6 +571,9 @@ namespace CppSharp.AST
public List<Expr> CaptureInits { get; private set; } = new List<Expr>(); public List<Expr> CaptureInits { get; private set; } = new List<Expr>();
public Stmt capturedStmt { get; set; } public Stmt capturedStmt { get; set; }
public uint CaptureSize { get; set; } public uint CaptureSize { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCapturedStmt(this);
} }
public partial class CXXCatchStmt : Stmt public partial class CXXCatchStmt : Stmt
@ -511,6 +585,9 @@ namespace CppSharp.AST
public SourceLocation CatchLoc { get; set; } public SourceLocation CatchLoc { get; set; }
public QualifiedType CaughtType { get; set; } public QualifiedType CaughtType { get; set; }
public Stmt HandlerBlock { get; set; } public Stmt HandlerBlock { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXCatchStmt(this);
} }
public partial class CXXTryStmt : Stmt public partial class CXXTryStmt : Stmt
@ -522,6 +599,9 @@ namespace CppSharp.AST
public SourceLocation TryLoc { get; set; } public SourceLocation TryLoc { get; set; }
public CompoundStmt TryBlock { get; set; } public CompoundStmt TryBlock { get; set; }
public uint NumHandlers { get; set; } public uint NumHandlers { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXTryStmt(this);
} }
public partial class CXXForRangeStmt : Stmt public partial class CXXForRangeStmt : Stmt
@ -543,6 +623,9 @@ namespace CppSharp.AST
public SourceLocation CoawaitLoc { get; set; } public SourceLocation CoawaitLoc { get; set; }
public SourceLocation ColonLoc { get; set; } public SourceLocation ColonLoc { get; set; }
public SourceLocation RParenLoc { get; set; } public SourceLocation RParenLoc { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCXXForRangeStmt(this);
} }
public partial class MSDependentExistsStmt : Stmt public partial class MSDependentExistsStmt : Stmt
@ -555,6 +638,9 @@ namespace CppSharp.AST
public bool IsIfExists { get; set; } public bool IsIfExists { get; set; }
public bool IsIfNotExists { get; set; } public bool IsIfNotExists { get; set; }
public CompoundStmt SubStmt { get; set; } public CompoundStmt SubStmt { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitMSDependentExistsStmt(this);
} }
public partial class CoroutineBodyStmt : Stmt public partial class CoroutineBodyStmt : Stmt
@ -614,6 +700,9 @@ namespace CppSharp.AST
public Stmt ResultDecl { get; set; } public Stmt ResultDecl { get; set; }
public Stmt ReturnStmt { get; set; } public Stmt ReturnStmt { get; set; }
public Stmt ReturnStmtOnAllocFailure { get; set; } public Stmt ReturnStmtOnAllocFailure { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCoroutineBodyStmt(this);
} }
public partial class CoreturnStmt : Stmt public partial class CoreturnStmt : Stmt
@ -633,5 +722,8 @@ namespace CppSharp.AST
public SourceLocation KeywordLoc { get; set; } public SourceLocation KeywordLoc { get; set; }
public Expr Operand { get; set; } public Expr Operand { get; set; }
public Expr PromiseCall { get; set; } public Expr PromiseCall { get; set; }
public override T Visit<T>(IStmtVisitor<T> visitor) =>
visitor.VisitCoreturnStmt(this);
} }
} }

1232
src/AST/StmtVisitor.cs

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save