01: /* Generated By:JJTree: Do not edit this line. ASTPrimarySuffix.java */
02:
03: package net.sourceforge.pmd.ast;
04:
05: public class ASTPrimarySuffix extends SimpleJavaNode {
06: public ASTPrimarySuffix(int id) {
07: super (id);
08: }
09:
10: public ASTPrimarySuffix(JavaParser p, int id) {
11: super (p, id);
12: }
13:
14: private boolean isArguments;
15: private boolean isArrayDereference;
16:
17: public void setIsArrayDereference() {
18: isArrayDereference = true;
19: }
20:
21: public boolean isArrayDereference() {
22: return isArrayDereference;
23: }
24:
25: public void setIsArguments() {
26: this .isArguments = true;
27: }
28:
29: public boolean isArguments() {
30: return this .isArguments;
31: }
32:
33: public int getArgumentCount() {
34: if (!this .isArguments()) {
35: throw new RuntimeException(
36: "ASTPrimarySuffix.getArgumentCount called, but this is not a method call");
37: }
38: return this .getFirstChildOfType(ASTArguments.class)
39: .getArgumentCount();
40: }
41:
42: public void dump(String prefix) {
43: String out = "";
44: if (isArrayDereference()) {
45: out += ":[";
46: }
47: if (this .getImage() != null) {
48: out += out.length() == 0 ? ":" + this .getImage() : this
49: .getImage();
50: }
51: System.out.println(toString(prefix) + out);
52: dumpChildren(prefix);
53: }
54:
55: /**
56: * Accept the visitor. *
57: */
58: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
59: return visitor.visit(this, data);
60: }
61: }
|