xref: /OpenGrok/opengrok-indexer/src/test/resources/analysis/eiffel/sample.e (revision 2d7e47c7588aedb2df0b0980945276fb07db4597)
1-- All source code and binary programs included in Gobo Eiffel
2-- are distributed under the terms and conditions of the MIT
3-- License:
4--
5--     The MIT License
6--
7--     Copyright (c) <year> <copyright holders>
8--
9--     Permission is hereby granted, free of charge, to any person obtaining
10--     a copy of this software and associated documentation files (the
11--     "Software"), to deal in the Software without restriction, including
12--     without limitation the rights to use, copy, modify, merge, publish,
13--     distribute, sublicense, and/or sell copies of the Software, and to
14--     permit persons to whom the Software is furnished to do so, subject to
15--     the following conditions:
16--
17--     The above copyright notice and this permission notice shall be included
18--     in all copies or substantial portions of the Software.
19--
20--     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21--     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22--     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23--     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24--     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25--     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26--     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27--
28-- This license is an OSI Approved License:
29--
30--     http://opensource.org/licenses/mit-license.html
31--
32-- and a GPL-Compatible Free Software License:
33--
34--     http://www.gnu.org/licenses/license-list.html#X11License
35--
36-- --
37-- Copyright (c) 1997-2007, Eric Bezault and others
38
39note
40
41	description:
42
43		"Scanners for config files made up of name/value pairs and preprocessor instructions"
44
45	copyright: "Copyright (c) 2007-2013, Eric Bezault and others"
46	license: "MIT License"
47	date: "$Date$"
48	revision: "$Revision$"
49	note0: "http://example.com"
50	note1: "[http://example.com]"
51	note2: "{http://example.com}"
52	note3: "xx{http://example.com}xx"
53	note4: "xx[http://example.com]xx"
54
55deferred class UT_CONFIG_SCANNER
56
57inherit
58
59	YY_COMPRESSED_SCANNER_SKELETON
60		rename
61			make as make_compressed_scanner_skeleton,
62			reset as reset_compressed_scanner_skeleton
63		redefine
64			wrap, output
65		end
66
67	UT_CONFIG_TOKENS
68		export {NONE} all end
69
70
71feature -- Status report
72
73	valid_start_condition (sc: INTEGER): BOOLEAN
74			-- Is `sc' a valid start condition?
75		do
76			Result := (INITIAL <= sc and sc <= S_EMPTY_LINE)
77		end
78
79feature {NONE} -- Implementation
80
81	yy_build_tables
82			-- Build scanner tables.
83		do
84			yy_nxt := yy_nxt_template
85			yy_chk := yy_chk_template
86			yy_base := yy_base_template
87			yy_def := yy_def_template
88			yy_ec := yy_ec_template
89			yy_meta := yy_meta_template
90			yy_accept := yy_accept_template
91		end
92
93	yy_execute_action (yy_act: INTEGER)
94			-- Execute semantic action.
95		do
96			inspect yy_act
97when 1, 2 then
98--|#line 40 "ut_config_scanner.l"
99debug ("GELEX")
100	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 40")
101end
102
103						-- Comment.
104						set_start_condition (S_SKIP_EOL)
105
106when 3 then
107--|#line 45 "ut_config_scanner.l"
108debug ("GELEX")
109	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 45")
110end
111
112						last_token := P_IFDEF
113						set_start_condition (S_PREPROC)
114
115when 4 then
116--|#line 49 "ut_config_scanner.l"
117debug ("GELEX")
118	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 49")
119end
120
121						last_token := P_IFNDEF
122						set_start_condition (S_PREPROC)
123
124when 5 then
125--|#line 53 "ut_config_scanner.l"
126debug ("GELEX")
127	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 53")
128end
129
130						last_token := P_ELSE
131						set_start_condition (S_PREPROC)
132
133when 6 then
134--|#line 57 "ut_config_scanner.l"
135debug ("GELEX")
136	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 57")
137end
138
139						last_token := P_ENDIF
140						set_start_condition (S_PREPROC)
141
142when 7 then
143--|#line 61 "ut_config_scanner.l"
144debug ("GELEX")
145	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 61")
146end
147
148						last_token := P_INCLUDE
149						set_start_condition (S_PREPROC)
150
151when 8 then
152--|#line 65 "ut_config_scanner.l"
153debug ("GELEX")
154	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 65")
155end
156
157						last_token := P_DEFINE
158						set_start_condition (S_PREPROC)
159
160when 9 then
161--|#line 69 "ut_config_scanner.l"
162debug ("GELEX")
163	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 69")
164end
165
166						last_token := P_UNDEF
167						set_start_condition (S_PREPROC)
168
169when 10 then
170--|#line 73 "ut_config_scanner.l"
171debug ("GELEX")
172	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 73")
173end
174
175						last_token := P_NAME
176						last_string_value := text
177						check attached last_string_value as l_last_string_value then
178							STRING_.left_adjust (l_last_string_value)
179						end
180						set_start_condition (S_NAME)
181
182when 11 then
183--|#line 81 "ut_config_scanner.l"
184debug ("GELEX")
185	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 81")
186end
187
188						last_token := P_EOL
189						line_nb := line_nb + 1
190
191when 12 then
192--|#line 85 "ut_config_scanner.l"
193debug ("GELEX")
194	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 85")
195end
196
197						set_start_condition (S_EMPTY_LINE)
198
199when 13 then
200--|#line 91 "ut_config_scanner.l"
201debug ("GELEX")
202	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 91")
203end
204
205						line_nb := line_nb + 1
206						set_start_condition (INITIAL)
207
208when 14 then
209--|#line 95 "ut_config_scanner.l"
210debug ("GELEX")
211	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 95")
212end
213
214						set_start_condition (INITIAL)
215
216when 15 then
217--|#line 101 "ut_config_scanner.l"
218debug ("GELEX")
219	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 101")
220end
221-- Separator.
222when 16 then
223--|#line 102 "ut_config_scanner.l"
224debug ("GELEX")
225	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 102")
226end
227
228						last_token := P_STRING
229						last_string_value := text_substring (2, text_count - 1)
230
231when 17 then
232--|#line 106 "ut_config_scanner.l"
233debug ("GELEX")
234	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 106")
235end
236
237						last_token := P_NAME
238						last_string_value := text
239
240when 18 then
241--|#line 110 "ut_config_scanner.l"
242debug ("GELEX")
243	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 110")
244end
245last_token := P_AND
246when 19 then
247--|#line 111 "ut_config_scanner.l"
248debug ("GELEX")
249	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 111")
250end
251last_token := P_OR
252when 20 then
253--|#line 112 "ut_config_scanner.l"
254debug ("GELEX")
255	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 112")
256end
257
258						last_token := P_EOL
259						line_nb := line_nb + 1
260						set_start_condition (INITIAL)
261
262when 21 then
263--|#line 124 "ut_config_scanner.l"
264debug ("GELEX")
265	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 124")
266end
267-- Separator.
268when 22 then
269--|#line 125 "ut_config_scanner.l"
270debug ("GELEX")
271	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 125")
272end
273
274						last_token := P_COLON
275						set_start_condition (S_VALUE)
276
277when 23 then
278--|#line 132 "ut_config_scanner.l"
279debug ("GELEX")
280	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 132")
281end
282-- Separator.
283when 24 then
284--|#line 133 "ut_config_scanner.l"
285debug ("GELEX")
286	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 133")
287end
288
289						last_token := P_VALUE
290						last_string_value := text
291
292when 25 then
293--|#line 137 "ut_config_scanner.l"
294debug ("GELEX")
295	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 137")
296end
297
298						last_token := P_EOL
299						line_nb := line_nb + 1
300						set_start_condition (INITIAL)
301
302when 26 then
303--|#line 149 "ut_config_scanner.l"
304debug ("GELEX")
305	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 149")
306end
307
308						last_token := P_EOL
309						line_nb := line_nb + 1
310						set_start_condition (INITIAL)
311
312when 27 then
313--|#line 160 "ut_config_scanner.l"
314debug ("GELEX")
315	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 160")
316end
317
318						last_token := text_item (1).code
319						set_start_condition (INITIAL)
320
321when 28 then
322--|#line 0 "ut_config_scanner.l"
323debug ("GELEX")
324	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 0")
325end
326last_token := yyError_token
327fatal_error ("scanner jammed")
328			else
329				last_token := yyError_token
330				fatal_error ("fatal scanner internal error: no action found")
331			end
332			yy_set_beginning_of_line
333		end
334
335	yy_execute_eof_action (yy_sc: INTEGER)
336			-- Execute EOF semantic action.
337		do
338			inspect yy_sc
339when 1 then
340--|#line 117 "ut_config_scanner.l"
341debug ("GELEX")
342	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 117")
343end
344
345						last_token := P_EOL
346						set_start_condition (INITIAL)
347
348when 5 then
349--|#line 142 "ut_config_scanner.l"
350debug ("GELEX")
351	std.error.put_line ("Executing scanner user-code from file 'ut_config_scanner.l' at line 142")
352end
353
354						last_token := P_EOL
355						set_start_condition (INITIAL)
356
357when 6 then
358--|#line 154 "ut_config_scanner.l"
359debug ("GELEX")
360	std.error.put_line ("xx[Executing scanner user-code from file
361    "ut_config_scanner.l"]x" at line 154]xx")
362end
363
364						last_token := P_EOL
365						set_start_condition (INITIAL)
366
367			else
368				terminate
369			end
370		end
371
372feature {NONE} -- Table templates
373
374	yy_nxt_template: SPECIAL [INTEGER]
375			-- Template for `yy_nxt'
376		local
377			an_array: ARRAY [INTEGER]
378		once
379			create an_array.make_filled (0, 0, 220)
380			yy_nxt_template_1 (an_array)
381			yy_nxt_template_2 (an_array)
382			Result := yy_fixed_array (an_array)
383		end
384
385	yy_nxt_template_1 (an_array: ARRAY [INTEGER])
386			-- Fill chunk #1 of template for `yy_nxt'.
387		do
388			yy_array_subcopy (an_array, <<
389			    0,   16,   17,   18,   16,   19,   16,   20,   21,   16,
390			   21,   21,   21,   21,   21,   21,   21,   21,   21,   16,
391			   16,   22,   23,   24,   16,   25,   26,   26,   16,   26,
392			   26,   26,   26,   26,   26,   26,   26,   26,   27,   30,
393			   30,   33,   34,   33,   34,   87,   31,   31,   36,   57,
394			   58,   37,   59,   38,   40,   60,   86,   67,   85,   84,
395			   41,   42,   68,   43,   83,   82,   81,   44,   88,   80,
396			   79,   88,   78,   45,   36,   77,   76,   37,   75,   38,
397			   62,   62,   74,   62,   62,   62,   73,   72,   62,   71,
398			   70,   69,   66,   65,   64,   55,   53,   52,   62,   16,
399
400			   16,   16,   16,   16,   16,   16,   16,   16,   28,   28,
401			   28,   28,   28,   28,   28,   28,   28,   32,   32,   32,
402			   32,   32,   32,   32,   32,   32,   39,   63,   46,   39,
403			   39,   39,   39,   39,   47,   47,   61,   56,   47,   47,
404			   47,   47,   47,   49,   49,   49,   49,   51,   51,   51,
405			   51,   51,   51,   51,   51,   51,   54,   54,   39,   54,
406			   54,   54,   54,   54,   54,   40,   40,   55,   40,   40,
407			   40,   40,   40,   40,   45,   45,   53,   45,   45,   45,
408			   45,   45,   45,   62,   62,   52,   62,   62,   62,   62,
409			   62,   62,   50,   48,   46,   39,   88,   35,   35,   29, yy_Dummy>>,
410			1, 200, 0)
411		end
412
413	yy_nxt_template_2 (an_array: ARRAY [INTEGER])
414			-- Fill chunk #2 of template for `yy_nxt'.
415		do
416			yy_array_subcopy (an_array, <<
417			   29,   15,   88,   88,   88,   88,   88,   88,   88,   88,
418			   88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
419			   88, yy_Dummy>>,
420			1, 21, 200)
421		end
422
423	yy_chk_template: SPECIAL [INTEGER]
424			-- Template for `yy_chk'
425		local
426			an_array: ARRAY [INTEGER]
427		once
428			create an_array.make_filled (0, 0, 220)
429			yy_chk_template_1 (an_array)
430			yy_chk_template_2 (an_array)
431			Result := yy_fixed_array (an_array)
432		end
433
434	yy_chk_template_1 (an_array: ARRAY [INTEGER])
435			-- Fill chunk #1 of template for `yy_chk'.
436		do
437			yy_array_subcopy (an_array, <<
438			    0,    2,    2,    2,    2,    2,    2,    2,    2,    2,
439			    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
440			    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
441			    3,    3,    3,    3,    3,    3,    3,    3,    3,    9,
442			   10,   11,   11,   12,   12,   86,    9,   10,   17,   42,
443			   42,   17,   43,   17,   19,   43,   82,   59,   81,   78,
444			   19,   19,   59,   19,   77,   76,   75,   19,   20,   74,
445			   73,   20,   71,   20,   36,   70,   69,   36,   68,   36,
446			   45,   45,   67,   45,   45,   45,   66,   65,   45,   64,
447			   61,   60,   58,   57,   56,   55,   53,   51,   45,   89,
448
449			   89,   89,   89,   89,   89,   89,   89,   89,   90,   90,
450			   90,   90,   90,   90,   90,   90,   90,   91,   91,   91,
451			   91,   91,   91,   91,   91,   91,   92,   47,   46,   92,
452			   92,   92,   92,   92,   93,   93,   44,   41,   93,   93,
453			   93,   93,   93,   94,   94,   94,   94,   95,   95,   95,
454			   95,   95,   95,   95,   95,   95,   96,   96,   39,   96,
455			   96,   96,   96,   96,   96,   97,   97,   33,   97,   97,
456			   97,   97,   97,   97,   98,   98,   30,   98,   98,   98,
457			   98,   98,   98,   99,   99,   28,   99,   99,   99,   99,
458			   99,   99,   27,   25,   22,   21,   15,   14,   13,    8, yy_Dummy>>,
459			1, 200, 0)
460		end
461
462	yy_chk_template_2 (an_array: ARRAY [INTEGER])
463			-- Fill chunk #2 of template for `yy_chk'.
464		do
465			yy_array_subcopy (an_array, <<
466			    7,   88,   88,   88,   88,   88,   88,   88,   88,   88,
467			   88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
468			   88, yy_Dummy>>,
469			1, 21, 200)
470		end
471
472	yy_base_template: SPECIAL [INTEGER]
473			-- Template for `yy_base'
474		once
475			Result := yy_fixed_array (<<
476			    0,    0,    0,   19,    0,    0,    0,  197,  196,   37,
477			   38,   39,   41,  195,  194,  196,  201,   46,  201,   49,
478			   66,  188,  192,  201,    0,  187,    0,  173,  182,  201,
479			  174,  201,    0,  165,  201,  201,   72,    0,    0,  151,
480			    0,  125,   34,   39,  120,   79,  126,  123,  201,    0,
481			  201,   94,  201,   94,    0,   93,   81,   76,   81,   46,
482			   81,   79,    0,  201,   75,   75,   72,   70,   67,   61,
483			   63,   56,  201,   57,   56,   54,   47,   51,   47,  201,
484			  201,   45,   45,  201,  201,  201,   33,  201,  201,   98,
485			  107,  116,  124,  133,  137,  146,  155,  164,  173,  182, yy_Dummy>>)
486		end
487
488	yy_def_template: SPECIAL [INTEGER]
489			-- Template for `yy_def'
490		once
491			Result := yy_fixed_array (<<
492			    0,   89,   88,   88,    3,   89,   89,   90,   90,   89,
493			   89,   91,   91,   89,   89,   88,   88,   92,   88,   88,
494			   92,   20,   88,   88,   93,   88,   94,   88,   95,   88,
495			   88,   88,   96,   88,   88,   88,   20,   19,   20,   20,
496			   97,   88,   88,   88,   88,   98,   88,   93,   88,   94,
497			   88,   95,   88,   88,   96,   88,   88,   88,   88,   88,
498			   88,   88,   99,   88,   88,   88,   88,   88,   88,   88,
499			   88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
500			   88,   88,   88,   88,   88,   88,   88,   88,    0,   88,
501			   88,   88,   88,   88,   88,   88,   88,   88,   88,   88, yy_Dummy>>)
502		end
503
504	yy_ec_template: SPECIAL [INTEGER]
505			-- Template for `yy_ec'
506		local
507			an_array: ARRAY [INTEGER]
508		once
509			create an_array.make_filled (0, 0, 256)
510			yy_ec_template_1 (an_array)
511			yy_ec_template_2 (an_array)
512			Result := yy_fixed_array (an_array)
513		end
514
515	yy_ec_template_1 (an_array: ARRAY [INTEGER])
516			-- Fill chunk #1 of template for `yy_ec'.
517		do
518			yy_array_subcopy (an_array, <<
519			    0,    1,    1,    1,    1,    1,    1,    1,    1,    2,
520			    3,    1,    1,    2,    1,    1,    1,    1,    1,    1,
521			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
522			    1,    1,    2,    1,    4,    5,    1,    1,    6,    1,
523			    1,    1,    1,    1,    1,    7,    8,    1,    8,    8,
524			    8,    8,    8,    8,    8,    8,    8,    8,    9,    1,
525			    1,    1,    1,    1,    1,    8,    8,   10,   11,   12,
526			   13,    8,    8,   14,    8,    8,   15,    8,   16,    8,
527			    8,    8,    8,   17,    8,   18,    8,    8,    8,    8,
528			    8,    1,    1,    1,    1,    8,    1,    8,    8,   10,
529
530			   11,   12,   13,    8,    8,   14,    8,    8,   15,    8,
531			   16,    8,    8,    8,    8,   17,    8,   18,    8,    8,
532			    8,    8,    8,    1,   19,    1,    1,    1,    1,    1,
533			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
534			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
535			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
536			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
537			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
538			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
539			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1, yy_Dummy>>,
540			1, 200, 0)
541		end
542
543	yy_ec_template_2 (an_array: ARRAY [INTEGER])
544			-- Fill chunk #2 of template for `yy_ec'.
545		do
546			yy_array_subcopy (an_array, <<
547			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
548			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
549			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
550			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
551			    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
552			    1,    1,    1,    1,    1,    1,    1, yy_Dummy>>,
553			1, 57, 200)
554		end
555
556	yy_meta_template: SPECIAL [INTEGER]
557			-- Template for `yy_meta'
558		once
559			Result := yy_fixed_array (<<
560			    0,    1,    2,    3,    4,    5,    1,    6,    7,    1,
561			    7,    7,    7,    7,    7,    7,    7,    8,    9,    1, yy_Dummy>>)
562		end
563
564	yy_accept_template: SPECIAL [INTEGER]
565			-- Template for `yy_accept'
566		once
567			Result := yy_fixed_array (<<
568			    0,    0,    0,    0,    0,    0,    0,   14,   14,    0,
569			    0,    0,    0,    0,    0,   29,   27,   12,   11,   27,
570			   10,   10,   15,   20,   27,   27,   17,   27,   14,   13,
571			   21,   22,   24,   23,   25,   26,   12,    0,   10,   10,
572			    2,    0,    0,    0,    0,    1,   15,    0,   18,   17,
573			   19,   14,   13,   21,   24,   23,    0,    0,    0,    0,
574			    0,    0,    1,   16,    0,    0,    0,    0,    0,    0,
575			    0,    0,    5,    0,    0,    0,    0,    0,    0,    6,
576			    3,    0,    0,    9,    8,    4,    0,    7,    0, yy_Dummy>>)
577		end
578
579feature {NONE} -- Constants
580
581	yyJam_base: INTEGER = 201
582			-- Position in `yy_nxt'/`yy_chk' tables
583			-- where default jam table starts
584
585	yyJam_state: INTEGER = 88
586			-- State id corresponding to jam state
587
588	yyTemplate_mark: INTEGER = 89
589			-- Mark between normal states and templates
590
591	yyNull_equiv_class: INTEGER = 1
592			-- Equivalence code for NULL character
593
594	yyReject_used: BOOLEAN = false
595			-- Is `reject' called?
596
597	yyVariable_trail_context: BOOLEAN = false
598			-- Is there a regular expression with
599			-- both leading and trailing parts having
600			-- variable length?
601
602	yyReject_or_variable_trail_context: BOOLEAN = false
603			-- Is `reject' called or is there a
604			-- regular expression with both leading
605			-- and trailing parts having variable length?
606
607	yyNb_rules: INTEGER = 28
608			-- Number of rules
609
610	yyEnd_of_buffer: INTEGER = 29
611			-- End of buffer rule code
612
613	yyLine_used: BOOLEAN = false
614			-- Are line and column numbers used?
615
616	yyPosition_used: BOOLEAN = false
617			-- Is `position' used?
618
619	INITIAL: INTEGER = 0b0
620	S_PREPROC: INTEGER = 0B1
621	S_READLINE: INTEGER = 0x2
622	S_SKIP_EOL: INTEGER = 0X3
623	S_NAME: INTEGER = 0c4
624	S_VALUE: INTEGER = 0C5
625	S_EMPTY_LINE: INTEGER = 6
626			-- Start condition codes
627
628feature -- User-defined features
629
630
631
632feature {NONE} -- Initialization
633
634	make
635			-- Create a new scanner.
636		do
637			make_with_buffer (Empty_buffer)
638			last_string_value := ""
639			line_nb := 1
640		end
641
642feature -- Initialization
643
644	reset
645			-- Reset scanner before scanning next input.
646		do
647			reset_compressed_scanner_skeleton
648			last_string_value := ""
649			line_nb := 1
650		end
651
652feature -- Access
653
654	line_nb: INTEGER
655			-- Current line number
656
657	include_stack: DS_STACK [YY_BUFFER]
658			-- Input buffers not completely parsed yet
659		deferred
660		ensure
661			include_stack_not_void: Result /= Void
662			no_void_buffer: not Result.has_void
663		end
664
665	line_nb_stack: DS_STACK [INTEGER]
666			-- Line numbers in the corresponding input buffers in `include_stack'
667		deferred
668		ensure
669			line_nb_stack_not_void: Result /= Void
670			same_count: Result.count = include_stack.count
671		end
672
673feature -- Status report
674
675	ignored: BOOLEAN
676			-- Is current line ignored?
677		deferred
678		end
679
680feature -- Element change
681
682	wrap: BOOLEAN
683			-- Should current scanner terminate when end of file is reached?
684			-- True unless an include file was being processed.
685		local
686			l_old_buffer: YY_BUFFER
687			a_file: KI_CHARACTER_INPUT_STREAM
688		do
689			if not include_stack.is_empty then
690				l_old_buffer := input_buffer
691				set_input_buffer (include_stack.item)
692				line_nb := line_nb_stack.item
693				line_nb_stack.remove
694				include_stack.remove
695				if attached {YY_FILE_BUFFER} l_old_buffer as l_old_file_buffer then
696					a_file := l_old_file_buffer.file
697					if a_file.is_closable then
698						a_file.close
699					end
700				end
701				set_start_condition (INITIAL)
702			else
703				Result := True
704			end
705		end
706
707feature -- Output
708
709	output (a_text: like text)
710			-- Silently ignore `a_text'.
711		do
712		end
713
714	special_chars
715		do
716			value := "abc"
717			value := 'abc' -- not a valid character
718			value := "%""
719			value := "%'"
720			value := '%''
721			value := '%"'
722		end
723end
724