/* This file was generated by SableCC (http://www.sablecc.org/). */
package net.sf.jame.contextfree.cfdg.node;
import java.util.*;
import net.sf.jame.contextfree.cfdg.analysis.*;
@SuppressWarnings("nls")
public final class ACfdg extends PCfdg
{
private final LinkedList<PCfdgDeclaration> _cfdgDeclaration_ = new LinkedList<PCfdgDeclaration>();
public ACfdg()
{
// Constructor
}
public ACfdg(
@SuppressWarnings("hiding") List<PCfdgDeclaration> _cfdgDeclaration_)
{
// Constructor
setCfdgDeclaration(_cfdgDeclaration_);
}
@Override
public Object clone()
{
return new ACfdg(
cloneList(this._cfdgDeclaration_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseACfdg(this);
}
public LinkedList<PCfdgDeclaration> getCfdgDeclaration()
{
return this._cfdgDeclaration_;
}
public void setCfdgDeclaration(List<PCfdgDeclaration> list)
{
this._cfdgDeclaration_.clear();
this._cfdgDeclaration_.addAll(list);
for(PCfdgDeclaration e : list)
{
if(e.parent() != null)
{
e.parent().removeChild(e);
}
e.parent(this);
}
}
@Override
public String toString()
{
return ""
+ toString(this._cfdgDeclaration_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._cfdgDeclaration_.remove(child))
{
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
for(ListIterator<PCfdgDeclaration> i = this._cfdgDeclaration_.listIterator(); i.hasNext();)
{
if(i.next() == oldChild)
{
if(newChild != null)
{
i.set((PCfdgDeclaration) newChild);
newChild.parent(this);
oldChild.parent(null);
return;
}
i.remove();
oldChild.parent(null);
return;
}
}
throw new RuntimeException("Not a child.");
}
}