| 1 | /* This file was generated by SableCC (http://www.sablecc.org/). */ |
| 2 | |
| 3 | package uk.co.zonetora.fj.ast.node; |
| 4 | |
| 5 | import uk.co.zonetora.fj.ast.analysis.*; |
| 6 | |
| 7 | public final class Start extends Node |
| 8 | { |
| 9 | private PProg _pProg_; |
| 10 | private EOF _eof_; |
| 11 | |
| 12 | public Start() |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | public Start( |
| 17 | PProg _pProg_, |
| 18 | EOF _eof_) |
| 19 | { |
| 20 | setPProg(_pProg_); |
| 21 | setEOF(_eof_); |
| 22 | } |
| 23 | |
| 24 | public Object clone() |
| 25 | { |
| 26 | return new Start( |
| 27 | (PProg) cloneNode(_pProg_), |
| 28 | (EOF) cloneNode(_eof_)); |
| 29 | } |
| 30 | |
| 31 | public void apply(Switch sw) |
| 32 | { |
| 33 | ((Analysis) sw).caseStart(this); |
| 34 | } |
| 35 | |
| 36 | public PProg getPProg() |
| 37 | { |
| 38 | return _pProg_; |
| 39 | } |
| 40 | |
| 41 | public void setPProg(PProg node) |
| 42 | { |
| 43 | if(_pProg_ != null) |
| 44 | { |
| 45 | _pProg_.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 | _pProg_ = 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(_pProg_ == child) |
| 89 | { |
| 90 | _pProg_ = 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(_pProg_ == oldChild) |
| 104 | { |
| 105 | setPProg((PProg) 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(_pProg_) + |
| 120 | toString(_eof_); |
| 121 | } |
| 122 | } |