Package org.eclipse.xtext.xbase.compiler
Class ScopeStack
- java.lang.Object
-
- org.eclipse.xtext.xbase.compiler.ScopeStack
-
public class ScopeStack extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ScopeStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseScope()java.lang.StringdeclareVariable(java.lang.Object key, java.lang.String proposedName, boolean synthetic)java.lang.StringdeclareVariable(java.lang.Object key, java.lang.String proposedName, boolean synthetic, boolean withUniqueName)provides and registers a fresh variable in the current scope.protected java.lang.StringfindNewName(java.util.Set<java.lang.String> names, java.lang.String proposedName)java.lang.Objectget(java.lang.String name)java.lang.StringgetName(java.lang.Object referenced)voidopenScope(boolean pseudoScope)java.lang.StringremoveName(java.lang.Object referenced)
-
-
-
Method Detail
-
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)
-
removeName
public java.lang.String removeName(java.lang.Object referenced) throws java.lang.IllegalStateException- Throws:
java.lang.IllegalStateException- if the referenced object does not have a name in the current scope.
-
declareVariable
public java.lang.String declareVariable(java.lang.Object key, java.lang.String proposedName, boolean synthetic)
-
declareVariable
public java.lang.String declareVariable(java.lang.Object key, java.lang.String proposedName, boolean synthetic, boolean withUniqueName)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.- Parameters:
withUniqueName- This is a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=445949
-
findNewName
protected java.lang.String findNewName(java.util.Set<java.lang.String> names, java.lang.String proposedName)
-
-