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

AOneDoStmt.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 AOneDoStmt extends POneDoStmt
00040 {
00041     private TDo _do_;
00042     private PStmt _stmt_;
00043     private TWhile _while_;
00044     private TLPar _lPar_;
00045     private PExp _exp_;
00046     private TRPar _rPar_;
00047     private TSemicolon _semicolon_;
00048 
00049     public AOneDoStmt()
00050     {
00051     }
00052     public AOneDoStmt(
00053         TDo _do_,
00054         PStmt _stmt_,
00055         TWhile _while_,
00056         TLPar _lPar_,
00057         PExp _exp_,
00058         TRPar _rPar_,
00059         TSemicolon _semicolon_)
00060     {
00061         setDo(_do_);
00062 
00063         setStmt(_stmt_);
00064 
00065         setWhile(_while_);
00066 
00067         setLPar(_lPar_);
00068 
00069         setExp(_exp_);
00070 
00071         setRPar(_rPar_);
00072 
00073         setSemicolon(_semicolon_);
00074 
00075     }
00076     public void apply(Switch sw)
00077     {
00078         ((Analysis) sw).caseAOneDoStmt(this);
00079     }
00080     public Object clone()
00081     {
00082         return new AOneDoStmt(
00083             (TDo) cloneNode(_do_),
00084             (PStmt) cloneNode(_stmt_),
00085             (TWhile) cloneNode(_while_),
00086             (TLPar) cloneNode(_lPar_),
00087             (PExp) cloneNode(_exp_),
00088             (TRPar) cloneNode(_rPar_),
00089             (TSemicolon) cloneNode(_semicolon_));
00090     }
00091     public TDo getDo()
00092     {
00093         return _do_;
00094     }
00095     public PExp getExp()
00096     {
00097         return _exp_;
00098     }
00099     public TLPar getLPar()
00100     {
00101         return _lPar_;
00102     }
00103     public TRPar getRPar()
00104     {
00105         return _rPar_;
00106     }
00107     public TSemicolon getSemicolon()
00108     {
00109         return _semicolon_;
00110     }
00111     public PStmt getStmt()
00112     {
00113         return _stmt_;
00114     }
00115     public TWhile getWhile()
00116     {
00117         return _while_;
00118     }
00119     void removeChild(Node child)
00120     {
00121         if(_do_ == child)
00122         {
00123             _do_ = null;
00124             return;
00125         }
00126 
00127         if(_stmt_ == child)
00128         {
00129             _stmt_ = null;
00130             return;
00131         }
00132 
00133         if(_while_ == child)
00134         {
00135             _while_ = null;
00136             return;
00137         }
00138 
00139         if(_lPar_ == child)
00140         {
00141             _lPar_ = null;
00142             return;
00143         }
00144 
00145         if(_exp_ == child)
00146         {
00147             _exp_ = null;
00148             return;
00149         }
00150 
00151         if(_rPar_ == child)
00152         {
00153             _rPar_ = null;
00154             return;
00155         }
00156 
00157         if(_semicolon_ == child)
00158         {
00159             _semicolon_ = null;
00160             return;
00161         }
00162 
00163     }
00164     void replaceChild(Node oldChild, Node newChild)
00165     {
00166         if(_do_ == oldChild)
00167         {
00168             setDo((TDo) newChild);
00169             return;
00170         }
00171 
00172         if(_stmt_ == oldChild)
00173         {
00174             setStmt((PStmt) newChild);
00175             return;
00176         }
00177 
00178         if(_while_ == oldChild)
00179         {
00180             setWhile((TWhile) newChild);
00181             return;
00182         }
00183 
00184         if(_lPar_ == oldChild)
00185         {
00186             setLPar((TLPar) newChild);
00187             return;
00188         }
00189 
00190         if(_exp_ == oldChild)
00191         {
00192             setExp((PExp) newChild);
00193             return;
00194         }
00195 
00196         if(_rPar_ == oldChild)
00197         {
00198             setRPar((TRPar) newChild);
00199             return;
00200         }
00201 
00202         if(_semicolon_ == oldChild)
00203         {
00204             setSemicolon((TSemicolon) newChild);
00205             return;
00206         }
00207 
00208     }
00209     public void setDo(TDo node)
00210     {
00211         if(_do_ != null)
00212         {
00213             _do_.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         _do_ = 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 setLPar(TLPar node)
00248     {
00249         if(_lPar_ != null)
00250         {
00251             _lPar_.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         _lPar_ = node;
00265     }
00266     public void setRPar(TRPar node)
00267     {
00268         if(_rPar_ != null)
00269         {
00270             _rPar_.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         _rPar_ = node;
00284     }
00285     public void setSemicolon(TSemicolon node)
00286     {
00287         if(_semicolon_ != null)
00288         {
00289             _semicolon_.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         _semicolon_ = node;
00303     }
00304     public void setStmt(PStmt node)
00305     {
00306         if(_stmt_ != null)
00307         {
00308             _stmt_.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         _stmt_ = node;
00322     }
00323     public void setWhile(TWhile node)
00324     {
00325         if(_while_ != null)
00326         {
00327             _while_.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         _while_ = node;
00341     }
00342     public String toString()
00343     {
00344         return ""
00345             + toString(_do_)
00346             + toString(_stmt_)
00347             + toString(_while_)
00348             + toString(_lPar_)
00349             + toString(_exp_)
00350             + toString(_rPar_)
00351             + toString(_semicolon_);
00352     }
00353 }

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