Package gnu.expr
Class SetExp
- All Implemented Interfaces:
gnu.kawa.format.Printable
,Named
,SourceLocator
,SourceLocator
,Locator
An Expression to set (bind) or define a new value to a named variable.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
"Failure" return value of canUseInc.static final int
static final int
static final int
static final int
static final int
Fields inherited from class gnu.expr.AccessExp
NEXT_AVAIL_FLAG, PREFER_BINDING2
Fields inherited from class gnu.expr.Expression
applyMethodExpression, flags, noExpressions, type, VALIDATED
Fields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
Constructor Summary
ConstructorsConstructorDescriptionSetExp
(Declaration decl, Expression val) SetExp
(Object symbol, Expression val) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(CallContext ctx) Evaluate the expression.protected final Type
static int
canUseInc
(Expression rhs, Declaration target) void
compile
(Compilation comp, Target target) final boolean
True if evaluating the SetExp yields the value of the RHS.final Expression
Get the Expression for calculating the new ("right-hand") value.final boolean
final boolean
True if this is a functon definition ("defun").final boolean
static SetExp
makeDefinition
(Declaration decl, Expression val) static SetExp
makeDefinition
(Object symbol, Expression val) protected boolean
void
print
(gnu.kawa.io.OutPort out) final void
setDefining
(boolean value) final void
setFuncDef
(boolean value) final void
setHasValue
(boolean value) void
setNewValue
(Expression newValue) final void
setSetIfUnbound
(boolean value) toString()
protected <R,
D> R visit
(ExpVisitor<R, D> visitor, D d) protected <R,
D> void visitChildren
(ExpVisitor<R, D> visitor, D d) Methods inherited from class gnu.expr.AccessExp
contextDecl, getBinding, getName, getSimpleName, getSymbol, setBinding, setContextDecl, string_name
Methods inherited from class gnu.expr.Expression
applyMethodExpression, checkLiteralKeyword, compile, compile, compileWithPosition, compileWithPosition, deepCopy, deepCopy, deepCopy, deepCopy, eval, eval, getColumnNumber, getEndColumn, getEndLine, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getStartColumn, getStartLine, getSystemId, getType, getTypeRaw, isSingleValue, isStableSourceLocation, makeWhile, maybeSetLine, neverReturns, numArgs, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLine, setLocation, setType, side_effects, validateApply, valueIfConstant
Methods inherited from class gnu.mapping.Procedure
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation
Methods inherited from class gnu.mapping.PropertySet
getProperty, removeProperty, setName, setProperty, setProperty, setSymbol
-
Field Details
-
DEFINING_FLAG
public static final int DEFINING_FLAG- See Also:
-
GLOBAL_FLAG
public static final int GLOBAL_FLAG- See Also:
-
PROCEDURE
public static final int PROCEDURE- See Also:
-
SET_IF_UNBOUND
public static final int SET_IF_UNBOUND- See Also:
-
HAS_VALUE
public static final int HAS_VALUE- See Also:
-
BAD_SHORT
public static final int BAD_SHORT"Failure" return value of canUseInc.- See Also:
-
-
Constructor Details
-
SetExp
-
SetExp
-
-
Method Details
-
makeDefinition
-
makeDefinition
-
getNewValue
Get the Expression for calculating the new ("right-hand") value. -
setNewValue
-
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 classExpression
-
apply
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 classExpression
- Throws:
Throwable
-
compile
- Specified by:
compile
in classExpression
-
canUseInc
-
calculateType
- Overrides:
calculateType
in classExpression
-
visit
- Overrides:
visit
in classExpression
-
visitChildren
- Overrides:
visitChildren
in classExpression
-
print
public void print(gnu.kawa.io.OutPort out) - Specified by:
print
in classExpression
-
toString
- Overrides:
toString
in classExpression
-