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 AEqEqualityExpression extends PEqualityExpression {
009: private PEqualityExpression _equalityExpression_;
010: private TEq _eq_;
011: private PRelationalExpression _relationalExpression_;
012:
013: public AEqEqualityExpression() {
014: }
015:
016: public AEqEqualityExpression(
017: PEqualityExpression _equalityExpression_, TEq _eq_,
018: PRelationalExpression _relationalExpression_) {
019: setEqualityExpression(_equalityExpression_);
020:
021: setEq(_eq_);
022:
023: setRelationalExpression(_relationalExpression_);
024:
025: }
026:
027: public Object clone() {
028: return new AEqEqualityExpression(
029: (PEqualityExpression) cloneNode(_equalityExpression_),
030: (TEq) cloneNode(_eq_),
031: (PRelationalExpression) cloneNode(_relationalExpression_));
032: }
033:
034: public void apply(Switch sw) {
035: ((Analysis) sw).caseAEqEqualityExpression(this );
036: }
037:
038: public PEqualityExpression getEqualityExpression() {
039: return _equalityExpression_;
040: }
041:
042: public void setEqualityExpression(PEqualityExpression node) {
043: if (_equalityExpression_ != null) {
044: _equalityExpression_.parent(null);
045: }
046:
047: if (node != null) {
048: if (node.parent() != null) {
049: node.parent().removeChild(node);
050: }
051:
052: node.parent(this );
053: }
054:
055: _equalityExpression_ = node;
056: }
057:
058: public TEq getEq() {
059: return _eq_;
060: }
061:
062: public void setEq(TEq node) {
063: if (_eq_ != null) {
064: _eq_.parent(null);
065: }
066:
067: if (node != null) {
068: if (node.parent() != null) {
069: node.parent().removeChild(node);
070: }
071:
072: node.parent(this );
073: }
074:
075: _eq_ = node;
076: }
077:
078: public PRelationalExpression getRelationalExpression() {
079: return _relationalExpression_;
080: }
081:
082: public void setRelationalExpression(PRelationalExpression node) {
083: if (_relationalExpression_ != null) {
084: _relationalExpression_.parent(null);
085: }
086:
087: if (node != null) {
088: if (node.parent() != null) {
089: node.parent().removeChild(node);
090: }
091:
092: node.parent(this );
093: }
094:
095: _relationalExpression_ = node;
096: }
097:
098: public String toString() {
099: return "" + toString(_equalityExpression_) + toString(_eq_)
100: + toString(_relationalExpression_);
101: }
102:
103: void removeChild(Node child) {
104: if (_equalityExpression_ == child) {
105: _equalityExpression_ = null;
106: return;
107: }
108:
109: if (_eq_ == child) {
110: _eq_ = null;
111: return;
112: }
113:
114: if (_relationalExpression_ == child) {
115: _relationalExpression_ = null;
116: return;
117: }
118:
119: }
120:
121: void replaceChild(Node oldChild, Node newChild) {
122: if (_equalityExpression_ == oldChild) {
123: setEqualityExpression((PEqualityExpression) newChild);
124: return;
125: }
126:
127: if (_eq_ == oldChild) {
128: setEq((TEq) newChild);
129: return;
130: }
131:
132: if (_relationalExpression_ == oldChild) {
133: setRelationalExpression((PRelationalExpression) newChild);
134: return;
135: }
136:
137: }
138: }
|