1 2 3 package soot.jimple.parser.node; 4 5 import soot.jimple.parser.analysis.*; 6 7 public final class Start extends Node 8 { 9 private PFile _pFile_; 10 private EOF _eof_; 11 12 public Start() 13 { 14 } 15 16 public Start( 17 PFile _pFile_, 18 EOF _eof_) 19 { 20 setPFile(_pFile_); 21 setEOF(_eof_); 22 } 23 24 public Object clone() 25 { 26 return new Start( 27 (PFile) cloneNode(_pFile_), 28 (EOF) cloneNode(_eof_)); 29 } 30 31 public void apply(Switch sw) 32 { 33 ((Analysis) sw).caseStart(this); 34 } 35 36 public PFile getPFile() 37 { 38 return _pFile_; 39 } 40 41 public void setPFile(PFile node) 42 { 43 if(_pFile_ != null) 44 { 45 _pFile_.parent(null); 46 } 47 48 if(node != null) 49 { 50 if(node.parent() != null) 51 { 52 node.parent().removeChild(node); 53 } 54 55 node.parent(this); 56 } 57 58 _pFile_ = node; 59 } 60 61 public EOF getEOF() 62 { 63 return _eof_; 64 } 65 66 public void setEOF(EOF node) 67 { 68 if(_eof_ != null) 69 { 70 _eof_.parent(null); 71 } 72 73 if(node != null) 74 { 75 if(node.parent() != null) 76 { 77 node.parent().removeChild(node); 78 } 79 80 node.parent(this); 81 } 82 83 _eof_ = node; 84 } 85 86 void removeChild(Node child) 87 { 88 if(_pFile_ == child) 89 { 90 _pFile_ = null; 91 return; 92 } 93 94 if(_eof_ == child) 95 { 96 _eof_ = null; 97 return; 98 } 99 } 100 101 void replaceChild(Node oldChild, Node newChild) 102 { 103 if(_pFile_ == oldChild) 104 { 105 setPFile((PFile) newChild); 106 return; 107 } 108 109 if(_eof_ == oldChild) 110 { 111 setEOF((EOF) newChild); 112 return; 113 } 114 } 115 116 public String toString() 117 { 118 return "" + 119 toString(_pFile_) + 120 toString(_eof_); 121 } 122 } 123 | Popular Tags |