Class List<T extends ASTNode>

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<T>, Parser.Symbol

    public class List<T extends ASTNode>
    extends ASTNode<T>
    implements java.lang.Cloneable, java.lang.Iterable<T>
    • Constructor Detail

      • List

        public List()
      • List

        public List​(T... initialChildren)
    • 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<T extends ASTNode>
      • add

        public List<T> add​(T node)
      • addAll

        public List<T> addAll​(java.lang.Iterable<? extends T> c)
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends ASTNode>
        Returns:
        an iterator to iterate over elements in this list node.
      • clone

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

        @Deprecated
        public List<T> 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<T extends ASTNode>
        Returns:
        dangling copy of the subtree at this node
      • treeCopyNoTransform

        public List<T> 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<T extends ASTNode>
        Returns:
        dangling copy of the subtree at this node
      • treeCopy

        public List<T> 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<T extends ASTNode>
        Returns:
        dangling copy of the subtree at this node