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!
  • Field Details

    • THIS_NAME

      public static final String THIS_NAME
      Non-interned name for implicit 'this' variable.
  • Constructor Details

    • ThisExp

      public ThisExp()
    • ThisExp

      public ThisExp(ScopeExp context)
    • ThisExp

      public ThisExp(Declaration binding)
    • ThisExp

      public ThisExp(ClassType type)
  • Method Details

    • 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: 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 ReferenceExp
      Throws:
      Throwable
    • getContextScope

      public ScopeExp getContextScope()
    • makeGivingContext

      public static ThisExp makeGivingContext(ScopeExp context)
    • compile

      public void compile(Compilation comp, Target target)
      Overrides:
      compile in class ReferenceExp
    • visit

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

      protected final Type calculateType()
      Overrides:
      calculateType in class ReferenceExp