gnu.expr
Class BeginExp

java.lang.Object
  extended by gnu.mapping.PropertySet
      extended by gnu.mapping.Procedure
          extended by gnu.mapping.Procedure0
              extended by gnu.expr.Expression
                  extended by gnu.expr.BeginExp
All Implemented Interfaces:
Named, Printable, SourceLocator, org.xml.sax.Locator

public class BeginExp
extends Expression

This class represents a sequence of Expressions. The expressions are evaluated for their side-effects, and the value of the last Expression is the result. A BeginExp may optionally have "compilation options" which can be used to control various compile-time aspects of Kawa, such as warning messages.


Field Summary
 
Fields inherited from class gnu.expr.Expression
flags, NEXT_AVAIL_FLAG, noExpressions
 
Constructor Summary
BeginExp()
           
BeginExp(Expression[] ex)
           
BeginExp(Expression exp0, Expression exp1)
           
 
Method Summary
 void add(Expression exp)
           
 void apply(CallContext ctx)
          Evaluate the expression.
static Expression canonicalize(Expression exp)
          Simplifies BeginExp.
static Expression canonicalize(Expression[] exps)
           
 void compile(Compilation comp, Target target)
           
 int getExpressionCount()
           
 Expression[] getExpressions()
           
 Type getType()
          Return the Type used to represent the values of this Expression.
protected  boolean mustCompile()
           
 void popOptions(Compilation comp)
           
 void print(OutPort out)
           
 void pushOptions(Compilation comp)
           
 void setCompileOptions(java.util.Vector options)
           
 void setExpressions(Expression[] exps)
           
protected  Expression walk(ExpWalker walker)
           
protected  void walkChildren(ExpWalker walker)
           
 
Methods inherited from class gnu.expr.Expression
apply0, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, inline, isStableSourceLocation, makeWhile, match0, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, side_effects, toString, valueIfConstant
 
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, getSetter, getSourceLocation, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation
 
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeginExp

public BeginExp()

BeginExp

public BeginExp(Expression[] ex)

BeginExp

public BeginExp(Expression exp0,
                Expression exp1)
Method Detail

canonicalize

public static final Expression canonicalize(Expression exp)
Simplifies BeginExp. (In the future, nested BeginExps may be "flattened" as well.)


canonicalize

public static final Expression canonicalize(Expression[] exps)

add

public final void add(Expression exp)

getExpressions

public final Expression[] getExpressions()

getExpressionCount

public final int getExpressionCount()

setExpressions

public final void setExpressions(Expression[] exps)

setCompileOptions

public void setCompileOptions(java.util.Vector options)

mustCompile

protected boolean mustCompile()
Specified by:
mustCompile in class Expression

apply

public void apply(CallContext ctx)
           throws java.lang.Throwable
Description copied from class: Expression
Evaluate the expression. This is named apply rather than eval so it is compatible with the full-tail-call calling convention, and we can stash an Expression in CallContext's proc field. FIXME - are we making use of this?

Overrides:
apply in class Expression
Throws:
java.lang.Throwable

pushOptions

public void pushOptions(Compilation comp)

popOptions

public void popOptions(Compilation comp)

compile

public void compile(Compilation comp,
                    Target target)
Specified by:
compile in class Expression

walk

protected Expression walk(ExpWalker walker)
Overrides:
walk in class Expression

walkChildren

protected void walkChildren(ExpWalker walker)
Overrides:
walkChildren in class Expression

print

public void print(OutPort out)
Specified by:
print in class Expression

getType

public Type getType()
Description copied from class: Expression
Return the Type used to represent the values of this Expression.

Overrides:
getType in class Expression