gnu.expr
Class ReferenceExp

java.lang.Object
  |
  +--gnu.expr.Expression
        |
        +--gnu.expr.ReferenceExp
Direct Known Subclasses:
ThisExp

public class ReferenceExp
extends Expression

This class represents a variable reference (an identifier).


Constructor Summary
ReferenceExp(Declaration binding)
           
ReferenceExp(java.lang.String symbol)
           
ReferenceExp(java.lang.String symbol, Declaration binding)
           
 
Method Summary
 void compile(Compilation comp, Target target)
           
 java.lang.Object eval(Environment env)
           
 Declaration getBinding()
          If non-null, the local Declaration this refers to.
 boolean getDontDereference()
           
 java.lang.String getName()
           
 Type getType()
          Return the Type used to represent the values of this Expression.
 boolean isProcedureName()
          True if this identifier appears in "function call position".
 void print(java.io.PrintWriter ps)
           
 void setDontDereference(boolean setting)
           
 void setProcedureName(boolean setting)
          Note if this identifier appears in "function call position".
 java.lang.String string_name()
           
 java.lang.String toString()
           
 
Methods inherited from class gnu.expr.Expression
compile, compileNotePosition, compileWithPosition, getColumn, getFile, getLine, setFile, setLine, setLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceExp

public ReferenceExp(java.lang.String symbol)

ReferenceExp

public ReferenceExp(java.lang.String symbol,
                    Declaration binding)

ReferenceExp

public ReferenceExp(Declaration binding)
Method Detail

string_name

public java.lang.String string_name()

getName

public final java.lang.String getName()

getBinding

public final Declaration getBinding()
If non-null, the local Declaration this refers to.

getDontDereference

public final boolean getDontDereference()

setDontDereference

public final void setDontDereference(boolean setting)

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".

eval

public java.lang.Object eval(Environment env)
Overrides:
eval in class Expression

compile

public void compile(Compilation comp,
                    Target target)
Overrides:
compile in class Expression

print

public void print(java.io.PrintWriter ps)
Overrides:
print in class Expression

getType

public final Type getType()
Description copied from class: Expression
Return the Type used to represent the values of this Expression.
Overrides:
getType in class Expression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object