1 /* Generated By:JJTree: Do not edit this line. ASTUnaryExpression.java */
2
3 package net.sourceforge.pmd.ast;
4
5 public class ASTUnaryExpression extends SimpleNode {
6 public ASTUnaryExpression(int id) {
7 super(id);
8 }
9
10 public ASTUnaryExpression(JavaParser p, int id) {
11 super(p, id);
12 }
13
14 private boolean isPositive;
15 private boolean isPlaceholder = true;
16
17 public void setNegative() {
18 isPositive = false;
19 isPlaceholder = false;
20 }
21
22 public void setPositive() {
23 isPositive = true;
24 isPlaceholder = false;
25 }
26
27 public boolean isPositive() {
28 if (isPlaceholder) return false;
29 return isPositive;
30 }
31
32 public boolean isPlaceholder() {
33 return isPlaceholder;
34 }
35
36 public boolean isNegative() {
37 if (isPlaceholder) return false;
38 return !isPositive;
39 }
40
41 public void dump(String prefix) {
42 if (isPlaceholder) {
43 System.out.println(toString(prefix) + ":" + ("(placeholder)"));
44 } else {
45 System.out.println(toString(prefix) + ":" + (isPositive ? "+" : "-"));
46 }
47 dumpChildren(prefix);
48 }
49
50 /*** Accept the visitor. **/
51 public Object jjtAccept(JavaParserVisitor visitor, Object data) {
52 return visitor.visit(this, data);
53 }
54 }
This page was automatically generated by Maven