Class Terminals

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

    public class Terminals
    extends GDecl
    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 GDecl
      • numChildren

        protected int numChildren()
        Overrides:
        numChildren in class GDecl
      • clone

        public Terminals clone()
                        throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class GDecl
        Throws:
        java.lang.CloneNotSupportedException
      • fullCopy

        @Deprecated
        public Terminals 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.
        Specified by:
        fullCopy in class GDecl
        Returns:
        dangling copy of the subtree at this node
      • treeCopyNoTransform

        public Terminals treeCopyNoTransform()
        Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
        Specified by:
        treeCopyNoTransform in class GDecl
        Returns:
        dangling copy of the subtree at this node
      • treeCopy

        public Terminals 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.
        Specified by:
        treeCopy in class GDecl
        Returns:
        dangling copy of the subtree at this node
      • setSymList

        public void setSymList​(List<GSym> list)
        Replaces the Sym list.
        Parameters:
        list - The new list node to be used as the Sym list.
      • getNumSym

        public int getNumSym()
        Retrieves the number of children in the Sym list.
        Returns:
        Number of children in the Sym list.
      • getNumSymNoTransform

        public int getNumSymNoTransform()
        Retrieves the number of children in the Sym list. Calling this method will not trigger rewrites.
        Returns:
        Number of children in the Sym list.
      • getSym

        public GSym getSym​(int i)
        Retrieves the element at index i in the Sym list.
        Parameters:
        i - Index of the element to return.
        Returns:
        The element at position i in the Sym list.
      • hasSym

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

        public void addSym​(GSym node)
        Append an element to the Sym list.
        Parameters:
        node - The element to append to the Sym list.
      • addSymNoTransform

        public void addSymNoTransform​(GSym node)
      • setSym

        public void setSym​(GSym node,
                           int i)
        Replaces the Sym 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.
      • getSymList

        @ListChild(name="Sym")
        public List<GSym> getSymList()
        Retrieves the Sym list.
        Returns:
        The node representing the Sym list.
      • getSymListNoTransform

        public List<GSym> getSymListNoTransform()
        Retrieves the Sym list.

        This method does not invoke AST transformations.

        Returns:
        The node representing the Sym list.
      • getSymNoTransform

        public GSym getSymNoTransform​(int i)
        Returns:
        the element at index i in the Sym list without triggering rewrites.
      • getSyms

        public List<GSym> getSyms()
        Retrieves the Sym list.
        Returns:
        The node representing the Sym list.
      • getSymsNoTransform

        public List<GSym> getSymsNoTransform()
        Retrieves the Sym list.

        This method does not invoke AST transformations.

        Returns:
        The node representing the Sym list.