01: /* This file was generated by SableCC (http://www.sablecc.org/). */
02:
03: package org.sablecc.sablecc.node;
04:
05: import org.sablecc.sablecc.analysis.*;
06:
07: public final class Start extends Node {
08: private PGrammar _pGrammar_;
09: private EOF _eof_;
10:
11: public Start() {
12: }
13:
14: public Start(PGrammar _pGrammar_, EOF _eof_) {
15: setPGrammar(_pGrammar_);
16: setEOF(_eof_);
17: }
18:
19: public Object clone() {
20: return new Start((PGrammar) cloneNode(_pGrammar_),
21: (EOF) cloneNode(_eof_));
22: }
23:
24: public void apply(Switch sw) {
25: ((Analysis) sw).caseStart(this );
26: }
27:
28: public PGrammar getPGrammar() {
29: return _pGrammar_;
30: }
31:
32: public void setPGrammar(PGrammar node) {
33: if (_pGrammar_ != null) {
34: _pGrammar_.parent(null);
35: }
36:
37: if (node != null) {
38: if (node.parent() != null) {
39: node.parent().removeChild(node);
40: }
41:
42: node.parent(this );
43: }
44:
45: _pGrammar_ = node;
46: }
47:
48: public EOF getEOF() {
49: return _eof_;
50: }
51:
52: public void setEOF(EOF node) {
53: if (_eof_ != null) {
54: _eof_.parent(null);
55: }
56:
57: if (node != null) {
58: if (node.parent() != null) {
59: node.parent().removeChild(node);
60: }
61:
62: node.parent(this );
63: }
64:
65: _eof_ = node;
66: }
67:
68: void removeChild(Node child) {
69: if (_pGrammar_ == child) {
70: _pGrammar_ = null;
71: return;
72: }
73:
74: if (_eof_ == child) {
75: _eof_ = null;
76: return;
77: }
78: }
79:
80: void replaceChild(Node oldChild, Node newChild) {
81: if (_pGrammar_ == oldChild) {
82: setPGrammar((PGrammar) newChild);
83: return;
84: }
85:
86: if (_eof_ == oldChild) {
87: setEOF((EOF) newChild);
88: return;
89: }
90: }
91:
92: public String toString() {
93: return "" + toString(_pGrammar_) + toString(_eof_);
94: }
95: }
|