gnu.expr

Class BeginExp

Implemented Interfaces:
Named, Printable

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

NEXT_AVAIL_FLAG, flags, noExpressions

Constructor Summary

BeginExp()
BeginExp(Expression exp0, Expression exp1)
BeginExp(Expression[] ex)

Method Summary

void
add(Expression exp)
void
apply(CallContext ctx)
static Expression
canonicalize(Expression exp)
Simplifies BeginExp.
static Expression
canonicalize(Expression[] exps)
void
compile(Compilation comp, Target target)
Object
eval(Environment env)
Expression[]
getExpressions()
Type
getType()
void
popOptions(Compilation comp)
void
print(OutPort out)
void
pushOptions(Compilation comp)
void
setCompileOptions(Vector options)
void
setExpressions(Expression[] exps)
protected Expression
walk(ExpWalker walker)
protected void
walkChildren(ExpWalker walker)

Methods inherited from class gnu.expr.Expression

apply, apply0, compile, compile, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumn, getFile, getFlag, getFlags, getLine, getType, makeWhile, match0, print, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, walk, walkChildren

Methods inherited from class gnu.mapping.Procedure0

apply0, apply1, apply2, apply3, apply4, applyN, numArgs

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Constructor Details

BeginExp

public BeginExp()

BeginExp

public BeginExp(Expression exp0,
                Expression exp1)

BeginExp

public BeginExp(Expression[] ex)

Method Details

add

public final void add(Expression exp)

apply

public void apply(CallContext ctx)
            throws Throwable
Overrides:
apply in interface Expression

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)

compile

public void compile(Compilation comp,
                    Target target)
Overrides:
compile in interface Expression

eval

public Object eval(Environment env)
            throws Throwable
Overrides:
eval in interface Expression

getExpressions

public final Expression[] getExpressions()

getType

public Type getType()
Overrides:
getType in interface Expression

popOptions

public void popOptions(Compilation comp)

print

public void print(OutPort out)
Overrides:
print in interface Expression

pushOptions

public void pushOptions(Compilation comp)

setCompileOptions

public void setCompileOptions(Vector options)

setExpressions

public final void setExpressions(Expression[] exps)

walk

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

walkChildren

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