gnu.expr
public abstract class Expression extends Procedure0 implements Printable, SourceLocator
| Field Summary | |
|---|---|
| protected int | flags |
| static Expression[] | noExpressions |
| protected static int | NEXT_AVAIL_FLAG |
| Method Summary | |
|---|---|
| void | apply(CallContext ctx) Evaluate the expression.
|
| Object | apply0() |
| abstract void | compile(Compilation comp, Target target) |
| void | compile(Compilation comp, Type type) |
| void | compile(Compilation comp, Declaration lhs) Compile an expression with checking suitable for a known Declaration.
|
| static void | compileButFirst(Expression exp, Compilation comp) Compile all but the first sub-"statement".
|
| void | compileNotePosition(Compilation comp, Target target, Expression position) Compile, but take note of line number. |
| void | compileWithPosition(Compilation comp, Target target) Same as compile, but emit line number beforehard. |
| void | compileWithPosition(Compilation comp, Target target, Expression position) Same as 2-argument compileWithPosition,
but use some other Expression's line number. |
| Object | eval(CallContext ctx) |
| Object | eval(Environment env) |
| int | getColumnNumber() |
| String | getFileName() |
| boolean | getFlag(int flag) |
| int | getFlags() |
| int | getLineNumber() Get the line number of (the start of) this Expression.
|
| String | getPublicId() |
| String | getSystemId() |
| Type | getType() Return the Type used to represent the values of this Expression. |
| Expression | inline(ApplyExp exp, InlineCalls walker, Declaration decl) Apply inlining transformations on a given ApplyExp.
|
| boolean | isStableSourceLocation() |
| static Expression | makeWhile(Object cond, Object body, Compilation parser) Helper method to create a `while' statement. |
| int | match0(CallContext ctx) |
| protected abstract boolean | mustCompile() |
| void | print(Consumer out) |
| abstract void | print(OutPort ps) |
| void | printLineColumn(OutPort out)
Print line and column number if specified.
|
| void | setFile(String filename) |
| void | setFlag(boolean setting, int flag) |
| void | setFlag(int flag) |
| Expression | setLine(Expression old) |
| void | setLine(int lineno, int colno) |
| void | setLine(int lineno) |
| void | setLine(Compilation comp) Set line number from current position in Compilation. |
| void | setLocation(SourceLocator location) Copies the current location. |
| boolean | side_effects() True if evaluating may have side-effects. |
| String | toString() |
| Object | valueIfConstant() Return value if it is constant, or null if non-constant or unknown. |
| protected Expression | walk(ExpWalker walker) |
| protected void | walkChildren(ExpWalker walker) |
Parameters: exp an application whose function expression can be simplified to this expression. walker the context for the current inlining pass decl if non-null, a Declaration bound to this expression
Returns: an Expression equivalent to te passed-in exp.
Compilation.