Package gnu.expr
Class QuoteExp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.expr.Expression
gnu.expr.QuoteExp
- All Implemented Interfaces:
gnu.kawa.format.Printable
,Named
,SourceLocator
,SourceLocator
,Locator
An Expression that evaluates to a constant value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic QuoteExp
static final QuoteExp
static QuoteExp
static final int
static QuoteExp
static QuoteExp
static final int
static QuoteExp
static QuoteExp
static QuoteExp
static final int
static QuoteExp
static QuoteExp
static QuoteExp
static QuoteExp
static QuoteExp
Same value as voidExp, but different type, to suppress diagnostics.Fields inherited from class gnu.expr.Expression
applyMethodExpression, flags, NEXT_AVAIL_FLAG, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(CallContext ctx) Evaluate the expression.protected final Type
void
compile
(Compilation comp, Target target) deepCopy
(IdentityHashTable mapper) static QuoteExp
getInstance
(Object value) static QuoteExp
getInstance
(Object value, SourceLocator position) final Type
final Object
getValue()
boolean
boolean
static QuoteExp
makeShared
(Object value, Type type) protected boolean
void
print
(gnu.kawa.io.OutPort out) void
boolean
True if evaluating may have side-effects.toString()
validateApply
(ApplyExp exp, InlineCalls visitor, Type required, Declaration decl) Apply inlining transformations on a given ApplyExp.final Object
Return value if it is constant, or null if non-constant or unknown.protected <R,
D> R visit
(ExpVisitor<R, D> visitor, D d) Methods inherited from class gnu.expr.Expression
applyMethodExpression, checkLiteralKeyword, compile, compile, compileWithPosition, compileWithPosition, 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, visitChildren
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
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
Field Details
-
EXPLICITLY_TYPED
public static final int EXPLICITLY_TYPED- See Also:
-
SHARED_CONSTANT
public static final int SHARED_CONSTANT- See Also:
-
IS_KEYWORD
public static final int IS_KEYWORD- See Also:
-
undefined_exp
-
abstractExp
-
nativeExp
-
voidExp
-
voidObjectExp
Same value as voidExp, but different type, to suppress diagnostics. -
trueExp
-
falseExp
-
trueObjExp
-
falseObjExp
-
emptyExp
-
isTrueTypeExp
-
nullExp
-
classObjectExp
-
-
Constructor Details
-
QuoteExp
-
QuoteExp
-
-
Method Details
-
getValue
-
valueIfConstant
Description copied from class:Expression
Return value if it is constant, or null if non-constant or unknown.- Overrides:
valueIfConstant
in classExpression
-
getRawType
-
calculateType
- Overrides:
calculateType
in classExpression
-
setType
- Overrides:
setType
in classExpression
-
isExplicitlyTyped
public boolean isExplicitlyTyped() -
getInstance
-
getInstance
-
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
-
compile
- Specified by:
compile
in classExpression
-
deepCopy
- Overrides:
deepCopy
in classExpression
-
visit
- Overrides:
visit
in classExpression
-
validateApply
Description copied from class:Expression
Apply inlining transformations on a given ApplyExp. Assumes the ApplyExp's function is this expression, or can be optimized to this expression.- Overrides:
validateApply
in classExpression
- Parameters:
exp
- an application whose function expression can be simplified to this expression.visitor
- the context for the current inlining passdecl
- if non-null, a Declaration bound to this expression.- Returns:
- an Expression equivalent to the passed-in exp.
-
side_effects
public boolean side_effects()Description copied from class:Expression
True if evaluating may have side-effects.- Overrides:
side_effects
in classExpression
-
toString
- Overrides:
toString
in classExpression
-
print
public void print(gnu.kawa.io.OutPort out) - Specified by:
print
in classExpression
-