Package gnu.expr
Class BeginExp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.expr.Expression
gnu.expr.BeginExp
- All Implemented Interfaces:
gnu.kawa.format.Printable
,Named
,SourceLocator
,SourceLocator
,Locator
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
Field Summary
Fields inherited from class gnu.expr.Expression
applyMethodExpression, flags, NEXT_AVAIL_FLAG, noExpressions, type, VALIDATED
Fields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
Constructor Summary
ConstructorsConstructorDescriptionBeginExp()
BeginExp
(Expression[] ex) BeginExp
(Expression exp0, Expression exp1) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(Expression exp) void
apply
(CallContext ctx) Evaluate the expression.protected Type
static final Expression
canonicalize
(Expression exp) Simplifies BeginExp.static final Expression
canonicalize
(Expression[] exps) void
compile
(Compilation comp, Target target) final int
final Expression[]
protected boolean
void
popOptions
(Compilation comp) void
print
(gnu.kawa.io.OutPort out) void
pushOptions
(Compilation comp) void
setCompileOptions
(Vector options) final void
setExpressions
(Expression[] exps) protected <R,
D> R visit
(ExpVisitor<R, D> visitor, D d) protected <R,
D> void visitChildren
(ExpVisitor<R, D> visitor, D d) Methods inherited from class gnu.expr.Expression
applyMethodExpression, checkLiteralKeyword, compile, compile, compileWithPosition, compileWithPosition, deepCopy, deepCopy, deepCopy, deepCopy, eval, eval, getColumnNumber, getEndColumn, getEndLine, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getStartColumn, getStartLine, getSystemId, getType, getTypeRaw, isSingleValue, isStableSourceLocation, makeWhile, maybeSetLine, neverReturns, numArgs, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLine, setLocation, setType, side_effects, toString, validateApply, valueIfConstant
Methods inherited from class gnu.mapping.Procedure
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
Constructor Details
-
BeginExp
public BeginExp() -
BeginExp
-
BeginExp
-
-
Method Details
-
canonicalize
Simplifies BeginExp. (In the future, nested BeginExps may be "flattened" as well.) -
canonicalize
-
add
-
getExpressions
-
getExpressionCount
public final int getExpressionCount() -
setExpressions
-
setCompileOptions
-
mustCompile
protected boolean mustCompile()- Specified by:
mustCompile
in classExpression
-
apply
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 classExpression
- Throws:
Throwable
-
pushOptions
-
popOptions
-
compile
- Specified by:
compile
in classExpression
-
visit
- Overrides:
visit
in classExpression
-
visitChildren
- Overrides:
visitChildren
in classExpression
-
print
public void print(gnu.kawa.io.OutPort out) - Specified by:
print
in classExpression
-
calculateType
- Overrides:
calculateType
in classExpression
-