Package org.codehaus.groovy.antlr

Examples of org.codehaus.groovy.antlr.GroovySourceAST


    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);
    }
View Full Code Here


        accept(t.childAt(2));
        closingVisit(t);
    }

    protected void accept_FirstSecondAndThirdChild_v_v_ForthChild(GroovySourceAST t) {
        GroovySourceAST child1 = (GroovySourceAST) t.getFirstChild();
        if (child1 != null) {
            accept(child1);
            GroovySourceAST child2 = (GroovySourceAST) child1.getNextSibling();
            if (child2 != null) {
                accept(child2);
                GroovySourceAST child3 = (GroovySourceAST) child2.getNextSibling();
                if (child3 != null) {
                    accept(child3);
                    openingVisit(t);
                    GroovySourceAST child4 = (GroovySourceAST) child3.getNextSibling();
                    if (child4 != null) {
                        subsequentVisit(t);
                        accept(child4);
                    }
                }
View Full Code Here

        }
    }

    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);
    }
View Full Code Here

        closingVisit(t);
    }

    protected void accept_v_FirstChild_v_SecondChild_v___LastChild_v(GroovySourceAST t) {
        openingVisit(t);
        GroovySourceAST child = (GroovySourceAST) t.getFirstChild();
        if (child != null) {
            accept(child);
            GroovySourceAST sibling = (GroovySourceAST) child.getNextSibling();
            while (sibling != null) {
                subsequentVisit(t);
                accept(sibling);
                sibling = (GroovySourceAST) sibling.getNextSibling();
            }
        }
        closingVisit(t);
    }
View Full Code Here

        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();
            }
        }


    }
View Full Code Here

        closingVisit(t);
    }

    protected void acceptSiblings(GroovySourceAST t) {
        if (t != null) {
            GroovySourceAST sibling = (GroovySourceAST) t.getNextSibling();
            while (sibling != null) {
                accept(sibling);
                sibling = (GroovySourceAST) sibling.getNextSibling();
            }
        }
    }
View Full Code Here

        }
    }

    protected void acceptChildren(GroovySourceAST t) {
        if (t != null) {
            GroovySourceAST child = (GroovySourceAST) t.getFirstChild();
            if (child != null) {
                accept(child);
                acceptSiblings(child);
            }
        }
View Full Code Here

        int n = Visitor.CLOSING_VISIT;
        visitNode(t, n);
    }

    public AST process(AST t) {
        GroovySourceAST node = (GroovySourceAST) t;

        // process each node in turn
        setUp(node);
        accept(node);
        acceptSiblings(node);
View Full Code Here

    public void push(GroovySourceAST t) {
        Iterator itr = visitors.iterator();
        while (itr.hasNext()) {((Visitor)itr.next()).push(t);}
    }
    public GroovySourceAST pop() {
        GroovySourceAST lastNodePopped = null;
        Iterator itr = backToFrontVisitors.iterator();
        while (itr.hasNext()) {lastNodePopped = (GroovySourceAST) ((Visitor)itr.next()).pop();}
        return lastNodePopped;
    }
View Full Code Here

    // visitEmptyStat ...
    //   token type EMPTY_STAT obsolete and should be removed, never visited/created
   
    public void visitEnumConstantDef(GroovySourceAST t,int visit) {
        GroovySourceAST sibling = (GroovySourceAST)t.getNextSibling();
        if (sibling != null && sibling.getType() == GroovyTokenTypes.ENUM_CONSTANT_DEF) {
            print(t,visit,null,null,", ");
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.antlr.GroovySourceAST

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.