/* Generated By:JJTree: Do not edit this line. SimpleNode.java */

package net.sourceforge.pmd.jsp.ast;


public class SimpleNode extends net.sourceforge.pmd.ast.SimpleNode implements Node {
    protected JspParser parser;

    public SimpleNode(int i) {
        super(i);
    }

    public SimpleNode(JspParser p, int i) {
        this(i);
        parser = p;
    }

    public void jjtOpen() {
        if (beginLine == -1 && parser.token.next != null) {
            beginLine = parser.token.next.beginLine;
            beginColumn = parser.token.next.beginColumn;
        }
    }

    public void jjtClose() {
        if (beginLine == -1 && (children == null || children.length == 0)) {
            beginColumn = parser.token.beginColumn;
        }
        if (beginLine == -1) {
            beginLine = parser.token.beginLine;
        }
        endLine = parser.token.endLine;
        endColumn = parser.token.endColumn;
    }

    /**
     * Accept the visitor. *
     */
    public Object jjtAccept(JspParserVisitor visitor, Object data) {
        return visitor.visit(this, data);
    }

    /**
     * Accept the visitor. *
     */
    public Object childrenAccept(JspParserVisitor visitor, Object data) {
        if (children != null) {
            for (int i = 0; i < children.length; ++i) {
                ((Node) children[i]).jjtAccept(visitor, data);
            }
        }
        return data;
    }

    public String toString() {
        return JspParserTreeConstants.jjtNodeName[id];
    }
}

