|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.Procedure gnu.mapping.Procedure0 gnu.expr.Expression
public abstract class Expression
Abstract class for syntactic forms that evaluate to a value. Scheme S-expressions get re-written to these before evaluation.
Field Summary | |
---|---|
protected int |
flags
|
protected static int |
NEXT_AVAIL_FLAG
|
static Expression[] |
noExpressions
|
Constructor Summary | |
---|---|
Expression()
|
Method Summary | |
---|---|
void |
apply(CallContext ctx)
Call this Procedure using the explicit-CallContext-convention. |
java.lang.Object |
apply0()
|
abstract void |
compile(Compilation comp,
Target target)
|
void |
compile(Compilation comp,
Type type)
|
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. |
java.lang.Object |
eval(CallContext ctx)
|
java.lang.Object |
eval(Environment env)
|
int |
getColumn()
|
java.lang.String |
getFile()
|
boolean |
getFlag(int flag)
|
int |
getFlags()
|
int |
getLine()
Get the line number of (the start of) this Expression. |
Type |
getType()
Return the Type used to represent the values of this Expression. |
static Expression |
makeWhile(java.lang.Object cond,
java.lang.Object body,
Compilation parser)
Helper method to create a `while' statement. |
int |
match0(CallContext ctx)
Pass zero arguments. |
abstract void |
print(OutPort ps)
|
void |
print(java.io.PrintWriter ps)
|
void |
printLineColumn(OutPort out)
Print line and column number if specified. |
void |
setFile(java.lang.String filename)
|
void |
setFlag(boolean setting,
int flag)
|
void |
setFlag(int flag)
|
void |
setLine(Compilation comp)
Set line number from current position in Compilation . |
Expression |
setLine(Expression old)
|
void |
setLine(int lineno)
|
void |
setLine(int lineno,
int colno)
|
protected Expression |
walk(ExpWalker walker)
|
protected void |
walkChildren(ExpWalker walker)
|
Methods inherited from class gnu.mapping.Procedure0 |
---|
apply1, apply2, apply3, apply4, applyN, numArgs |
Methods inherited from class gnu.mapping.Procedure |
---|
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Expression[] noExpressions
protected int flags
protected static final int NEXT_AVAIL_FLAG
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public java.lang.Object eval(Environment env) throws java.lang.Throwable
java.lang.Throwable
public final int match0(CallContext ctx)
Procedure
match0
in class Procedure
public final java.lang.Object apply0() throws java.lang.Throwable
apply0
in class Procedure0
java.lang.Throwable
public void apply(CallContext ctx) throws java.lang.Throwable
Procedure
apply
in class Procedure
java.lang.Throwable
public final java.lang.Object eval(CallContext ctx) throws java.lang.Throwable
java.lang.Throwable
public final void print(java.io.PrintWriter ps)
print
in interface Printable
public abstract void print(OutPort ps)
public void printLineColumn(OutPort out)
public abstract void compile(Compilation comp, Target target)
public final void compileWithPosition(Compilation comp, Target target)
public final void compileWithPosition(Compilation comp, Target target, Expression position)
public final void compileNotePosition(Compilation comp, Target target, Expression position)
public final void compile(Compilation comp, Type type)
public static void compileButFirst(Expression exp, Compilation comp)
protected Expression walk(ExpWalker walker)
protected void walkChildren(ExpWalker walker)
public static Expression makeWhile(java.lang.Object cond, java.lang.Object body, Compilation parser)
public final Expression setLine(Expression old)
public final void setFile(java.lang.String filename)
public final void setLine(int lineno, int colno)
public final void setLine(int lineno)
public final java.lang.String getFile()
public void setLine(Compilation comp)
Compilation
.
public final int getLine()
public final int getColumn()
public Type getType()
public void setFlag(boolean setting, int flag)
public void setFlag(int flag)
public int getFlags()
public boolean getFlag(int flag)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |