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 X1PImportDeclaration extends XPImportDeclaration
00040 {
00041 private XPImportDeclaration _xPImportDeclaration_;
00042 private PImportDeclaration _pImportDeclaration_;
00043
00044 public X1PImportDeclaration()
00045 {
00046 }
00047 public X1PImportDeclaration(
00048 XPImportDeclaration _xPImportDeclaration_,
00049 PImportDeclaration _pImportDeclaration_)
00050 {
00051 setXPImportDeclaration(_xPImportDeclaration_);
00052 setPImportDeclaration(_pImportDeclaration_);
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 PImportDeclaration getPImportDeclaration()
00063 {
00064 return _pImportDeclaration_;
00065 }
00066 public XPImportDeclaration getXPImportDeclaration()
00067 {
00068 return _xPImportDeclaration_;
00069 }
00070 void removeChild(Node child)
00071 {
00072 if(_xPImportDeclaration_ == child)
00073 {
00074 _xPImportDeclaration_ = null;
00075 }
00076
00077 if(_pImportDeclaration_ == child)
00078 {
00079 _pImportDeclaration_ = null;
00080 }
00081 }
00082 void replaceChild(Node oldChild, Node newChild)
00083 {
00084 }
00085 public void setPImportDeclaration(PImportDeclaration node)
00086 {
00087 if(_pImportDeclaration_ != null)
00088 {
00089 _pImportDeclaration_.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 _pImportDeclaration_ = node;
00103 }
00104 public void setXPImportDeclaration(XPImportDeclaration node)
00105 {
00106 if(_xPImportDeclaration_ != null)
00107 {
00108 _xPImportDeclaration_.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 _xPImportDeclaration_ = node;
00122 }
00123 public String toString()
00124 {
00125 return "" +
00126 toString(_xPImportDeclaration_) +
00127 toString(_pImportDeclaration_);
00128 }
00129 }