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 intstatic final intstatic final intstatic final intstatic final intFields inherited from class gnu.expr.AccessExp
NEXT_AVAIL_FLAG, PREFER_BINDING2Fields inherited from class gnu.expr.Expression
applyMethodExpression, flags, noExpressions, type, VALIDATEDFields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKeyFields inherited from class gnu.mapping.PropertySet
nameKey -
Constructor Summary
ConstructorsConstructorDescriptionSetExp(Declaration decl, Expression val) SetExp(Object symbol, Expression val) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(CallContext ctx) Evaluate the expression.protected final Typestatic intcanUseInc(Expression rhs, Declaration target) voidcompile(Compilation comp, Target target) final booleanTrue if evaluating the SetExp yields the value of the RHS.final ExpressionGet the Expression for calculating the new ("right-hand") value.final booleanfinal booleanTrue if this is a functon definition ("defun").final booleanstatic SetExpmakeDefinition(Declaration decl, Expression val) static SetExpmakeDefinition(Object symbol, Expression val) protected booleanvoidprint(gnu.kawa.io.OutPort out) final voidsetDefining(boolean value) final voidsetFuncDef(boolean value) final voidsetHasValue(boolean value) voidsetNewValue(Expression newValue) final voidsetSetIfUnbound(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_nameMethods 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, valueIfConstantMethods 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, setSourceLocationMethods 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:
mustCompilein classExpression
-
apply
Description copied from class:ExpressionEvaluate 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:
applyin classExpression- Throws:
Throwable
-
compile
- Specified by:
compilein classExpression
-
canUseInc
-
calculateType
- Overrides:
calculateTypein classExpression
-
visit
- Overrides:
visitin classExpression
-
visitChildren
- Overrides:
visitChildrenin classExpression
-
print
public void print(gnu.kawa.io.OutPort out) - Specified by:
printin classExpression
-
toString
- Overrides:
toStringin classExpression
-