All Implemented Interfaces:
FromSourceLocation, ToNode, TypeCheck

public final class GetAttr extends Expression
A rule-set expression for indexing a record/object or array.
  • Field Details

  • Method Details

    • builder

      public static GetAttr.Builder builder()
    • evaluate

      public Value evaluate(Value target)
    • getTarget

      public Expression getTarget()
    • getPath

      public List<GetAttr.Part> getPath()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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.
      Parameters:
      visitor - the visitor to be invoked.
      Returns:
      the return value of the visitor.
    • typeCheckLocal

      public Type typeCheckLocal(Scope<Type> scope)
      Specified by:
      typeCheckLocal in class Expression
    • template

      public String template()
      Description copied from class: Expression
      Converts this expression to a string template. By default this implementation returns a RuntimeException.
      Overrides:
      template in class Expression
      Returns:
      the string template.
    • toNode

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

      public Condition condition()
      Convert this function into a condition.
      Returns:
      the function as a condition.
    • condition

      public Condition condition(String result)
      Converts this function into a condition which stores the output in the named result.
      Parameters:
      result - the name of the result parameter.
      Returns:
      the function as a condition.
    • equals

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

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