gnu.expr
Class ScopeExp
java.lang.Object
|
+--gnu.expr.Expression
|
+--gnu.expr.ScopeExp
- Direct Known Subclasses:
- CatchClause, LambdaExp, LetExp
- public abstract class ScopeExp
- extends Expression
Abstract class for expressions that add local variable bindings.
|
Field Summary |
ScopeExp |
outer
The statically enclosing binding contour. |
| Methods inherited from class gnu.expr.Expression |
compile,
compile,
compileNotePosition,
compileWithPosition,
eval,
getColumn,
getFile,
getLine,
getType,
print,
setFile,
setLine,
setLine |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
outer
public ScopeExp outer
- The statically enclosing binding contour.
ScopeExp
public ScopeExp()
firstDecl
public final Declaration firstDecl()
add
public void add(Declaration decl)
currentLambda
public LambdaExp currentLambda()
lookup
public Declaration lookup(java.lang.String sym)
- Find a Declaration by name.
- Parameters:
sym - the (interned) name of the Declaration sought- Returns:
- the matching Declaration, if found; otherwise null
addDeclaration
public final Declaration addDeclaration(java.lang.String name)
- Create a new declaration in the current Scope.
- Parameters:
name - name (interned) to give to the new Declaration.
addDeclaration
public final Declaration addDeclaration(java.lang.String name,
Type type)
- Create a new declaration in the current Scope.
- Parameters:
name - name (interned) to give to the new Declaration.type - type of the new Declaration.
addDeclaration
public final void addDeclaration(Declaration decl)
- Add a Declaration to the current Scope.
countDecls
public int countDecls()