01: /* Generated By:JJTree: Do not edit this line. SimpleNode.java */
02:
03: package net.sourceforge.pmd.jsp.ast;
04:
05: public class SimpleNode extends net.sourceforge.pmd.ast.SimpleNode
06: implements Node {
07: protected JspParser parser;
08:
09: public SimpleNode(int i) {
10: super (i);
11: }
12:
13: public SimpleNode(JspParser p, int i) {
14: this (i);
15: parser = p;
16: }
17:
18: public void jjtOpen() {
19: if (beginLine == -1 && parser.token.next != null) {
20: beginLine = parser.token.next.beginLine;
21: beginColumn = parser.token.next.beginColumn;
22: }
23: }
24:
25: public void jjtClose() {
26: if (beginLine == -1
27: && (children == null || children.length == 0)) {
28: beginColumn = parser.token.beginColumn;
29: }
30: if (beginLine == -1) {
31: beginLine = parser.token.beginLine;
32: }
33: endLine = parser.token.endLine;
34: endColumn = parser.token.endColumn;
35: }
36:
37: /**
38: * Accept the visitor. *
39: */
40: public Object jjtAccept(JspParserVisitor visitor, Object data) {
41: return visitor.visit(this , data);
42: }
43:
44: /**
45: * Accept the visitor. *
46: */
47: public Object childrenAccept(JspParserVisitor visitor, Object data) {
48: if (children != null) {
49: for (int i = 0; i < children.length; ++i) {
50: ((Node) children[i]).jjtAccept(visitor, data);
51: }
52: }
53: return data;
54: }
55:
56: public String toString() {
57: return JspParserTreeConstants.jjtNodeName[id];
58: }
59: }
|