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 ((ASTArguments) this
39: .getFirstChildOfType(ASTArguments.class))
40: .getArgumentCount();
41: }
42:
43: public void dump(String prefix) {
44: String out = "";
45: if (isArrayDereference()) {
46: out += ":[";
47: }
48: if (this .getImage() != null) {
49: out += out.length() == 0 ? ":" + this .getImage() : this
50: .getImage();
51: }
52: System.out.println(toString(prefix) + out);
53: dumpChildren(prefix);
54: }
55:
56: /**
57: * Accept the visitor. *
58: */
59: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
60: return visitor.visit(this, data);
61: }
62: }
|