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
public class QuoteExp extends Expression
An Expression that evaluates to a constant value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
-
Field Summary
Fields Modifier and Type Field Description static QuoteExpabstractExpstatic QuoteExpclassObjectExpstatic QuoteExpemptyExpstatic intEXPLICITLY_TYPEDstatic QuoteExpfalseExpstatic QuoteExpfalseObjExpstatic intIS_KEYWORDstatic QuoteExpisTrueTypeExpstatic QuoteExpnativeExpstatic QuoteExpnullExpstatic intSHARED_CONSTANTstatic QuoteExptrueExpstatic QuoteExptrueObjExpstatic QuoteExpundefined_expstatic QuoteExpvoidExpstatic QuoteExpvoidObjectExpSame 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(CallContext ctx)Evaluate the expression.protected TypecalculateType()voidcompile(Compilation comp, Target target)ExpressiondeepCopy(IdentityHashTable mapper)static QuoteExpgetInstance(Object value)static QuoteExpgetInstance(Object value, SourceLocator position)TypegetRawType()ObjectgetValue()booleanisExplicitlyTyped()booleanisSharedConstant()static QuoteExpmakeShared(Object value, Type type)protected booleanmustCompile()voidprint(gnu.kawa.io.OutPort out)voidsetType(Type type)booleanside_effects()True if evaluating may have side-effects.StringtoString()ExpressionvalidateApply(ApplyExp exp, InlineCalls visitor, Type required, Declaration decl)Apply inlining transformations on a given ApplyExp.ObjectvalueIfConstant()Return value if it is constant, or null if non-constant or unknown.protected <R,D>
Rvisit(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 Detail
-
EXPLICITLY_TYPED
public static final int EXPLICITLY_TYPED
- See Also:
- Constant Field Values
-
SHARED_CONSTANT
public static final int SHARED_CONSTANT
- See Also:
- Constant Field Values
-
IS_KEYWORD
public static final int IS_KEYWORD
- See Also:
- Constant Field Values
-
undefined_exp
public static QuoteExp undefined_exp
-
abstractExp
public static QuoteExp abstractExp
-
nativeExp
public static QuoteExp nativeExp
-
voidExp
public static QuoteExp voidExp
-
voidObjectExp
public static QuoteExp voidObjectExp
Same value as voidExp, but different type, to suppress diagnostics.
-
trueExp
public static QuoteExp trueExp
-
falseExp
public static QuoteExp falseExp
-
trueObjExp
public static QuoteExp trueObjExp
-
falseObjExp
public static QuoteExp falseObjExp
-
emptyExp
public static QuoteExp emptyExp
-
isTrueTypeExp
public static QuoteExp isTrueTypeExp
-
nullExp
public static QuoteExp nullExp
-
classObjectExp
public static final QuoteExp classObjectExp
-
-
Method Detail
-
getValue
public final Object getValue()
-
valueIfConstant
public final Object valueIfConstant()
Description copied from class:ExpressionReturn value if it is constant, or null if non-constant or unknown.- Overrides:
valueIfConstantin classExpression
-
getRawType
public final Type getRawType()
-
calculateType
protected final Type calculateType()
- Overrides:
calculateTypein classExpression
-
setType
public void setType(Type type)
- Overrides:
setTypein classExpression
-
isExplicitlyTyped
public boolean isExplicitlyTyped()
-
isSharedConstant
public boolean isSharedConstant()
-
getInstance
public static QuoteExp getInstance(Object value, SourceLocator position)
-
mustCompile
protected boolean mustCompile()
- Specified by:
mustCompilein classExpression
-
apply
public void apply(CallContext ctx)
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
-
compile
public void compile(Compilation comp, Target target)
- Specified by:
compilein classExpression
-
deepCopy
public Expression deepCopy(IdentityHashTable mapper)
- Overrides:
deepCopyin classExpression
-
visit
protected <R,D> R visit(ExpVisitor<R,D> visitor, D d)
- Overrides:
visitin classExpression
-
validateApply
public Expression validateApply(ApplyExp exp, InlineCalls visitor, Type required, Declaration decl)
Description copied from class:ExpressionApply inlining transformations on a given ApplyExp. Assumes the ApplyExp's function is this expression, or can be optimized to this expression.- Overrides:
validateApplyin 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:ExpressionTrue if evaluating may have side-effects.- Overrides:
side_effectsin classExpression
-
toString
public String toString()
- Overrides:
toStringin classExpression
-
print
public void print(gnu.kawa.io.OutPort out)
- Specified by:
printin classExpression
-
-