|
1 |
| |
|
2 |
| |
|
3 |
| package net.sourceforge.pmd.ast; |
|
4 |
| |
|
5 |
| public class ASTPrimarySuffix extends SimpleJavaNode { |
|
6 |
0
| public ASTPrimarySuffix(int id) {
|
|
7 |
0
| super(id);
|
|
8 |
| } |
|
9 |
| |
|
10 |
1052
| public ASTPrimarySuffix(JavaParser p, int id) {
|
|
11 |
1052
| super(p, id);
|
|
12 |
| } |
|
13 |
| |
|
14 |
| private boolean isArguments; |
|
15 |
| private boolean isArrayDereference; |
|
16 |
| |
|
17 |
43
| public void setIsArrayDereference() {
|
|
18 |
43
| isArrayDereference = true;
|
|
19 |
| } |
|
20 |
| |
|
21 |
7
| public boolean isArrayDereference() {
|
|
22 |
7
| return isArrayDereference;
|
|
23 |
| } |
|
24 |
| |
|
25 |
902
| public void setIsArguments() {
|
|
26 |
902
| this.isArguments = true;
|
|
27 |
| } |
|
28 |
| |
|
29 |
1056
| public boolean isArguments() {
|
|
30 |
1056
| return this.isArguments;
|
|
31 |
| } |
|
32 |
| |
|
33 |
4
| public int getArgumentCount() {
|
|
34 |
4
| if (!this.isArguments()) {
|
|
35 |
0
| throw new RuntimeException("ASTPrimarySuffix.getArgumentCount called, but this is not a method call");
|
|
36 |
| } |
|
37 |
4
| return ((ASTArguments)this.getFirstChildOfType(ASTArguments.class)).getArgumentCount();
|
|
38 |
| } |
|
39 |
| |
|
40 |
0
| public void dump(String prefix) {
|
|
41 |
0
| String out = "";
|
|
42 |
0
| if (isArrayDereference()) {
|
|
43 |
0
| out += ":[";
|
|
44 |
| } |
|
45 |
0
| if (this.getImage() != null) {
|
|
46 |
0
| out += out.length() == 0 ? ":" + this.getImage() : this.getImage();
|
|
47 |
| } |
|
48 |
0
| System.out.println(toString(prefix) + out);
|
|
49 |
0
| dumpChildren(prefix);
|
|
50 |
| } |
|
51 |
| |
|
52 |
| |
|
53 |
| |
|
54 |
| |
|
55 |
2929
| public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
|
56 |
2929
| return visitor.visit(this, data);
|
|
57 |
| } |
|
58 |
| } |