use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class TraversalHelper method accept_FirstChild_v_SecondChildsChildren_v.
protected void accept_FirstChild_v_SecondChildsChildren_v(GroovySourceAST t) {
accept(t.childAt(0));
openingVisit(t);
GroovySourceAST secondChild = t.childAt(1);
if (secondChild != null) {
acceptChildren(secondChild);
}
closingVisit(t);
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class TraversalHelper method accept_v_FirstChild_2ndv_SecondChild_v___LastChild_v.
protected void accept_v_FirstChild_2ndv_SecondChild_v___LastChild_v(GroovySourceAST t) {
openingVisit(t);
GroovySourceAST child = (GroovySourceAST) t.getFirstChild();
if (child != null) {
accept(child);
GroovySourceAST sibling = (GroovySourceAST) child.getNextSibling();
if (sibling != null) {
secondVisit(t);
accept(sibling);
sibling = (GroovySourceAST) sibling.getNextSibling();
while (sibling != null) {
subsequentVisit(t);
accept(sibling);
sibling = (GroovySourceAST) sibling.getNextSibling();
}
}
}
closingVisit(t);
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class TraversalHelper method accept_FirstChild_v_RestOfTheChildren_v_LastChild.
protected void accept_FirstChild_v_RestOfTheChildren_v_LastChild(GroovySourceAST t) {
int count = 0;
accept(t.childAt(0));
count++;
openingVisit(t);
if (t.childAt(0) != null) {
GroovySourceAST sibling = (GroovySourceAST) t.childAt(0).getNextSibling();
while (sibling != null) {
if (count == t.getNumberOfChildren() - 1) {
closingVisit(t);
}
accept(sibling);
count++;
sibling = (GroovySourceAST) sibling.getNextSibling();
}
}
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class TraversalHelper method acceptSiblings.
protected void acceptSiblings(GroovySourceAST t) {
if (t != null) {
GroovySourceAST sibling = (GroovySourceAST) t.getNextSibling();
while (sibling != null) {
accept(sibling);
sibling = (GroovySourceAST) sibling.getNextSibling();
}
}
}
use of org.codehaus.groovy.antlr.GroovySourceAST in project groovy-core by groovy.
the class TraversalHelper method process.
public AST process(AST t) {
GroovySourceAST node = (GroovySourceAST) t;
// process each node in turn
setUp(node);
accept(node);
acceptSiblings(node);
tearDown(node);
return null;
}
Aggregations