Top Description Fields Constructors Methods
org.codehaus.groovy.antlr.treewalker

public Class SourceCodeTraversal

extends TraversalHelper
Class Inheritance
Imports
org.codehaus.groovy.antlr.GroovySourceAST, org.codehaus.groovy.antlr.parser.GroovyTokenTypes, java.util.ArrayList, .Collections

Deprecated

as a consequence of TraversalHelper being deprecated. See corresponding docs for further information.

A treewalker for the antlr generated AST that attempts to visit the AST nodes in the order needed to generate valid groovy source code.

Field Summary

Inherited from org.codehaus.groovy.antlr.treewalker.TraversalHelper:
unvisitedNodes

Constructor Summary

AccessConstructor and Description
public
SourceCodeTraversal(Visitor
the visitor implementation to call for each AST node.
visitor
)

Constructs a treewalker for the antlr generated AST that attempts to visit the AST nodes in the order needed to generate valid groovy source code.

Method Summary

Modifier and TypeMethod and Description
protected void
public void
setUp(GroovySourceAST
the AST to process
t
)

Overrides org.codehaus.groovy.antlr.treewalker.TraversalHelper.setUp.

gather, sort and process all unvisited nodes
private void
traverse(GroovySourceAST
the AST node to traverse
t
)

traverse an AST node

Inherited from org.codehaus.groovy.antlr.treewalker.TraversalHelper:
accept_FirstChild_v_RestOfTheChildrenaccept_FirstChild_v_RestOfTheChildren_vaccept_FirstChild_v_RestOfTheChildren_v_LastChildaccept_FirstChild_v_SecondChildaccept_FirstChild_v_SecondChild_vaccept_FirstChild_v_SecondChild_v_ThirdChild_vaccept_FirstChild_v_SecondChildsChildren_vaccept_FirstSecondAndThirdChild_v_v_ForthChildaccept_SecondChild_v_ThirdChild_vaccept_v_AllChildren_vaccept_v_AllChildren_v_Siblingsaccept_v_FirstChild_2ndv_SecondChild_v___LastChild_vaccept_v_FirstChild_SecondChild_v_ThirdChild_vaccept_v_FirstChild_vaccept_v_FirstChild_v_RestOfTheChildrenaccept_v_FirstChild_v_RestOfTheChildren_vaccept_v_FirstChild_v_SecondChild_v___LastChild_vaccept_v_FirstChildsFirstChild_v_Child2_Child3_v_Child4_v___v_LastChildaccept_v_FirstChildsFirstChild_v_RestOfTheChildrenaccept_v_Siblings_vacceptChildrenacceptSiblingsclosingVisitopeningVisitpopprocesspushsecondVisitskipsubsequentVisittearDownvisitNode

Constructor Detail

SourceCodeTraversalback to summary
public SourceCodeTraversal(Visitor visitor)

Constructs a treewalker for the antlr generated AST that attempts to visit the AST nodes in the order needed to generate valid groovy source code.

Parameters
visitor:Visitor

the visitor implementation to call for each AST node.

Method Detail

acceptback to summary
protected void accept(GroovySourceAST currentNode)

Implements abstract org.codehaus.groovy.antlr.treewalker.TraversalHelper.accept.

setUpback to summary
public void setUp(GroovySourceAST t)

Overrides org.codehaus.groovy.antlr.treewalker.TraversalHelper.setUp.

gather, sort and process all unvisited nodes

Parameters
t:GroovySourceAST

the AST to process

traverseback to summary
private void traverse(GroovySourceAST t)

traverse an AST node

Parameters
t:GroovySourceAST

the AST node to traverse