Package gnu.expr

Class SetExp

All Implemented Interfaces:
gnu.kawa.format.Printable, Named, SourceLocator, SourceLocator, Locator

public class SetExp extends AccessExp
An Expression to set (bind) or define a new value to a named variable.
  • Field Details

  • Constructor Details

  • Method Details

    • makeDefinition

      public static SetExp makeDefinition(Object symbol, Expression val)
    • makeDefinition

      public static SetExp makeDefinition(Declaration decl, Expression val)
    • getNewValue

      public final Expression getNewValue()
      Get the Expression for calculating the new ("right-hand") value.
    • setNewValue

      public void setNewValue(Expression newValue)
    • isDefining

      public final boolean isDefining()
    • setDefining

      public final void setDefining(boolean value)
    • getHasValue

      public final boolean getHasValue()
      True if evaluating the SetExp yields the value of the RHS.
    • setHasValue

      public final void setHasValue(boolean value)
    • isFuncDef

      public final boolean isFuncDef()
      True if this is a functon definition ("defun").
    • setFuncDef

      public final void setFuncDef(boolean value)
    • isSetIfUnbound

      public final boolean isSetIfUnbound()
    • setSetIfUnbound

      public final void setSetIfUnbound(boolean value)
    • mustCompile

      protected boolean mustCompile()
      Specified by:
      mustCompile in class Expression
    • 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
    • compile

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

      public static int canUseInc(Expression rhs, Declaration target)
    • calculateType

      protected final Type calculateType()
      Overrides:
      calculateType in class Expression
    • visit

      protected <R, D> R visit(ExpVisitor<R,D> visitor, D d)
      Overrides:
      visit in class Expression
    • visitChildren

      protected <R, D> void visitChildren(ExpVisitor<R,D> visitor, D d)
      Overrides:
      visitChildren in class Expression
    • print

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

      public String toString()
      Overrides:
      toString in class Expression