forked from qt-creator/qt-creator
Added Bind::switchScope() and Bind::currentScope().
This commit is contained in:
@@ -64,6 +64,7 @@ namespace { bool debug_todo = false; }
|
|||||||
|
|
||||||
Bind::Bind(TranslationUnit *unit)
|
Bind::Bind(TranslationUnit *unit)
|
||||||
: ASTVisitor(unit),
|
: ASTVisitor(unit),
|
||||||
|
_currentScope(0),
|
||||||
_currentExpression(0),
|
_currentExpression(0),
|
||||||
_currentName(0)
|
_currentName(0)
|
||||||
{
|
{
|
||||||
@@ -71,6 +72,18 @@ Bind::Bind(TranslationUnit *unit)
|
|||||||
translationUnit(unit->ast()->asTranslationUnit());
|
translationUnit(unit->ast()->asTranslationUnit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Scope *Bind::currentScope() const
|
||||||
|
{
|
||||||
|
return _currentScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
Scope *Bind::switchScope(Scope *scope)
|
||||||
|
{
|
||||||
|
Scope *previousScope = _currentScope;
|
||||||
|
_currentScope = scope;
|
||||||
|
return previousScope;
|
||||||
|
}
|
||||||
|
|
||||||
void Bind::statement(StatementAST *ast)
|
void Bind::statement(StatementAST *ast)
|
||||||
{
|
{
|
||||||
accept(ast);
|
accept(ast);
|
||||||
|
@@ -72,6 +72,9 @@ public:
|
|||||||
FullySpecifiedType coreDeclarator(CoreDeclaratorAST *ast, const FullySpecifiedType &init);
|
FullySpecifiedType coreDeclarator(CoreDeclaratorAST *ast, const FullySpecifiedType &init);
|
||||||
FullySpecifiedType postfixDeclarator(PostfixDeclaratorAST *ast, const FullySpecifiedType &init);
|
FullySpecifiedType postfixDeclarator(PostfixDeclaratorAST *ast, const FullySpecifiedType &init);
|
||||||
|
|
||||||
|
Scope *currentScope() const;
|
||||||
|
Scope *switchScope(Scope *scope);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using ASTVisitor::translationUnit;
|
using ASTVisitor::translationUnit;
|
||||||
|
|
||||||
@@ -266,6 +269,7 @@ protected:
|
|||||||
virtual bool visit(ArrayDeclaratorAST *ast);
|
virtual bool visit(ArrayDeclaratorAST *ast);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Scope *_currentScope;
|
||||||
ExpressionTy _currentExpression;
|
ExpressionTy _currentExpression;
|
||||||
const Name *_currentName;
|
const Name *_currentName;
|
||||||
FullySpecifiedType _currentType;
|
FullySpecifiedType _currentType;
|
||||||
|
Reference in New Issue
Block a user