forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -190,6 +190,110 @@ public:
|
|||||||
virtual bool visit(IdentifierListAST *) { return true; }
|
virtual bool visit(IdentifierListAST *) { return true; }
|
||||||
virtual bool visit(ObjCClassDeclarationAST *) { return true; }
|
virtual bool visit(ObjCClassDeclarationAST *) { return true; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
virtual void endVisit(AccessDeclarationAST *) { }
|
||||||
|
virtual void endVisit(ArrayAccessAST *) { }
|
||||||
|
virtual void endVisit(ArrayDeclaratorAST *) { }
|
||||||
|
virtual void endVisit(ArrayInitializerAST *) { }
|
||||||
|
virtual void endVisit(AsmDefinitionAST *) { }
|
||||||
|
virtual void endVisit(AttributeSpecifierAST *) { }
|
||||||
|
virtual void endVisit(AttributeAST *) { }
|
||||||
|
virtual void endVisit(BaseSpecifierAST *) { }
|
||||||
|
virtual void endVisit(BinaryExpressionAST *) { }
|
||||||
|
virtual void endVisit(BoolLiteralAST *) { }
|
||||||
|
virtual void endVisit(BreakStatementAST *) { }
|
||||||
|
virtual void endVisit(CallAST *) { }
|
||||||
|
virtual void endVisit(CaseStatementAST *) { }
|
||||||
|
virtual void endVisit(CastExpressionAST *) { }
|
||||||
|
virtual void endVisit(CatchClauseAST *) { }
|
||||||
|
virtual void endVisit(ClassSpecifierAST *) { }
|
||||||
|
virtual void endVisit(CompoundLiteralAST *) { }
|
||||||
|
virtual void endVisit(CompoundStatementAST *) { }
|
||||||
|
virtual void endVisit(ConditionAST *) { }
|
||||||
|
virtual void endVisit(ConditionalExpressionAST *) { }
|
||||||
|
virtual void endVisit(ContinueStatementAST *) { }
|
||||||
|
virtual void endVisit(ConversionFunctionIdAST *) { }
|
||||||
|
virtual void endVisit(CppCastExpressionAST *) { }
|
||||||
|
virtual void endVisit(CtorInitializerAST *) { }
|
||||||
|
virtual void endVisit(DeclaratorAST *) { }
|
||||||
|
virtual void endVisit(DeclarationStatementAST *) { }
|
||||||
|
virtual void endVisit(DeclaratorIdAST *) { }
|
||||||
|
virtual void endVisit(DeclaratorListAST *) { }
|
||||||
|
virtual void endVisit(DeleteExpressionAST *) { }
|
||||||
|
virtual void endVisit(DestructorNameAST *) { }
|
||||||
|
virtual void endVisit(DoStatementAST *) { }
|
||||||
|
virtual void endVisit(ElaboratedTypeSpecifierAST *) { }
|
||||||
|
virtual void endVisit(EmptyDeclarationAST *) { }
|
||||||
|
virtual void endVisit(EnumSpecifierAST *) { }
|
||||||
|
virtual void endVisit(EnumeratorAST *) { }
|
||||||
|
virtual void endVisit(ExceptionDeclarationAST *) { }
|
||||||
|
virtual void endVisit(ExceptionSpecificationAST *) { }
|
||||||
|
virtual void endVisit(ExpressionListAST *) { }
|
||||||
|
virtual void endVisit(ExpressionOrDeclarationStatementAST *) { }
|
||||||
|
virtual void endVisit(ExpressionStatementAST *) { }
|
||||||
|
virtual void endVisit(ForStatementAST *) { }
|
||||||
|
virtual void endVisit(FunctionDeclaratorAST *) { }
|
||||||
|
virtual void endVisit(FunctionDefinitionAST *) { }
|
||||||
|
virtual void endVisit(GotoStatementAST *) { }
|
||||||
|
virtual void endVisit(IfStatementAST *) { }
|
||||||
|
virtual void endVisit(LabeledStatementAST *) { }
|
||||||
|
virtual void endVisit(LinkageBodyAST *) { }
|
||||||
|
virtual void endVisit(LinkageSpecificationAST *) { }
|
||||||
|
virtual void endVisit(MemInitializerAST *) { }
|
||||||
|
virtual void endVisit(MemberAccessAST *) { }
|
||||||
|
virtual void endVisit(NamedTypeSpecifierAST *) { }
|
||||||
|
virtual void endVisit(NamespaceAST *) { }
|
||||||
|
virtual void endVisit(NamespaceAliasDefinitionAST *) { }
|
||||||
|
virtual void endVisit(NestedDeclaratorAST *) { }
|
||||||
|
virtual void endVisit(NestedExpressionAST *) { }
|
||||||
|
virtual void endVisit(NestedNameSpecifierAST *) { }
|
||||||
|
virtual void endVisit(NewDeclaratorAST *) { }
|
||||||
|
virtual void endVisit(NewExpressionAST *) { }
|
||||||
|
virtual void endVisit(NewInitializerAST *) { }
|
||||||
|
virtual void endVisit(NewTypeIdAST *) { }
|
||||||
|
virtual void endVisit(NumericLiteralAST *) { }
|
||||||
|
virtual void endVisit(OperatorAST *) { }
|
||||||
|
virtual void endVisit(OperatorFunctionIdAST *) { }
|
||||||
|
virtual void endVisit(ParameterDeclarationAST *) { }
|
||||||
|
virtual void endVisit(ParameterDeclarationClauseAST *) { }
|
||||||
|
virtual void endVisit(PointerAST *) { }
|
||||||
|
virtual void endVisit(PointerToMemberAST *) { }
|
||||||
|
virtual void endVisit(PostIncrDecrAST *) { }
|
||||||
|
virtual void endVisit(PostfixExpressionAST *) { }
|
||||||
|
virtual void endVisit(QualifiedNameAST *) { }
|
||||||
|
virtual void endVisit(ReferenceAST *) { }
|
||||||
|
virtual void endVisit(ReturnStatementAST *) { }
|
||||||
|
virtual void endVisit(SimpleDeclarationAST *) { }
|
||||||
|
virtual void endVisit(SimpleNameAST *) { }
|
||||||
|
virtual void endVisit(SimpleSpecifierAST *) { }
|
||||||
|
virtual void endVisit(SizeofExpressionAST *) { }
|
||||||
|
virtual void endVisit(StringLiteralAST *) { }
|
||||||
|
virtual void endVisit(SwitchStatementAST *) { }
|
||||||
|
virtual void endVisit(TemplateArgumentListAST *) { }
|
||||||
|
virtual void endVisit(TemplateDeclarationAST *) { }
|
||||||
|
virtual void endVisit(TemplateIdAST *) { }
|
||||||
|
virtual void endVisit(TemplateTypeParameterAST *) { }
|
||||||
|
virtual void endVisit(ThisExpressionAST *) { }
|
||||||
|
virtual void endVisit(ThrowExpressionAST *) { }
|
||||||
|
virtual void endVisit(TranslationUnitAST *) { }
|
||||||
|
virtual void endVisit(TryBlockStatementAST *) { }
|
||||||
|
virtual void endVisit(TypeConstructorCallAST *) { }
|
||||||
|
virtual void endVisit(TypeIdAST *) { }
|
||||||
|
virtual void endVisit(TypeidExpressionAST *) { }
|
||||||
|
virtual void endVisit(TypeofSpecifierAST *) { }
|
||||||
|
virtual void endVisit(TypenameCallExpressionAST *) { }
|
||||||
|
virtual void endVisit(TypenameTypeParameterAST *) { }
|
||||||
|
virtual void endVisit(UnaryExpressionAST *) { }
|
||||||
|
virtual void endVisit(UsingAST *) { }
|
||||||
|
virtual void endVisit(UsingDirectiveAST *) { }
|
||||||
|
virtual void endVisit(WhileStatementAST *) { }
|
||||||
|
virtual void endVisit(QtMethodAST *) { }
|
||||||
|
|
||||||
|
// ObjC++
|
||||||
|
virtual void endVisit(IdentifierListAST *) { }
|
||||||
|
virtual void endVisit(ObjCClassDeclarationAST *) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Control *_control;
|
Control *_control;
|
||||||
};
|
};
|
||||||
|
@@ -103,6 +103,7 @@ bool CheckStatement::visit(CaseStatementAST *ast)
|
|||||||
bool CheckStatement::visit(CompoundStatementAST *ast)
|
bool CheckStatement::visit(CompoundStatementAST *ast)
|
||||||
{
|
{
|
||||||
Block *block = control()->newBlock(ast->lbrace_token);
|
Block *block = control()->newBlock(ast->lbrace_token);
|
||||||
|
ast->symbol = block;
|
||||||
_scope->enterSymbol(block);
|
_scope->enterSymbol(block);
|
||||||
Scope *previousScope = switchScope(block->members());
|
Scope *previousScope = switchScope(block->members());
|
||||||
for (StatementAST *it = ast->statements; it; it = it->next) {
|
for (StatementAST *it = ast->statements; it; it = it->next) {
|
||||||
@@ -145,6 +146,7 @@ bool CheckStatement::visit(ExpressionStatementAST *ast)
|
|||||||
bool CheckStatement::visit(ForStatementAST *ast)
|
bool CheckStatement::visit(ForStatementAST *ast)
|
||||||
{
|
{
|
||||||
Block *block = control()->newBlock(ast->for_token);
|
Block *block = control()->newBlock(ast->for_token);
|
||||||
|
ast->symbol = block;
|
||||||
_scope->enterSymbol(block);
|
_scope->enterSymbol(block);
|
||||||
Scope *previousScope = switchScope(block->members());
|
Scope *previousScope = switchScope(block->members());
|
||||||
semantic()->check(ast->initializer, _scope);
|
semantic()->check(ast->initializer, _scope);
|
||||||
@@ -158,6 +160,7 @@ bool CheckStatement::visit(ForStatementAST *ast)
|
|||||||
bool CheckStatement::visit(IfStatementAST *ast)
|
bool CheckStatement::visit(IfStatementAST *ast)
|
||||||
{
|
{
|
||||||
Block *block = control()->newBlock(ast->if_token);
|
Block *block = control()->newBlock(ast->if_token);
|
||||||
|
ast->symbol = block;
|
||||||
_scope->enterSymbol(block);
|
_scope->enterSymbol(block);
|
||||||
Scope *previousScope = switchScope(block->members());
|
Scope *previousScope = switchScope(block->members());
|
||||||
FullySpecifiedType exprTy = semantic()->check(ast->condition, _scope);
|
FullySpecifiedType exprTy = semantic()->check(ast->condition, _scope);
|
||||||
@@ -197,6 +200,7 @@ bool CheckStatement::visit(ReturnStatementAST *ast)
|
|||||||
bool CheckStatement::visit(SwitchStatementAST *ast)
|
bool CheckStatement::visit(SwitchStatementAST *ast)
|
||||||
{
|
{
|
||||||
Block *block = control()->newBlock(ast->switch_token);
|
Block *block = control()->newBlock(ast->switch_token);
|
||||||
|
ast->symbol = block;
|
||||||
_scope->enterSymbol(block);
|
_scope->enterSymbol(block);
|
||||||
Scope *previousScope = switchScope(block->members());
|
Scope *previousScope = switchScope(block->members());
|
||||||
FullySpecifiedType condTy = semantic()->check(ast->condition, _scope);
|
FullySpecifiedType condTy = semantic()->check(ast->condition, _scope);
|
||||||
@@ -217,6 +221,7 @@ bool CheckStatement::visit(TryBlockStatementAST *ast)
|
|||||||
bool CheckStatement::visit(CatchClauseAST *ast)
|
bool CheckStatement::visit(CatchClauseAST *ast)
|
||||||
{
|
{
|
||||||
Block *block = control()->newBlock(ast->catch_token);
|
Block *block = control()->newBlock(ast->catch_token);
|
||||||
|
ast->symbol = block;
|
||||||
_scope->enterSymbol(block);
|
_scope->enterSymbol(block);
|
||||||
Scope *previousScope = switchScope(block->members());
|
Scope *previousScope = switchScope(block->members());
|
||||||
semantic()->check(ast->exception_declaration, _scope);
|
semantic()->check(ast->exception_declaration, _scope);
|
||||||
@@ -228,6 +233,7 @@ bool CheckStatement::visit(CatchClauseAST *ast)
|
|||||||
bool CheckStatement::visit(WhileStatementAST *ast)
|
bool CheckStatement::visit(WhileStatementAST *ast)
|
||||||
{
|
{
|
||||||
Block *block = control()->newBlock(ast->while_token);
|
Block *block = control()->newBlock(ast->while_token);
|
||||||
|
ast->symbol = block;
|
||||||
_scope->enterSymbol(block);
|
_scope->enterSymbol(block);
|
||||||
Scope *previousScope = switchScope(block->members());
|
Scope *previousScope = switchScope(block->members());
|
||||||
FullySpecifiedType condTy = semantic()->check(ast->condition, _scope);
|
FullySpecifiedType condTy = semantic()->check(ast->condition, _scope);
|
||||||
|
@@ -63,58 +63,22 @@ Name::~Name()
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool Name::isNameId() const
|
bool Name::isNameId() const
|
||||||
{ return dynamic_cast<const NameId *>(this) != 0; }
|
{ return asNameId() != 0; }
|
||||||
|
|
||||||
bool Name::isTemplateNameId() const
|
bool Name::isTemplateNameId() const
|
||||||
{ return dynamic_cast<const TemplateNameId *>(this) != 0; }
|
{ return asTemplateNameId() != 0; }
|
||||||
|
|
||||||
bool Name::isDestructorNameId() const
|
bool Name::isDestructorNameId() const
|
||||||
{ return dynamic_cast<const DestructorNameId *>(this) != 0; }
|
{ return asDestructorNameId() != 0; }
|
||||||
|
|
||||||
bool Name::isOperatorNameId() const
|
bool Name::isOperatorNameId() const
|
||||||
{ return dynamic_cast<const OperatorNameId *>(this) != 0; }
|
{ return asOperatorNameId() != 0; }
|
||||||
|
|
||||||
bool Name::isConversionNameId() const
|
bool Name::isConversionNameId() const
|
||||||
{ return dynamic_cast<const ConversionNameId *>(this) != 0; }
|
{ return asConversionNameId() != 0; }
|
||||||
|
|
||||||
bool Name::isQualifiedNameId() const
|
bool Name::isQualifiedNameId() const
|
||||||
{ return dynamic_cast<const QualifiedNameId *>(this) != 0; }
|
{ return asQualifiedNameId() != 0; }
|
||||||
|
|
||||||
const NameId *Name::asNameId() const
|
|
||||||
{ return dynamic_cast<const NameId *>(this); }
|
|
||||||
|
|
||||||
const TemplateNameId *Name::asTemplateNameId() const
|
|
||||||
{ return dynamic_cast<const TemplateNameId *>(this); }
|
|
||||||
|
|
||||||
const DestructorNameId *Name::asDestructorNameId() const
|
|
||||||
{ return dynamic_cast<const DestructorNameId *>(this); }
|
|
||||||
|
|
||||||
const OperatorNameId *Name::asOperatorNameId() const
|
|
||||||
{ return dynamic_cast<const OperatorNameId *>(this); }
|
|
||||||
|
|
||||||
const ConversionNameId *Name::asConversionNameId() const
|
|
||||||
{ return dynamic_cast<const ConversionNameId *>(this); }
|
|
||||||
|
|
||||||
const QualifiedNameId *Name::asQualifiedNameId() const
|
|
||||||
{ return dynamic_cast<const QualifiedNameId *>(this); }
|
|
||||||
|
|
||||||
NameId *Name::asNameId()
|
|
||||||
{ return dynamic_cast<NameId *>(this); }
|
|
||||||
|
|
||||||
TemplateNameId *Name::asTemplateNameId()
|
|
||||||
{ return dynamic_cast<TemplateNameId *>(this); }
|
|
||||||
|
|
||||||
DestructorNameId *Name::asDestructorNameId()
|
|
||||||
{ return dynamic_cast<DestructorNameId *>(this); }
|
|
||||||
|
|
||||||
OperatorNameId *Name::asOperatorNameId()
|
|
||||||
{ return dynamic_cast<OperatorNameId *>(this); }
|
|
||||||
|
|
||||||
ConversionNameId *Name::asConversionNameId()
|
|
||||||
{ return dynamic_cast<ConversionNameId *>(this); }
|
|
||||||
|
|
||||||
QualifiedNameId *Name::asQualifiedNameId()
|
|
||||||
{ return dynamic_cast<QualifiedNameId *>(this); }
|
|
||||||
|
|
||||||
void Name::accept(NameVisitor *visitor)
|
void Name::accept(NameVisitor *visitor)
|
||||||
{
|
{
|
||||||
|
@@ -74,19 +74,19 @@ public:
|
|||||||
bool isConversionNameId() const;
|
bool isConversionNameId() const;
|
||||||
bool isQualifiedNameId() const;
|
bool isQualifiedNameId() const;
|
||||||
|
|
||||||
const NameId *asNameId() const;
|
virtual const NameId *asNameId() const { return 0; }
|
||||||
const TemplateNameId *asTemplateNameId() const;
|
virtual const TemplateNameId *asTemplateNameId() const { return 0; }
|
||||||
const DestructorNameId *asDestructorNameId() const;
|
virtual const DestructorNameId *asDestructorNameId() const { return 0; }
|
||||||
const OperatorNameId *asOperatorNameId() const;
|
virtual const OperatorNameId *asOperatorNameId() const { return 0; }
|
||||||
const ConversionNameId *asConversionNameId() const;
|
virtual const ConversionNameId *asConversionNameId() const { return 0; }
|
||||||
const QualifiedNameId *asQualifiedNameId() const;
|
virtual const QualifiedNameId *asQualifiedNameId() const { return 0; }
|
||||||
|
|
||||||
NameId *asNameId();
|
virtual NameId *asNameId() { return 0; }
|
||||||
TemplateNameId *asTemplateNameId();
|
virtual TemplateNameId *asTemplateNameId() { return 0; }
|
||||||
DestructorNameId *asDestructorNameId();
|
virtual DestructorNameId *asDestructorNameId() { return 0; }
|
||||||
OperatorNameId *asOperatorNameId();
|
virtual OperatorNameId *asOperatorNameId() { return 0; }
|
||||||
ConversionNameId *asConversionNameId();
|
virtual ConversionNameId *asConversionNameId() { return 0; }
|
||||||
QualifiedNameId *asQualifiedNameId();
|
virtual QualifiedNameId *asQualifiedNameId() { return 0; }
|
||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const = 0;
|
virtual bool isEqualTo(const Name *other) const = 0;
|
||||||
|
|
||||||
|
@@ -77,6 +77,12 @@ public:
|
|||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const;
|
virtual bool isEqualTo(const Name *other) const;
|
||||||
|
|
||||||
|
virtual const QualifiedNameId *asQualifiedNameId() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual QualifiedNameId *asQualifiedNameId()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(NameVisitor *visitor);
|
virtual void accept0(NameVisitor *visitor);
|
||||||
|
|
||||||
@@ -96,6 +102,12 @@ public:
|
|||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const;
|
virtual bool isEqualTo(const Name *other) const;
|
||||||
|
|
||||||
|
virtual const NameId *asNameId() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual NameId *asNameId()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(NameVisitor *visitor);
|
virtual void accept0(NameVisitor *visitor);
|
||||||
|
|
||||||
@@ -113,6 +125,12 @@ public:
|
|||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const;
|
virtual bool isEqualTo(const Name *other) const;
|
||||||
|
|
||||||
|
virtual const DestructorNameId *asDestructorNameId() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual DestructorNameId *asDestructorNameId()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(NameVisitor *visitor);
|
virtual void accept0(NameVisitor *visitor);
|
||||||
|
|
||||||
@@ -137,6 +155,12 @@ public:
|
|||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const;
|
virtual bool isEqualTo(const Name *other) const;
|
||||||
|
|
||||||
|
virtual const TemplateNameId *asTemplateNameId() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual TemplateNameId *asTemplateNameId()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(NameVisitor *visitor);
|
virtual void accept0(NameVisitor *visitor);
|
||||||
|
|
||||||
@@ -211,6 +235,12 @@ public:
|
|||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const;
|
virtual bool isEqualTo(const Name *other) const;
|
||||||
|
|
||||||
|
virtual const OperatorNameId *asOperatorNameId() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual OperatorNameId *asOperatorNameId()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(NameVisitor *visitor);
|
virtual void accept0(NameVisitor *visitor);
|
||||||
|
|
||||||
@@ -228,6 +258,12 @@ public:
|
|||||||
|
|
||||||
virtual bool isEqualTo(const Name *other) const;
|
virtual bool isEqualTo(const Name *other) const;
|
||||||
|
|
||||||
|
virtual const ConversionNameId *asConversionNameId() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual ConversionNameId *asConversionNameId()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(NameVisitor *visitor);
|
virtual void accept0(NameVisitor *visitor);
|
||||||
|
|
||||||
|
@@ -320,102 +320,36 @@ bool Symbol::isPrivate() const
|
|||||||
{ return _visibility == Private; }
|
{ return _visibility == Private; }
|
||||||
|
|
||||||
bool Symbol::isScopedSymbol() const
|
bool Symbol::isScopedSymbol() const
|
||||||
{ return dynamic_cast<const ScopedSymbol *>(this) != 0; }
|
{ return asScopedSymbol() != 0; }
|
||||||
|
|
||||||
bool Symbol::isEnum() const
|
bool Symbol::isEnum() const
|
||||||
{ return dynamic_cast<const Enum *>(this) != 0; }
|
{ return asEnum() != 0; }
|
||||||
|
|
||||||
bool Symbol::isFunction() const
|
bool Symbol::isFunction() const
|
||||||
{ return dynamic_cast<const Function *>(this) != 0; }
|
{ return asFunction() != 0; }
|
||||||
|
|
||||||
bool Symbol::isNamespace() const
|
bool Symbol::isNamespace() const
|
||||||
{ return dynamic_cast<const Namespace *>(this) != 0; }
|
{ return asNamespace() != 0; }
|
||||||
|
|
||||||
bool Symbol::isClass() const
|
bool Symbol::isClass() const
|
||||||
{ return dynamic_cast<const Class *>(this) != 0; }
|
{ return asClass() != 0; }
|
||||||
|
|
||||||
bool Symbol::isBlock() const
|
bool Symbol::isBlock() const
|
||||||
{ return dynamic_cast<const Block *>(this) != 0; }
|
{ return asBlock() != 0; }
|
||||||
|
|
||||||
bool Symbol::isUsingNamespaceDirective() const
|
bool Symbol::isUsingNamespaceDirective() const
|
||||||
{ return dynamic_cast<const UsingNamespaceDirective *>(this) != 0; }
|
{ return asUsingNamespaceDirective() != 0; }
|
||||||
|
|
||||||
bool Symbol::isUsingDeclaration() const
|
bool Symbol::isUsingDeclaration() const
|
||||||
{ return dynamic_cast<const UsingDeclaration *>(this) != 0; }
|
{ return asUsingDeclaration() != 0; }
|
||||||
|
|
||||||
bool Symbol::isDeclaration() const
|
bool Symbol::isDeclaration() const
|
||||||
{ return dynamic_cast<const Declaration *>(this) != 0; }
|
{ return asDeclaration() != 0; }
|
||||||
|
|
||||||
bool Symbol::isArgument() const
|
bool Symbol::isArgument() const
|
||||||
{ return dynamic_cast<const Argument *>(this) != 0; }
|
{ return asArgument() != 0; }
|
||||||
|
|
||||||
bool Symbol::isBaseClass() const
|
bool Symbol::isBaseClass() const
|
||||||
{ return dynamic_cast<const BaseClass *>(this) != 0; }
|
{ return asBaseClass() != 0; }
|
||||||
|
|
||||||
const ScopedSymbol *Symbol::asScopedSymbol() const
|
|
||||||
{ return dynamic_cast<const ScopedSymbol *>(this); }
|
|
||||||
|
|
||||||
const Enum *Symbol::asEnum() const
|
|
||||||
{ return dynamic_cast<const Enum *>(this); }
|
|
||||||
|
|
||||||
const Function *Symbol::asFunction() const
|
|
||||||
{ return dynamic_cast<const Function *>(this); }
|
|
||||||
|
|
||||||
const Namespace *Symbol::asNamespace() const
|
|
||||||
{ return dynamic_cast<const Namespace *>(this); }
|
|
||||||
|
|
||||||
const Class *Symbol::asClass() const
|
|
||||||
{ return dynamic_cast<const Class *>(this); }
|
|
||||||
|
|
||||||
const Block *Symbol::asBlock() const
|
|
||||||
{ return dynamic_cast<const Block *>(this); }
|
|
||||||
|
|
||||||
const UsingNamespaceDirective *Symbol::asUsingNamespaceDirective() const
|
|
||||||
{ return dynamic_cast<const UsingNamespaceDirective *>(this); }
|
|
||||||
|
|
||||||
const UsingDeclaration *Symbol::asUsingDeclaration() const
|
|
||||||
{ return dynamic_cast<const UsingDeclaration *>(this); }
|
|
||||||
|
|
||||||
const Declaration *Symbol::asDeclaration() const
|
|
||||||
{ return dynamic_cast<const Declaration *>(this); }
|
|
||||||
|
|
||||||
const Argument *Symbol::asArgument() const
|
|
||||||
{ return dynamic_cast<const Argument *>(this); }
|
|
||||||
|
|
||||||
const BaseClass *Symbol::asBaseClass() const
|
|
||||||
{ return dynamic_cast<const BaseClass *>(this); }
|
|
||||||
|
|
||||||
ScopedSymbol *Symbol::asScopedSymbol()
|
|
||||||
{ return dynamic_cast<ScopedSymbol *>(this); }
|
|
||||||
|
|
||||||
Enum *Symbol::asEnum()
|
|
||||||
{ return dynamic_cast<Enum *>(this); }
|
|
||||||
|
|
||||||
Function *Symbol::asFunction()
|
|
||||||
{ return dynamic_cast<Function *>(this); }
|
|
||||||
|
|
||||||
Namespace *Symbol::asNamespace()
|
|
||||||
{ return dynamic_cast<Namespace *>(this); }
|
|
||||||
|
|
||||||
Class *Symbol::asClass()
|
|
||||||
{ return dynamic_cast<Class *>(this); }
|
|
||||||
|
|
||||||
Block *Symbol::asBlock()
|
|
||||||
{ return dynamic_cast<Block *>(this); }
|
|
||||||
|
|
||||||
UsingNamespaceDirective *Symbol::asUsingNamespaceDirective()
|
|
||||||
{ return dynamic_cast<UsingNamespaceDirective *>(this); }
|
|
||||||
|
|
||||||
UsingDeclaration *Symbol::asUsingDeclaration()
|
|
||||||
{ return dynamic_cast<UsingDeclaration *>(this); }
|
|
||||||
|
|
||||||
Declaration *Symbol::asDeclaration()
|
|
||||||
{ return dynamic_cast<Declaration *>(this); }
|
|
||||||
|
|
||||||
Argument *Symbol::asArgument()
|
|
||||||
{ return dynamic_cast<Argument *>(this); }
|
|
||||||
|
|
||||||
BaseClass *Symbol::asBaseClass()
|
|
||||||
{ return dynamic_cast<BaseClass *>(this); }
|
|
||||||
|
|
||||||
CPLUSPLUS_END_NAMESPACE
|
CPLUSPLUS_END_NAMESPACE
|
||||||
|
@@ -197,29 +197,29 @@ public:
|
|||||||
/// Returns true if this Symbol is a BaseClass.
|
/// Returns true if this Symbol is a BaseClass.
|
||||||
bool isBaseClass() const;
|
bool isBaseClass() const;
|
||||||
|
|
||||||
const ScopedSymbol *asScopedSymbol() const;
|
virtual const ScopedSymbol *asScopedSymbol() const { return 0; }
|
||||||
const Enum *asEnum() const;
|
virtual const Enum *asEnum() const { return 0; }
|
||||||
const Function *asFunction() const;
|
virtual const Function *asFunction() const { return 0; }
|
||||||
const Namespace *asNamespace() const;
|
virtual const Namespace *asNamespace() const { return 0; }
|
||||||
const Class *asClass() const;
|
virtual const Class *asClass() const { return 0; }
|
||||||
const Block *asBlock() const;
|
virtual const Block *asBlock() const { return 0; }
|
||||||
const UsingNamespaceDirective *asUsingNamespaceDirective() const;
|
virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const { return 0; }
|
||||||
const UsingDeclaration *asUsingDeclaration() const;
|
virtual const UsingDeclaration *asUsingDeclaration() const { return 0; }
|
||||||
const Declaration *asDeclaration() const;
|
virtual const Declaration *asDeclaration() const { return 0; }
|
||||||
const Argument *asArgument() const;
|
virtual const Argument *asArgument() const { return 0; }
|
||||||
const BaseClass *asBaseClass() const;
|
virtual const BaseClass *asBaseClass() const { return 0; }
|
||||||
|
|
||||||
ScopedSymbol *asScopedSymbol();
|
virtual ScopedSymbol *asScopedSymbol() { return 0; }
|
||||||
Enum *asEnum();
|
virtual Enum *asEnum() { return 0; }
|
||||||
Function *asFunction();
|
virtual Function *asFunction() { return 0; }
|
||||||
Namespace *asNamespace();
|
virtual Namespace *asNamespace() { return 0; }
|
||||||
Class *asClass();
|
virtual Class *asClass() { return 0; }
|
||||||
Block *asBlock();
|
virtual Block *asBlock() { return 0; }
|
||||||
UsingNamespaceDirective *asUsingNamespaceDirective();
|
virtual UsingNamespaceDirective *asUsingNamespaceDirective() { return 0; }
|
||||||
UsingDeclaration *asUsingDeclaration();
|
virtual UsingDeclaration *asUsingDeclaration() { return 0; }
|
||||||
Declaration *asDeclaration();
|
virtual Declaration *asDeclaration() { return 0; }
|
||||||
Argument *asArgument();
|
virtual Argument *asArgument() { return 0; }
|
||||||
BaseClass *asBaseClass();
|
virtual BaseClass *asBaseClass() { return 0; }
|
||||||
|
|
||||||
/// Returns this Symbol's type.
|
/// Returns this Symbol's type.
|
||||||
virtual FullySpecifiedType type() const = 0;
|
virtual FullySpecifiedType type() const = 0;
|
||||||
|
@@ -71,6 +71,12 @@ public:
|
|||||||
// Symbol's interface
|
// Symbol's interface
|
||||||
virtual FullySpecifiedType type() const;
|
virtual FullySpecifiedType type() const;
|
||||||
|
|
||||||
|
virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual UsingNamespaceDirective *asUsingNamespaceDirective()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
};
|
};
|
||||||
@@ -84,6 +90,12 @@ public:
|
|||||||
// Symbol's interface
|
// Symbol's interface
|
||||||
virtual FullySpecifiedType type() const;
|
virtual FullySpecifiedType type() const;
|
||||||
|
|
||||||
|
virtual const UsingDeclaration *asUsingDeclaration() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual UsingDeclaration *asUsingDeclaration()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
};
|
};
|
||||||
@@ -105,6 +117,12 @@ public:
|
|||||||
// Symbol's interface
|
// Symbol's interface
|
||||||
virtual FullySpecifiedType type() const;
|
virtual FullySpecifiedType type() const;
|
||||||
|
|
||||||
|
virtual const Declaration *asDeclaration() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Declaration *asDeclaration()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
|
|
||||||
@@ -127,6 +145,12 @@ public:
|
|||||||
// Symbol's interface
|
// Symbol's interface
|
||||||
virtual FullySpecifiedType type() const;
|
virtual FullySpecifiedType type() const;
|
||||||
|
|
||||||
|
virtual const Argument *asArgument() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Argument *asArgument()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
|
|
||||||
@@ -146,6 +170,12 @@ public:
|
|||||||
Scope *members() const;
|
Scope *members() const;
|
||||||
void addMember(Symbol *member);
|
void addMember(Symbol *member);
|
||||||
|
|
||||||
|
virtual const ScopedSymbol *asScopedSymbol() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual ScopedSymbol *asScopedSymbol()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Scope *_members;
|
Scope *_members;
|
||||||
};
|
};
|
||||||
@@ -159,6 +189,12 @@ public:
|
|||||||
// Symbol's interface
|
// Symbol's interface
|
||||||
virtual FullySpecifiedType type() const;
|
virtual FullySpecifiedType type() const;
|
||||||
|
|
||||||
|
virtual const Block *asBlock() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Block *asBlock()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
};
|
};
|
||||||
@@ -175,6 +211,12 @@ public:
|
|||||||
// Type's interface
|
// Type's interface
|
||||||
virtual bool isEqualTo(const Type *other) const;
|
virtual bool isEqualTo(const Type *other) const;
|
||||||
|
|
||||||
|
virtual const Enum *asEnum() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Enum *asEnum()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
virtual void accept0(TypeVisitor *visitor);
|
virtual void accept0(TypeVisitor *visitor);
|
||||||
@@ -230,6 +272,12 @@ public:
|
|||||||
// Type's interface
|
// Type's interface
|
||||||
virtual bool isEqualTo(const Type *other) const;
|
virtual bool isEqualTo(const Type *other) const;
|
||||||
|
|
||||||
|
virtual const Function *asFunction() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Function *asFunction()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
virtual void accept0(TypeVisitor *visitor);
|
virtual void accept0(TypeVisitor *visitor);
|
||||||
@@ -264,6 +312,12 @@ public:
|
|||||||
// Type's interface
|
// Type's interface
|
||||||
virtual bool isEqualTo(const Type *other) const;
|
virtual bool isEqualTo(const Type *other) const;
|
||||||
|
|
||||||
|
virtual const Namespace *asNamespace() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Namespace *asNamespace()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
virtual void accept0(TypeVisitor *visitor);
|
virtual void accept0(TypeVisitor *visitor);
|
||||||
@@ -281,6 +335,12 @@ public:
|
|||||||
// Symbol's interface
|
// Symbol's interface
|
||||||
virtual FullySpecifiedType type() const;
|
virtual FullySpecifiedType type() const;
|
||||||
|
|
||||||
|
virtual const BaseClass *asBaseClass() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual BaseClass *asBaseClass()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
|
|
||||||
@@ -322,6 +382,12 @@ public:
|
|||||||
// Type's interface
|
// Type's interface
|
||||||
virtual bool isEqualTo(const Type *other) const;
|
virtual bool isEqualTo(const Type *other) const;
|
||||||
|
|
||||||
|
virtual const Class *asClass() const
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
|
virtual Class *asClass()
|
||||||
|
{ return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||||
virtual void accept0(TypeVisitor *visitor);
|
virtual void accept0(TypeVisitor *visitor);
|
||||||
|
Reference in New Issue
Block a user