/* This file was generated by SableCC (http://www.sablecc.org/). */ package soot.jimple.parser.node; import java.util.*; import soot.jimple.parser.analysis.*; @SuppressWarnings("nls") public final class ATableswitchStatement extends PStatement { private TTableswitch _tableswitch_; private TLParen _lParen_; private PImmediate _immediate_; private TRParen _rParen_; private TLBrace _lBrace_; private final LinkedList<PCaseStmt> _caseStmt_ = new LinkedList<PCaseStmt>(); private TRBrace _rBrace_; private TSemicolon _semicolon_; public ATableswitchStatement() { // Constructor } public ATableswitchStatement( @SuppressWarnings("hiding") TTableswitch _tableswitch_, @SuppressWarnings("hiding") TLParen _lParen_, @SuppressWarnings("hiding") PImmediate _immediate_, @SuppressWarnings("hiding") TRParen _rParen_, @SuppressWarnings("hiding") TLBrace _lBrace_, @SuppressWarnings("hiding") List<PCaseStmt> _caseStmt_, @SuppressWarnings("hiding") TRBrace _rBrace_, @SuppressWarnings("hiding") TSemicolon _semicolon_) { // Constructor setTableswitch(_tableswitch_); setLParen(_lParen_); setImmediate(_immediate_); setRParen(_rParen_); setLBrace(_lBrace_); setCaseStmt(_caseStmt_); setRBrace(_rBrace_); setSemicolon(_semicolon_); } @Override public Object clone() { return new ATableswitchStatement( cloneNode(this._tableswitch_), cloneNode(this._lParen_), cloneNode(this._immediate_), cloneNode(this._rParen_), cloneNode(this._lBrace_), cloneList(this._caseStmt_), cloneNode(this._rBrace_), cloneNode(this._semicolon_)); } public void apply(Switch sw) { ((Analysis) sw).caseATableswitchStatement(this); } public TTableswitch getTableswitch() { return this._tableswitch_; } public void setTableswitch(TTableswitch node) { if(this._tableswitch_ != null) { this._tableswitch_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._tableswitch_ = node; } public TLParen getLParen() { return this._lParen_; } public void setLParen(TLParen node) { if(this._lParen_ != null) { this._lParen_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._lParen_ = node; } public PImmediate getImmediate() { return this._immediate_; } public void setImmediate(PImmediate node) { if(this._immediate_ != null) { this._immediate_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._immediate_ = node; } public TRParen getRParen() { return this._rParen_; } public void setRParen(TRParen node) { if(this._rParen_ != null) { this._rParen_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._rParen_ = node; } public TLBrace getLBrace() { return this._lBrace_; } public void setLBrace(TLBrace node) { if(this._lBrace_ != null) { this._lBrace_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._lBrace_ = node; } public LinkedList<PCaseStmt> getCaseStmt() { return this._caseStmt_; } public void setCaseStmt(List<PCaseStmt> list) { this._caseStmt_.clear(); this._caseStmt_.addAll(list); for(PCaseStmt e : list) { if(e.parent() != null) { e.parent().removeChild(e); } e.parent(this); } } public TRBrace getRBrace() { return this._rBrace_; } public void setRBrace(TRBrace node) { if(this._rBrace_ != null) { this._rBrace_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._rBrace_ = node; } public TSemicolon getSemicolon() { return this._semicolon_; } public void setSemicolon(TSemicolon node) { if(this._semicolon_ != null) { this._semicolon_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._semicolon_ = node; } @Override public String toString() { return "" + toString(this._tableswitch_) + toString(this._lParen_) + toString(this._immediate_) + toString(this._rParen_) + toString(this._lBrace_) + toString(this._caseStmt_) + toString(this._rBrace_) + toString(this._semicolon_); } @Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._tableswitch_ == child) { this._tableswitch_ = null; return; } if(this._lParen_ == child) { this._lParen_ = null; return; } if(this._immediate_ == child) { this._immediate_ = null; return; } if(this._rParen_ == child) { this._rParen_ = null; return; } if(this._lBrace_ == child) { this._lBrace_ = null; return; } if(this._caseStmt_.remove(child)) { return; } if(this._rBrace_ == child) { this._rBrace_ = null; return; } if(this._semicolon_ == child) { this._semicolon_ = null; return; } throw new RuntimeException("Not a child."); } @Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._tableswitch_ == oldChild) { setTableswitch((TTableswitch) newChild); return; } if(this._lParen_ == oldChild) { setLParen((TLParen) newChild); return; } if(this._immediate_ == oldChild) { setImmediate((PImmediate) newChild); return; } if(this._rParen_ == oldChild) { setRParen((TRParen) newChild); return; } if(this._lBrace_ == oldChild) { setLBrace((TLBrace) newChild); return; } for(ListIterator<PCaseStmt> i = this._caseStmt_.listIterator(); i.hasNext();) { if(i.next() == oldChild) { if(newChild != null) { i.set((PCaseStmt) newChild); newChild.parent(this); oldChild.parent(null); return; } i.remove(); oldChild.parent(null); return; } } if(this._rBrace_ == oldChild) { setRBrace((TRBrace) newChild); return; } if(this._semicolon_ == oldChild) { setSemicolon((TSemicolon) newChild); return; } throw new RuntimeException("Not a child."); } }