Package gnu.expr

Class BeginExp

  • All Implemented Interfaces:
    gnu.kawa.format.Printable, Named, SourceLocator, SourceLocator, 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.
    • Method Detail

      • canonicalize

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

        public final Expression[] getExpressions()
      • getExpressionCount

        public final int getExpressionCount()
      • setExpressions

        public final void setExpressions​(Expression[] exps)
      • setCompileOptions

        public void setCompileOptions​(Vector options)
      • apply

        public void apply​(CallContext ctx)
                   throws 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:
        Throwable
      • pushOptions

        public void pushOptions​(Compilation comp)
      • popOptions

        public void popOptions​(Compilation comp)
      • print

        public void print​(gnu.kawa.io.OutPort out)
        Specified by:
        print in class Expression