| gnu.expr.Expression gnu.expr.ScopeExp
All known Subclasses: gnu.expr.LambdaExp, gnu.expr.CatchClause, gnu.expr.LetExp,
ScopeExp | abstract public class ScopeExp extends Expression (Code) | | Abstract class for expressions that add local variable bindings.
author: Per Bothner |
Method Summary | |
public void | add(Declaration decl) | public void | add(Declaration prev, Declaration decl) Add a Declaration at a specified position. | final public Declaration | addDeclaration(Object name) Create a new declaration in the current Scope. | final public Declaration | addDeclaration(Object name, Type type) Create a new declaration in the current Scope. | final public void | addDeclaration(Declaration decl) Add a Declaration to the current Scope. | public int | countDecls() | public LambdaExp | currentLambda() | public ModuleExp | currentModule() | public static void | duplicateDeclarationError(Declaration oldDecl, Declaration newDecl, Compilation comp) | public Declaration | firstDecl() | public Declaration | getDefine(Object name, char severity, Compilation parser) Add a new Declaration, with a message if there is an existing one. | public Declaration | getNoDefine(Object name) Lookup a declaration, create a non-defining declaration if needed. | public Scope | getVarScope() | public Declaration | lookup(Object sym) Find a Declaration by name. | public Declaration | lookup(Object sym, Language language, int namespace) | public static int | nesting(ScopeExp sc) | public void | popScope(CodeAttr code) Clear bytecode resources for the ScopeExp. | public void | remove(Declaration decl) | public void | remove(Declaration prev, Declaration decl) | public void | replaceFollowing(Declaration prev, Declaration newDecl) Replace the prev.next by newDecl .
If prev==null , replace the first decl. | protected void | setIndexes() Calculate offset and frameSize needed by interpreter. | public String | toString() | protected Expression | walk(ExpWalker walker) |
counter | static int counter(Code) | | |
frameSize | protected int frameSize(Code) | | Size of evalFrame to allocate in interpreter.
|
id | public int id(Code) | | Unique id number, to ease print-outs and debugging.
|
outer | public ScopeExp outer(Code) | | The statically enclosing binding contour.
|
ScopeExp | public ScopeExp()(Code) | | |
addDeclaration | final public Declaration addDeclaration(Object name)(Code) | | Create a new declaration in the current Scope.
Parameters: name - name (interned) to give to the new Declaration. |
addDeclaration | final public Declaration addDeclaration(Object name, Type type)(Code) | | Create a new declaration in the current Scope.
Parameters: name - name (interned) to give to the new Declaration. Parameters: type - type of the new Declaration. |
addDeclaration | final public void addDeclaration(Declaration decl)(Code) | | Add a Declaration to the current Scope.
|
countDecls | public int countDecls()(Code) | | |
getNoDefine | public Declaration getNoDefine(Object name)(Code) | | Lookup a declaration, create a non-defining declaration if needed.
|
lookup | public Declaration lookup(Object sym)(Code) | | Find a Declaration by name.
Parameters: sym - the (interned) name of the Declaration sought the matching Declaration, if found; otherwise null |
popScope | public void popScope(CodeAttr code)(Code) | | Clear bytecode resources for the ScopeExp.
This potentially allows Kawa to generate code for the same (inlined,
shared) ScopeExp multiple times - though we're not making use of that yet.
|
replaceFollowing | public void replaceFollowing(Declaration prev, Declaration newDecl)(Code) | | Replace the prev.next by newDecl .
If prev==null , replace the first decl.
|
setIndexes | protected void setIndexes()(Code) | | Calculate offset and frameSize needed by interpreter.
|
Methods inherited from gnu.expr.Expression | public void apply(CallContext ctx) throws Throwable(Code)(Java Doc) final public Object apply0() throws Throwable(Code)(Java Doc) abstract public void compile(Compilation comp, Target target)(Code)(Java Doc) final public void compile(Compilation comp, Type type)(Code)(Java Doc) final public void compile(Compilation comp, Declaration lhs)(Code)(Java Doc) public static void compileButFirst(Expression exp, Compilation comp)(Code)(Java Doc) final public void compileNotePosition(Compilation comp, Target target, Expression position)(Code)(Java Doc) final public void compileWithPosition(Compilation comp, Target target)(Code)(Java Doc) final public void compileWithPosition(Compilation comp, Target target, Expression position)(Code)(Java Doc) final public Object eval(CallContext ctx) throws Throwable(Code)(Java Doc) final public Object eval(Environment env) throws Throwable(Code)(Java Doc) final public int getColumnNumber()(Code)(Java Doc) final public String getFileName()(Code)(Java Doc) public boolean getFlag(int flag)(Code)(Java Doc) public int getFlags()(Code)(Java Doc) final public int getLineNumber()(Code)(Java Doc) public String getPublicId()(Code)(Java Doc) public String getSystemId()(Code)(Java Doc) public Type getType()(Code)(Java Doc) public Expression inline(ApplyExp exp, InlineCalls walker, Declaration decl)(Code)(Java Doc) public boolean isStableSourceLocation()(Code)(Java Doc) public static Expression makeWhile(Object cond, Object body, Compilation parser)(Code)(Java Doc) final public int match0(CallContext ctx)(Code)(Java Doc) abstract protected boolean mustCompile()(Code)(Java Doc) final public void print(Consumer out)(Code)(Java Doc) abstract public void print(OutPort ps)(Code)(Java Doc) public void printLineColumn(OutPort out)(Code)(Java Doc) final public void setFile(String filename)(Code)(Java Doc) public void setFlag(boolean setting, int flag)(Code)(Java Doc) public void setFlag(int flag)(Code)(Java Doc) final public Expression setLine(Expression old)(Code)(Java Doc) final public void setLine(int lineno, int colno)(Code)(Java Doc) final public void setLine(int lineno)(Code)(Java Doc) public void setLine(Compilation comp)(Code)(Java Doc) final public void setLocation(SourceLocator location)(Code)(Java Doc) public boolean side_effects()(Code)(Java Doc) public String toString()(Code)(Java Doc) public Object valueIfConstant()(Code)(Java Doc) protected Expression walk(ExpWalker walker)(Code)(Java Doc) protected void walkChildren(ExpWalker walker)(Code)(Java Doc)
|
|
|