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

AAnyPattern.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 AAnyPattern extends PPattern
00042 {
00043     private TAny _any_;
00044     private TRightarrow _rightarrow_;
00045     private PTokenTokenSet _tokenTokenSet_;
00046     private TSemicolon _semicolon_;
00047 
00048     public AAnyPattern()
00049     {
00050     }
00051     public AAnyPattern(
00052         TAny _any_,
00053         TRightarrow _rightarrow_,
00054         PTokenTokenSet _tokenTokenSet_,
00055         TSemicolon _semicolon_)
00056     {
00057         setAny(_any_);
00058 
00059         setRightarrow(_rightarrow_);
00060 
00061         setTokenTokenSet(_tokenTokenSet_);
00062 
00063         setSemicolon(_semicolon_);
00064 
00065     }
00066     public void apply(Switch sw)
00067     {
00068         ((Analysis) sw).caseAAnyPattern(this);
00069     }
00070     public Object clone()
00071     {
00072         return new AAnyPattern(
00073             (TAny) cloneNode(_any_),
00074             (TRightarrow) cloneNode(_rightarrow_),
00075             (PTokenTokenSet) cloneNode(_tokenTokenSet_),
00076             (TSemicolon) cloneNode(_semicolon_));
00077     }
00078     public TAny getAny()
00079     {
00080         return _any_;
00081     }
00082     public TRightarrow getRightarrow()
00083     {
00084         return _rightarrow_;
00085     }
00086     public TSemicolon getSemicolon()
00087     {
00088         return _semicolon_;
00089     }
00090     public PTokenTokenSet getTokenTokenSet()
00091     {
00092         return _tokenTokenSet_;
00093     }
00094     void removeChild(Node child)
00095     {
00096         if(_any_ == child)
00097         {
00098             _any_ = null;
00099             return;
00100         }
00101 
00102         if(_rightarrow_ == child)
00103         {
00104             _rightarrow_ = null;
00105             return;
00106         }
00107 
00108         if(_tokenTokenSet_ == child)
00109         {
00110             _tokenTokenSet_ = null;
00111             return;
00112         }
00113 
00114         if(_semicolon_ == child)
00115         {
00116             _semicolon_ = null;
00117             return;
00118         }
00119 
00120     }
00121     void replaceChild(Node oldChild, Node newChild)
00122     {
00123         if(_any_ == oldChild)
00124         {
00125             setAny((TAny) newChild);
00126             return;
00127         }
00128 
00129         if(_rightarrow_ == oldChild)
00130         {
00131             setRightarrow((TRightarrow) newChild);
00132             return;
00133         }
00134 
00135         if(_tokenTokenSet_ == oldChild)
00136         {
00137             setTokenTokenSet((PTokenTokenSet) newChild);
00138             return;
00139         }
00140 
00141         if(_semicolon_ == oldChild)
00142         {
00143             setSemicolon((TSemicolon) newChild);
00144             return;
00145         }
00146 
00147     }
00148     public void setAny(TAny node)
00149     {
00150         if(_any_ != null)
00151         {
00152             _any_.parent(null);
00153         }
00154 
00155         if(node != null)
00156         {
00157             if(node.parent() != null)
00158             {
00159                 node.parent().removeChild(node);
00160             }
00161 
00162             node.parent(this);
00163         }
00164 
00165         _any_ = node;
00166     }
00167     public void setRightarrow(TRightarrow node)
00168     {
00169         if(_rightarrow_ != null)
00170         {
00171             _rightarrow_.parent(null);
00172         }
00173 
00174         if(node != null)
00175         {
00176             if(node.parent() != null)
00177             {
00178                 node.parent().removeChild(node);
00179             }
00180 
00181             node.parent(this);
00182         }
00183 
00184         _rightarrow_ = node;
00185     }
00186     public void setSemicolon(TSemicolon node)
00187     {
00188         if(_semicolon_ != null)
00189         {
00190             _semicolon_.parent(null);
00191         }
00192 
00193         if(node != null)
00194         {
00195             if(node.parent() != null)
00196             {
00197                 node.parent().removeChild(node);
00198             }
00199 
00200             node.parent(this);
00201         }
00202 
00203         _semicolon_ = node;
00204     }
00205     public void setTokenTokenSet(PTokenTokenSet node)
00206     {
00207         if(_tokenTokenSet_ != null)
00208         {
00209             _tokenTokenSet_.parent(null);
00210         }
00211 
00212         if(node != null)
00213         {
00214             if(node.parent() != null)
00215             {
00216                 node.parent().removeChild(node);
00217             }
00218 
00219             node.parent(this);
00220         }
00221 
00222         _tokenTokenSet_ = node;
00223     }
00224     public String toString()
00225     {
00226         return ""
00227             + toString(_any_)
00228             + toString(_rightarrow_)
00229             + toString(_tokenTokenSet_)
00230             + toString(_semicolon_);
00231     }
00232 }

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