Class FieldAccess


public final class FieldAccess extends Expression
An expression which selects a field from a struct/block, as in 'foo.bar'.
  • Method Details

    • convert

      @Nullable public static Expression convert(@Nonnull Context context, int position, @Nonnull Expression base, int namePosition, @Nonnull String name)
      Returns a field-access expression.
    • make

      @Nonnull public static Expression make(int position, Expression base, int fieldIndex, boolean anonymousBlock)
      Returns a field-access expression.
    • getKind

      public Node.ExpressionKind getKind()
      Specified by:
      getKind in class Expression
      See Also:
    • accept

      public boolean accept(@Nonnull TreeVisitor visitor)
      Description copied from class: Node
      Visit this AST with a given visitor.
      Specified by:
      accept in class Node
      Returns:
      true to stop recursion and propagate true up the stack, false to continue
    • getBase

      public Expression getBase()
    • getFieldIndex

      public int getFieldIndex()
    • isAnonymousBlock

      public boolean isAnonymousBlock()
    • clone

      @Nonnull public Expression clone(int position)
      Specified by:
      clone in class Expression
    • toString

      @Nonnull public String toString(int parentPrecedence)
      Specified by:
      toString in class Expression