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

AExpressionPropositionDefinition.java

00001 package edu.ksu.cis.bandera.specification.predicate.node;
00002 
00003 /* This file was generated by SableCC (http://www.sable.mcgill.ca/sablecc/). */
00004 
00005 import java.util.*;
00006 import edu.ksu.cis.bandera.specification.predicate.analysis.*;
00007 
00008 public final class AExpressionPropositionDefinition extends PPropositionDefinition
00009 {
00010     private TExpression _expression_;
00011     private TId _id_;
00012     private TLParen _lParen_;
00013     private PParams _params_;
00014     private TRParen _rParen_;
00015     private PColonExp _colonExp_;
00016     private TSemicolon _semicolon_;
00017     private final LinkedList _comment_ = new TypedLinkedList(new Comment_Cast());
00018 
00019     private class Comment_Cast implements Cast
00020     {
00021         public Object cast(Object o)
00022         {
00023             PComment node = (PComment) o;
00024 
00025             if((node.parent() != null) &&
00026                 (node.parent() != AExpressionPropositionDefinition.this))
00027             {
00028                 node.parent().removeChild(node);
00029             }
00030 
00031             if((node.parent() == null) ||
00032                 (node.parent() != AExpressionPropositionDefinition.this))
00033             {
00034                 node.parent(AExpressionPropositionDefinition.this);
00035             }
00036 
00037             return node;
00038         }
00039     }
00040     public AExpressionPropositionDefinition()
00041     {
00042     }
00043     public AExpressionPropositionDefinition(
00044         TExpression _expression_,
00045         TId _id_,
00046         TLParen _lParen_,
00047         PParams _params_,
00048         TRParen _rParen_,
00049         PColonExp _colonExp_,
00050         TSemicolon _semicolon_,
00051         XPComment _comment_)
00052     {
00053         setExpression(_expression_);
00054 
00055         setId(_id_);
00056 
00057         setLParen(_lParen_);
00058 
00059         setParams(_params_);
00060 
00061         setRParen(_rParen_);
00062 
00063         setColonExp(_colonExp_);
00064 
00065         setSemicolon(_semicolon_);
00066 
00067         if(_comment_ != null)
00068         {
00069             while(_comment_ instanceof X1PComment)
00070             {
00071                 this._comment_.addFirst(((X1PComment) _comment_).getPComment());
00072                 _comment_ = ((X1PComment) _comment_).getXPComment();
00073             }
00074             this._comment_.addFirst(((X2PComment) _comment_).getPComment());
00075         }
00076 
00077     }
00078     public AExpressionPropositionDefinition(
00079         TExpression _expression_,
00080         TId _id_,
00081         TLParen _lParen_,
00082         PParams _params_,
00083         TRParen _rParen_,
00084         PColonExp _colonExp_,
00085         TSemicolon _semicolon_,
00086         List _comment_)
00087     {
00088         setExpression(_expression_);
00089 
00090         setId(_id_);
00091 
00092         setLParen(_lParen_);
00093 
00094         setParams(_params_);
00095 
00096         setRParen(_rParen_);
00097 
00098         setColonExp(_colonExp_);
00099 
00100         setSemicolon(_semicolon_);
00101 
00102         {
00103             Object temp[] = _comment_.toArray();
00104             for(int i = 0; i < temp.length; i++)
00105             {
00106                 this._comment_.add(temp[i]);
00107             }
00108         }
00109 
00110     }
00111     public void apply(Switch sw)
00112     {
00113         ((Analysis) sw).caseAExpressionPropositionDefinition(this);
00114     }
00115     public Object clone()
00116     {
00117         return new AExpressionPropositionDefinition(
00118             (TExpression) cloneNode(_expression_),
00119             (TId) cloneNode(_id_),
00120             (TLParen) cloneNode(_lParen_),
00121             (PParams) cloneNode(_params_),
00122             (TRParen) cloneNode(_rParen_),
00123             (PColonExp) cloneNode(_colonExp_),
00124             (TSemicolon) cloneNode(_semicolon_),
00125             cloneList(_comment_));
00126     }
00127     public PColonExp getColonExp()
00128     {
00129         return _colonExp_;
00130     }
00131     public LinkedList getComment()
00132     {
00133         return _comment_;
00134     }
00135     public TExpression getExpression()
00136     {
00137         return _expression_;
00138     }
00139     public TId getId()
00140     {
00141         return _id_;
00142     }
00143     public TLParen getLParen()
00144     {
00145         return _lParen_;
00146     }
00147     public PParams getParams()
00148     {
00149         return _params_;
00150     }
00151     public TRParen getRParen()
00152     {
00153         return _rParen_;
00154     }
00155     public TSemicolon getSemicolon()
00156     {
00157         return _semicolon_;
00158     }
00159     void removeChild(Node child)
00160     {
00161         if(_expression_ == child)
00162         {
00163             _expression_ = null;
00164             return;
00165         }
00166 
00167         if(_id_ == child)
00168         {
00169             _id_ = null;
00170             return;
00171         }
00172 
00173         if(_lParen_ == child)
00174         {
00175             _lParen_ = null;
00176             return;
00177         }
00178 
00179         if(_params_ == child)
00180         {
00181             _params_ = null;
00182             return;
00183         }
00184 
00185         if(_rParen_ == child)
00186         {
00187             _rParen_ = null;
00188             return;
00189         }
00190 
00191         if(_colonExp_ == child)
00192         {
00193             _colonExp_ = null;
00194             return;
00195         }
00196 
00197         if(_semicolon_ == child)
00198         {
00199             _semicolon_ = null;
00200             return;
00201         }
00202 
00203         if(_comment_.remove(child))
00204         {
00205             return;
00206         }
00207 
00208     }
00209     void replaceChild(Node oldChild, Node newChild)
00210     {
00211         if(_expression_ == oldChild)
00212         {
00213             setExpression((TExpression) newChild);
00214             return;
00215         }
00216 
00217         if(_id_ == oldChild)
00218         {
00219             setId((TId) newChild);
00220             return;
00221         }
00222 
00223         if(_lParen_ == oldChild)
00224         {
00225             setLParen((TLParen) newChild);
00226             return;
00227         }
00228 
00229         if(_params_ == oldChild)
00230         {
00231             setParams((PParams) newChild);
00232             return;
00233         }
00234 
00235         if(_rParen_ == oldChild)
00236         {
00237             setRParen((TRParen) newChild);
00238             return;
00239         }
00240 
00241         if(_colonExp_ == oldChild)
00242         {
00243             setColonExp((PColonExp) newChild);
00244             return;
00245         }
00246 
00247         if(_semicolon_ == oldChild)
00248         {
00249             setSemicolon((TSemicolon) newChild);
00250             return;
00251         }
00252 
00253         for(ListIterator i = _comment_.listIterator(); i.hasNext();)
00254         {
00255             if(i.next() == oldChild)
00256             {
00257                 if(newChild != null)
00258                 {
00259                     i.set(newChild);
00260                     oldChild.parent(null);
00261                     return;
00262                 }
00263 
00264                 i.remove();
00265                 oldChild.parent(null);
00266                 return;
00267             }
00268         }
00269 
00270     }
00271     public void setColonExp(PColonExp node)
00272     {
00273         if(_colonExp_ != null)
00274         {
00275             _colonExp_.parent(null);
00276         }
00277 
00278         if(node != null)
00279         {
00280             if(node.parent() != null)
00281             {
00282                 node.parent().removeChild(node);
00283             }
00284 
00285             node.parent(this);
00286         }
00287 
00288         _colonExp_ = node;
00289     }
00290     public void setComment(List list)
00291     {
00292         Object temp[] = list.toArray();
00293         for(int i = 0; i < temp.length; i++)
00294         {
00295             _comment_.add(temp[i]);
00296         }
00297     }
00298     public void setExpression(TExpression node)
00299     {
00300         if(_expression_ != null)
00301         {
00302             _expression_.parent(null);
00303         }
00304 
00305         if(node != null)
00306         {
00307             if(node.parent() != null)
00308             {
00309                 node.parent().removeChild(node);
00310             }
00311 
00312             node.parent(this);
00313         }
00314 
00315         _expression_ = node;
00316     }
00317     public void setId(TId node)
00318     {
00319         if(_id_ != null)
00320         {
00321             _id_.parent(null);
00322         }
00323 
00324         if(node != null)
00325         {
00326             if(node.parent() != null)
00327             {
00328                 node.parent().removeChild(node);
00329             }
00330 
00331             node.parent(this);
00332         }
00333 
00334         _id_ = node;
00335     }
00336     public void setLParen(TLParen node)
00337     {
00338         if(_lParen_ != null)
00339         {
00340             _lParen_.parent(null);
00341         }
00342 
00343         if(node != null)
00344         {
00345             if(node.parent() != null)
00346             {
00347                 node.parent().removeChild(node);
00348             }
00349 
00350             node.parent(this);
00351         }
00352 
00353         _lParen_ = node;
00354     }
00355     public void setParams(PParams node)
00356     {
00357         if(_params_ != null)
00358         {
00359             _params_.parent(null);
00360         }
00361 
00362         if(node != null)
00363         {
00364             if(node.parent() != null)
00365             {
00366                 node.parent().removeChild(node);
00367             }
00368 
00369             node.parent(this);
00370         }
00371 
00372         _params_ = node;
00373     }
00374     public void setRParen(TRParen node)
00375     {
00376         if(_rParen_ != null)
00377         {
00378             _rParen_.parent(null);
00379         }
00380 
00381         if(node != null)
00382         {
00383             if(node.parent() != null)
00384             {
00385                 node.parent().removeChild(node);
00386             }
00387 
00388             node.parent(this);
00389         }
00390 
00391         _rParen_ = node;
00392     }
00393     public void setSemicolon(TSemicolon node)
00394     {
00395         if(_semicolon_ != null)
00396         {
00397             _semicolon_.parent(null);
00398         }
00399 
00400         if(node != null)
00401         {
00402             if(node.parent() != null)
00403             {
00404                 node.parent().removeChild(node);
00405             }
00406 
00407             node.parent(this);
00408         }
00409 
00410         _semicolon_ = node;
00411     }
00412     public String toString()
00413     {
00414         return ""
00415             + toString(_expression_)
00416             + toString(_id_)
00417             + toString(_lParen_)
00418             + toString(_params_)
00419             + toString(_rParen_)
00420             + toString(_colonExp_)
00421             + toString(_semicolon_)
00422             + toString(_comment_);
00423     }
00424 }

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