KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > jimple > parser > node > AIntegerConstant


1 /* This file was generated by SableCC (http://www.sablecc.org/). */
2
3 package soot.jimple.parser.node;
4
5 import java.util.*;
6 import soot.jimple.parser.analysis.*;
7
8 public final class AIntegerConstant extends PConstant
9 {
10     private TMinus _minus_;
11     private TIntegerConstant _integerConstant_;
12
13     public AIntegerConstant()
14     {
15     }
16
17     public AIntegerConstant(
18         TMinus _minus_,
19         TIntegerConstant _integerConstant_)
20     {
21         setMinus(_minus_);
22
23         setIntegerConstant(_integerConstant_);
24
25     }
26     public Object JavaDoc clone()
27     {
28         return new AIntegerConstant(
29             (TMinus) cloneNode(_minus_),
30             (TIntegerConstant) cloneNode(_integerConstant_));
31     }
32
33     public void apply(Switch sw)
34     {
35         ((Analysis) sw).caseAIntegerConstant(this);
36     }
37
38     public TMinus getMinus()
39     {
40         return _minus_;
41     }
42
43     public void setMinus(TMinus node)
44     {
45         if(_minus_ != null)
46         {
47             _minus_.parent(null);
48         }
49
50         if(node != null)
51         {
52             if(node.parent() != null)
53             {
54                 node.parent().removeChild(node);
55             }
56
57             node.parent(this);
58         }
59
60         _minus_ = node;
61     }
62
63     public TIntegerConstant getIntegerConstant()
64     {
65         return _integerConstant_;
66     }
67
68     public void setIntegerConstant(TIntegerConstant node)
69     {
70         if(_integerConstant_ != null)
71         {
72             _integerConstant_.parent(null);
73         }
74
75         if(node != null)
76         {
77             if(node.parent() != null)
78             {
79                 node.parent().removeChild(node);
80             }
81
82             node.parent(this);
83         }
84
85         _integerConstant_ = node;
86     }
87
88     public String JavaDoc toString()
89     {
90         return ""
91             + toString(_minus_)
92             + toString(_integerConstant_);
93     }
94
95     void removeChild(Node child)
96     {
97         if(_minus_ == child)
98         {
99             _minus_ = null;
100             return;
101         }
102
103         if(_integerConstant_ == child)
104         {
105             _integerConstant_ = null;
106             return;
107         }
108
109     }
110
111     void replaceChild(Node oldChild, Node newChild)
112     {
113         if(_minus_ == oldChild)
114         {
115             setMinus((TMinus) newChild);
116             return;
117         }
118
119         if(_integerConstant_ == oldChild)
120         {
121             setIntegerConstant((TIntegerConstant) newChild);
122             return;
123         }
124
125     }
126 }
127
Popular Tags