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

APatternPattern.java

00001 package edu.ksu.cis.bandera.abstraction.specification.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 /* This file was generated by SableCC (http://www.sable.mcgill.ca/sablecc/). */
00037 
00038 import java.util.*;
00039 import edu.ksu.cis.bandera.abstraction.specification.analysis.*;
00040 
00041 public final class APatternPattern extends PPattern
00042 {
00043     private TLParen _lParen_;
00044     private PAnyId _lId_;
00045     private TComma _comma_;
00046     private PAnyId _rId_;
00047     private TRParen _rParen_;
00048     private TRightarrow _rightarrow_;
00049     private PTokenTokenSet _tokenTokenSet_;
00050     private TSemicolon _semicolon_;
00051 
00052     public APatternPattern()
00053     {
00054     }
00055     public APatternPattern(
00056         TLParen _lParen_,
00057         PAnyId _lId_,
00058         TComma _comma_,
00059         PAnyId _rId_,
00060         TRParen _rParen_,
00061         TRightarrow _rightarrow_,
00062         PTokenTokenSet _tokenTokenSet_,
00063         TSemicolon _semicolon_)
00064     {
00065         setLParen(_lParen_);
00066 
00067         setLId(_lId_);
00068 
00069         setComma(_comma_);
00070 
00071         setRId(_rId_);
00072 
00073         setRParen(_rParen_);
00074 
00075         setRightarrow(_rightarrow_);
00076 
00077         setTokenTokenSet(_tokenTokenSet_);
00078 
00079         setSemicolon(_semicolon_);
00080 
00081     }
00082     public void apply(Switch sw)
00083     {
00084         ((Analysis) sw).caseAPatternPattern(this);
00085     }
00086     public Object clone()
00087     {
00088         return new APatternPattern(
00089             (TLParen) cloneNode(_lParen_),
00090             (PAnyId) cloneNode(_lId_),
00091             (TComma) cloneNode(_comma_),
00092             (PAnyId) cloneNode(_rId_),
00093             (TRParen) cloneNode(_rParen_),
00094             (TRightarrow) cloneNode(_rightarrow_),
00095             (PTokenTokenSet) cloneNode(_tokenTokenSet_),
00096             (TSemicolon) cloneNode(_semicolon_));
00097     }
00098     public TComma getComma()
00099     {
00100         return _comma_;
00101     }
00102     public PAnyId getLId()
00103     {
00104         return _lId_;
00105     }
00106     public TLParen getLParen()
00107     {
00108         return _lParen_;
00109     }
00110     public PAnyId getRId()
00111     {
00112         return _rId_;
00113     }
00114     public TRightarrow getRightarrow()
00115     {
00116         return _rightarrow_;
00117     }
00118     public TRParen getRParen()
00119     {
00120         return _rParen_;
00121     }
00122     public TSemicolon getSemicolon()
00123     {
00124         return _semicolon_;
00125     }
00126     public PTokenTokenSet getTokenTokenSet()
00127     {
00128         return _tokenTokenSet_;
00129     }
00130     void removeChild(Node child)
00131     {
00132         if(_lParen_ == child)
00133         {
00134             _lParen_ = null;
00135             return;
00136         }
00137 
00138         if(_lId_ == child)
00139         {
00140             _lId_ = null;
00141             return;
00142         }
00143 
00144         if(_comma_ == child)
00145         {
00146             _comma_ = null;
00147             return;
00148         }
00149 
00150         if(_rId_ == child)
00151         {
00152             _rId_ = null;
00153             return;
00154         }
00155 
00156         if(_rParen_ == child)
00157         {
00158             _rParen_ = null;
00159             return;
00160         }
00161 
00162         if(_rightarrow_ == child)
00163         {
00164             _rightarrow_ = null;
00165             return;
00166         }
00167 
00168         if(_tokenTokenSet_ == child)
00169         {
00170             _tokenTokenSet_ = null;
00171             return;
00172         }
00173 
00174         if(_semicolon_ == child)
00175         {
00176             _semicolon_ = null;
00177             return;
00178         }
00179 
00180     }
00181     void replaceChild(Node oldChild, Node newChild)
00182     {
00183         if(_lParen_ == oldChild)
00184         {
00185             setLParen((TLParen) newChild);
00186             return;
00187         }
00188 
00189         if(_lId_ == oldChild)
00190         {
00191             setLId((PAnyId) newChild);
00192             return;
00193         }
00194 
00195         if(_comma_ == oldChild)
00196         {
00197             setComma((TComma) newChild);
00198             return;
00199         }
00200 
00201         if(_rId_ == oldChild)
00202         {
00203             setRId((PAnyId) newChild);
00204             return;
00205         }
00206 
00207         if(_rParen_ == oldChild)
00208         {
00209             setRParen((TRParen) newChild);
00210             return;
00211         }
00212 
00213         if(_rightarrow_ == oldChild)
00214         {
00215             setRightarrow((TRightarrow) newChild);
00216             return;
00217         }
00218 
00219         if(_tokenTokenSet_ == oldChild)
00220         {
00221             setTokenTokenSet((PTokenTokenSet) newChild);
00222             return;
00223         }
00224 
00225         if(_semicolon_ == oldChild)
00226         {
00227             setSemicolon((TSemicolon) newChild);
00228             return;
00229         }
00230 
00231     }
00232     public void setComma(TComma node)
00233     {
00234         if(_comma_ != null)
00235         {
00236             _comma_.parent(null);
00237         }
00238 
00239         if(node != null)
00240         {
00241             if(node.parent() != null)
00242             {
00243                 node.parent().removeChild(node);
00244             }
00245 
00246             node.parent(this);
00247         }
00248 
00249         _comma_ = node;
00250     }
00251     public void setLId(PAnyId node)
00252     {
00253         if(_lId_ != null)
00254         {
00255             _lId_.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         _lId_ = node;
00269     }
00270     public void setLParen(TLParen node)
00271     {
00272         if(_lParen_ != null)
00273         {
00274             _lParen_.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         _lParen_ = node;
00288     }
00289     public void setRId(PAnyId node)
00290     {
00291         if(_rId_ != null)
00292         {
00293             _rId_.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         _rId_ = node;
00307     }
00308     public void setRightarrow(TRightarrow node)
00309     {
00310         if(_rightarrow_ != null)
00311         {
00312             _rightarrow_.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         _rightarrow_ = node;
00326     }
00327     public void setRParen(TRParen node)
00328     {
00329         if(_rParen_ != null)
00330         {
00331             _rParen_.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         _rParen_ = node;
00345     }
00346     public void setSemicolon(TSemicolon node)
00347     {
00348         if(_semicolon_ != null)
00349         {
00350             _semicolon_.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         _semicolon_ = node;
00364     }
00365     public void setTokenTokenSet(PTokenTokenSet node)
00366     {
00367         if(_tokenTokenSet_ != null)
00368         {
00369             _tokenTokenSet_.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         _tokenTokenSet_ = node;
00383     }
00384     public String toString()
00385     {
00386         return ""
00387             + toString(_lParen_)
00388             + toString(_lId_)
00389             + toString(_comma_)
00390             + toString(_rId_)
00391             + toString(_rParen_)
00392             + toString(_rightarrow_)
00393             + toString(_tokenTokenSet_)
00394             + toString(_semicolon_);
00395     }
00396 }

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