1
/* This file was generated by SableCC (http://www.sablecc.org/). */
3
package org.sablecc.sablecc.node;
6
import org.sablecc.sablecc.analysis.*;
8
public final class AHelpers extends PHelpers
10
private THelpers _helpers_;
11
private final LinkedList _helperDefs_ = new TypedLinkedList(new HelperDefs_Cast());
20
setHelpers(_helpers_);
23
this._helperDefs_.clear();
24
this._helperDefs_.addAll(_helperDefs_);
31
XPHelperDef _helperDefs_)
33
setHelpers(_helpers_);
35
if(_helperDefs_ != null)
37
while(_helperDefs_ instanceof X1PHelperDef)
39
this._helperDefs_.addFirst(((X1PHelperDef) _helperDefs_).getPHelperDef());
40
_helperDefs_ = ((X1PHelperDef) _helperDefs_).getXPHelperDef();
42
this._helperDefs_.addFirst(((X2PHelperDef) _helperDefs_).getPHelperDef());
49
(THelpers) cloneNode(_helpers_),
50
cloneList(_helperDefs_));
53
public void apply(Switch sw)
55
((Analysis) sw).caseAHelpers(this);
58
public THelpers getHelpers()
63
public void setHelpers(THelpers node)
67
_helpers_.parent(null);
72
if(node.parent() != null)
74
node.parent().removeChild(node);
83
public LinkedList getHelperDefs()
88
public void setHelperDefs(List list)
91
_helperDefs_.addAll(list);
94
public String toString()
98
+ toString(_helperDefs_);
101
void removeChild(Node child)
103
if(_helpers_ == child)
109
if(_helperDefs_.remove(child))
116
void replaceChild(Node oldChild, Node newChild)
118
if(_helpers_ == oldChild)
120
setHelpers((THelpers) newChild);
124
for(ListIterator i = _helperDefs_.listIterator(); i.hasNext();)
126
if(i.next() == oldChild)
131
oldChild.parent(null);
136
oldChild.parent(null);
143
private class HelperDefs_Cast implements Cast
145
public Object cast(Object o)
147
PHelperDef node = (PHelperDef) o;
149
if((node.parent() != null) &&
150
(node.parent() != AHelpers.this))
152
node.parent().removeChild(node);
155
if((node.parent() == null) ||
156
(node.parent() != AHelpers.this))
158
node.parent(AHelpers.this);