00001 package edu.ksu.cis.bandera.jjjc.node;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 import ca.mcgill.sable.util.*;
00037 import edu.ksu.cis.bandera.jjjc.analysis.*;
00038
00039 public final class X1PVariableDeclarator extends XPVariableDeclarator
00040 {
00041 private XPVariableDeclarator _xPVariableDeclarator_;
00042 private PVariableDeclarator _pVariableDeclarator_;
00043
00044 public X1PVariableDeclarator()
00045 {
00046 }
00047 public X1PVariableDeclarator(
00048 XPVariableDeclarator _xPVariableDeclarator_,
00049 PVariableDeclarator _pVariableDeclarator_)
00050 {
00051 setXPVariableDeclarator(_xPVariableDeclarator_);
00052 setPVariableDeclarator(_pVariableDeclarator_);
00053 }
00054 public void apply(Switch sw)
00055 {
00056 throw new RuntimeException("Switch not supported.");
00057 }
00058 public Object clone()
00059 {
00060 throw new RuntimeException("Unsupported Operation");
00061 }
00062 public PVariableDeclarator getPVariableDeclarator()
00063 {
00064 return _pVariableDeclarator_;
00065 }
00066 public XPVariableDeclarator getXPVariableDeclarator()
00067 {
00068 return _xPVariableDeclarator_;
00069 }
00070 void removeChild(Node child)
00071 {
00072 if(_xPVariableDeclarator_ == child)
00073 {
00074 _xPVariableDeclarator_ = null;
00075 }
00076
00077 if(_pVariableDeclarator_ == child)
00078 {
00079 _pVariableDeclarator_ = null;
00080 }
00081 }
00082 void replaceChild(Node oldChild, Node newChild)
00083 {
00084 }
00085 public void setPVariableDeclarator(PVariableDeclarator node)
00086 {
00087 if(_pVariableDeclarator_ != null)
00088 {
00089 _pVariableDeclarator_.parent(null);
00090 }
00091
00092 if(node != null)
00093 {
00094 if(node.parent() != null)
00095 {
00096 node.parent().removeChild(node);
00097 }
00098
00099 node.parent(this);
00100 }
00101
00102 _pVariableDeclarator_ = node;
00103 }
00104 public void setXPVariableDeclarator(XPVariableDeclarator node)
00105 {
00106 if(_xPVariableDeclarator_ != null)
00107 {
00108 _xPVariableDeclarator_.parent(null);
00109 }
00110
00111 if(node != null)
00112 {
00113 if(node.parent() != null)
00114 {
00115 node.parent().removeChild(node);
00116 }
00117
00118 node.parent(this);
00119 }
00120
00121 _xPVariableDeclarator_ = node;
00122 }
00123 public String toString()
00124 {
00125 return "" +
00126 toString(_xPVariableDeclarator_) +
00127 toString(_pVariableDeclarator_);
00128 }
00129 }