Package gnu.expr

Class ReferenceExp

All Implemented Interfaces:
gnu.kawa.format.Printable, Named, SourceLocator, SourceLocator, Locator
Direct Known Subclasses:
ThisExp

public class ReferenceExp extends AccessExp
This class represents a variable reference (an identifier).
  • Field Details

  • Constructor Details

    • ReferenceExp

      public ReferenceExp(Object symbol)
    • ReferenceExp

      public ReferenceExp(Object symbol, Declaration binding)
    • ReferenceExp

      public ReferenceExp(Declaration binding)
    • ReferenceExp

      public ReferenceExp(ReferenceExp old)
  • Method Details

    • 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
    • valueIfConstant

      public final Object valueIfConstant()
      Description copied from class: Expression
      Return value if it is constant, or null if non-constant or unknown.
      Overrides:
      valueIfConstant in class Expression
    • apply

      public void apply(CallContext ctx) throws 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:
      Throwable
    • compile

      public void compile(Compilation comp, Target target)
      Specified by:
      compile in class Expression
    • deepCopy

      protected Expression deepCopy(IdentityHashTable mapper)
      Overrides:
      deepCopy in class Expression
    • visit

      protected <R, D> R visit(ExpVisitor<R,D> visitor, D d)
      Overrides:
      visit in class Expression
    • validateApply

      public Expression validateApply(ApplyExp exp, InlineCalls visitor, Type required, Declaration decl)
      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 class Expression
      Parameters:
      exp - an application whose function expression can be simplified to this expression.
      visitor - the context for the current inlining pass
      decl - if non-null, a Declaration bound to this expression.
      Returns:
      an Expression equivalent to the passed-in exp.
    • print

      public void print(gnu.kawa.io.OutPort ps)
      Specified by:
      print in class Expression
    • calculateType

      protected Type calculateType()
      Overrides:
      calculateType in class Expression
    • isSingleValue

      public boolean isSingleValue()
      Overrides:
      isSingleValue 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 String toString()
      Overrides:
      toString in class Expression