Renamed Symbol::scope() to Symbol::enclosingScope().

This commit is contained in:
Roberto Raggi
2010-08-26 16:16:22 +02:00
parent 688d382ad9
commit 05f2fd6669
21 changed files with 65 additions and 65 deletions

View File

@@ -143,7 +143,7 @@ void SymbolTable::enterSymbol(Symbol *symbol)
_symbols = reinterpret_cast<Symbol **>(realloc(_symbols, sizeof(Symbol *) * _allocatedSymbols));
}
assert(! symbol->_scope || symbol->scope() == _owner);
assert(! symbol->_scope || symbol->enclosingScope() == _owner);
symbol->_index = _symbolCount;
symbol->_scope = _owner;
_symbols[_symbolCount] = symbol;

View File

@@ -233,7 +233,7 @@ const Identifier *Symbol::identifier() const
return 0;
}
Scope *Symbol::scope() const
Scope *Symbol::enclosingScope() const
{ return _scope; }
void Symbol::setScope(Scope *scope)
@@ -244,7 +244,7 @@ void Symbol::setScope(Scope *scope)
Namespace *Symbol::enclosingNamespace() const
{
for (Scope *s = _scope; s; s = s->scope()) {
for (Scope *s = _scope; s; s = s->enclosingScope()) {
if (Namespace *ns = s->asNamespace())
return ns;
}
@@ -253,7 +253,7 @@ Namespace *Symbol::enclosingNamespace() const
Template *Symbol::enclosingTemplate() const
{
for (Scope *s = _scope; s; s = s->scope()) {
for (Scope *s = _scope; s; s = s->enclosingScope()) {
if (Template *templ = s->asTemplate())
return templ;
}
@@ -262,7 +262,7 @@ Template *Symbol::enclosingTemplate() const
Class *Symbol::enclosingClass() const
{
for (Scope *s = _scope; s; s = s->scope()) {
for (Scope *s = _scope; s; s = s->enclosingScope()) {
if (Class *klass = s->asClass())
return klass;
}
@@ -271,7 +271,7 @@ Class *Symbol::enclosingClass() const
Enum *Symbol::enclosingEnum() const
{
for (Scope *s = _scope; s; s = s->scope()) {
for (Scope *s = _scope; s; s = s->enclosingScope()) {
if (Enum *e = s->asEnum())
return e;
}
@@ -280,7 +280,7 @@ Enum *Symbol::enclosingEnum() const
Function *Symbol::enclosingFunction() const
{
for (Scope *s = _scope; s; s = s->scope()) {
for (Scope *s = _scope; s; s = s->enclosingScope()) {
if (Function *fun = s->asFunction())
return fun;
}
@@ -289,7 +289,7 @@ Function *Symbol::enclosingFunction() const
Block *Symbol::enclosingBlock() const
{
for (Scope *s = _scope; s; s = s->scope()) {
for (Scope *s = _scope; s; s = s->enclosingScope()) {
if (Block *block = s->asBlock())
return block;
}

View File

@@ -287,7 +287,7 @@ public:
void setUnavailable(bool isUnavailable);
/// Returns this Symbol's eclosing scope.
Scope *scope() const;
Scope *enclosingScope() const;
/// Returns the eclosing namespace scope.
Namespace *enclosingNamespace() const;
@@ -307,7 +307,7 @@ public:
/// Returns the enclosing Block scope.
Block *enclosingBlock() const;
void setScope(Scope *scope); // ### make me private
void setScope(Scope *enclosingScope); // ### make me private
void setSourceLocation(unsigned sourceLocation, TranslationUnit *translationUnit); // ### make me private
void visitSymbol(SymbolVisitor *visitor);