gnu.expr

Class SetExp

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

NEXT_AVAIL_FLAG, flags, noExpressions

Constructor Summary

SetExp(Object symbol, Expression val)
SetExp(Declaration decl, Expression val)

Method Summary

void
compile(Compilation comp, Target target)
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)
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, compile, compileButFirst, 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

Field Details

DEFINING_FLAG

public static final int DEFINING_FLAG
Field Value:
1

GLOBAL_FLAG

public static final int GLOBAL_FLAG
Field Value:
2

HAS_VALUE

public static final int HAS_VALUE
Field Value:
32

PREFER_BINDING2

public static final int PREFER_BINDING2
Field Value:
4

PROCEDURE

public static final int PROCEDURE
Field Value:
8

SET_IF_UNBOUND

public static final int SET_IF_UNBOUND
Field Value:
16

Constructor Details

SetExp

public SetExp(Object symbol,
              Expression val)

SetExp

public SetExp(Declaration decl,
              Expression val)

Method Details

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

getHasValue

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

getNewValue

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

getType

public final Type getType()
Return the Type used to represent the values of this Expression.
Overrides:
getType in interface Expression

isDefining

public final boolean isDefining()

isFuncDef

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

isSetIfUnbound

public final boolean isSetIfUnbound()

print

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

setDefining

public final void setDefining(boolean value)

setFuncDef

public final void setFuncDef(boolean value)

setHasValue

public final void setHasValue(boolean value)

setSetIfUnbound

public final void setSetIfUnbound(boolean value)

toString

public String toString()
Overrides:
toString in interface Procedure

walk

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

walkChildren

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