gnu.expr
public abstract class ScopeExp extends Expression
| Field Summary | |
|---|---|
| protected int | frameSize Size of evalFrame to allocate in interpreter. |
| int | id Unique id number, to ease print-outs and debugging. |
| ScopeExp | outer The statically enclosing binding contour. |
| Constructor Summary | |
|---|---|
| ScopeExp() | |
| Method Summary | |
|---|---|
| void | add(Declaration decl) |
| void | add(Declaration prev, Declaration decl) Add a Declaration at a specified position. |
| Declaration | addDeclaration(Object name)
Create a new declaration in the current Scope. |
| Declaration | addDeclaration(Object name, Type type)
Create a new declaration in the current Scope. |
| void | addDeclaration(Declaration decl)
Add a Declaration to the current Scope. |
| int | countDecls() |
| LambdaExp | currentLambda() |
| ModuleExp | currentModule() |
| static void | duplicateDeclarationError(Declaration oldDecl, Declaration newDecl, Compilation comp) |
| Declaration | firstDecl() |
| Declaration | getDefine(Object name, char severity, Compilation parser) Add a new Declaration, with a message if there is an existing one. |
| Declaration | getNoDefine(Object name) Lookup a declaration, create a non-defining declaration if needed. |
| Scope | getVarScope() |
| Declaration | lookup(Object sym)
Find a Declaration by name. |
| Declaration | lookup(Object sym, Language language, int namespace) |
| static int | nesting(ScopeExp sc) |
| void | popScope(CodeAttr code) Clear bytecode resources for the ScopeExp.
|
| void | remove(Declaration decl) |
| void | remove(Declaration prev, Declaration decl) |
| void | replaceFollowing(Declaration prev, Declaration newDecl) Replace the prev.next by newDecl.
|
| protected void | setIndexes() Calculate offset and frameSize needed by interpreter. |
| String | toString() |
| protected Expression | walk(ExpWalker walker) |
Parameters: name name (interned) to give to the new Declaration.
Parameters: name name (interned) to give to the new Declaration. type type of the new Declaration.
Parameters: sym the (interned) name of the Declaration sought
Returns: the matching Declaration, if found; otherwise null
prev.next by newDecl.
If prev==null, replace the first decl.