gnu.expr
Class Expression

java.lang.Object
  |
  +--gnu.expr.Expression
Direct Known Subclasses:
ApplyExp, BeginExp, BlockExp, ErrorExp, ExitExp, IfExp, QuoteExp, ReferenceExp, ScopeExp, SetExp, SynchronizedExp, TryExp

public abstract class Expression
extends java.lang.Object
implements Printable

Abstract class for syntactic forms that evaluate to a value. Scheme S-expressions get re-written to these before evaluation.


Constructor Summary
Expression()
           
 
Method Summary
abstract  void compile(Compilation comp, Target target)
           
 void compile(Compilation comp, Type type)
           
 void compileNotePosition(Compilation comp, Target target)
          Compile, but take note of line number.
 void compileWithPosition(Compilation comp, Target target)
          Same as compile, but emit line number beforehard.
 java.lang.Object eval(Environment env)
           
 int getColumn()
           
 java.lang.String getFile()
           
 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.
abstract  void print(java.io.PrintWriter ps)
           
 void setFile(java.lang.String filename)
           
 void setLine(int lineno)
           
 void setLine(int lineno, int colno)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Method Detail

eval

public java.lang.Object eval(Environment env)

print

public abstract void print(java.io.PrintWriter ps)
Specified by:
print in interface Printable

compile

public abstract void compile(Compilation comp,
                             Target target)

compileWithPosition

public final void compileWithPosition(Compilation comp,
                                      Target target)
Same as compile, but emit line number beforehard.

compileNotePosition

public final void compileNotePosition(Compilation comp,
                                      Target target)
Compile, but take note of line number.

compile

public final void compile(Compilation comp,
                          Type type)

setFile

public final void setFile(java.lang.String filename)

setLine

public final void setLine(int lineno,
                          int colno)

setLine

public final void setLine(int lineno)

getFile

public final java.lang.String getFile()

getLine

public final int getLine()
Get the line number of (the start of) this Expression. The "first" line is line 1.

getColumn

public final int getColumn()

getType

public Type getType()
Return the Type used to represent the values of this Expression.