All Implemented Interfaces:
FromSourceLocation, ToNode, TypeCheck, ToCondition, ToExpression

public final class Reference extends Expression
A reference to a field.
  • Constructor Details

    • Reference

      public Reference(Identifier name, FromSourceLocation sourceLocation)
      Creates a Reference for the identifier from the given source location.
      name - the identifier being referenced.
      sourceLocation - the source location for the reference.
  • Method Details

    • getName

      public Identifier getName()
      Gets the name of the field being referenced.
      the name of the referenced field.
    • template

      public String template()
      Description copied from class: SyntaxElement
      Converts this expression to a string template. By default, this implementation returns a RuntimeException.
      template in class SyntaxElement
      the String template.
    • accept

      public <R> R accept(ExpressionVisitor<R> visitor)
      Description copied from class: Expression
      Invoke the ExpressionVisitor functions for this expression.
      Specified by:
      accept in class Expression
      Type Parameters:
      R - the visitor return type.
      visitor - the visitor to be invoked.
      the return value of the visitor.
    • typeCheckLocal

      protected Type typeCheckLocal(Scope<Type> scope)
      Specified by:
      typeCheckLocal in class Expression
    • toNode

      public Node toNode()
      Description copied from interface: ToNode
      Converts a value to a Node.
      Returns the creates Node.
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class Expression
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Expression
    • toString

      public String toString()
      toString in class Object