3399de0ae952a7e3d7abbd6cf295446a16540773
[nit.git] / contrib / pep8analysis / src / parser / parser_nodes.nit
1 # Raw AST node hierarchy.
2 # This file was generated by SableCC (http://www.sablecc.org/).
3 module parser_nodes
4
5 import location
6
7 # Root of the AST hierarchy
8 abstract class ANode
9 var _location: nullable Location = null
10
11 # Location is set during AST building. Once built, location cannon be null
12 # However, manual instanciated nodes may need mode care
13 fun location: Location do return _location.as(not null)
14 end
15
16 # Ancestor of all tokens
17 abstract class Token
18 super ANode
19
20 fun text : String is abstract
21 end
22
23 # Ancestor of all productions
24 abstract class Prod
25 super ANode
26 fun location=(loc: Location) do _location = loc
27 end
28 class TEol
29 super Token
30 end
31 class TNumber
32 super Token
33 end
34 class TFloat
35 super Token
36 end
37 class TChar
38 super Token
39 end
40 class TString
41 super Token
42 end
43 class THex
44 super Token
45 end
46 class TColon
47 super Token
48 end
49 class TComma
50 super Token
51 end
52 class TComment
53 super Token
54 end
55 class TTkByte
56 super Token
57 end
58 class TTkWord
59 super Token
60 end
61 class TTkBlock
62 super Token
63 end
64 class TTkAscii
65 super Token
66 end
67 class TTkAddrss
68 super Token
69 end
70 class TTkEquate
71 super Token
72 end
73 class TTkBurn
74 super Token
75 end
76 class TEndBlock
77 super Token
78 end
79 class TId
80 super Token
81 end
82 class EOF
83 super Token
84 #private init noinit do end
85 end
86 class AError
87 super EOF
88 #private init noinit do end
89 end
90
91 class ALine
92 super Prod
93 readable var _n_label_decl: nullable ALabelDecl = null
94 readable var _n_comment: nullable TComment = null
95 end
96 class AInstruction
97 super Prod
98 readable writable var _n_id: TId
99 init do end
100 end
101 class AOperand
102 super Prod
103 readable var _n_value: AValue
104 init do end
105 end
106 class AValue super Prod end
107 class ADirective super Prod end
108
109 class AListing
110 super Prod
111 readable var _n_lines: List[ALine] = new List[ALine]
112 readable var _n_label_decl: nullable ALabelDecl = null
113 readable var _n_end_block: TEndBlock
114 init do end
115 end
116 class AEmptyLine
117 super ALine
118 readable var _n_eol: TEol
119 init do end
120 end
121 abstract class ANonEmptyLine
122 super ALine
123 end
124 class AInstructionLine
125 super ANonEmptyLine
126 readable var _n_instruction: AInstruction
127 readable var _n_eol: TEol
128 init do end
129 end
130 class ADirectiveLine
131 super ANonEmptyLine
132 readable var _n_directive: ADirective
133 readable var _n_eol: TEol
134 init do end
135 end
136 class ALabelDecl
137 super Prod
138 readable var _n_id: TId
139 readable var _n_colon: TColon
140 init do end
141 end
142 class AUnaryInstruction
143 super AInstruction
144 end
145 class ABinaryInstruction
146 super AInstruction
147 readable var _n_operand: AOperand
148 init do end
149 end
150 class AImmediateOperand
151 super AOperand
152 end
153 class AAnyOperand
154 super AOperand
155 readable var _n_comma: TComma
156 readable var _n_id: TId
157 init do end
158 end
159 class ALabelValue
160 super AValue
161 readable var _n_id: TId
162 init do end
163 end
164 class ANumberValue
165 super AValue
166 readable var _n_number: TNumber
167 init do end
168 end
169 class ACharValue
170 super AValue
171 readable var _n_char: TChar
172 init do end
173 end
174 class AStringValue
175 super AValue
176 readable var _n_string: TString
177 init do end
178 end
179 class AHexValue
180 super AValue
181 readable var _n_hex: THex
182 init do end
183 end
184 class AByteDirective
185 super ADirective
186 readable var _n_tk_byte: TTkByte
187 readable var _n_value: AValue
188 init do end
189 end
190 class AWordDirective
191 super ADirective
192 readable var _n_tk_word: TTkWord
193 readable var _n_value: AValue
194 init do end
195 end
196 class ABlockDirective
197 super ADirective
198 readable var _n_tk_block: TTkBlock
199 readable var _n_value: AValue
200 init do end
201 end
202 class AAsciiDirective
203 super ADirective
204 readable var _n_tk_ascii: TTkAscii
205 readable var _n_value: AValue
206 init do end
207 end
208 class AAddrssDirective
209 super ADirective
210 readable var _n_tk_addrss: TTkAddrss
211 readable var _n_value: AValue
212 init do end
213 end
214 class AEquateDirective
215 super ADirective
216 readable var _n_tk_equate: TTkEquate
217 readable var _n_value: AValue
218 init do end
219 end
220 class ABurnDirective
221 super ADirective
222 readable var _n_tk_burn: TTkBurn
223 readable var _n_value: AValue
224 init do end
225 end
226
227 class Start
228 super Prod
229 readable var _n_base: nullable AListing
230 readable var _n_eof: EOF
231 init(n_base: nullable AListing, n_eof: EOF)
232 do
233 super
234 _n_base = n_base
235 _n_eof = n_eof
236 end
237 end