Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

AQuestionExp.java

00001 package edu.ksu.cis.bandera.specification.predicate.node;
00002 
00003 /* This file was generated by SableCC (http://www.sable.mcgill.ca/sablecc/). */
00004 
00005 import java.util.*;
00006 import edu.ksu.cis.bandera.specification.predicate.analysis.*;
00007 
00008 public final class AQuestionExp extends PExp
00009 {
00010     private PExp _exp_;
00011     private TQuestion _question_;
00012     private PExp _trueExp_;
00013     private TColon _colon_;
00014     private PExp _falseExp_;
00015 
00016     public AQuestionExp()
00017     {
00018     }
00019     public AQuestionExp(
00020         PExp _exp_,
00021         TQuestion _question_,
00022         PExp _trueExp_,
00023         TColon _colon_,
00024         PExp _falseExp_)
00025     {
00026         setExp(_exp_);
00027 
00028         setQuestion(_question_);
00029 
00030         setTrueExp(_trueExp_);
00031 
00032         setColon(_colon_);
00033 
00034         setFalseExp(_falseExp_);
00035 
00036     }
00037     public void apply(Switch sw)
00038     {
00039         ((Analysis) sw).caseAQuestionExp(this);
00040     }
00041     public Object clone()
00042     {
00043         return new AQuestionExp(
00044             (PExp) cloneNode(_exp_),
00045             (TQuestion) cloneNode(_question_),
00046             (PExp) cloneNode(_trueExp_),
00047             (TColon) cloneNode(_colon_),
00048             (PExp) cloneNode(_falseExp_));
00049     }
00050     public TColon getColon()
00051     {
00052         return _colon_;
00053     }
00054     public PExp getExp()
00055     {
00056         return _exp_;
00057     }
00058     public PExp getFalseExp()
00059     {
00060         return _falseExp_;
00061     }
00062     public TQuestion getQuestion()
00063     {
00064         return _question_;
00065     }
00066     public PExp getTrueExp()
00067     {
00068         return _trueExp_;
00069     }
00070     void removeChild(Node child)
00071     {
00072         if(_exp_ == child)
00073         {
00074             _exp_ = null;
00075             return;
00076         }
00077 
00078         if(_question_ == child)
00079         {
00080             _question_ = null;
00081             return;
00082         }
00083 
00084         if(_trueExp_ == child)
00085         {
00086             _trueExp_ = null;
00087             return;
00088         }
00089 
00090         if(_colon_ == child)
00091         {
00092             _colon_ = null;
00093             return;
00094         }
00095 
00096         if(_falseExp_ == child)
00097         {
00098             _falseExp_ = null;
00099             return;
00100         }
00101 
00102     }
00103     void replaceChild(Node oldChild, Node newChild)
00104     {
00105         if(_exp_ == oldChild)
00106         {
00107             setExp((PExp) newChild);
00108             return;
00109         }
00110 
00111         if(_question_ == oldChild)
00112         {
00113             setQuestion((TQuestion) newChild);
00114             return;
00115         }
00116 
00117         if(_trueExp_ == oldChild)
00118         {
00119             setTrueExp((PExp) newChild);
00120             return;
00121         }
00122 
00123         if(_colon_ == oldChild)
00124         {
00125             setColon((TColon) newChild);
00126             return;
00127         }
00128 
00129         if(_falseExp_ == oldChild)
00130         {
00131             setFalseExp((PExp) newChild);
00132             return;
00133         }
00134 
00135     }
00136     public void setColon(TColon node)
00137     {
00138         if(_colon_ != null)
00139         {
00140             _colon_.parent(null);
00141         }
00142 
00143         if(node != null)
00144         {
00145             if(node.parent() != null)
00146             {
00147                 node.parent().removeChild(node);
00148             }
00149 
00150             node.parent(this);
00151         }
00152 
00153         _colon_ = node;
00154     }
00155     public void setExp(PExp node)
00156     {
00157         if(_exp_ != null)
00158         {
00159             _exp_.parent(null);
00160         }
00161 
00162         if(node != null)
00163         {
00164             if(node.parent() != null)
00165             {
00166                 node.parent().removeChild(node);
00167             }
00168 
00169             node.parent(this);
00170         }
00171 
00172         _exp_ = node;
00173     }
00174     public void setFalseExp(PExp node)
00175     {
00176         if(_falseExp_ != null)
00177         {
00178             _falseExp_.parent(null);
00179         }
00180 
00181         if(node != null)
00182         {
00183             if(node.parent() != null)
00184             {
00185                 node.parent().removeChild(node);
00186             }
00187 
00188             node.parent(this);
00189         }
00190 
00191         _falseExp_ = node;
00192     }
00193     public void setQuestion(TQuestion node)
00194     {
00195         if(_question_ != null)
00196         {
00197             _question_.parent(null);
00198         }
00199 
00200         if(node != null)
00201         {
00202             if(node.parent() != null)
00203             {
00204                 node.parent().removeChild(node);
00205             }
00206 
00207             node.parent(this);
00208         }
00209 
00210         _question_ = node;
00211     }
00212     public void setTrueExp(PExp node)
00213     {
00214         if(_trueExp_ != null)
00215         {
00216             _trueExp_.parent(null);
00217         }
00218 
00219         if(node != null)
00220         {
00221             if(node.parent() != null)
00222             {
00223                 node.parent().removeChild(node);
00224             }
00225 
00226             node.parent(this);
00227         }
00228 
00229         _trueExp_ = node;
00230     }
00231     public String toString()
00232     {
00233         return ""
00234             + toString(_exp_)
00235             + toString(_question_)
00236             + toString(_trueExp_)
00237             + toString(_colon_)
00238             + toString(_falseExp_);
00239     }
00240 }

Generated at Thu Feb 7 06:39:19 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001