Class GGrammar

  • All Implemented Interfaces:
    java.lang.Cloneable, Parser.Symbol

    public class GGrammar
    extends ASTNode<ASTNode>
    implements java.lang.Cloneable
    • Method Detail

      • init$Children

        public void init$Children()
        Initializes the child array to the correct size. Initializes List and Opt nta children.
        Overrides:
        init$Children in class ASTNode<ASTNode>
      • clone

        public GGrammar clone()
                       throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class ASTNode<ASTNode>
        Throws:
        java.lang.CloneNotSupportedException
      • fullCopy

        @Deprecated
        public GGrammar fullCopy()
        Deprecated.
        Please use treeCopy or treeCopyNoTransform instead
        Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
        Overrides:
        fullCopy in class ASTNode<ASTNode>
        Returns:
        dangling copy of the subtree at this node
      • treeCopyNoTransform

        public GGrammar treeCopyNoTransform()
        Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
        Overrides:
        treeCopyNoTransform in class ASTNode<ASTNode>
        Returns:
        dangling copy of the subtree at this node
      • treeCopy

        public GGrammar treeCopy()
        Create a deep copy of the AST subtree at this node. The subtree of this node is traversed to trigger rewrites before copy. The copy is dangling, i.e. has no parent.
        Overrides:
        treeCopy in class ASTNode<ASTNode>
        Returns:
        dangling copy of the subtree at this node
      • setGDeclList

        public void setGDeclList​(List<GDecl> list)
        Replaces the GDecl list.
        Parameters:
        list - The new list node to be used as the GDecl list.
      • getNumGDecl

        public int getNumGDecl()
        Retrieves the number of children in the GDecl list.
        Returns:
        Number of children in the GDecl list.
      • getNumGDeclNoTransform

        public int getNumGDeclNoTransform()
        Retrieves the number of children in the GDecl list. Calling this method will not trigger rewrites.
        Returns:
        Number of children in the GDecl list.
      • getGDecl

        public GDecl getGDecl​(int i)
        Retrieves the element at index i in the GDecl list.
        Parameters:
        i - Index of the element to return.
        Returns:
        The element at position i in the GDecl list.
      • hasGDecl

        public boolean hasGDecl()
        Check whether the GDecl list has any children.
        Returns:
        true if it has at least one child, false otherwise.
      • addGDecl

        public void addGDecl​(GDecl node)
        Append an element to the GDecl list.
        Parameters:
        node - The element to append to the GDecl list.
      • addGDeclNoTransform

        public void addGDeclNoTransform​(GDecl node)
      • setGDecl

        public void setGDecl​(GDecl node,
                             int i)
        Replaces the GDecl list element at index i with the new node node.
        Parameters:
        node - The new node to replace the old list element.
        i - The list index of the node to be replaced.
      • getGDeclList

        @ListChild(name="GDecl")
        public List<GDecl> getGDeclList()
        Retrieves the GDecl list.
        Returns:
        The node representing the GDecl list.
      • getGDeclListNoTransform

        public List<GDecl> getGDeclListNoTransform()
        Retrieves the GDecl list.

        This method does not invoke AST transformations.

        Returns:
        The node representing the GDecl list.
      • getGDeclNoTransform

        public GDecl getGDeclNoTransform​(int i)
        Returns:
        the element at index i in the GDecl list without triggering rewrites.
      • getGDecls

        public List<GDecl> getGDecls()
        Retrieves the GDecl list.
        Returns:
        The node representing the GDecl list.
      • getGDeclsNoTransform

        public List<GDecl> getGDeclsNoTransform()
        Retrieves the GDecl list.

        This method does not invoke AST transformations.

        Returns:
        The node representing the GDecl list.