public abstract class Scope
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
abstract InterpretedClassDef |
addClass(Location location,
java.lang.String name,
java.lang.String parent,
java.util.ArrayList<java.lang.String> ifaceList,
int index,
boolean isTop)
Adds a class.
|
protected abstract void |
addConditionalClass(InterpretedClassDef def)
Adds a conditional class.
|
protected void |
addConditionalFunction(Function function)
Adds a function defined in a conditional block.
|
protected void |
addConditionalFunction(StringValue name,
Function function)
Adds a function defined in a conditional block.
|
void |
addConstant(java.lang.String name,
Expr value)
Adds a constant.
|
abstract void |
addFunction(StringValue name,
Function function,
boolean isTop)
Adds a function.
|
Scope |
getParent()
Returns the parent scope.
|
boolean |
isAbstract()
Returns true for an abstract scope, e.g.
|
boolean |
isClass()
Returns true if scope is within a class.
|
boolean |
isFunction()
Returns true if scope is local to a function.
|
boolean |
isGlobal()
Returns true if scope is global.
|
boolean |
isIf()
Returns true if scope is local to an IF statement.
|
boolean |
isSwitchCase()
Returns true if scope is local to a switch case statement.
|
boolean |
isTry()
Returns true if scope is local to a try statement.
|
boolean |
isWhile()
Returns true if scope is local to a while statement.
|
protected Scope _parent
public Scope()
public Scope(Scope parent)
public boolean isAbstract()
public boolean isGlobal()
public boolean isClass()
public boolean isFunction()
public boolean isIf()
public boolean isSwitchCase()
public boolean isWhile()
public boolean isTry()
public Scope getParent()
public void addConstant(java.lang.String name, Expr value)
public abstract void addFunction(StringValue name, Function function, boolean isTop)
protected void addConditionalFunction(StringValue name, Function function)
protected void addConditionalFunction(Function function)
public abstract InterpretedClassDef addClass(Location location, java.lang.String name, java.lang.String parent, java.util.ArrayList<java.lang.String> ifaceList, int index, boolean isTop)
protected abstract void addConditionalClass(InterpretedClassDef def)