gnu.expr
Class SetExp

java.lang.Object
  extended by gnu.mapping.Procedure
      extended by gnu.mapping.Procedure0
          extended by gnu.expr.Expression
              extended by gnu.expr.AccessExp
                  extended by gnu.expr.SetExp
All Implemented Interfaces:
Named, Printable

public class SetExp
extends AccessExp

An Expression to set (bind) or define a new value to a named variable.


Field Summary
static int DEFINING_FLAG
           
static int GLOBAL_FLAG
           
static int HAS_VALUE
           
static int PREFER_BINDING2
           
static int PROCEDURE
           
static int SET_IF_UNBOUND
           
 
Fields inherited from class gnu.expr.Expression
flags, NEXT_AVAIL_FLAG, noExpressions
 
Constructor Summary
SetExp(Declaration decl, Expression val)
           
SetExp(java.lang.Object symbol, Expression val)
           
 
Method Summary
 void compile(Compilation comp, Target target)
           
 java.lang.Object eval(Environment env)
           
 boolean getHasValue()
          True if evaluating the SetExp yields the value of the RHS.
 Expression getNewValue()
          Get the Expression for calculating the new ("right-hand") value.
 Type getType()
          Return the Type used to represent the values of this Expression.
 boolean isDefining()
           
 boolean isFuncDef()
          True if this is a functon definition ("defun").
 boolean isSetIfUnbound()
           
 void print(OutPort out)
           
 void setDefining(boolean value)
           
 void setFuncDef(boolean value)
           
 void setHasValue(boolean value)
           
 void setSetIfUnbound(boolean value)
           
 java.lang.String toString()
           
protected  Expression walk(ExpWalker walker)
           
protected  void walkChildren(ExpWalker walker)
           
 
Methods inherited from class gnu.expr.AccessExp
contextDecl, getBinding, getName, getSymbol, setBinding, setContextDecl, string_name
 
Methods inherited from class gnu.expr.Expression
apply, apply0, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, getColumn, getFile, getFlag, getFlags, getLine, makeWhile, match0, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine
 
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, getProperty, getSetter, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFINING_FLAG

public static final int DEFINING_FLAG
See Also:
Constant Field Values

GLOBAL_FLAG

public static final int GLOBAL_FLAG
See Also:
Constant Field Values

PREFER_BINDING2

public static final int PREFER_BINDING2
See Also:
Constant Field Values

PROCEDURE

public static final int PROCEDURE
See Also:
Constant Field Values

SET_IF_UNBOUND

public static final int SET_IF_UNBOUND
See Also:
Constant Field Values

HAS_VALUE

public static final int HAS_VALUE
See Also:
Constant Field Values
Constructor Detail

SetExp

public SetExp(java.lang.Object symbol,
              Expression val)

SetExp

public SetExp(Declaration decl,
              Expression val)
Method Detail

getNewValue

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


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)

eval

public java.lang.Object eval(Environment env)
                      throws java.lang.Throwable
Overrides:
eval in class Expression
Throws:
java.lang.Throwable

compile

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

getType

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

Overrides:
getType 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

toString

public java.lang.String toString()
Overrides:
toString in class Procedure