Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
d782ce27
Commit
d782ce27
authored
Feb 09, 2009
by
Roberto Raggi
Browse files
Reimplemented the AST::as*AST() methods as virtual functions (as suggested by andre).
parent
cd9e752a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/AST.cpp
View file @
d782ce27
...
...
@@ -66,324 +66,6 @@ AST::AST()
AST
::~
AST
()
{
assert
(
0
);
}
AccessDeclarationAST
*
AST
::
asAccessDeclaration
()
{
return
dynamic_cast
<
AccessDeclarationAST
*>
(
this
);
}
ArrayAccessAST
*
AST
::
asArrayAccess
()
{
return
dynamic_cast
<
ArrayAccessAST
*>
(
this
);
}
ArrayDeclaratorAST
*
AST
::
asArrayDeclarator
()
{
return
dynamic_cast
<
ArrayDeclaratorAST
*>
(
this
);
}
ArrayInitializerAST
*
AST
::
asArrayInitializer
()
{
return
dynamic_cast
<
ArrayInitializerAST
*>
(
this
);
}
AsmDefinitionAST
*
AST
::
asAsmDefinition
()
{
return
dynamic_cast
<
AsmDefinitionAST
*>
(
this
);
}
AttributeAST
*
AST
::
asAttribute
()
{
return
dynamic_cast
<
AttributeAST
*>
(
this
);
}
AttributeSpecifierAST
*
AST
::
asAttributeSpecifier
()
{
return
dynamic_cast
<
AttributeSpecifierAST
*>
(
this
);
}
BaseSpecifierAST
*
AST
::
asBaseSpecifier
()
{
return
dynamic_cast
<
BaseSpecifierAST
*>
(
this
);
}
QtMethodAST
*
AST
::
asQtMethod
()
{
return
dynamic_cast
<
QtMethodAST
*>
(
this
);
}
BinaryExpressionAST
*
AST
::
asBinaryExpression
()
{
return
dynamic_cast
<
BinaryExpressionAST
*>
(
this
);
}
BoolLiteralAST
*
AST
::
asBoolLiteral
()
{
return
dynamic_cast
<
BoolLiteralAST
*>
(
this
);
}
BreakStatementAST
*
AST
::
asBreakStatement
()
{
return
dynamic_cast
<
BreakStatementAST
*>
(
this
);
}
CallAST
*
AST
::
asCall
()
{
return
dynamic_cast
<
CallAST
*>
(
this
);
}
CaseStatementAST
*
AST
::
asCaseStatement
()
{
return
dynamic_cast
<
CaseStatementAST
*>
(
this
);
}
CastExpressionAST
*
AST
::
asCastExpression
()
{
return
dynamic_cast
<
CastExpressionAST
*>
(
this
);
}
CatchClauseAST
*
AST
::
asCatchClause
()
{
return
dynamic_cast
<
CatchClauseAST
*>
(
this
);
}
ClassSpecifierAST
*
AST
::
asClassSpecifier
()
{
return
dynamic_cast
<
ClassSpecifierAST
*>
(
this
);
}
CompoundLiteralAST
*
AST
::
asCompoundLiteral
()
{
return
dynamic_cast
<
CompoundLiteralAST
*>
(
this
);
}
CompoundStatementAST
*
AST
::
asCompoundStatement
()
{
return
dynamic_cast
<
CompoundStatementAST
*>
(
this
);
}
ConditionAST
*
AST
::
asCondition
()
{
return
dynamic_cast
<
ConditionAST
*>
(
this
);
}
ConditionalExpressionAST
*
AST
::
asConditionalExpression
()
{
return
dynamic_cast
<
ConditionalExpressionAST
*>
(
this
);
}
ContinueStatementAST
*
AST
::
asContinueStatement
()
{
return
dynamic_cast
<
ContinueStatementAST
*>
(
this
);
}
ConversionFunctionIdAST
*
AST
::
asConversionFunctionId
()
{
return
dynamic_cast
<
ConversionFunctionIdAST
*>
(
this
);
}
CoreDeclaratorAST
*
AST
::
asCoreDeclarator
()
{
return
dynamic_cast
<
CoreDeclaratorAST
*>
(
this
);
}
CppCastExpressionAST
*
AST
::
asCppCastExpression
()
{
return
dynamic_cast
<
CppCastExpressionAST
*>
(
this
);
}
CtorInitializerAST
*
AST
::
asCtorInitializer
()
{
return
dynamic_cast
<
CtorInitializerAST
*>
(
this
);
}
DeclarationAST
*
AST
::
asDeclaration
()
{
return
dynamic_cast
<
DeclarationAST
*>
(
this
);
}
DeclarationStatementAST
*
AST
::
asDeclarationStatement
()
{
return
dynamic_cast
<
DeclarationStatementAST
*>
(
this
);
}
DeclaratorAST
*
AST
::
asDeclarator
()
{
return
dynamic_cast
<
DeclaratorAST
*>
(
this
);
}
DeclaratorIdAST
*
AST
::
asDeclaratorId
()
{
return
dynamic_cast
<
DeclaratorIdAST
*>
(
this
);
}
DeclaratorListAST
*
AST
::
asDeclaratorList
()
{
return
dynamic_cast
<
DeclaratorListAST
*>
(
this
);
}
DeleteExpressionAST
*
AST
::
asDeleteExpression
()
{
return
dynamic_cast
<
DeleteExpressionAST
*>
(
this
);
}
DestructorNameAST
*
AST
::
asDestructorName
()
{
return
dynamic_cast
<
DestructorNameAST
*>
(
this
);
}
DoStatementAST
*
AST
::
asDoStatement
()
{
return
dynamic_cast
<
DoStatementAST
*>
(
this
);
}
ElaboratedTypeSpecifierAST
*
AST
::
asElaboratedTypeSpecifier
()
{
return
dynamic_cast
<
ElaboratedTypeSpecifierAST
*>
(
this
);
}
EmptyDeclarationAST
*
AST
::
asEmptyDeclaration
()
{
return
dynamic_cast
<
EmptyDeclarationAST
*>
(
this
);
}
EnumSpecifierAST
*
AST
::
asEnumSpecifier
()
{
return
dynamic_cast
<
EnumSpecifierAST
*>
(
this
);
}
EnumeratorAST
*
AST
::
asEnumerator
()
{
return
dynamic_cast
<
EnumeratorAST
*>
(
this
);
}
ExceptionDeclarationAST
*
AST
::
asExceptionDeclaration
()
{
return
dynamic_cast
<
ExceptionDeclarationAST
*>
(
this
);
}
ExceptionSpecificationAST
*
AST
::
asExceptionSpecification
()
{
return
dynamic_cast
<
ExceptionSpecificationAST
*>
(
this
);
}
ExpressionAST
*
AST
::
asExpression
()
{
return
dynamic_cast
<
ExpressionAST
*>
(
this
);
}
ExpressionListAST
*
AST
::
asExpressionList
()
{
return
dynamic_cast
<
ExpressionListAST
*>
(
this
);
}
ExpressionOrDeclarationStatementAST
*
AST
::
asExpressionOrDeclarationStatement
()
{
return
dynamic_cast
<
ExpressionOrDeclarationStatementAST
*>
(
this
);
}
ExpressionStatementAST
*
AST
::
asExpressionStatement
()
{
return
dynamic_cast
<
ExpressionStatementAST
*>
(
this
);
}
ForStatementAST
*
AST
::
asForStatement
()
{
return
dynamic_cast
<
ForStatementAST
*>
(
this
);
}
FunctionDeclaratorAST
*
AST
::
asFunctionDeclarator
()
{
return
dynamic_cast
<
FunctionDeclaratorAST
*>
(
this
);
}
FunctionDefinitionAST
*
AST
::
asFunctionDefinition
()
{
return
dynamic_cast
<
FunctionDefinitionAST
*>
(
this
);
}
GotoStatementAST
*
AST
::
asGotoStatement
()
{
return
dynamic_cast
<
GotoStatementAST
*>
(
this
);
}
IfStatementAST
*
AST
::
asIfStatement
()
{
return
dynamic_cast
<
IfStatementAST
*>
(
this
);
}
LabeledStatementAST
*
AST
::
asLabeledStatement
()
{
return
dynamic_cast
<
LabeledStatementAST
*>
(
this
);
}
LinkageBodyAST
*
AST
::
asLinkageBody
()
{
return
dynamic_cast
<
LinkageBodyAST
*>
(
this
);
}
LinkageSpecificationAST
*
AST
::
asLinkageSpecification
()
{
return
dynamic_cast
<
LinkageSpecificationAST
*>
(
this
);
}
MemInitializerAST
*
AST
::
asMemInitializer
()
{
return
dynamic_cast
<
MemInitializerAST
*>
(
this
);
}
MemberAccessAST
*
AST
::
asMemberAccess
()
{
return
dynamic_cast
<
MemberAccessAST
*>
(
this
);
}
NameAST
*
AST
::
asName
()
{
return
dynamic_cast
<
NameAST
*>
(
this
);
}
NamedTypeSpecifierAST
*
AST
::
asNamedTypeSpecifier
()
{
return
dynamic_cast
<
NamedTypeSpecifierAST
*>
(
this
);
}
NamespaceAST
*
AST
::
asNamespace
()
{
return
dynamic_cast
<
NamespaceAST
*>
(
this
);
}
NamespaceAliasDefinitionAST
*
AST
::
asNamespaceAliasDefinition
()
{
return
dynamic_cast
<
NamespaceAliasDefinitionAST
*>
(
this
);
}
NestedDeclaratorAST
*
AST
::
asNestedDeclarator
()
{
return
dynamic_cast
<
NestedDeclaratorAST
*>
(
this
);
}
NestedExpressionAST
*
AST
::
asNestedExpression
()
{
return
dynamic_cast
<
NestedExpressionAST
*>
(
this
);
}
NestedNameSpecifierAST
*
AST
::
asNestedNameSpecifier
()
{
return
dynamic_cast
<
NestedNameSpecifierAST
*>
(
this
);
}
NewDeclaratorAST
*
AST
::
asNewDeclarator
()
{
return
dynamic_cast
<
NewDeclaratorAST
*>
(
this
);
}
NewExpressionAST
*
AST
::
asNewExpression
()
{
return
dynamic_cast
<
NewExpressionAST
*>
(
this
);
}
NewInitializerAST
*
AST
::
asNewInitializer
()
{
return
dynamic_cast
<
NewInitializerAST
*>
(
this
);
}
NewTypeIdAST
*
AST
::
asNewTypeId
()
{
return
dynamic_cast
<
NewTypeIdAST
*>
(
this
);
}
NumericLiteralAST
*
AST
::
asNumericLiteral
()
{
return
dynamic_cast
<
NumericLiteralAST
*>
(
this
);
}
OperatorAST
*
AST
::
asOperator
()
{
return
dynamic_cast
<
OperatorAST
*>
(
this
);
}
OperatorFunctionIdAST
*
AST
::
asOperatorFunctionId
()
{
return
dynamic_cast
<
OperatorFunctionIdAST
*>
(
this
);
}
ParameterDeclarationAST
*
AST
::
asParameterDeclaration
()
{
return
dynamic_cast
<
ParameterDeclarationAST
*>
(
this
);
}
ParameterDeclarationClauseAST
*
AST
::
asParameterDeclarationClause
()
{
return
dynamic_cast
<
ParameterDeclarationClauseAST
*>
(
this
);
}
PointerAST
*
AST
::
asPointer
()
{
return
dynamic_cast
<
PointerAST
*>
(
this
);
}
PointerToMemberAST
*
AST
::
asPointerToMember
()
{
return
dynamic_cast
<
PointerToMemberAST
*>
(
this
);
}
PostIncrDecrAST
*
AST
::
asPostIncrDecr
()
{
return
dynamic_cast
<
PostIncrDecrAST
*>
(
this
);
}
PostfixAST
*
AST
::
asPostfix
()
{
return
dynamic_cast
<
PostfixAST
*>
(
this
);
}
PostfixDeclaratorAST
*
AST
::
asPostfixDeclarator
()
{
return
dynamic_cast
<
PostfixDeclaratorAST
*>
(
this
);
}
PostfixExpressionAST
*
AST
::
asPostfixExpression
()
{
return
dynamic_cast
<
PostfixExpressionAST
*>
(
this
);
}
PtrOperatorAST
*
AST
::
asPtrOperator
()
{
return
dynamic_cast
<
PtrOperatorAST
*>
(
this
);
}
QualifiedNameAST
*
AST
::
asQualifiedName
()
{
return
dynamic_cast
<
QualifiedNameAST
*>
(
this
);
}
ReferenceAST
*
AST
::
asReference
()
{
return
dynamic_cast
<
ReferenceAST
*>
(
this
);
}
ReturnStatementAST
*
AST
::
asReturnStatement
()
{
return
dynamic_cast
<
ReturnStatementAST
*>
(
this
);
}
SimpleDeclarationAST
*
AST
::
asSimpleDeclaration
()
{
return
dynamic_cast
<
SimpleDeclarationAST
*>
(
this
);
}
SimpleNameAST
*
AST
::
asSimpleName
()
{
return
dynamic_cast
<
SimpleNameAST
*>
(
this
);
}
SimpleSpecifierAST
*
AST
::
asSimpleSpecifier
()
{
return
dynamic_cast
<
SimpleSpecifierAST
*>
(
this
);
}
SizeofExpressionAST
*
AST
::
asSizeofExpression
()
{
return
dynamic_cast
<
SizeofExpressionAST
*>
(
this
);
}
SpecifierAST
*
AST
::
asSpecifier
()
{
return
dynamic_cast
<
SpecifierAST
*>
(
this
);
}
StatementAST
*
AST
::
asStatement
()
{
return
dynamic_cast
<
StatementAST
*>
(
this
);
}
StringLiteralAST
*
AST
::
asStringLiteral
()
{
return
dynamic_cast
<
StringLiteralAST
*>
(
this
);
}
SwitchStatementAST
*
AST
::
asSwitchStatement
()
{
return
dynamic_cast
<
SwitchStatementAST
*>
(
this
);
}
TemplateArgumentListAST
*
AST
::
asTemplateArgumentList
()
{
return
dynamic_cast
<
TemplateArgumentListAST
*>
(
this
);
}
TemplateDeclarationAST
*
AST
::
asTemplateDeclaration
()
{
return
dynamic_cast
<
TemplateDeclarationAST
*>
(
this
);
}
TemplateIdAST
*
AST
::
asTemplateId
()
{
return
dynamic_cast
<
TemplateIdAST
*>
(
this
);
}
TemplateTypeParameterAST
*
AST
::
asTemplateTypeParameter
()
{
return
dynamic_cast
<
TemplateTypeParameterAST
*>
(
this
);
}
ThisExpressionAST
*
AST
::
asThisExpression
()
{
return
dynamic_cast
<
ThisExpressionAST
*>
(
this
);
}
ThrowExpressionAST
*
AST
::
asThrowExpression
()
{
return
dynamic_cast
<
ThrowExpressionAST
*>
(
this
);
}
TranslationUnitAST
*
AST
::
asTranslationUnit
()
{
return
dynamic_cast
<
TranslationUnitAST
*>
(
this
);
}
TryBlockStatementAST
*
AST
::
asTryBlockStatement
()
{
return
dynamic_cast
<
TryBlockStatementAST
*>
(
this
);
}
TypeConstructorCallAST
*
AST
::
asTypeConstructorCall
()
{
return
dynamic_cast
<
TypeConstructorCallAST
*>
(
this
);
}
TypeIdAST
*
AST
::
asTypeId
()
{
return
dynamic_cast
<
TypeIdAST
*>
(
this
);
}
TypeidExpressionAST
*
AST
::
asTypeidExpression
()
{
return
dynamic_cast
<
TypeidExpressionAST
*>
(
this
);
}
TypenameCallExpressionAST
*
AST
::
asTypenameCallExpression
()
{
return
dynamic_cast
<
TypenameCallExpressionAST
*>
(
this
);
}
TypenameTypeParameterAST
*
AST
::
asTypenameTypeParameter
()
{
return
dynamic_cast
<
TypenameTypeParameterAST
*>
(
this
);
}
TypeofSpecifierAST
*
AST
::
asTypeofSpecifier
()
{
return
dynamic_cast
<
TypeofSpecifierAST
*>
(
this
);
}
UnaryExpressionAST
*
AST
::
asUnaryExpression
()
{
return
dynamic_cast
<
UnaryExpressionAST
*>
(
this
);
}
UsingAST
*
AST
::
asUsing
()
{
return
dynamic_cast
<
UsingAST
*>
(
this
);
}
UsingDirectiveAST
*
AST
::
asUsingDirective
()
{
return
dynamic_cast
<
UsingDirectiveAST
*>
(
this
);
}
WhileStatementAST
*
AST
::
asWhileStatement
()
{
return
dynamic_cast
<
WhileStatementAST
*>
(
this
);
}
void
AST
::
accept
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
preVisit
(
this
))
...
...
src/shared/cplusplus/AST.h
View file @
d782ce27
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment