org.eclipse.xtext.xbase.compiler
Class ScopeStack
java.lang.Object
org.eclipse.xtext.xbase.compiler.ScopeStack
public class ScopeStack
- extends java.lang.Object
- Author:
- Sven Efftinge - Initial contribution and API
Method Summary |
void |
closeScope()
|
java.lang.String |
declareVariable(java.lang.Object key,
java.lang.String proposedName,
boolean synthetic)
provides and registers a fresh variable in the current scope. |
protected java.lang.String |
findNewName(java.util.Set<java.lang.String> names,
java.lang.String proposedName)
|
java.lang.Object |
get(java.lang.String name)
|
java.lang.String |
getName(java.lang.Object referenced)
|
void |
openScope(boolean pseudoScope)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScopeStack
public ScopeStack()
openScope
public void openScope(boolean pseudoScope)
closeScope
public void closeScope()
get
@Nullable
public java.lang.Object get(java.lang.String name)
getName
@Nullable
public java.lang.String getName(java.lang.Object referenced)
declareVariable
@NonNull
public java.lang.String declareVariable(@NonNull
java.lang.Object key,
@NonNull
java.lang.String proposedName,
boolean synthetic)
- provides and registers a fresh variable in the current scope.
It takes parent scopes into account and only reuses names of synthetic variables from parent scopes.
Pseudo scopes are treated as if they were part of their parent scope.
findNewName
@NonNull
protected java.lang.String findNewName(@NonNull
java.util.Set<java.lang.String> names,
@NonNull
java.lang.String proposedName)