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 ALeftDivMultiplicativeExpression extends
009: PMultiplicativeExpression {
010: private PMultiplicativeExpression _multiplicativeExpression_;
011: private TLeftDiv _leftDiv_;
012: private PUnaryExpression _unaryExpression_;
013:
014: public ALeftDivMultiplicativeExpression() {
015: }
016:
017: public ALeftDivMultiplicativeExpression(
018: PMultiplicativeExpression _multiplicativeExpression_,
019: TLeftDiv _leftDiv_, PUnaryExpression _unaryExpression_) {
020: setMultiplicativeExpression(_multiplicativeExpression_);
021:
022: setLeftDiv(_leftDiv_);
023:
024: setUnaryExpression(_unaryExpression_);
025:
026: }
027:
028: public Object clone() {
029: return new ALeftDivMultiplicativeExpression(
030: (PMultiplicativeExpression) cloneNode(_multiplicativeExpression_),
031: (TLeftDiv) cloneNode(_leftDiv_),
032: (PUnaryExpression) cloneNode(_unaryExpression_));
033: }
034:
035: public void apply(Switch sw) {
036: ((Analysis) sw).caseALeftDivMultiplicativeExpression(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 TLeftDiv getLeftDiv() {
061: return _leftDiv_;
062: }
063:
064: public void setLeftDiv(TLeftDiv node) {
065: if (_leftDiv_ != null) {
066: _leftDiv_.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: _leftDiv_ = 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(_leftDiv_) + toString(_unaryExpression_);
103: }
104:
105: void removeChild(Node child) {
106: if (_multiplicativeExpression_ == child) {
107: _multiplicativeExpression_ = null;
108: return;
109: }
110:
111: if (_leftDiv_ == child) {
112: _leftDiv_ = 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 (_leftDiv_ == oldChild) {
130: setLeftDiv((TLeftDiv) newChild);
131: return;
132: }
133:
134: if (_unaryExpression_ == oldChild) {
135: setUnaryExpression((PUnaryExpression) newChild);
136: return;
137: }
138:
139: }
140: }
|