1 2 3 package org.sablecc.sablecc.launcher.syntax3.node; 4 5 import org.sablecc.sablecc.launcher.syntax3.analysis.*; 6 7 @SuppressWarnings ("nls") 8 public final class AOperand extends POperand 9 { 10 private TOperandText _operandText_; 11 12 public AOperand() 13 { 14 } 16 17 public AOperand( 18 @SuppressWarnings ("hiding") TOperandText _operandText_) 19 { 20 setOperandText(_operandText_); 22 23 } 24 25 @Override 26 public Object clone() 27 { 28 return new AOperand( 29 cloneNode(this._operandText_)); 30 } 31 32 public void apply(Switch sw) 33 { 34 ((Analysis) sw).caseAOperand(this); 35 } 36 37 public TOperandText getOperandText() 38 { 39 return this._operandText_; 40 } 41 42 public void setOperandText(TOperandText node) 43 { 44 if(this._operandText_ != null) 45 { 46 this._operandText_.parent(null); 47 } 48 49 if(node != null) 50 { 51 if(node.parent() != null) 52 { 53 node.parent().removeChild(node); 54 } 55 56 node.parent(this); 57 } 58 59 this._operandText_ = node; 60 } 61 62 @Override 63 public String toString() 64 { 65 return "" 66 + toString(this._operandText_); 67 } 68 69 @Override 70 void removeChild(@SuppressWarnings ("unused") Node child) 71 { 72 if(this._operandText_ == child) 74 { 75 this._operandText_ = null; 76 return; 77 } 78 79 throw new RuntimeException ("Not a child."); 80 } 81 82 @Override 83 void replaceChild(@SuppressWarnings ("unused") Node oldChild, @SuppressWarnings ("unused") Node newChild) 84 { 85 if(this._operandText_ == oldChild) 87 { 88 setOperandText((TOperandText) newChild); 89 return; 90 } 91 92 throw new RuntimeException ("Not a child."); 93 } 94 } 95 | Popular Tags |