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

AIfThenElseStmtNoShortIf.java

00001 package edu.ksu.cis.bandera.jjjc.node;
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  * Bandera, a Java(TM) analysis and transformation toolkit           *
00005  * Copyright (C) 1998-2001 SAnToS Laboratories (santos@cis.ksu.edu)  *
00006 
00007  * All rights reserved.                                              *
00008  *                                                                   *
00009  * This work was done as a project in the SAnToS Laboratory,         *
00010  * Department of Computing and Information Sciences, Kansas State    *
00011  * University, USA (http://www.cis.ksu.edu/santos).                  *
00012  * It is understood that any modification not identified as such is  *
00013  * not covered by the preceding statement.                           *
00014  *                                                                   *
00015  * This work is free software; you can redistribute it and/or        *
00016  * modify it under the terms of the GNU Library General Public       *
00017  * License as published by the Free Software Foundation; either      *
00018  * version 2 of the License, or (at your option) any later version.  *
00019  *                                                                   *
00020  * This work is distributed in the hope that it will be useful,      *
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *
00023  * Library General Public License for more details.                  *
00024  *                                                                   *
00025  * You should have received a copy of the GNU Library General Public *
00026  * License along with this toolkit; if not, write to the             *
00027  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,      *
00028  * Boston, MA  02111-1307, USA.                                      *
00029  *                                                                   *
00030  * Java is a trademark of Sun Microsystems, Inc.                     *
00031  *                                                                   *
00032  * To submit a bug report, send a comment, or get the latest news on *
00033  * this project and other SAnToS projects, please visit the web-site *
00034  *                http://www.cis.ksu.edu/santos                      *
00035  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00036 import ca.mcgill.sable.util.*;
00037 import edu.ksu.cis.bandera.jjjc.analysis.*;
00038 
00039 public final class AIfThenElseStmtNoShortIf extends PIfThenElseStmtNoShortIf
00040 {
00041     private TIf _if_;
00042     private TLPar _lPar_;
00043     private PExp _exp_;
00044     private TRPar _rPar_;
00045     private PStmtNoShortIf _stmtNoShortIf1_;
00046     private TElse _else_;
00047     private PStmtNoShortIf _stmtNoShortIf2_;
00048 
00049     public AIfThenElseStmtNoShortIf()
00050     {
00051     }
00052     public AIfThenElseStmtNoShortIf(
00053         TIf _if_,
00054         TLPar _lPar_,
00055         PExp _exp_,
00056         TRPar _rPar_,
00057         PStmtNoShortIf _stmtNoShortIf1_,
00058         TElse _else_,
00059         PStmtNoShortIf _stmtNoShortIf2_)
00060     {
00061         setIf(_if_);
00062 
00063         setLPar(_lPar_);
00064 
00065         setExp(_exp_);
00066 
00067         setRPar(_rPar_);
00068 
00069         setStmtNoShortIf1(_stmtNoShortIf1_);
00070 
00071         setElse(_else_);
00072 
00073         setStmtNoShortIf2(_stmtNoShortIf2_);
00074 
00075     }
00076     public void apply(Switch sw)
00077     {
00078         ((Analysis) sw).caseAIfThenElseStmtNoShortIf(this);
00079     }
00080     public Object clone()
00081     {
00082         return new AIfThenElseStmtNoShortIf(
00083             (TIf) cloneNode(_if_),
00084             (TLPar) cloneNode(_lPar_),
00085             (PExp) cloneNode(_exp_),
00086             (TRPar) cloneNode(_rPar_),
00087             (PStmtNoShortIf) cloneNode(_stmtNoShortIf1_),
00088             (TElse) cloneNode(_else_),
00089             (PStmtNoShortIf) cloneNode(_stmtNoShortIf2_));
00090     }
00091     public TElse getElse()
00092     {
00093         return _else_;
00094     }
00095     public PExp getExp()
00096     {
00097         return _exp_;
00098     }
00099     public TIf getIf()
00100     {
00101         return _if_;
00102     }
00103     public TLPar getLPar()
00104     {
00105         return _lPar_;
00106     }
00107     public TRPar getRPar()
00108     {
00109         return _rPar_;
00110     }
00111     public PStmtNoShortIf getStmtNoShortIf1()
00112     {
00113         return _stmtNoShortIf1_;
00114     }
00115     public PStmtNoShortIf getStmtNoShortIf2()
00116     {
00117         return _stmtNoShortIf2_;
00118     }
00119     void removeChild(Node child)
00120     {
00121         if(_if_ == child)
00122         {
00123             _if_ = null;
00124             return;
00125         }
00126 
00127         if(_lPar_ == child)
00128         {
00129             _lPar_ = null;
00130             return;
00131         }
00132 
00133         if(_exp_ == child)
00134         {
00135             _exp_ = null;
00136             return;
00137         }
00138 
00139         if(_rPar_ == child)
00140         {
00141             _rPar_ = null;
00142             return;
00143         }
00144 
00145         if(_stmtNoShortIf1_ == child)
00146         {
00147             _stmtNoShortIf1_ = null;
00148             return;
00149         }
00150 
00151         if(_else_ == child)
00152         {
00153             _else_ = null;
00154             return;
00155         }
00156 
00157         if(_stmtNoShortIf2_ == child)
00158         {
00159             _stmtNoShortIf2_ = null;
00160             return;
00161         }
00162 
00163     }
00164     void replaceChild(Node oldChild, Node newChild)
00165     {
00166         if(_if_ == oldChild)
00167         {
00168             setIf((TIf) newChild);
00169             return;
00170         }
00171 
00172         if(_lPar_ == oldChild)
00173         {
00174             setLPar((TLPar) newChild);
00175             return;
00176         }
00177 
00178         if(_exp_ == oldChild)
00179         {
00180             setExp((PExp) newChild);
00181             return;
00182         }
00183 
00184         if(_rPar_ == oldChild)
00185         {
00186             setRPar((TRPar) newChild);
00187             return;
00188         }
00189 
00190         if(_stmtNoShortIf1_ == oldChild)
00191         {
00192             setStmtNoShortIf1((PStmtNoShortIf) newChild);
00193             return;
00194         }
00195 
00196         if(_else_ == oldChild)
00197         {
00198             setElse((TElse) newChild);
00199             return;
00200         }
00201 
00202         if(_stmtNoShortIf2_ == oldChild)
00203         {
00204             setStmtNoShortIf2((PStmtNoShortIf) newChild);
00205             return;
00206         }
00207 
00208     }
00209     public void setElse(TElse node)
00210     {
00211         if(_else_ != null)
00212         {
00213             _else_.parent(null);
00214         }
00215 
00216         if(node != null)
00217         {
00218             if(node.parent() != null)
00219             {
00220                 node.parent().removeChild(node);
00221             }
00222 
00223             node.parent(this);
00224         }
00225 
00226         _else_ = node;
00227     }
00228     public void setExp(PExp node)
00229     {
00230         if(_exp_ != null)
00231         {
00232             _exp_.parent(null);
00233         }
00234 
00235         if(node != null)
00236         {
00237             if(node.parent() != null)
00238             {
00239                 node.parent().removeChild(node);
00240             }
00241 
00242             node.parent(this);
00243         }
00244 
00245         _exp_ = node;
00246     }
00247     public void setIf(TIf node)
00248     {
00249         if(_if_ != null)
00250         {
00251             _if_.parent(null);
00252         }
00253 
00254         if(node != null)
00255         {
00256             if(node.parent() != null)
00257             {
00258                 node.parent().removeChild(node);
00259             }
00260 
00261             node.parent(this);
00262         }
00263 
00264         _if_ = node;
00265     }
00266     public void setLPar(TLPar node)
00267     {
00268         if(_lPar_ != null)
00269         {
00270             _lPar_.parent(null);
00271         }
00272 
00273         if(node != null)
00274         {
00275             if(node.parent() != null)
00276             {
00277                 node.parent().removeChild(node);
00278             }
00279 
00280             node.parent(this);
00281         }
00282 
00283         _lPar_ = node;
00284     }
00285     public void setRPar(TRPar node)
00286     {
00287         if(_rPar_ != null)
00288         {
00289             _rPar_.parent(null);
00290         }
00291 
00292         if(node != null)
00293         {
00294             if(node.parent() != null)
00295             {
00296                 node.parent().removeChild(node);
00297             }
00298 
00299             node.parent(this);
00300         }
00301 
00302         _rPar_ = node;
00303     }
00304     public void setStmtNoShortIf1(PStmtNoShortIf node)
00305     {
00306         if(_stmtNoShortIf1_ != null)
00307         {
00308             _stmtNoShortIf1_.parent(null);
00309         }
00310 
00311         if(node != null)
00312         {
00313             if(node.parent() != null)
00314             {
00315                 node.parent().removeChild(node);
00316             }
00317 
00318             node.parent(this);
00319         }
00320 
00321         _stmtNoShortIf1_ = node;
00322     }
00323     public void setStmtNoShortIf2(PStmtNoShortIf node)
00324     {
00325         if(_stmtNoShortIf2_ != null)
00326         {
00327             _stmtNoShortIf2_.parent(null);
00328         }
00329 
00330         if(node != null)
00331         {
00332             if(node.parent() != null)
00333             {
00334                 node.parent().removeChild(node);
00335             }
00336 
00337             node.parent(this);
00338         }
00339 
00340         _stmtNoShortIf2_ = node;
00341     }
00342     public String toString()
00343     {
00344         return ""
00345             + toString(_if_)
00346             + toString(_lPar_)
00347             + toString(_exp_)
00348             + toString(_rPar_)
00349             + toString(_stmtNoShortIf1_)
00350             + toString(_else_)
00351             + toString(_stmtNoShortIf2_);
00352     }
00353 }

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