gnu.expr
Class SetExp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.Procedure0
gnu.expr.Expression
gnu.expr.AccessExp
gnu.expr.SetExp
- All Implemented Interfaces:
- Named, Printable, javax.xml.transform.SourceLocator, org.xml.sax.Locator
public class SetExp
- extends AccessExp
An Expression to set (bind) or define a new value to a named variable.
Methods inherited from class gnu.expr.Expression |
apply0, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, inline, isStableSourceLocation, makeWhile, match0, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, side_effects, valueIfConstant |
Methods inherited from class gnu.mapping.Procedure |
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
SetExp
public SetExp(java.lang.Object symbol,
Expression val)
SetExp
public SetExp(Declaration decl,
Expression val)
makeDefinition
public static SetExp makeDefinition(java.lang.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.
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 java.lang.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:
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 Expression