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 registeres 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
public java.lang.Object get(java.lang.String name)
getName
public java.lang.String getName(java.lang.Object referenced)
declareVariable
public java.lang.String declareVariable(java.lang.Object key,
java.lang.String proposedName,
boolean synthetic)
- provides and registeres 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
protected java.lang.String findNewName(java.util.Set<java.lang.String> names,
java.lang.String proposedName)