KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sablecc > sablecc > syntax3 > node > ASyntax


1 /* This file was generated by SableCC (http://www.sablecc.org/). */
2
3 package org.sablecc.sablecc.syntax3.node;
4
5 import org.sablecc.sablecc.syntax3.analysis.*;
6
7 @SuppressWarnings JavaDoc("nls")
8 public final class ASyntax extends PSyntax
9 {
10     private TNumber _version_;
11
12     public ASyntax()
13     {
14         // Constructor
15
}
16
17     public ASyntax(
18         @SuppressWarnings JavaDoc("hiding") TNumber _version_)
19     {
20         // Constructor
21
setVersion(_version_);
22
23     }
24
25     @Override JavaDoc
26     public Object JavaDoc clone()
27     {
28         return new ASyntax(
29             cloneNode(this._version_));
30     }
31
32     public void apply(Switch sw)
33     {
34         ((Analysis) sw).caseASyntax(this);
35     }
36
37     public TNumber getVersion()
38     {
39         return this._version_;
40     }
41
42     public void setVersion(TNumber node)
43     {
44         if(this._version_ != null)
45         {
46             this._version_.parent(null);
47         }
48
49         if(node != null)
50         {
51             if(node.parent() != null)
52             {
53                 node.parent().removeChild(node);
54             }
55
56             node.parent(this);
57         }
58
59         this._version_ = node;
60     }
61
62     @Override JavaDoc
63     public String JavaDoc toString()
64     {
65         return ""
66             + toString(this._version_);
67     }
68
69     @Override JavaDoc
70     void removeChild(@SuppressWarnings JavaDoc("unused") Node child)
71     {
72         // Remove child
73
if(this._version_ == child)
74         {
75             this._version_ = null;
76             return;
77         }
78
79         throw new RuntimeException JavaDoc("Not a child.");
80     }
81
82     @Override JavaDoc
83     void replaceChild(@SuppressWarnings JavaDoc("unused") Node oldChild, @SuppressWarnings JavaDoc("unused") Node newChild)
84     {
85         // Replace child
86
if(this._version_ == oldChild)
87         {
88             setVersion((TNumber) newChild);
89             return;
90         }
91
92         throw new RuntimeException JavaDoc("Not a child.");
93     }
94 }
95
Popular Tags