Package gnu.expr
Class ThisExp
-
- All Implemented Interfaces:
gnu.kawa.format.Printable,Named,SourceLocator,SourceLocator,Locator
public class ThisExp extends ReferenceExp
Evaluates to the "this" implicit variable. This is currently neither robust nor general. FIXME!
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
-
Field Summary
Fields Modifier and Type Field Description static StringTHIS_NAMENon-interned name for implicit 'this' variable.-
Fields inherited from class gnu.expr.ReferenceExp
ALLOCATE_ON_STACK_LAST, DONT_DEREFERENCE, PROCEDURE_NAME, TYPE_NAME
-
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
-
-
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)ScopeExpgetContextScope()booleanisForContext()If this is being used to pass the context instance to a Macro.static ThisExpmakeGivingContext(ScopeExp context)protected <R,D>
Rvisit(ExpVisitor<R,D> visitor, D d)-
Methods inherited from class gnu.expr.ReferenceExp
deepCopy, getDontDereference, isProcedureName, isSingleValue, isUnknown, mustCompile, print, setDontDereference, setProcedureName, side_effects, toString, validateApply, valueIfConstant
-
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, eval, eval, getColumnNumber, getEndColumn, getEndLine, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getStartColumn, getStartLine, getSystemId, getType, getTypeRaw, isStableSourceLocation, makeWhile, maybeSetLine, neverReturns, numArgs, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLine, setLocation, setType, 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
getProperty, removeProperty, setName, setProperty, setProperty, setSymbol
-
-
-
-
Field Detail
-
THIS_NAME
public static final String THIS_NAME
Non-interned name for implicit 'this' variable.
-
-
Constructor Detail
-
ThisExp
public ThisExp()
-
ThisExp
public ThisExp(ScopeExp context)
-
ThisExp
public ThisExp(Declaration binding)
-
ThisExp
public ThisExp(ClassType type)
-
-
Method Detail
-
isForContext
public final boolean isForContext()
If this is being used to pass the context instance to a Macro.
-
apply
public void apply(CallContext ctx) throws Throwable
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 classReferenceExp- Throws:
Throwable
-
getContextScope
public ScopeExp getContextScope()
-
compile
public void compile(Compilation comp, Target target)
- Overrides:
compilein classReferenceExp
-
visit
protected <R,D> R visit(ExpVisitor<R,D> visitor, D d)
- Overrides:
visitin classReferenceExp
-
calculateType
protected final Type calculateType()
- Overrides:
calculateTypein classReferenceExp
-
-