File: et_lace_parser.e

package info (click to toggle)
gobo 2.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 17,764 kB
  • ctags: 11,254
  • sloc: lex: 3,980; yacc: 3,875; makefile: 716; sh: 402; ansic: 40
file content (413 lines) | stat: -rw-r--r-- 12,231 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
indexing

	description:

		"Lace parsers"

	author:     "Eric Bezault <ericb@gobosoft.com>"
	copyright:  "Copyright (c) 1999-2001, Eric Bezault and others"
	license:    "Eiffel Forum Freeware License v1 (see forum.txt)"
	date:       "$Date: 2001/03/18 12:57:01 $"
	revision:   "$Revision: 1.4 $"

class ET_LACE_PARSER

inherit

	ET_LACE_PARSER_SKELETON

	ET_LACE_SCANNER
		rename
			make as make_lace_scanner
		end

creation

	make, make_with_factory


feature {NONE} -- Implementation

	yy_build_parser_tables is
			-- Build parser tables.
		do
			yytranslate ?= yytranslate_template
			yyr1 ?= yyr1_template
			yyr2 ?= yyr2_template
			yydefact ?= yydefact_template
			yydefgoto ?= yydefgoto_template
			yypact ?= yypact_template
			yypgoto ?= yypgoto_template
			yytable ?= yytable_template
			yycheck ?= yycheck_template
		end

feature {NONE} -- Semantic actions

	yy_do_action (yy_act: INTEGER) is
			-- Execute semantic action.
		local
			yyval1: ET_IDENTIFIER
			yyval2: ET_CLUSTER
			yyval3: ET_CLUSTERS
			yyval4: ET_EXCLUDE
		do
			inspect yy_act
when 1 then
--|#line 47
			yyval := yyval_default;
			last_universe := new_universe (yytype3 (yyvs.item (yyvsp - 2)))
			last_universe.set_root_class (yytype1 (yyvs.item (yyvsp - 6)))
		

when 18 then
--|#line 87

yyval3 := yytype3 (yyvs.item (yyvsp)) 
			yyval := yyval3
when 19 then
--|#line 91

yyval3 := new_clusters (yytype2 (yyvs.item (yyvsp - 1))) 
			yyval := yyval3
when 20 then
--|#line 93

yyval3 := yytype3 (yyvs.item (yyvsp)); yyval3.put_first (yytype2 (yyvs.item (yyvsp - 2))) 
			yyval := yyval3
when 21 then
--|#line 97

yyval2 := yytype2 (yyvs.item (yyvsp)); yyval2.set_abstract (True) 
			yyval := yyval2
when 22 then
--|#line 99

yyval2 := yytype2 (yyvs.item (yyvsp)); yyval2.set_recursive (True) 
			yyval := yyval2
when 23 then
--|#line 101

yyval2 := yytype2 (yyvs.item (yyvsp)) 
			yyval := yyval2
when 24 then
--|#line 105

			yyval2 := new_cluster (yytype1 (yyvs.item (yyvsp - 4)), yytype1 (yyvs.item (yyvsp - 2)))
			yyval2.set_subclusters (yytype3 (yyvs.item (yyvsp)))
		
			yyval := yyval2
when 25 then
--|#line 110

			yyval2 := new_cluster (yytype1 (yyvs.item (yyvsp - 2)), Void)
			yyval2.set_subclusters (yytype3 (yyvs.item (yyvsp)))
		
			yyval := yyval2
when 26 then
--|#line 117

			yyval2 := new_cluster (yytype1 (yyvs.item (yyvsp - 4)), yytype1 (yyvs.item (yyvsp - 2)))
			yyval2.set_exclude (yytype4 (yyvs.item (yyvsp - 1)))
		
			yyval := yyval2
when 33 then
--|#line 136

yyval3 := yytype3 (yyvs.item (yyvsp - 1)) 
			yyval := yyval3
when 36 then
--|#line 142

yyval4 := yytype4 (yyvs.item (yyvsp - 1)) 
			yyval := yyval4
when 37 then
--|#line 144

yyval4 := yytype4 (yyvs.item (yyvsp - 2)) 
			yyval := yyval4
when 38 then
--|#line 148

!! yyval4.make yyval4.put_last (yytype1 (yyvs.item (yyvsp))) 
			yyval := yyval4
when 39 then
--|#line 150

yyval4 := yytype4 (yyvs.item (yyvsp - 2)); yyval4.put_last (yytype1 (yyvs.item (yyvsp))) 
			yyval := yyval4
when 64 then
--|#line 202

yyval1 := yytype1 (yyvs.item (yyvsp)) 
			yyval := yyval1
when 65 then
--|#line 204

yyval1 := yytype1 (yyvs.item (yyvsp)) 
			yyval := yyval1
			else
					-- No action
				yyval := yyval_default
			end
		end

feature {NONE} -- Table templates

	yytranslate_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			    0,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			   16,   17,    2,    2,   20,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,   18,   19,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,

			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,

			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
			    2,    2,    2,    2,    2,    2,    1,    2,    3,    4,
			    5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
			   15>>)
		end

	yyr1_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			    0,   30,   31,   31,   32,   32,   33,   33,   33,   35,
			   35,   36,   37,   37,   38,   38,   25,   25,   25,   24,
			   24,   21,   21,   21,   22,   22,   23,   39,   39,   40,
			   40,   26,   26,   26,   27,   27,   27,   27,   28,   28,
			   41,   41,   41,   42,   42,   43,   46,   46,   44,   44,
			   45,   45,   34,   34,   34,   47,   47,   48,   51,   51,
			   49,   49,   50,   50,   29,   29>>)
		end

	yyr2_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			    0,   10,    0,    3,    0,    2,    0,    1,    2,    2,
			    3,    4,    0,    1,    0,    1,    0,    1,    2,    2,
			    3,    2,    2,    1,    5,    3,    5,    0,    1,    0,
			    1,    0,    2,    3,    0,    2,    3,    4,    1,    3,
			    0,    2,    3,    2,    3,    6,    1,    3,    0,    1,
			    0,    1,    0,    1,    2,    2,    3,    3,    1,    3,
			    0,    1,    0,    1,    1,    1>>)
		end

	yydefact_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			    0,    0,   65,   64,    0,    0,    2,    0,    4,    0,
			    0,    6,    3,    5,    7,   16,    0,    8,   14,   17,
			   52,    0,   15,    9,    0,    0,    0,   29,   23,   18,
			   40,   53,    0,    0,   10,   22,    0,   21,   30,   19,
			    0,    0,    0,   31,    0,   54,   62,    1,   11,    0,
			   20,   40,   41,    0,    0,   50,    0,   25,    0,   63,
			   55,    0,   34,   31,    0,   42,   51,   43,    0,   32,
			    0,   58,   57,   56,    0,   40,   24,    0,   44,   33,
			    0,   35,    0,   38,   26,    0,   59,    0,   36,    0,
			   37,   39,   46,   45,    0,   47,    0,    0,    0>>)
		end

	yydefgoto_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			   27,   28,   35,   29,   20,   57,   75,   82,   30,   96,
			    8,   11,   15,   32,   17,   18,   23,   24,   39,   40,
			   43,   54,   55,   67,   68,   93,   45,   46,   60,   61,
			   72>>)
		end

	yypact_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			   81,   48, -32768, -32768,   77,   48,   71,   48,   73,   72,
			   48,   76, -32768, -32768,   48,   74,   69, -32768,    2,   36,
			   68,   48,   50, -32768,   48,   48,   48,    7, -32768, -32768,
			   13,   48,   70,   65, -32768, -32768,   60, -32768,   46, -32768,
			   36,   48,   39,   64,   59, -32768,    9, -32768, -32768,   48,
			 -32768,   55, -32768,   58,   67,    0,   22, -32768,   48,   66,
			 -32768,   48,   57,   64,   48, -32768,   63, -32768,   48, -32768,
			   61, -32768,   45, -32768,   29,   55, -32768,   42, -32768, -32768,
			   48, -32768,   -2, -32768, -32768,   27, -32768,   24, -32768,   48,
			 -32768, -32768, -32768,   19,   48, -32768,   16,   11, -32768>>)
		end

	yypgoto_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			 -32768,   78, -32768,  -38, -32768,   32, -32768, -32768,   -1, -32768,
			 -32768, -32768, -32768, -32768,   75, -32768, -32768, -32768, -32768, -32768,
			  -50,   26, -32768, -32768, -32768, -32768,   31, -32768, -32768, -32768,
			 -32768>>)
		end

	yytable_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			    4,   63,   50,   88,    6,  -48,    9,  -12,  -12,   13,
			  -12,   98,  -27,   16,  -60,  -27,   97,   87,   70,   66,
			   33,   22,   42,   16,   36,   84,   38,   69,   59,   90,
			   44,   41,   26,   25,   81,    3,    2,    3,    2,   94,
			   51,   53,    3,    2,   52,   89,   26,   25,   62,    3,
			    2,  -28,    3,    2,  -28,  -13,  -13,   71,  -13,   85,
			   44,    3,    2,   77,   42,   80,   79,   53,  -49,   74,
			   56,  -61,   65,   83,   64,   47,   31,   58,   49,   86,
			   19,    5,   48,   14,    1,   21,   91,    7,   92,   12,
			    0,   10,   73,   95,   78,   76,    0,    0,    0,   34,

			    0,    0,    0,    0,   37>>)
		end

	yycheck_template: ANY is
			-- This is supposed to be "like FIXED_INTEGER_ARRAY_TYPE",
			-- but once functions cannot be declared with anchored types.
		once
			Result := yyfixed_array (<<
			    1,   51,   40,    5,    5,    5,    7,    5,    6,   10,
			    8,    0,    5,   14,    5,    8,    0,   19,   56,   19,
			   21,   19,    9,   24,   25,   75,   19,    5,   19,    5,
			   31,   18,   10,   11,    5,   13,   14,   13,   14,   20,
			   41,   42,   13,   14,    5,   18,   10,   11,   49,   13,
			   14,    5,   13,   14,    8,    5,    6,   58,    8,   17,
			   61,   13,   14,   64,    9,   20,    5,   68,    5,   12,
			    6,    5,    5,   74,   16,    5,    8,   18,   18,   80,
			    6,    4,   17,    7,    3,   16,   87,   16,   89,   17,
			   -1,   18,   61,   94,   68,   63,   -1,   -1,   -1,   24,

			   -1,   -1,   -1,   -1,   26>>)
		end

feature {NONE} -- Conversion

	yytype1 (v: ANY): ET_IDENTIFIER is
		require
			valid_type: yyis_type1 (v)
		do
			Result ?= v
		ensure
			definition: Result = v
		end

	yyis_type1 (v: ANY): BOOLEAN is
		local
			u: ET_IDENTIFIER
		do
			u ?= v
			Result := (u = v)
		end

	yytype2 (v: ANY): ET_CLUSTER is
		require
			valid_type: yyis_type2 (v)
		do
			Result ?= v
		ensure
			definition: Result = v
		end

	yyis_type2 (v: ANY): BOOLEAN is
		local
			u: ET_CLUSTER
		do
			u ?= v
			Result := (u = v)
		end

	yytype3 (v: ANY): ET_CLUSTERS is
		require
			valid_type: yyis_type3 (v)
		do
			Result ?= v
		ensure
			definition: Result = v
		end

	yyis_type3 (v: ANY): BOOLEAN is
		local
			u: ET_CLUSTERS
		do
			u ?= v
			Result := (u = v)
		end

	yytype4 (v: ANY): ET_EXCLUDE is
		require
			valid_type: yyis_type4 (v)
		do
			Result ?= v
		ensure
			definition: Result = v
		end

	yyis_type4 (v: ANY): BOOLEAN is
		local
			u: ET_EXCLUDE
		do
			u ?= v
			Result := (u = v)
		end


feature {NONE} -- Constants

	yyFinal: INTEGER is 98
			-- Termination state id

	yyFlag: INTEGER is -32768
			-- Most negative INTEGER

	yyNtbase: INTEGER is 21
			-- Number of tokens

	yyLast: INTEGER is 104
			-- Upper bound of `yytable' and `yycheck'

	yyMax_token: INTEGER is 270
			-- Maximum token id
			-- (upper bound of `yytranslate'.)

	yyNsyms: INTEGER is 52
			-- Number of symbols
			-- (terminal and nonterminal)

feature -- User-defined features



end -- class ET_LACE_PARSER