Record Class RecordedSymbols.Reference

java.lang.Object
java.lang.Record
org.ek9lang.compiler.support.RecordedSymbols.Reference
Record Components:
node - the identifier node (IdentifierContext, or PrimaryReferenceContext for this/super) - its start token is the name's exact position
symbol - the symbol it is bound to; for a call, the callable it resolved to, never the call itself
Enclosing class:
RecordedSymbols

public static record RecordedSymbols.Reference(org.antlr.v4.runtime.ParserRuleContext node, ISymbol symbol) extends Record
One identifier occurrence the compiler bound to a symbol.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Reference(org.antlr.v4.runtime.ParserRuleContext node, ISymbol symbol)
    Creates an instance of a Reference record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    0-based column of the name.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    A bare name: neither qualified, nor reached through a ., nor this/super.
    boolean
    Reached through a . (other.total, items.length()) - bound through the object.
    boolean
    Written module::name - it cannot re-bind wherever the text is moved.
    boolean
    this or super.
    int
    1-based line of the name.
    The name as written (the bare name, without any module:: qualifier).
    org.antlr.v4.runtime.ParserRuleContext
    Returns the value of the node record component.
    Returns the value of the symbol record component.
    org.antlr.v4.runtime.Token
    The name's token.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Reference

      public Reference(org.antlr.v4.runtime.ParserRuleContext node, ISymbol symbol)
      Creates an instance of a Reference record class.
      Parameters:
      node - the value for the node record component
      symbol - the value for the symbol record component
  • Method Details

    • token

      public org.antlr.v4.runtime.Token token()
      The name's token.
    • name

      public String name()
      The name as written (the bare name, without any module:: qualifier).
    • line

      public int line()
      1-based line of the name.
    • column

      public int column()
      0-based column of the name.
    • isQualified

      public boolean isQualified()
      Written module::name - it cannot re-bind wherever the text is moved.
    • isMemberAccess

      public boolean isMemberAccess()
      Reached through a . (other.total, items.length()) - bound through the object.
    • isThisOrSuper

      public boolean isThisOrSuper()
      this or super.
    • isBareName

      public boolean isBareName()
      A bare name: neither qualified, nor reached through a ., nor this/super.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • node

      public org.antlr.v4.runtime.ParserRuleContext node()
      Returns the value of the node record component.
      Returns:
      the value of the node record component
    • symbol

      public ISymbol symbol()
      Returns the value of the symbol record component.
      Returns:
      the value of the symbol record component