001: /* This file was generated by SableCC (http://www.sablecc.org/). */
002:
003: package org.jmatlab.node;
004:
005: import java.util.*;
006: import org.jmatlab.analysis.*;
007:
008: public final class ADivMultiplicativeExpression extends
009: PMultiplicativeExpression {
010: private PMultiplicativeExpression _multiplicativeExpression_;
011: private TRightDiv _rightDiv_;
012: private PUnaryExpression _unaryExpression_;
013:
014: public ADivMultiplicativeExpression() {
015: }
016:
017: public ADivMultiplicativeExpression(
018: PMultiplicativeExpression _multiplicativeExpression_,
019: TRightDiv _rightDiv_, PUnaryExpression _unaryExpression_) {
020: setMultiplicativeExpression(_multiplicativeExpression_);
021:
022: setRightDiv(_rightDiv_);
023:
024: setUnaryExpression(_unaryExpression_);
025:
026: }
027:
028: public Object clone() {
029: return new ADivMultiplicativeExpression(
030: (PMultiplicativeExpression) cloneNode(_multiplicativeExpression_),
031: (TRightDiv) cloneNode(_rightDiv_),
032: (PUnaryExpression) cloneNode(_unaryExpression_));
033: }
034:
035: public void apply(Switch sw) {
036: ((Analysis) sw).caseADivMultiplicativeExpression(this );
037: }
038:
039: public PMultiplicativeExpression getMultiplicativeExpression() {
040: return _multiplicativeExpression_;
041: }
042:
043: public void setMultiplicativeExpression(
044: PMultiplicativeExpression node) {
045: if (_multiplicativeExpression_ != null) {
046: _multiplicativeExpression_.parent(null);
047: }
048:
049: if (node != null) {
050: if (node.parent() != null) {
051: node.parent().removeChild(node);
052: }
053:
054: node.parent(this );
055: }
056:
057: _multiplicativeExpression_ = node;
058: }
059:
060: public TRightDiv getRightDiv() {
061: return _rightDiv_;
062: }
063:
064: public void setRightDiv(TRightDiv node) {
065: if (_rightDiv_ != null) {
066: _rightDiv_.parent(null);
067: }
068:
069: if (node != null) {
070: if (node.parent() != null) {
071: node.parent().removeChild(node);
072: }
073:
074: node.parent(this );
075: }
076:
077: _rightDiv_ = node;
078: }
079:
080: public PUnaryExpression getUnaryExpression() {
081: return _unaryExpression_;
082: }
083:
084: public void setUnaryExpression(PUnaryExpression node) {
085: if (_unaryExpression_ != null) {
086: _unaryExpression_.parent(null);
087: }
088:
089: if (node != null) {
090: if (node.parent() != null) {
091: node.parent().removeChild(node);
092: }
093:
094: node.parent(this );
095: }
096:
097: _unaryExpression_ = node;
098: }
099:
100: public String toString() {
101: return "" + toString(_multiplicativeExpression_)
102: + toString(_rightDiv_) + toString(_unaryExpression_);
103: }
104:
105: void removeChild(Node child) {
106: if (_multiplicativeExpression_ == child) {
107: _multiplicativeExpression_ = null;
108: return;
109: }
110:
111: if (_rightDiv_ == child) {
112: _rightDiv_ = null;
113: return;
114: }
115:
116: if (_unaryExpression_ == child) {
117: _unaryExpression_ = null;
118: return;
119: }
120:
121: }
122:
123: void replaceChild(Node oldChild, Node newChild) {
124: if (_multiplicativeExpression_ == oldChild) {
125: setMultiplicativeExpression((PMultiplicativeExpression) newChild);
126: return;
127: }
128:
129: if (_rightDiv_ == oldChild) {
130: setRightDiv((TRightDiv) newChild);
131: return;
132: }
133:
134: if (_unaryExpression_ == oldChild) {
135: setUnaryExpression((PUnaryExpression) newChild);
136: return;
137: }
138:
139: }
140: }
|