com.sun.tools.javac.code
Class Scope.DelegatedScope

java.lang.Object
  extended by com.sun.tools.javac.code.Scope
      extended by com.sun.tools.javac.code.Scope.DelegatedScope
Enclosing class:
Scope

public static class Scope.DelegatedScope
extends Scope

An empty scope, into which you can't place anything. Used for the scope for a variable initializer.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.tools.javac.code.Scope
Scope.DelegatedScope, Scope.Entry, Scope.ErrorScope, Scope.ImportScope
 
Field Summary
static Scope.Entry[] emptyTable
           
 
Fields inherited from class com.sun.tools.javac.code.Scope
elems, emptyScope, nelems, next, owner, table
 
Constructor Summary
Scope.DelegatedScope(Scope outer)
           
 
Method Summary
 Scope dup()
          Construct a fresh scope within this scope, with same owner, which shares its table with the outer scope.
 Scope dupUnshared()
          Construct a fresh scope within this scope, with same owner, with a new hash table, whose contents initially are those of the table of its outer scope.
 void enter(Symbol sym)
          Enter symbol sym in this scope.
 void enter(Symbol sym, Scope s)
           
 Scope leave()
          Remove all entries of this scope from its table, if shared with next.
 Scope.Entry lookup(Name name)
          Return the entry associated with given name, starting in this scope and proceeding outwards.
 void remove(Symbol sym)
          Remove symbol from this scope.
 
Methods inherited from class com.sun.tools.javac.code.Scope
dup, enter, enterIfAbsent, getElements, includes, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

emptyTable

public static final Scope.Entry[] emptyTable
Constructor Detail

Scope.DelegatedScope

public Scope.DelegatedScope(Scope outer)
Method Detail

dup

public Scope dup()
Description copied from class: Scope
Construct a fresh scope within this scope, with same owner, which shares its table with the outer scope. Used in connection with method leave if scope access is stack-like in order to avoid allocation of fresh tables.

Overrides:
dup in class Scope

dupUnshared

public Scope dupUnshared()
Description copied from class: Scope
Construct a fresh scope within this scope, with same owner, with a new hash table, whose contents initially are those of the table of its outer scope.

Overrides:
dupUnshared in class Scope

leave

public Scope leave()
Description copied from class: Scope
Remove all entries of this scope from its table, if shared with next.

Overrides:
leave in class Scope

enter

public void enter(Symbol sym)
Description copied from class: Scope
Enter symbol sym in this scope.

Overrides:
enter in class Scope

enter

public void enter(Symbol sym,
                  Scope s)
Overrides:
enter in class Scope

remove

public void remove(Symbol sym)
Description copied from class: Scope
Remove symbol from this scope. Used when an inner class attribute tells us that the class isn't a package member.

Overrides:
remove in class Scope

lookup

public Scope.Entry lookup(Name name)
Description copied from class: Scope
Return the entry associated with given name, starting in this scope and proceeding outwards. If no entry was found, return the sentinel, which is characterized by having a null in both its scope and sym fields, whereas both fields are non-null for regular entries.

Overrides:
lookup in class Scope


Copyright © 2009. All Rights Reserved.