gnu.expr
Class ReferenceExp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.Procedure0
gnu.expr.Expression
gnu.expr.AccessExp
gnu.expr.ReferenceExp
- All Implemented Interfaces:
- Named, Printable, javax.xml.transform.SourceLocator, org.xml.sax.Locator
- Direct Known Subclasses:
- ThisExp
public class ReferenceExp
- extends AccessExp
This class represents a variable reference (an identifier).
Methods inherited from class gnu.expr.Expression |
apply0, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, isStableSourceLocation, makeWhile, match0, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, valueIfConstant, walkChildren |
Methods inherited from class gnu.mapping.Procedure |
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DONT_DEREFERENCE
public static final int DONT_DEREFERENCE
- See Also:
- Constant Field Values
PROCEDURE_NAME
public static final int PROCEDURE_NAME
- See Also:
- Constant Field Values
PREFER_BINDING2
public static final int PREFER_BINDING2
- See Also:
- Constant Field Values
CREATE_FIELD_REFERENCE
public static final int CREATE_FIELD_REFERENCE
- Create a FieldLocation referencing the binding.
- See Also:
- Constant Field Values
ReferenceExp
public ReferenceExp(java.lang.Object symbol)
ReferenceExp
public ReferenceExp(java.lang.Object symbol,
Declaration binding)
ReferenceExp
public ReferenceExp(Declaration binding)
getDontDereference
public final boolean getDontDereference()
setDontDereference
public final void setDontDereference(boolean setting)
isUnknown
public final boolean isUnknown()
isProcedureName
public final boolean isProcedureName()
- True if this identifier appears in "function call position".
If so, it should be interpreted as a function name, which makes a
difference for languages (like Common Lisp) that have two name spaces.
setProcedureName
public final void setProcedureName(boolean setting)
- Note if this identifier appears in "function call position".
mustCompile
protected boolean mustCompile()
- Specified by:
mustCompile
in class Expression
apply
public void apply(CallContext ctx)
throws java.lang.Throwable
- 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 class Expression
- Throws:
java.lang.Throwable
compile
public void compile(Compilation comp,
Target target)
- Specified by:
compile
in class Expression
walk
protected Expression walk(ExpWalker walker)
- Overrides:
walk
in class Expression
inline
public Expression inline(ApplyExp exp,
InlineCalls walker,
Declaration decl,
boolean argsInlined)
- 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:
inline
in class Expression
- Parameters:
exp
- an application whose function expression can be simplified
to this expression.walker
- the context for the current inlining passdecl
- if non-null, a Declaration bound to this expression.argsInlined
- true iff exp.getArgs()
have been walked.
- Returns:
- an Expression equivalent to the passed-in exp.
print
public void print(OutPort ps)
- Specified by:
print
in class Expression
getType
public Type getType()
- Description copied from class:
Expression
- Return the Type used to represent the values of this Expression.
- Overrides:
getType
in class Expression
side_effects
public boolean side_effects()
- Description copied from class:
Expression
- True if evaluating may have side-effects.
- Overrides:
side_effects
in class Expression
toString
public java.lang.String toString()
- Overrides:
toString
in class Expression