/* This file was generated by SableCC (http://www.sablecc.org/). */ package org.uva.student.calinwouter.qlqls.generated.node; import org.uva.student.calinwouter.qlqls.generated.analysis.*; @SuppressWarnings("nls") public final class AValueStatement extends PStatement { private TIdentifier _identifier_; private TString _string_; private PType _type_; private PExpression _expression_; public AValueStatement() { // Constructor } public AValueStatement( @SuppressWarnings("hiding") TIdentifier _identifier_, @SuppressWarnings("hiding") TString _string_, @SuppressWarnings("hiding") PType _type_, @SuppressWarnings("hiding") PExpression _expression_) { // Constructor setIdentifier(_identifier_); setString(_string_); setType(_type_); setExpression(_expression_); } @Override public Object clone() { return new AValueStatement( cloneNode(this._identifier_), cloneNode(this._string_), cloneNode(this._type_), cloneNode(this._expression_)); } @Override public void apply(Switch sw) { ((Analysis) sw).caseAValueStatement(this); } public TIdentifier getIdentifier() { return this._identifier_; } public void setIdentifier(TIdentifier node) { if(this._identifier_ != null) { this._identifier_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._identifier_ = node; } public TString getString() { return this._string_; } public void setString(TString node) { if(this._string_ != null) { this._string_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._string_ = node; } public PType getType() { return this._type_; } public void setType(PType node) { if(this._type_ != null) { this._type_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._type_ = node; } public PExpression getExpression() { return this._expression_; } public void setExpression(PExpression node) { if(this._expression_ != null) { this._expression_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._expression_ = node; } @Override public String toString() { return "" + toString(this._identifier_) + toString(this._string_) + toString(this._type_) + toString(this._expression_); } @Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._identifier_ == child) { this._identifier_ = null; return; } if(this._string_ == child) { this._string_ = null; return; } if(this._type_ == child) { this._type_ = null; return; } if(this._expression_ == child) { this._expression_ = null; return; } throw new RuntimeException("Not a child."); } @Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._identifier_ == oldChild) { setIdentifier((TIdentifier) newChild); return; } if(this._string_ == oldChild) { setString((TString) newChild); return; } if(this._type_ == oldChild) { setType((PType) newChild); return; } if(this._expression_ == oldChild) { setExpression((PExpression) newChild); return; } throw new RuntimeException("Not a child."); } }