Class ASTNode<T extends ASTNode>

    • Field Detail

      • generatedWithCacheCycle

        public static final boolean generatedWithCacheCycle
        See Also:
        Constant Field Values
      • children

        protected ASTNode[] children
      • numChildren

        protected int numChildren
    • Constructor Detail

      • ASTNode

        public ASTNode()
    • Method Detail

      • accept

        public void accept​(GVisitor vis)
      • init$Children

        public void init$Children()
        Initializes the child array to the correct size. Initializes List and Opt nta children.
      • getIndexOfChild

        public int getIndexOfChild​(ASTNode node)
      • resetState

        public static final ASTState resetState()
      • astChildIterator

        public java.util.Iterator<T> astChildIterator()
        Returns:
        an iterator that can be used to iterate over the children of this node. The iterator does not allow removing children.
      • astChildren

        public java.lang.Iterable<T> astChildren()
        Returns:
        an object that can be used to iterate over the children of this node
      • getChild

        public T getChild​(int i)
      • addChild

        public void addChild​(T node)
      • getChildNoTransform

        public T getChildNoTransform​(int i)
        Gets a child without triggering rewrites.
      • numChildren

        protected int numChildren()
      • getNumChild

        public int getNumChild()
      • getNumChildNoTransform

        public final int getNumChildNoTransform()
        Behaves like getNumChild, but does not invoke AST transformations (rewrites).
      • setChild

        public void setChild​(ASTNode node,
                             int i)
      • insertChild

        public void insertChild​(ASTNode node,
                                int i)
      • removeChild

        public void removeChild​(int i)
      • getParent

        public ASTNode getParent()
      • setParent

        public void setParent​(ASTNode node)
      • flushTreeCache

        public void flushTreeCache()
      • flushCache

        public void flushCache()
      • flushAttrAndCollectionCache

        public void flushAttrAndCollectionCache()
      • flushAttrCache

        public void flushAttrCache()
      • flushCollectionCache

        public void flushCollectionCache()
      • clone

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

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

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

        public ASTNode<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.
        Returns:
        dangling copy of the subtree at this node
      • doFullTraversal

        public void doFullTraversal()
        Performs a full traversal of the tree using getChild to trigger rewrites
      • is$Equal

        protected boolean is$Equal​(ASTNode node)
      • rewrittenNode

        public ASTNode rewrittenNode()