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

AOneForStmt.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 AOneForStmt extends POneForStmt
00040 {
00041     private TFor _for_;
00042     private TLPar _lPar_;
00043     private PForInit _forInit_;
00044     private TSemicolon _semicolon1_;
00045     private PExp _exp_;
00046     private TSemicolon _semicolon2_;
00047     private PForUpdate _forUpdate_;
00048     private TRPar _rPar_;
00049     private PStmt _stmt_;
00050 
00051     public AOneForStmt()
00052     {
00053     }
00054     public AOneForStmt(
00055         TFor _for_,
00056         TLPar _lPar_,
00057         PForInit _forInit_,
00058         TSemicolon _semicolon1_,
00059         PExp _exp_,
00060         TSemicolon _semicolon2_,
00061         PForUpdate _forUpdate_,
00062         TRPar _rPar_,
00063         PStmt _stmt_)
00064     {
00065         setFor(_for_);
00066 
00067         setLPar(_lPar_);
00068 
00069         setForInit(_forInit_);
00070 
00071         setSemicolon1(_semicolon1_);
00072 
00073         setExp(_exp_);
00074 
00075         setSemicolon2(_semicolon2_);
00076 
00077         setForUpdate(_forUpdate_);
00078 
00079         setRPar(_rPar_);
00080 
00081         setStmt(_stmt_);
00082 
00083     }
00084     public void apply(Switch sw)
00085     {
00086         ((Analysis) sw).caseAOneForStmt(this);
00087     }
00088     public Object clone()
00089     {
00090         return new AOneForStmt(
00091             (TFor) cloneNode(_for_),
00092             (TLPar) cloneNode(_lPar_),
00093             (PForInit) cloneNode(_forInit_),
00094             (TSemicolon) cloneNode(_semicolon1_),
00095             (PExp) cloneNode(_exp_),
00096             (TSemicolon) cloneNode(_semicolon2_),
00097             (PForUpdate) cloneNode(_forUpdate_),
00098             (TRPar) cloneNode(_rPar_),
00099             (PStmt) cloneNode(_stmt_));
00100     }
00101     public PExp getExp()
00102     {
00103         return _exp_;
00104     }
00105     public TFor getFor()
00106     {
00107         return _for_;
00108     }
00109     public PForInit getForInit()
00110     {
00111         return _forInit_;
00112     }
00113     public PForUpdate getForUpdate()
00114     {
00115         return _forUpdate_;
00116     }
00117     public TLPar getLPar()
00118     {
00119         return _lPar_;
00120     }
00121     public TRPar getRPar()
00122     {
00123         return _rPar_;
00124     }
00125     public TSemicolon getSemicolon1()
00126     {
00127         return _semicolon1_;
00128     }
00129     public TSemicolon getSemicolon2()
00130     {
00131         return _semicolon2_;
00132     }
00133     public PStmt getStmt()
00134     {
00135         return _stmt_;
00136     }
00137     void removeChild(Node child)
00138     {
00139         if(_for_ == child)
00140         {
00141             _for_ = null;
00142             return;
00143         }
00144 
00145         if(_lPar_ == child)
00146         {
00147             _lPar_ = null;
00148             return;
00149         }
00150 
00151         if(_forInit_ == child)
00152         {
00153             _forInit_ = null;
00154             return;
00155         }
00156 
00157         if(_semicolon1_ == child)
00158         {
00159             _semicolon1_ = null;
00160             return;
00161         }
00162 
00163         if(_exp_ == child)
00164         {
00165             _exp_ = null;
00166             return;
00167         }
00168 
00169         if(_semicolon2_ == child)
00170         {
00171             _semicolon2_ = null;
00172             return;
00173         }
00174 
00175         if(_forUpdate_ == child)
00176         {
00177             _forUpdate_ = null;
00178             return;
00179         }
00180 
00181         if(_rPar_ == child)
00182         {
00183             _rPar_ = null;
00184             return;
00185         }
00186 
00187         if(_stmt_ == child)
00188         {
00189             _stmt_ = null;
00190             return;
00191         }
00192 
00193     }
00194     void replaceChild(Node oldChild, Node newChild)
00195     {
00196         if(_for_ == oldChild)
00197         {
00198             setFor((TFor) newChild);
00199             return;
00200         }
00201 
00202         if(_lPar_ == oldChild)
00203         {
00204             setLPar((TLPar) newChild);
00205             return;
00206         }
00207 
00208         if(_forInit_ == oldChild)
00209         {
00210             setForInit((PForInit) newChild);
00211             return;
00212         }
00213 
00214         if(_semicolon1_ == oldChild)
00215         {
00216             setSemicolon1((TSemicolon) newChild);
00217             return;
00218         }
00219 
00220         if(_exp_ == oldChild)
00221         {
00222             setExp((PExp) newChild);
00223             return;
00224         }
00225 
00226         if(_semicolon2_ == oldChild)
00227         {
00228             setSemicolon2((TSemicolon) newChild);
00229             return;
00230         }
00231 
00232         if(_forUpdate_ == oldChild)
00233         {
00234             setForUpdate((PForUpdate) newChild);
00235             return;
00236         }
00237 
00238         if(_rPar_ == oldChild)
00239         {
00240             setRPar((TRPar) newChild);
00241             return;
00242         }
00243 
00244         if(_stmt_ == oldChild)
00245         {
00246             setStmt((PStmt) newChild);
00247             return;
00248         }
00249 
00250     }
00251     public void setExp(PExp node)
00252     {
00253         if(_exp_ != null)
00254         {
00255             _exp_.parent(null);
00256         }
00257 
00258         if(node != null)
00259         {
00260             if(node.parent() != null)
00261             {
00262                 node.parent().removeChild(node);
00263             }
00264 
00265             node.parent(this);
00266         }
00267 
00268         _exp_ = node;
00269     }
00270     public void setFor(TFor node)
00271     {
00272         if(_for_ != null)
00273         {
00274             _for_.parent(null);
00275         }
00276 
00277         if(node != null)
00278         {
00279             if(node.parent() != null)
00280             {
00281                 node.parent().removeChild(node);
00282             }
00283 
00284             node.parent(this);
00285         }
00286 
00287         _for_ = node;
00288     }
00289     public void setForInit(PForInit node)
00290     {
00291         if(_forInit_ != null)
00292         {
00293             _forInit_.parent(null);
00294         }
00295 
00296         if(node != null)
00297         {
00298             if(node.parent() != null)
00299             {
00300                 node.parent().removeChild(node);
00301             }
00302 
00303             node.parent(this);
00304         }
00305 
00306         _forInit_ = node;
00307     }
00308     public void setForUpdate(PForUpdate node)
00309     {
00310         if(_forUpdate_ != null)
00311         {
00312             _forUpdate_.parent(null);
00313         }
00314 
00315         if(node != null)
00316         {
00317             if(node.parent() != null)
00318             {
00319                 node.parent().removeChild(node);
00320             }
00321 
00322             node.parent(this);
00323         }
00324 
00325         _forUpdate_ = node;
00326     }
00327     public void setLPar(TLPar node)
00328     {
00329         if(_lPar_ != null)
00330         {
00331             _lPar_.parent(null);
00332         }
00333 
00334         if(node != null)
00335         {
00336             if(node.parent() != null)
00337             {
00338                 node.parent().removeChild(node);
00339             }
00340 
00341             node.parent(this);
00342         }
00343 
00344         _lPar_ = node;
00345     }
00346     public void setRPar(TRPar node)
00347     {
00348         if(_rPar_ != null)
00349         {
00350             _rPar_.parent(null);
00351         }
00352 
00353         if(node != null)
00354         {
00355             if(node.parent() != null)
00356             {
00357                 node.parent().removeChild(node);
00358             }
00359 
00360             node.parent(this);
00361         }
00362 
00363         _rPar_ = node;
00364     }
00365     public void setSemicolon1(TSemicolon node)
00366     {
00367         if(_semicolon1_ != null)
00368         {
00369             _semicolon1_.parent(null);
00370         }
00371 
00372         if(node != null)
00373         {
00374             if(node.parent() != null)
00375             {
00376                 node.parent().removeChild(node);
00377             }
00378 
00379             node.parent(this);
00380         }
00381 
00382         _semicolon1_ = node;
00383     }
00384     public void setSemicolon2(TSemicolon node)
00385     {
00386         if(_semicolon2_ != null)
00387         {
00388             _semicolon2_.parent(null);
00389         }
00390 
00391         if(node != null)
00392         {
00393             if(node.parent() != null)
00394             {
00395                 node.parent().removeChild(node);
00396             }
00397 
00398             node.parent(this);
00399         }
00400 
00401         _semicolon2_ = node;
00402     }
00403     public void setStmt(PStmt node)
00404     {
00405         if(_stmt_ != null)
00406         {
00407             _stmt_.parent(null);
00408         }
00409 
00410         if(node != null)
00411         {
00412             if(node.parent() != null)
00413             {
00414                 node.parent().removeChild(node);
00415             }
00416 
00417             node.parent(this);
00418         }
00419 
00420         _stmt_ = node;
00421     }
00422     public String toString()
00423     {
00424         return ""
00425             + toString(_for_)
00426             + toString(_lPar_)
00427             + toString(_forInit_)
00428             + toString(_semicolon1_)
00429             + toString(_exp_)
00430             + toString(_semicolon2_)
00431             + toString(_forUpdate_)
00432             + toString(_rPar_)
00433             + toString(_stmt_);
00434     }
00435 }

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