Class JavaAstVisitor.DetailAstPair

  • Enclosing class:
    JavaAstVisitor

    private static final class JavaAstVisitor.DetailAstPair
    extends java.lang.Object
    Used to swap and organize DetailAstImpl subtrees.
    • Field Detail

      • root

        private DetailAstImpl root
        The root DetailAstImpl of this pair.
      • child

        private DetailAstImpl child
        The child (potentially with siblings) of this pair.
    • Constructor Detail

      • DetailAstPair

        private DetailAstPair()
    • Method Detail

      • advanceChildToEnd

        private void advanceChildToEnd()
        Moves child reference to the last child.
      • getRoot

        private DetailAstImpl getRoot()
        Returns the root node.
        Returns:
        the root node
      • makeAstRoot

        private static void makeAstRoot​(JavaAstVisitor.DetailAstPair pair,
                                        DetailAstImpl ast)
        This method is used to replace the ^ (set as root node) ANTLR2 operator.
        Parameters:
        pair - the DetailAstPair to use for swapping nodes
        ast - the new root
      • addAstChild

        private static void addAstChild​(JavaAstVisitor.DetailAstPair pair,
                                        DetailAstImpl ast)
        Adds a child (or new root) to the given DetailAstPair.
        Parameters:
        pair - the DetailAstPair to add child to
        ast - the child to add