1 | /* This file was generated by SableCC (http://www.sablecc.org/). */ |
2 | |
3 | package uk.co.zonetora.fj.ast.node; |
4 | |
5 | import java.util.*; |
6 | import uk.co.zonetora.fj.ast.analysis.*; |
7 | |
8 | public final class ACommaParamArgList extends PCommaParamArgList |
9 | { |
10 | private TComma _comma_; |
11 | private PParamArg _paramArg_; |
12 | |
13 | public ACommaParamArgList() |
14 | { |
15 | } |
16 | |
17 | public ACommaParamArgList( |
18 | TComma _comma_, |
19 | PParamArg _paramArg_) |
20 | { |
21 | setComma(_comma_); |
22 | |
23 | setParamArg(_paramArg_); |
24 | |
25 | } |
26 | public Object clone() |
27 | { |
28 | return new ACommaParamArgList( |
29 | (TComma) cloneNode(_comma_), |
30 | (PParamArg) cloneNode(_paramArg_)); |
31 | } |
32 | |
33 | public void apply(Switch sw) |
34 | { |
35 | ((Analysis) sw).caseACommaParamArgList(this); |
36 | } |
37 | |
38 | public TComma getComma() |
39 | { |
40 | return _comma_; |
41 | } |
42 | |
43 | public void setComma(TComma node) |
44 | { |
45 | if(_comma_ != null) |
46 | { |
47 | _comma_.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 | _comma_ = node; |
61 | } |
62 | |
63 | public PParamArg getParamArg() |
64 | { |
65 | return _paramArg_; |
66 | } |
67 | |
68 | public void setParamArg(PParamArg node) |
69 | { |
70 | if(_paramArg_ != null) |
71 | { |
72 | _paramArg_.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 | _paramArg_ = node; |
86 | } |
87 | |
88 | public String toString() |
89 | { |
90 | return "" |
91 | + toString(_comma_) |
92 | + toString(_paramArg_); |
93 | } |
94 | |
95 | void removeChild(Node child) |
96 | { |
97 | if(_comma_ == child) |
98 | { |
99 | _comma_ = null; |
100 | return; |
101 | } |
102 | |
103 | if(_paramArg_ == child) |
104 | { |
105 | _paramArg_ = null; |
106 | return; |
107 | } |
108 | |
109 | } |
110 | |
111 | void replaceChild(Node oldChild, Node newChild) |
112 | { |
113 | if(_comma_ == oldChild) |
114 | { |
115 | setComma((TComma) newChild); |
116 | return; |
117 | } |
118 | |
119 | if(_paramArg_ == oldChild) |
120 | { |
121 | setParamArg((PParamArg) newChild); |
122 | return; |
123 | } |
124 | |
125 | } |
126 | } |