1 | #line 2 "scanner.cc" |
---|
2 | /* A lexical scanner generated by flex */ |
---|
3 | |
---|
4 | /* Scanner skeleton version: |
---|
5 | * $Header: /exports/cvsroot-2/cvsroot/modules/modgen/scanner.cc,v 1.1 2005-07-25 09:01:21 Singular Exp $ |
---|
6 | */ |
---|
7 | |
---|
8 | #define FLEX_SCANNER |
---|
9 | #define YY_FLEX_MAJOR_VERSION 2 |
---|
10 | #define YY_FLEX_MINOR_VERSION 5 |
---|
11 | |
---|
12 | #include <stdio.h> |
---|
13 | |
---|
14 | |
---|
15 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ |
---|
16 | #ifdef c_plusplus |
---|
17 | #ifndef __cplusplus |
---|
18 | #define __cplusplus |
---|
19 | #endif |
---|
20 | #endif |
---|
21 | |
---|
22 | |
---|
23 | #ifdef __cplusplus |
---|
24 | |
---|
25 | #include <stdlib.h> |
---|
26 | #include <unistd.h> |
---|
27 | |
---|
28 | /* Use prototypes in function declarations. */ |
---|
29 | #define YY_USE_PROTOS |
---|
30 | |
---|
31 | /* The "const" storage-class-modifier is valid. */ |
---|
32 | #define YY_USE_CONST |
---|
33 | |
---|
34 | #else /* ! __cplusplus */ |
---|
35 | |
---|
36 | #if __STDC__ |
---|
37 | |
---|
38 | #define YY_USE_PROTOS |
---|
39 | #define YY_USE_CONST |
---|
40 | |
---|
41 | #endif /* __STDC__ */ |
---|
42 | #endif /* ! __cplusplus */ |
---|
43 | |
---|
44 | #ifdef __TURBOC__ |
---|
45 | #pragma warn -rch |
---|
46 | #pragma warn -use |
---|
47 | #include <io.h> |
---|
48 | #include <stdlib.h> |
---|
49 | #define YY_USE_CONST |
---|
50 | #define YY_USE_PROTOS |
---|
51 | #endif |
---|
52 | |
---|
53 | #ifdef YY_USE_CONST |
---|
54 | #define yyconst const |
---|
55 | #else |
---|
56 | #define yyconst |
---|
57 | #endif |
---|
58 | |
---|
59 | |
---|
60 | #ifdef YY_USE_PROTOS |
---|
61 | #define YY_PROTO(proto) proto |
---|
62 | #else |
---|
63 | #define YY_PROTO(proto) () |
---|
64 | #endif |
---|
65 | |
---|
66 | /* Returned upon end-of-file. */ |
---|
67 | #define YY_NULL 0 |
---|
68 | |
---|
69 | /* Promotes a possibly negative, possibly signed char to an unsigned |
---|
70 | * integer for use as an array index. If the signed char is negative, |
---|
71 | * we want to instead treat it as an 8-bit unsigned char, hence the |
---|
72 | * double cast. |
---|
73 | */ |
---|
74 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
---|
75 | |
---|
76 | /* Enter a start condition. This macro really ought to take a parameter, |
---|
77 | * but we do it the disgusting crufty way forced on us by the ()-less |
---|
78 | * definition of BEGIN. |
---|
79 | */ |
---|
80 | #define BEGIN yy_start = 1 + 2 * |
---|
81 | |
---|
82 | /* Translate the current start state into a value that can be later handed |
---|
83 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
---|
84 | * compatibility. |
---|
85 | */ |
---|
86 | #define YY_START ((yy_start - 1) / 2) |
---|
87 | #define YYSTATE YY_START |
---|
88 | |
---|
89 | /* Action number for EOF rule of a given start state. */ |
---|
90 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
---|
91 | |
---|
92 | /* Special action meaning "start processing a new file". */ |
---|
93 | #define YY_NEW_FILE yyrestart( yyin ) |
---|
94 | |
---|
95 | #define YY_END_OF_BUFFER_CHAR 0 |
---|
96 | |
---|
97 | /* Size of default input buffer. */ |
---|
98 | #define YY_BUF_SIZE 16384 |
---|
99 | |
---|
100 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
---|
101 | |
---|
102 | extern int yyleng; |
---|
103 | extern FILE *yyin, *yyout; |
---|
104 | |
---|
105 | #define EOB_ACT_CONTINUE_SCAN 0 |
---|
106 | #define EOB_ACT_END_OF_FILE 1 |
---|
107 | #define EOB_ACT_LAST_MATCH 2 |
---|
108 | |
---|
109 | /* The funky do-while in the following #define is used to turn the definition |
---|
110 | * int a single C statement (which needs a semi-colon terminator). This |
---|
111 | * avoids problems with code like: |
---|
112 | * |
---|
113 | * if ( condition_holds ) |
---|
114 | * yyless( 5 ); |
---|
115 | * else |
---|
116 | * do_something_else(); |
---|
117 | * |
---|
118 | * Prior to using the do-while the compiler would get upset at the |
---|
119 | * "else" because it interpreted the "if" statement as being all |
---|
120 | * done when it reached the ';' after the yyless() call. |
---|
121 | */ |
---|
122 | |
---|
123 | /* Return all but the first 'n' matched characters back to the input stream. */ |
---|
124 | |
---|
125 | #define yyless(n) \ |
---|
126 | do \ |
---|
127 | { \ |
---|
128 | /* Undo effects of setting up yytext. */ \ |
---|
129 | *yy_cp = yy_hold_char; \ |
---|
130 | YY_RESTORE_YY_MORE_OFFSET \ |
---|
131 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
---|
132 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
---|
133 | } \ |
---|
134 | while ( 0 ) |
---|
135 | |
---|
136 | #define unput(c) yyunput( c, yytext_ptr ) |
---|
137 | |
---|
138 | /* The following is because we cannot portably get our hands on size_t |
---|
139 | * (without autoconf's help, which isn't available because we want |
---|
140 | * flex-generated scanners to compile on their own). |
---|
141 | */ |
---|
142 | typedef unsigned int yy_size_t; |
---|
143 | |
---|
144 | |
---|
145 | struct yy_buffer_state |
---|
146 | { |
---|
147 | FILE *yy_input_file; |
---|
148 | |
---|
149 | char *yy_ch_buf; /* input buffer */ |
---|
150 | char *yy_buf_pos; /* current position in input buffer */ |
---|
151 | |
---|
152 | /* Size of input buffer in bytes, not including room for EOB |
---|
153 | * characters. |
---|
154 | */ |
---|
155 | yy_size_t yy_buf_size; |
---|
156 | |
---|
157 | /* Number of characters read into yy_ch_buf, not including EOB |
---|
158 | * characters. |
---|
159 | */ |
---|
160 | int yy_n_chars; |
---|
161 | |
---|
162 | /* Whether we "own" the buffer - i.e., we know we created it, |
---|
163 | * and can realloc() it to grow it, and should free() it to |
---|
164 | * delete it. |
---|
165 | */ |
---|
166 | int yy_is_our_buffer; |
---|
167 | |
---|
168 | /* Whether this is an "interactive" input source; if so, and |
---|
169 | * if we're using stdio for input, then we want to use getc() |
---|
170 | * instead of fread(), to make sure we stop fetching input after |
---|
171 | * each newline. |
---|
172 | */ |
---|
173 | int yy_is_interactive; |
---|
174 | |
---|
175 | /* Whether we're considered to be at the beginning of a line. |
---|
176 | * If so, '^' rules will be active on the next match, otherwise |
---|
177 | * not. |
---|
178 | */ |
---|
179 | int yy_at_bol; |
---|
180 | |
---|
181 | /* Whether to try to fill the input buffer when we reach the |
---|
182 | * end of it. |
---|
183 | */ |
---|
184 | int yy_fill_buffer; |
---|
185 | |
---|
186 | int yy_buffer_status; |
---|
187 | #define YY_BUFFER_NEW 0 |
---|
188 | #define YY_BUFFER_NORMAL 1 |
---|
189 | /* When an EOF's been seen but there's still some text to process |
---|
190 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
---|
191 | * shouldn't try reading from the input source any more. We might |
---|
192 | * still have a bunch of tokens to match, though, because of |
---|
193 | * possible backing-up. |
---|
194 | * |
---|
195 | * When we actually see the EOF, we change the status to "new" |
---|
196 | * (via yyrestart()), so that the user can continue scanning by |
---|
197 | * just pointing yyin at a new input file. |
---|
198 | */ |
---|
199 | #define YY_BUFFER_EOF_PENDING 2 |
---|
200 | }; |
---|
201 | |
---|
202 | static YY_BUFFER_STATE yy_current_buffer = 0; |
---|
203 | |
---|
204 | /* We provide macros for accessing buffer states in case in the |
---|
205 | * future we want to put the buffer states in a more general |
---|
206 | * "scanner state". |
---|
207 | */ |
---|
208 | #define YY_CURRENT_BUFFER yy_current_buffer |
---|
209 | |
---|
210 | |
---|
211 | /* yy_hold_char holds the character lost when yytext is formed. */ |
---|
212 | static char yy_hold_char; |
---|
213 | |
---|
214 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
---|
215 | |
---|
216 | |
---|
217 | int yyleng; |
---|
218 | |
---|
219 | /* Points to current character in buffer. */ |
---|
220 | static char *yy_c_buf_p = (char *) 0; |
---|
221 | static int yy_init = 1; /* whether we need to initialize */ |
---|
222 | static int yy_start = 0; /* start state number */ |
---|
223 | |
---|
224 | /* Flag which is used to allow yywrap()'s to do buffer switches |
---|
225 | * instead of setting up a fresh yyin. A bit of a hack ... |
---|
226 | */ |
---|
227 | static int yy_did_buffer_switch_on_eof; |
---|
228 | |
---|
229 | void yyrestart YY_PROTO(( FILE *input_file )); |
---|
230 | |
---|
231 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); |
---|
232 | void yy_load_buffer_state YY_PROTO(( void )); |
---|
233 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); |
---|
234 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
235 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); |
---|
236 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
237 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
---|
238 | |
---|
239 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
---|
240 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
---|
241 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
---|
242 | |
---|
243 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
---|
244 | static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); |
---|
245 | static void yy_flex_free YY_PROTO(( void * )); |
---|
246 | |
---|
247 | #define yy_new_buffer yy_create_buffer |
---|
248 | |
---|
249 | #define yy_set_interactive(is_interactive) \ |
---|
250 | { \ |
---|
251 | if ( ! yy_current_buffer ) \ |
---|
252 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
253 | yy_current_buffer->yy_is_interactive = is_interactive; \ |
---|
254 | } |
---|
255 | |
---|
256 | #define yy_set_bol(at_bol) \ |
---|
257 | { \ |
---|
258 | if ( ! yy_current_buffer ) \ |
---|
259 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
260 | yy_current_buffer->yy_at_bol = at_bol; \ |
---|
261 | } |
---|
262 | |
---|
263 | #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
---|
264 | |
---|
265 | typedef unsigned char YY_CHAR; |
---|
266 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
---|
267 | typedef int yy_state_type; |
---|
268 | extern char *yytext; |
---|
269 | #define yytext_ptr yytext |
---|
270 | |
---|
271 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
---|
272 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
---|
273 | static int yy_get_next_buffer YY_PROTO(( void )); |
---|
274 | static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); |
---|
275 | |
---|
276 | /* Done after the current pattern has been matched and before the |
---|
277 | * corresponding action - sets up yytext. |
---|
278 | */ |
---|
279 | #define YY_DO_BEFORE_ACTION \ |
---|
280 | yytext_ptr = yy_bp; \ |
---|
281 | yytext_ptr -= yy_more_len; \ |
---|
282 | yyleng = (int) (yy_cp - yytext_ptr); \ |
---|
283 | yy_hold_char = *yy_cp; \ |
---|
284 | *yy_cp = '\0'; \ |
---|
285 | yy_c_buf_p = yy_cp; |
---|
286 | |
---|
287 | #define YY_NUM_RULES 100 |
---|
288 | #define YY_END_OF_BUFFER 101 |
---|
289 | static yyconst short int yy_accept[384] = |
---|
290 | { 0, |
---|
291 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
292 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
293 | 0, 0, 0, 0, 58, 58, 64, 64, 0, 0, |
---|
294 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
295 | 0, 0, 101, 100, 13, 14, 100, 18, 100, 17, |
---|
296 | 100, 10, 16, 15, 100, 100, 100, 7, 100, 100, |
---|
297 | 19, 19, 19, 100, 25, 100, 100, 96, 91, 93, |
---|
298 | 96, 88, 89, 90, 96, 87, 95, 92, 23, 22, |
---|
299 | 23, 23, 86, 83, 86, 85, 80, 84, 86, 81, |
---|
300 | 82, 34, 33, 34, 32, 77, 76, 77, 75, 27, |
---|
301 | |
---|
302 | 26, 27, 30, 27, 43, 36, 35, 43, 43, 43, |
---|
303 | 37, 43, 43, 43, 43, 52, 45, 44, 52, 52, |
---|
304 | 52, 46, 51, 51, 51, 52, 58, 57, 58, 58, |
---|
305 | 58, 73, 66, 73, 62, 70, 67, 68, 69, 73, |
---|
306 | 63, 64, 72, 71, 65, 65, 65, 59, 56, 54, |
---|
307 | 53, 56, 55, 99, 99, 98, 99, 97, 13, 15, |
---|
308 | 14, 6, 0, 0, 0, 15, 15, 0, 0, 10, |
---|
309 | 0, 7, 5, 0, 0, 0, 0, 8, 19, 10, |
---|
310 | 19, 0, 25, 0, 0, 91, 87, 93, 94, 92, |
---|
311 | 22, 0, 83, 78, 0, 33, 31, 76, 74, 26, |
---|
312 | |
---|
313 | 29, 28, 36, 35, 38, 0, 0, 0, 0, 45, |
---|
314 | 44, 47, 0, 51, 51, 51, 58, 58, 57, 6, |
---|
315 | 58, 58, 5, 58, 58, 66, 60, 0, 64, 65, |
---|
316 | 63, 65, 54, 53, 0, 97, 98, 15, 6, 0, |
---|
317 | 0, 0, 9, 0, 20, 20, 5, 0, 0, 0, |
---|
318 | 0, 11, 0, 0, 0, 21, 0, 0, 79, 0, |
---|
319 | 0, 39, 0, 0, 0, 0, 0, 48, 0, 51, |
---|
320 | 51, 6, 58, 58, 5, 58, 58, 0, 61, 0, |
---|
321 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, |
---|
322 | 51, 58, 58, 58, 58, 0, 0, 0, 0, 0, |
---|
323 | |
---|
324 | 0, 0, 40, 0, 51, 51, 58, 58, 58, 58, |
---|
325 | 0, 0, 0, 0, 0, 0, 0, 42, 51, 50, |
---|
326 | 58, 58, 58, 58, 0, 0, 0, 0, 0, 0, |
---|
327 | 41, 49, 58, 58, 58, 58, 0, 0, 0, 0, |
---|
328 | 0, 0, 58, 58, 58, 58, 2, 0, 1, 0, |
---|
329 | 0, 0, 2, 58, 1, 58, 2, 0, 1, 0, |
---|
330 | 0, 0, 2, 58, 1, 58, 4, 0, 3, 0, |
---|
331 | 4, 3, 4, 0, 12, 0, 3, 0, 24, 0, |
---|
332 | 4, 3, 0 |
---|
333 | } ; |
---|
334 | |
---|
335 | static yyconst int yy_ec[256] = |
---|
336 | { 0, |
---|
337 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
---|
338 | 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, |
---|
339 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
340 | 1, 5, 1, 6, 7, 1, 8, 1, 1, 9, |
---|
341 | 10, 11, 1, 12, 13, 14, 15, 16, 16, 17, |
---|
342 | 17, 17, 17, 17, 17, 17, 17, 18, 19, 1, |
---|
343 | 20, 1, 1, 1, 21, 21, 22, 21, 23, 21, |
---|
344 | 21, 21, 21, 21, 21, 21, 21, 24, 25, 21, |
---|
345 | 21, 21, 26, 21, 21, 21, 21, 21, 27, 21, |
---|
346 | 1, 28, 1, 1, 21, 1, 29, 21, 30, 31, |
---|
347 | |
---|
348 | 32, 21, 33, 34, 35, 21, 21, 36, 37, 38, |
---|
349 | 39, 40, 21, 41, 42, 43, 44, 21, 21, 45, |
---|
350 | 27, 21, 46, 1, 47, 1, 1, 1, 1, 1, |
---|
351 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
352 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
353 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
354 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
355 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
356 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
357 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
358 | |
---|
359 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
360 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
361 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
362 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
363 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
364 | 1, 1, 1, 1, 1 |
---|
365 | } ; |
---|
366 | |
---|
367 | static yyconst int yy_meta[48] = |
---|
368 | { 0, |
---|
369 | 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, |
---|
370 | 1, 1, 3, 4, 1, 3, 3, 1, 1, 1, |
---|
371 | 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, |
---|
372 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
---|
373 | 3, 3, 3, 3, 3, 1, 1 |
---|
374 | } ; |
---|
375 | |
---|
376 | static yyconst short int yy_base[423] = |
---|
377 | { 0, |
---|
378 | 0, 47, 0, 0, 92, 94, 102, 0, 96, 147, |
---|
379 | 153, 198, 0, 0, 149, 159, 161, 163, 177, 181, |
---|
380 | 244, 285, 327, 845, 174, 185, 374, 0, 192, 212, |
---|
381 | 216, 220, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
382 | 0, 0, 852, 854, 171, 854, 848, 854, 186, 854, |
---|
383 | 835, 854, 854, 231, 835, 215, 218, 251, 235, 160, |
---|
384 | 834, 241, 246, 207, 854, 224, 264, 854, 260, 854, |
---|
385 | 844, 854, 854, 854, 828, 854, 854, 0, 854, 854, |
---|
386 | 842, 797, 854, 854, 840, 854, 854, 854, 175, 854, |
---|
387 | 854, 854, 854, 839, 826, 854, 854, 837, 824, 854, |
---|
388 | |
---|
389 | 854, 835, 854, 236, 854, 229, 854, 834, 251, 259, |
---|
390 | 854, 791, 794, 791, 272, 854, 280, 854, 830, 273, |
---|
391 | 286, 854, 0, 787, 788, 280, 827, 854, 826, 419, |
---|
392 | 420, 854, 854, 825, 854, 854, 854, 854, 854, 292, |
---|
393 | 292, 294, 854, 854, 0, 280, 175, 854, 854, 313, |
---|
394 | 854, 824, 854, 854, 424, 854, 823, 854, 428, 429, |
---|
395 | 854, 0, 790, 783, 318, 321, 430, 809, 394, 808, |
---|
396 | 411, 434, 0, 786, 781, 778, 448, 854, 804, 803, |
---|
397 | 430, 454, 854, 458, 460, 463, 854, 854, 854, 0, |
---|
398 | 854, 463, 854, 854, 466, 854, 854, 854, 854, 854, |
---|
399 | |
---|
400 | 854, 854, 469, 854, 854, 472, 787, 776, 785, 475, |
---|
401 | 854, 854, 475, 0, 784, 783, 808, 854, 854, 807, |
---|
402 | 289, 151, 806, 452, 444, 854, 854, 480, 472, 0, |
---|
403 | 0, 455, 488, 854, 489, 854, 854, 490, 0, 770, |
---|
404 | 768, 496, 854, 498, 776, 854, 0, 767, 773, 764, |
---|
405 | 500, 854, 502, 506, 508, 854, 510, 512, 854, 514, |
---|
406 | 516, 854, 518, 765, 771, 757, 520, 854, 522, 762, |
---|
407 | 755, 794, 435, 493, 793, 504, 524, 525, 854, 527, |
---|
408 | 762, 764, 760, 757, 761, 530, 750, 534, 754, 748, |
---|
409 | 752, 535, 532, 537, 541, 742, 753, 740, 745, 750, |
---|
410 | |
---|
411 | 542, 745, 545, 750, 743, 748, 538, 540, 545, 546, |
---|
412 | 741, 745, 739, 739, 742, 548, 740, 854, 739, 0, |
---|
413 | 280, 550, 551, 553, 741, 725, 739, 710, 701, 554, |
---|
414 | 854, 0, 556, 552, 557, 558, 692, 688, 652, 650, |
---|
415 | 585, 563, 566, 570, 571, 572, 0, 592, 0, 594, |
---|
416 | 590, 587, 618, 573, 614, 574, 0, 568, 0, 565, |
---|
417 | 444, 589, 437, 576, 424, 585, 0, 591, 0, 596, |
---|
418 | 311, 240, 0, 600, 854, 605, 0, 611, 854, 616, |
---|
419 | 234, 227, 854, 627, 631, 635, 639, 643, 647, 651, |
---|
420 | 655, 659, 663, 667, 669, 671, 675, 176, 166, 679, |
---|
421 | |
---|
422 | 98, 683, 687, 691, 695, 699, 703, 707, 711, 715, |
---|
423 | 719, 723, 727, 731, 735, 739, 743, 747, 751, 755, |
---|
424 | 759, 763 |
---|
425 | } ; |
---|
426 | |
---|
427 | static yyconst short int yy_def[423] = |
---|
428 | { 0, |
---|
429 | 383, 383, 384, 384, 385, 385, 383, 7, 386, 386, |
---|
430 | 387, 387, 384, 384, 388, 388, 389, 389, 390, 390, |
---|
431 | 391, 391, 383, 23, 392, 392, 383, 27, 393, 393, |
---|
432 | 394, 394, 384, 384, 384, 384, 384, 384, 384, 384, |
---|
433 | 384, 384, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
434 | 383, 383, 383, 383, 395, 395, 395, 383, 383, 383, |
---|
435 | 396, 396, 396, 397, 383, 397, 397, 383, 383, 383, |
---|
436 | 383, 383, 383, 383, 383, 383, 383, 398, 383, 383, |
---|
437 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
438 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
439 | |
---|
440 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
441 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
442 | 383, 383, 399, 399, 399, 383, 400, 383, 400, 400, |
---|
443 | 400, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
444 | 383, 383, 383, 383, 401, 401, 401, 383, 383, 383, |
---|
445 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
446 | 383, 402, 383, 383, 403, 383, 383, 395, 383, 395, |
---|
447 | 395, 383, 404, 383, 383, 383, 405, 383, 396, 396, |
---|
448 | 396, 397, 383, 397, 397, 383, 383, 383, 383, 398, |
---|
449 | 383, 406, 383, 383, 407, 383, 383, 383, 383, 383, |
---|
450 | |
---|
451 | 383, 383, 383, 383, 383, 408, 383, 383, 383, 383, |
---|
452 | 383, 383, 409, 399, 399, 399, 400, 383, 383, 410, |
---|
453 | 400, 400, 411, 400, 400, 383, 383, 412, 383, 401, |
---|
454 | 401, 401, 383, 383, 383, 383, 383, 383, 402, 383, |
---|
455 | 383, 403, 383, 403, 383, 383, 404, 383, 383, 383, |
---|
456 | 405, 383, 405, 397, 406, 383, 406, 407, 383, 407, |
---|
457 | 408, 383, 408, 383, 383, 383, 409, 383, 409, 399, |
---|
458 | 399, 410, 400, 400, 411, 400, 400, 412, 383, 412, |
---|
459 | 383, 383, 383, 383, 383, 397, 383, 383, 383, 399, |
---|
460 | 399, 400, 400, 400, 400, 383, 383, 383, 383, 383, |
---|
461 | |
---|
462 | 397, 383, 383, 383, 399, 399, 400, 400, 400, 400, |
---|
463 | 383, 383, 383, 383, 383, 397, 383, 383, 399, 399, |
---|
464 | 400, 400, 400, 400, 383, 383, 383, 383, 383, 397, |
---|
465 | 383, 399, 400, 400, 400, 400, 383, 383, 383, 383, |
---|
466 | 383, 397, 400, 400, 400, 400, 413, 383, 414, 383, |
---|
467 | 383, 397, 415, 400, 416, 400, 413, 383, 414, 383, |
---|
468 | 383, 397, 415, 400, 416, 400, 417, 418, 419, 420, |
---|
469 | 421, 422, 417, 418, 383, 418, 419, 420, 383, 420, |
---|
470 | 421, 422, 0, 383, 383, 383, 383, 383, 383, 383, |
---|
471 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
472 | |
---|
473 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
474 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
475 | 383, 383 |
---|
476 | } ; |
---|
477 | |
---|
478 | static yyconst short int yy_nxt[902] = |
---|
479 | { 0, |
---|
480 | 44, 45, 46, 47, 45, 48, 44, 49, 44, 44, |
---|
481 | 44, 50, 44, 44, 51, 52, 44, 44, 53, 54, |
---|
482 | 55, 55, 55, 56, 55, 55, 57, 44, 55, 55, |
---|
483 | 55, 55, 55, 55, 55, 55, 55, 56, 55, 55, |
---|
484 | 55, 55, 55, 55, 55, 44, 44, 44, 58, 46, |
---|
485 | 47, 58, 48, 44, 59, 44, 44, 44, 50, 44, |
---|
486 | 44, 60, 52, 44, 44, 53, 54, 61, 61, 61, |
---|
487 | 62, 61, 61, 63, 44, 61, 61, 61, 61, 61, |
---|
488 | 61, 61, 61, 61, 62, 61, 61, 61, 61, 61, |
---|
489 | 61, 61, 44, 44, 65, 66, 65, 66, 80, 81, |
---|
490 | |
---|
491 | 230, 67, 68, 69, 70, 71, 69, 68, 68, 68, |
---|
492 | 72, 73, 68, 74, 68, 68, 68, 68, 68, 75, |
---|
493 | 76, 77, 78, 78, 78, 78, 78, 78, 78, 68, |
---|
494 | 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, |
---|
495 | 78, 78, 78, 78, 78, 78, 78, 68, 68, 80, |
---|
496 | 81, 93, 94, 218, 82, 84, 85, 86, 87, 95, |
---|
497 | 88, 93, 94, 97, 98, 97, 98, 89, 214, 95, |
---|
498 | 178, 99, 159, 99, 165, 159, 128, 129, 190, 101, |
---|
499 | 102, 130, 103, 101, 102, 194, 103, 128, 129, 195, |
---|
500 | 160, 274, 131, 150, 151, 152, 150, 232, 90, 91, |
---|
501 | |
---|
502 | 84, 85, 86, 87, 104, 88, 232, 162, 104, 183, |
---|
503 | 184, 163, 89, 150, 151, 152, 150, 155, 156, 157, |
---|
504 | 155, 155, 156, 157, 155, 164, 183, 184, 169, 218, |
---|
505 | 203, 169, 166, 203, 158, 166, 218, 153, 158, 170, |
---|
506 | 171, 201, 218, 90, 91, 106, 107, 108, 106, 171, |
---|
507 | 167, 109, 172, 170, 169, 172, 173, 153, 110, 169, |
---|
508 | 174, 186, 111, 202, 186, 180, 183, 184, 181, 205, |
---|
509 | 160, 175, 162, 206, 176, 112, 163, 181, 187, 180, |
---|
510 | 177, 210, 218, 113, 210, 114, 106, 107, 108, 106, |
---|
511 | 164, 218, 115, 173, 162, 185, 212, 174, 163, 110, |
---|
512 | |
---|
513 | 213, 173, 227, 111, 231, 174, 228, 229, 229, 229, |
---|
514 | 229, 176, 164, 218, 233, 333, 112, 233, 231, 176, |
---|
515 | 243, 244, 166, 273, 113, 166, 114, 116, 117, 118, |
---|
516 | 119, 117, 116, 116, 120, 116, 116, 116, 116, 116, |
---|
517 | 116, 121, 116, 116, 116, 122, 116, 123, 123, 123, |
---|
518 | 123, 123, 123, 123, 116, 123, 123, 123, 124, 123, |
---|
519 | 123, 123, 123, 123, 123, 123, 123, 123, 125, 123, |
---|
520 | 123, 123, 116, 116, 132, 132, 133, 134, 132, 135, |
---|
521 | 136, 132, 137, 138, 132, 139, 132, 132, 140, 141, |
---|
522 | 142, 132, 143, 144, 145, 145, 145, 146, 145, 145, |
---|
523 | |
---|
524 | 147, 132, 145, 145, 145, 145, 145, 145, 145, 145, |
---|
525 | 145, 146, 145, 145, 145, 145, 145, 145, 145, 148, |
---|
526 | 132, 218, 218, 245, 169, 235, 218, 246, 235, 159, |
---|
527 | 238, 166, 159, 238, 166, 172, 170, 218, 172, 218, |
---|
528 | 220, 223, 236, 169, 221, 224, 218, 160, 160, 167, |
---|
529 | 252, 253, 170, 160, 218, 180, 183, 184, 222, 225, |
---|
530 | 183, 184, 183, 184, 186, 256, 257, 186, 259, 260, |
---|
531 | 203, 180, 292, 203, 262, 263, 210, 268, 269, 210, |
---|
532 | 231, 187, 279, 280, 277, 369, 276, 229, 229, 233, |
---|
533 | 235, 238, 233, 235, 238, 218, 231, 254, 243, 244, |
---|
534 | |
---|
535 | 243, 244, 252, 253, 252, 253, 218, 236, 183, 184, |
---|
536 | 256, 257, 256, 257, 259, 260, 259, 260, 262, 263, |
---|
537 | 262, 263, 268, 269, 268, 269, 218, 279, 280, 279, |
---|
538 | 280, 293, 183, 184, 218, 303, 286, 218, 303, 218, |
---|
539 | 218, 294, 218, 218, 183, 184, 303, 218, 218, 303, |
---|
540 | 183, 184, 218, 218, 218, 218, 183, 184, 218, 218, |
---|
541 | 218, 308, 295, 288, 301, 183, 184, 307, 218, 309, |
---|
542 | 310, 322, 218, 218, 218, 218, 218, 324, 218, 316, |
---|
543 | 334, 321, 330, 336, 343, 345, 335, 218, 323, 183, |
---|
544 | 184, 183, 184, 375, 376, 344, 342, 352, 379, 380, |
---|
545 | |
---|
546 | 368, 346, 375, 376, 364, 366, 353, 375, 376, 367, |
---|
547 | 354, 355, 356, 379, 380, 362, 218, 371, 379, 380, |
---|
548 | 218, 361, 360, 358, 370, 351, 372, 44, 44, 44, |
---|
549 | 44, 64, 64, 64, 64, 79, 79, 79, 79, 83, |
---|
550 | 83, 83, 83, 92, 92, 92, 92, 96, 96, 96, |
---|
551 | 96, 100, 100, 100, 100, 105, 105, 105, 105, 127, |
---|
552 | 127, 127, 127, 149, 149, 149, 149, 154, 154, 154, |
---|
553 | 154, 168, 168, 179, 179, 182, 182, 182, 182, 217, |
---|
554 | 217, 217, 217, 239, 350, 239, 239, 242, 242, 242, |
---|
555 | 242, 247, 349, 247, 247, 251, 251, 251, 251, 255, |
---|
556 | |
---|
557 | 255, 255, 255, 258, 258, 258, 258, 261, 261, 261, |
---|
558 | 261, 267, 267, 267, 267, 272, 272, 272, 272, 275, |
---|
559 | 275, 275, 275, 278, 278, 278, 278, 357, 348, 357, |
---|
560 | 357, 359, 347, 359, 359, 363, 363, 363, 363, 365, |
---|
561 | 365, 365, 365, 373, 341, 373, 373, 374, 374, 374, |
---|
562 | 374, 377, 340, 377, 377, 378, 378, 378, 378, 381, |
---|
563 | 381, 381, 381, 382, 382, 382, 382, 339, 338, 337, |
---|
564 | 332, 331, 329, 328, 327, 326, 325, 320, 319, 318, |
---|
565 | 317, 315, 314, 313, 312, 311, 306, 305, 304, 302, |
---|
566 | 300, 299, 298, 297, 296, 218, 218, 291, 290, 289, |
---|
567 | |
---|
568 | 288, 287, 285, 284, 283, 246, 282, 281, 218, 218, |
---|
569 | 218, 271, 270, 266, 265, 264, 169, 169, 250, 249, |
---|
570 | 248, 169, 169, 241, 240, 237, 234, 226, 219, 218, |
---|
571 | 216, 215, 211, 209, 208, 207, 204, 200, 199, 198, |
---|
572 | 197, 196, 193, 192, 191, 189, 188, 169, 169, 165, |
---|
573 | 161, 383, 126, 43, 383, 383, 383, 383, 383, 383, |
---|
574 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
575 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
576 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
577 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
578 | |
---|
579 | 383 |
---|
580 | } ; |
---|
581 | |
---|
582 | static yyconst short int yy_chk[902] = |
---|
583 | { 0, |
---|
584 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
585 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
586 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
587 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
588 | 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, |
---|
589 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
590 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
591 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
592 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
593 | 2, 2, 2, 2, 5, 5, 6, 6, 9, 9, |
---|
594 | |
---|
595 | 401, 6, 7, 7, 7, 7, 7, 7, 7, 7, |
---|
596 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
---|
597 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
---|
598 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
---|
599 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 10, |
---|
600 | 10, 15, 15, 222, 10, 11, 11, 11, 11, 15, |
---|
601 | 11, 16, 16, 17, 17, 18, 18, 11, 399, 16, |
---|
602 | 60, 17, 45, 18, 60, 45, 25, 25, 398, 19, |
---|
603 | 19, 25, 19, 20, 20, 89, 20, 26, 26, 89, |
---|
604 | 45, 222, 26, 29, 29, 29, 29, 147, 11, 11, |
---|
605 | |
---|
606 | 12, 12, 12, 12, 19, 12, 147, 49, 20, 64, |
---|
607 | 64, 49, 12, 30, 30, 30, 30, 31, 31, 31, |
---|
608 | 31, 32, 32, 32, 32, 49, 66, 66, 56, 382, |
---|
609 | 106, 57, 54, 106, 31, 54, 381, 29, 32, 56, |
---|
610 | 57, 104, 372, 12, 12, 21, 21, 21, 21, 57, |
---|
611 | 54, 21, 58, 56, 62, 58, 59, 30, 21, 63, |
---|
612 | 59, 69, 21, 104, 69, 62, 67, 67, 63, 110, |
---|
613 | 58, 59, 109, 110, 59, 21, 109, 63, 69, 62, |
---|
614 | 59, 117, 321, 21, 117, 21, 22, 22, 22, 22, |
---|
615 | 109, 221, 22, 115, 120, 67, 121, 115, 120, 22, |
---|
616 | |
---|
617 | 121, 126, 140, 22, 146, 126, 140, 141, 141, 142, |
---|
618 | 142, 115, 120, 371, 150, 321, 22, 150, 146, 126, |
---|
619 | 165, 165, 166, 221, 22, 166, 22, 23, 23, 23, |
---|
620 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, |
---|
621 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, |
---|
622 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, |
---|
623 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, |
---|
624 | 23, 23, 23, 23, 27, 27, 27, 27, 27, 27, |
---|
625 | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, |
---|
626 | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, |
---|
627 | |
---|
628 | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, |
---|
629 | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, |
---|
630 | 27, 130, 131, 169, 171, 155, 365, 169, 155, 159, |
---|
631 | 160, 167, 159, 160, 167, 172, 171, 273, 172, 363, |
---|
632 | 130, 131, 155, 181, 130, 131, 225, 159, 160, 167, |
---|
633 | 177, 177, 171, 172, 224, 181, 182, 182, 130, 131, |
---|
634 | 184, 184, 185, 185, 186, 192, 192, 186, 195, 195, |
---|
635 | 203, 181, 273, 203, 206, 206, 210, 213, 213, 210, |
---|
636 | 232, 186, 228, 228, 225, 361, 224, 229, 229, 233, |
---|
637 | 235, 238, 233, 235, 238, 274, 232, 185, 242, 242, |
---|
638 | |
---|
639 | 244, 244, 251, 251, 253, 253, 276, 235, 254, 254, |
---|
640 | 255, 255, 257, 257, 258, 258, 260, 260, 261, 261, |
---|
641 | 263, 263, 267, 267, 269, 269, 277, 278, 278, 280, |
---|
642 | 280, 274, 286, 286, 293, 288, 254, 292, 288, 294, |
---|
643 | 307, 276, 308, 295, 301, 301, 303, 309, 310, 303, |
---|
644 | 316, 316, 322, 323, 334, 324, 330, 330, 333, 335, |
---|
645 | 336, 293, 277, 288, 286, 342, 342, 292, 343, 294, |
---|
646 | 295, 308, 344, 345, 346, 354, 356, 310, 364, 301, |
---|
647 | 322, 307, 316, 324, 333, 335, 323, 366, 309, 352, |
---|
648 | 352, 362, 362, 368, 368, 334, 330, 342, 370, 370, |
---|
649 | |
---|
650 | 360, 336, 374, 374, 354, 356, 343, 376, 376, 358, |
---|
651 | 344, 345, 346, 378, 378, 352, 355, 364, 380, 380, |
---|
652 | 353, 351, 350, 348, 362, 341, 366, 384, 384, 384, |
---|
653 | 384, 385, 385, 385, 385, 386, 386, 386, 386, 387, |
---|
654 | 387, 387, 387, 388, 388, 388, 388, 389, 389, 389, |
---|
655 | 389, 390, 390, 390, 390, 391, 391, 391, 391, 392, |
---|
656 | 392, 392, 392, 393, 393, 393, 393, 394, 394, 394, |
---|
657 | 394, 395, 395, 396, 396, 397, 397, 397, 397, 400, |
---|
658 | 400, 400, 400, 402, 340, 402, 402, 403, 403, 403, |
---|
659 | 403, 404, 339, 404, 404, 405, 405, 405, 405, 406, |
---|
660 | |
---|
661 | 406, 406, 406, 407, 407, 407, 407, 408, 408, 408, |
---|
662 | 408, 409, 409, 409, 409, 410, 410, 410, 410, 411, |
---|
663 | 411, 411, 411, 412, 412, 412, 412, 413, 338, 413, |
---|
664 | 413, 414, 337, 414, 414, 415, 415, 415, 415, 416, |
---|
665 | 416, 416, 416, 417, 329, 417, 417, 418, 418, 418, |
---|
666 | 418, 419, 328, 419, 419, 420, 420, 420, 420, 421, |
---|
667 | 421, 421, 421, 422, 422, 422, 422, 327, 326, 325, |
---|
668 | 319, 317, 315, 314, 313, 312, 311, 306, 305, 304, |
---|
669 | 302, 300, 299, 298, 297, 296, 291, 290, 289, 287, |
---|
670 | 285, 284, 283, 282, 281, 275, 272, 271, 270, 266, |
---|
671 | |
---|
672 | 265, 264, 250, 249, 248, 245, 241, 240, 223, 220, |
---|
673 | 217, 216, 215, 209, 208, 207, 180, 179, 176, 175, |
---|
674 | 174, 170, 168, 164, 163, 157, 152, 134, 129, 127, |
---|
675 | 125, 124, 119, 114, 113, 112, 108, 102, 99, 98, |
---|
676 | 95, 94, 85, 82, 81, 75, 71, 61, 55, 51, |
---|
677 | 47, 43, 24, 383, 383, 383, 383, 383, 383, 383, |
---|
678 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
679 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
680 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
681 | 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, |
---|
682 | |
---|
683 | 383 |
---|
684 | } ; |
---|
685 | |
---|
686 | static yy_state_type yy_last_accepting_state; |
---|
687 | static char *yy_last_accepting_cpos; |
---|
688 | |
---|
689 | /* The intent behind this definition is that it'll catch |
---|
690 | * any uses of REJECT which flex missed. |
---|
691 | */ |
---|
692 | #define REJECT reject_used_but_not_detected |
---|
693 | static int yy_more_flag = 0; |
---|
694 | static int yy_more_len = 0; |
---|
695 | #define yymore() (yy_more_flag = 1) |
---|
696 | #define YY_MORE_ADJ yy_more_len |
---|
697 | #define YY_RESTORE_YY_MORE_OFFSET |
---|
698 | char *yytext; |
---|
699 | #line 1 "scanner.l" |
---|
700 | #define INITIAL 0 |
---|
701 | #line 2 "scanner.l" |
---|
702 | /**************************************** |
---|
703 | * Computer Algebra System SINGULAR * |
---|
704 | ****************************************/ |
---|
705 | /* $Id: scanner.cc,v 1.1 2005-07-25 09:01:21 Singular Exp $ */ |
---|
706 | #include <stdio.h> |
---|
707 | #include <string.h> |
---|
708 | #include <stdlib.h> |
---|
709 | #include <ctype.h> |
---|
710 | |
---|
711 | #include "modgen.h" |
---|
712 | #include "stype.h" |
---|
713 | #include "../../Singular/grammar.h" |
---|
714 | #include "mod_grammar.h" |
---|
715 | |
---|
716 | #define DEBUG 3 |
---|
717 | |
---|
718 | # define YYLP_ERR_NONE 0 |
---|
719 | # define YYLP_DEF_BR2 1 |
---|
720 | # define YYLP_BODY_BR2 2 |
---|
721 | # define YYLP_BODY_BR3 3 |
---|
722 | # define YYLP_BODY_TMBR2 4 |
---|
723 | # define YYLP_BODY_TMBR3 5 |
---|
724 | # define YYLP_EX_BR2 6 |
---|
725 | # define YYLP_EX_BR3 7 |
---|
726 | # define YYLP_BAD_CHAR 8 |
---|
727 | # define YYLP_MISSQUOT 9 |
---|
728 | # define YYLP_MISS_BR1 10 |
---|
729 | # define YYLP_MISS_BR2 11 |
---|
730 | # define YYLP_MISS_BR3 12 |
---|
731 | |
---|
732 | extern int iseof; |
---|
733 | |
---|
734 | int offset = 0; |
---|
735 | int yylineno = 1; |
---|
736 | int do_return = 0; |
---|
737 | |
---|
738 | int state_level = -1; |
---|
739 | int state_max = 0; |
---|
740 | char *yylp_buffer_start; |
---|
741 | |
---|
742 | extern int sectnum; |
---|
743 | static int oldsectnum = 1; |
---|
744 | extern moddef module_def; |
---|
745 | extern procdef procedure_decl; |
---|
746 | |
---|
747 | char *sectname[] = { "sect -0", "section 1", |
---|
748 | "Singular", "procedures", "C-part" |
---|
749 | }; |
---|
750 | |
---|
751 | struct _states { |
---|
752 | char name[32]; |
---|
753 | int state; |
---|
754 | } * old_states = NULL; |
---|
755 | /* int *old_states = NULL;*/ |
---|
756 | |
---|
757 | int current_pos(int i); |
---|
758 | int read_string(char **buffer, long *start, long end); |
---|
759 | int libread(FILE* f, char* buf, int max_size); |
---|
760 | void add_action(char *new_text); |
---|
761 | |
---|
762 | void push_state(int state, int new_state, char *name); |
---|
763 | void switch_state(int state, int new_state, char *name); |
---|
764 | void pop_state(); |
---|
765 | int return_sect_token(int passed, int old_sect, int new_sect); |
---|
766 | extern int init_modgen(moddef *module_def, char *filename); |
---|
767 | |
---|
768 | static char * dupyytext() |
---|
769 | { |
---|
770 | if (yyleng>0) yytext[yyleng-1] = '\0'; |
---|
771 | return strdup((char *)yytext); |
---|
772 | } |
---|
773 | |
---|
774 | # undef YY_DECL |
---|
775 | # define YY_DECL int yylex(YYSTYPE* lvalp) |
---|
776 | |
---|
777 | # undef YY_INPUT |
---|
778 | # define YY_INPUT(buf,result,max_size) \ |
---|
779 | if ( ((result = libread( (yyin), (char *) buf, max_size )) < 0 ) \ |
---|
780 | && ferror( yyin ) ) \ |
---|
781 | YY_FATAL_ERROR( "read in flex scanner failed" ); |
---|
782 | |
---|
783 | # undef yywrap |
---|
784 | extern "C" |
---|
785 | { |
---|
786 | int yywrap(); |
---|
787 | } |
---|
788 | |
---|
789 | #define ACTION_ECHO add_action( yytext ) |
---|
790 | |
---|
791 | /* %start START */ |
---|
792 | #define preamble 1 |
---|
793 | |
---|
794 | #define MODINITIAL 2 |
---|
795 | |
---|
796 | #define PROCCMDBLOCK 3 |
---|
797 | |
---|
798 | #define CODEBLOCK 4 |
---|
799 | |
---|
800 | #define CODEBLOCK2 5 |
---|
801 | |
---|
802 | #define module 6 |
---|
803 | |
---|
804 | #define COMMENT 7 |
---|
805 | |
---|
806 | #define COMMENTB 8 |
---|
807 | |
---|
808 | #define STRING 9 |
---|
809 | |
---|
810 | #define SECT2 10 |
---|
811 | |
---|
812 | #define SECT3 11 |
---|
813 | |
---|
814 | #define SECT4 12 |
---|
815 | |
---|
816 | #define PROCDECL 13 |
---|
817 | |
---|
818 | #define EXAMPLE 14 |
---|
819 | |
---|
820 | #define ANYLINE 15 |
---|
821 | |
---|
822 | #define pdef 16 |
---|
823 | |
---|
824 | #define procopt 17 |
---|
825 | |
---|
826 | #define procdef 18 |
---|
827 | |
---|
828 | #define ctext 19 |
---|
829 | |
---|
830 | #define cstring 20 |
---|
831 | |
---|
832 | #line 833 "scanner.cc" |
---|
833 | |
---|
834 | /* Macros after this point can all be overridden by user definitions in |
---|
835 | * section 1. |
---|
836 | */ |
---|
837 | |
---|
838 | #ifndef YY_SKIP_YYWRAP |
---|
839 | #ifdef __cplusplus |
---|
840 | extern "C" int yywrap YY_PROTO(( void )); |
---|
841 | #else |
---|
842 | extern int yywrap YY_PROTO(( void )); |
---|
843 | #endif |
---|
844 | #endif |
---|
845 | |
---|
846 | #ifndef YY_NO_UNPUT |
---|
847 | static void yyunput YY_PROTO(( int c, char *buf_ptr )); |
---|
848 | #endif |
---|
849 | |
---|
850 | #ifndef yytext_ptr |
---|
851 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
---|
852 | #endif |
---|
853 | |
---|
854 | #ifdef YY_NEED_STRLEN |
---|
855 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
---|
856 | #endif |
---|
857 | |
---|
858 | #ifndef YY_NO_INPUT |
---|
859 | #ifdef __cplusplus |
---|
860 | static int yyinput YY_PROTO(( void )); |
---|
861 | #else |
---|
862 | static int input YY_PROTO(( void )); |
---|
863 | #endif |
---|
864 | #endif |
---|
865 | |
---|
866 | #if YY_STACK_USED |
---|
867 | static int yy_start_stack_ptr = 0; |
---|
868 | static int yy_start_stack_depth = 0; |
---|
869 | static int *yy_start_stack = 0; |
---|
870 | #ifndef YY_NO_PUSH_STATE |
---|
871 | static void yy_push_state YY_PROTO(( int new_state )); |
---|
872 | #endif |
---|
873 | #ifndef YY_NO_POP_STATE |
---|
874 | static void yy_pop_state YY_PROTO(( void )); |
---|
875 | #endif |
---|
876 | #ifndef YY_NO_TOP_STATE |
---|
877 | static int yy_top_state YY_PROTO(( void )); |
---|
878 | #endif |
---|
879 | |
---|
880 | #else |
---|
881 | #define YY_NO_PUSH_STATE 1 |
---|
882 | #define YY_NO_POP_STATE 1 |
---|
883 | #define YY_NO_TOP_STATE 1 |
---|
884 | #endif |
---|
885 | |
---|
886 | #ifdef YY_MALLOC_DECL |
---|
887 | YY_MALLOC_DECL |
---|
888 | #else |
---|
889 | #if __STDC__ |
---|
890 | #ifndef __cplusplus |
---|
891 | #include <stdlib.h> |
---|
892 | #endif |
---|
893 | #else |
---|
894 | /* Just try to get by without declaring the routines. This will fail |
---|
895 | * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) |
---|
896 | * or sizeof(void*) != sizeof(int). |
---|
897 | */ |
---|
898 | #endif |
---|
899 | #endif |
---|
900 | |
---|
901 | /* Amount of stuff to slurp up with each read. */ |
---|
902 | #ifndef YY_READ_BUF_SIZE |
---|
903 | #define YY_READ_BUF_SIZE 8192 |
---|
904 | #endif |
---|
905 | |
---|
906 | /* Copy whatever the last rule matched to the standard output. */ |
---|
907 | |
---|
908 | #ifndef ECHO |
---|
909 | /* This used to be an fputs(), but since the string might contain NUL's, |
---|
910 | * we now use fwrite(). |
---|
911 | */ |
---|
912 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
---|
913 | #endif |
---|
914 | |
---|
915 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
---|
916 | * is returned in "result". |
---|
917 | */ |
---|
918 | #ifndef YY_INPUT |
---|
919 | #define YY_INPUT(buf,result,max_size) \ |
---|
920 | if ( yy_current_buffer->yy_is_interactive ) \ |
---|
921 | { \ |
---|
922 | int c = '*', n; \ |
---|
923 | for ( n = 0; n < max_size && \ |
---|
924 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
---|
925 | buf[n] = (char) c; \ |
---|
926 | if ( c == '\n' ) \ |
---|
927 | buf[n++] = (char) c; \ |
---|
928 | if ( c == EOF && ferror( yyin ) ) \ |
---|
929 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
---|
930 | result = n; \ |
---|
931 | } \ |
---|
932 | else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
---|
933 | && ferror( yyin ) ) \ |
---|
934 | YY_FATAL_ERROR( "input in flex scanner failed" ); |
---|
935 | #endif |
---|
936 | |
---|
937 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
---|
938 | * we don't want an extra ';' after the "return" because that will cause |
---|
939 | * some compilers to complain about unreachable statements. |
---|
940 | */ |
---|
941 | #ifndef yyterminate |
---|
942 | #define yyterminate() return YY_NULL |
---|
943 | #endif |
---|
944 | |
---|
945 | /* Number of entries by which start-condition stack grows. */ |
---|
946 | #ifndef YY_START_STACK_INCR |
---|
947 | #define YY_START_STACK_INCR 25 |
---|
948 | #endif |
---|
949 | |
---|
950 | /* Report a fatal error. */ |
---|
951 | #ifndef YY_FATAL_ERROR |
---|
952 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
---|
953 | #endif |
---|
954 | |
---|
955 | /* Default declaration of generated scanner - a define so the user can |
---|
956 | * easily add parameters. |
---|
957 | */ |
---|
958 | #ifndef YY_DECL |
---|
959 | #define YY_DECL int yylex YY_PROTO(( void )) |
---|
960 | #endif |
---|
961 | |
---|
962 | /* Code executed at the beginning of each rule, after yytext and yyleng |
---|
963 | * have been set up. |
---|
964 | */ |
---|
965 | #ifndef YY_USER_ACTION |
---|
966 | #define YY_USER_ACTION |
---|
967 | #endif |
---|
968 | |
---|
969 | /* Code executed at the end of each rule. */ |
---|
970 | #ifndef YY_BREAK |
---|
971 | #define YY_BREAK break; |
---|
972 | #endif |
---|
973 | |
---|
974 | #define YY_RULE_SETUP \ |
---|
975 | if ( yyleng > 0 ) \ |
---|
976 | yy_current_buffer->yy_at_bol = \ |
---|
977 | (yytext[yyleng - 1] == '\n'); \ |
---|
978 | YY_USER_ACTION |
---|
979 | |
---|
980 | YY_DECL |
---|
981 | { |
---|
982 | register yy_state_type yy_current_state; |
---|
983 | register char *yy_cp = NULL, *yy_bp = NULL; |
---|
984 | register int yy_act; |
---|
985 | |
---|
986 | #line 149 "scanner.l" |
---|
987 | |
---|
988 | static int brace1 = 0; /* { } */ |
---|
989 | static int brace2 = 0; /* ( ) */ |
---|
990 | static int brace3 = 0; /* [ ] */ |
---|
991 | static int quote = 0; /* " */ |
---|
992 | |
---|
993 | #line 994 "scanner.cc" |
---|
994 | |
---|
995 | if ( yy_init ) |
---|
996 | { |
---|
997 | yy_init = 0; |
---|
998 | |
---|
999 | #ifdef YY_USER_INIT |
---|
1000 | YY_USER_INIT; |
---|
1001 | #endif |
---|
1002 | |
---|
1003 | if ( ! yy_start ) |
---|
1004 | yy_start = 1; /* first start state */ |
---|
1005 | |
---|
1006 | if ( ! yyin ) |
---|
1007 | yyin = stdin; |
---|
1008 | |
---|
1009 | if ( ! yyout ) |
---|
1010 | yyout = stdout; |
---|
1011 | |
---|
1012 | if ( ! yy_current_buffer ) |
---|
1013 | yy_current_buffer = |
---|
1014 | yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
1015 | |
---|
1016 | yy_load_buffer_state(); |
---|
1017 | } |
---|
1018 | |
---|
1019 | while ( 1 ) /* loops until end-of-file is reached */ |
---|
1020 | { |
---|
1021 | yy_more_len = 0; |
---|
1022 | if ( yy_more_flag ) |
---|
1023 | { |
---|
1024 | yy_more_len = yy_c_buf_p - yytext_ptr; |
---|
1025 | yy_more_flag = 0; |
---|
1026 | } |
---|
1027 | yy_cp = yy_c_buf_p; |
---|
1028 | |
---|
1029 | /* Support of yytext. */ |
---|
1030 | *yy_cp = yy_hold_char; |
---|
1031 | |
---|
1032 | /* yy_bp points to the position in yy_ch_buf of the start of |
---|
1033 | * the current run. |
---|
1034 | */ |
---|
1035 | yy_bp = yy_cp; |
---|
1036 | |
---|
1037 | yy_current_state = yy_start; |
---|
1038 | yy_current_state += YY_AT_BOL(); |
---|
1039 | yy_match: |
---|
1040 | do |
---|
1041 | { |
---|
1042 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
---|
1043 | if ( yy_accept[yy_current_state] ) |
---|
1044 | { |
---|
1045 | yy_last_accepting_state = yy_current_state; |
---|
1046 | yy_last_accepting_cpos = yy_cp; |
---|
1047 | } |
---|
1048 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1049 | { |
---|
1050 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1051 | if ( yy_current_state >= 384 ) |
---|
1052 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1053 | } |
---|
1054 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1055 | ++yy_cp; |
---|
1056 | } |
---|
1057 | while ( yy_base[yy_current_state] != 854 ); |
---|
1058 | |
---|
1059 | yy_find_action: |
---|
1060 | yy_act = yy_accept[yy_current_state]; |
---|
1061 | if ( yy_act == 0 ) |
---|
1062 | { /* have to back up */ |
---|
1063 | yy_cp = yy_last_accepting_cpos; |
---|
1064 | yy_current_state = yy_last_accepting_state; |
---|
1065 | yy_act = yy_accept[yy_current_state]; |
---|
1066 | } |
---|
1067 | |
---|
1068 | YY_DO_BEFORE_ACTION; |
---|
1069 | |
---|
1070 | |
---|
1071 | do_action: /* This label is used only to access EOF actions. */ |
---|
1072 | |
---|
1073 | |
---|
1074 | switch ( yy_act ) |
---|
1075 | { /* beginning of action switch */ |
---|
1076 | case 0: /* must back up */ |
---|
1077 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
---|
1078 | *yy_cp = yy_hold_char; |
---|
1079 | yy_cp = yy_last_accepting_cpos; |
---|
1080 | yy_current_state = yy_last_accepting_state; |
---|
1081 | goto yy_find_action; |
---|
1082 | |
---|
1083 | case YY_STATE_EOF(COMMENT): |
---|
1084 | case YY_STATE_EOF(COMMENTB): |
---|
1085 | case YY_STATE_EOF(STRING): |
---|
1086 | case YY_STATE_EOF(INITIAL): |
---|
1087 | #line 155 "scanner.l" |
---|
1088 | { |
---|
1089 | printf( "EOF encountered inside an action\n"); |
---|
1090 | printf("ERRRRROOOOORRR\n"); |
---|
1091 | } |
---|
1092 | YY_BREAK |
---|
1093 | |
---|
1094 | case 1: |
---|
1095 | YY_RULE_SETUP |
---|
1096 | #line 161 "scanner.l" |
---|
1097 | { |
---|
1098 | int passed = (oldsectnum == sectnum) ? 0 : 1; |
---|
1099 | int old_sect = sectnum; |
---|
1100 | |
---|
1101 | oldsectnum = sectnum; |
---|
1102 | sectnum = 2; |
---|
1103 | if(!passed) yyless(0); |
---|
1104 | else push_state(YYSTATE, SECT2, "SECT2"); |
---|
1105 | return(return_sect_token(passed, old_sect, sectnum)); |
---|
1106 | } |
---|
1107 | YY_BREAK |
---|
1108 | case 2: |
---|
1109 | YY_RULE_SETUP |
---|
1110 | #line 171 "scanner.l" |
---|
1111 | { |
---|
1112 | int passed = (oldsectnum == sectnum) ? 0 : 1; |
---|
1113 | int old_sect = sectnum; |
---|
1114 | |
---|
1115 | oldsectnum = sectnum; |
---|
1116 | sectnum = 2; |
---|
1117 | if(!passed) yyless(0); |
---|
1118 | else push_state(YYSTATE, SECT2, "SECT2"); |
---|
1119 | return(return_sect_token(passed, old_sect, sectnum)); |
---|
1120 | } |
---|
1121 | YY_BREAK |
---|
1122 | case 3: |
---|
1123 | YY_RULE_SETUP |
---|
1124 | #line 181 "scanner.l" |
---|
1125 | { |
---|
1126 | int passed = (oldsectnum == sectnum) ? 0 : 1; |
---|
1127 | int old_sect = sectnum; |
---|
1128 | |
---|
1129 | oldsectnum = sectnum; |
---|
1130 | sectnum = 3; |
---|
1131 | if(!passed) yyless(0); |
---|
1132 | else push_state(YYSTATE, SECT3, "SECT3"); |
---|
1133 | return(return_sect_token(passed, old_sect, sectnum)); |
---|
1134 | } |
---|
1135 | YY_BREAK |
---|
1136 | case 4: |
---|
1137 | YY_RULE_SETUP |
---|
1138 | #line 191 "scanner.l" |
---|
1139 | { |
---|
1140 | int passed = (oldsectnum == sectnum) ? 0 : 1; |
---|
1141 | int old_sect = sectnum; |
---|
1142 | |
---|
1143 | oldsectnum = sectnum; |
---|
1144 | sectnum = 3; |
---|
1145 | if(!passed) yyless(0); |
---|
1146 | else push_state(YYSTATE, SECT3, "SECT3"); |
---|
1147 | return(return_sect_token(passed, old_sect, sectnum)); |
---|
1148 | } |
---|
1149 | YY_BREAK |
---|
1150 | case 5: |
---|
1151 | YY_RULE_SETUP |
---|
1152 | #line 201 "scanner.l" |
---|
1153 | { |
---|
1154 | int passed = (oldsectnum == sectnum) ? 0 : 1; |
---|
1155 | int old_sect = sectnum; |
---|
1156 | |
---|
1157 | oldsectnum = sectnum; |
---|
1158 | sectnum = 4; |
---|
1159 | if(!passed) yyless(0); |
---|
1160 | else push_state(YYSTATE, SECT4, "SECT4"); |
---|
1161 | return(return_sect_token(passed, old_sect, sectnum)); |
---|
1162 | } |
---|
1163 | YY_BREAK |
---|
1164 | case 6: |
---|
1165 | YY_RULE_SETUP |
---|
1166 | #line 211 "scanner.l" |
---|
1167 | { |
---|
1168 | int passed = (oldsectnum == sectnum) ? 0 : 1; |
---|
1169 | int old_sect = sectnum; |
---|
1170 | |
---|
1171 | oldsectnum = sectnum; |
---|
1172 | sectnum = 4; |
---|
1173 | if(!passed) yyless(0); |
---|
1174 | else push_state(YYSTATE, SECT4, "SECT4-2"); |
---|
1175 | return(return_sect_token(passed, old_sect, sectnum)); |
---|
1176 | } |
---|
1177 | YY_BREAK |
---|
1178 | |
---|
1179 | |
---|
1180 | case 7: |
---|
1181 | YY_RULE_SETUP |
---|
1182 | #line 225 "scanner.l" |
---|
1183 | push_state(YYSTATE, CODEBLOCK, "CODEBLOCK"); |
---|
1184 | YY_BREAK |
---|
1185 | case 8: |
---|
1186 | YY_RULE_SETUP |
---|
1187 | #line 226 "scanner.l" |
---|
1188 | push_state(YYSTATE, COMMENT, "COMMENT"); yymore(); |
---|
1189 | YY_BREAK |
---|
1190 | case 9: |
---|
1191 | YY_RULE_SETUP |
---|
1192 | #line 227 "scanner.l" |
---|
1193 | ++yylineno; ACTION_ECHO; |
---|
1194 | YY_BREAK |
---|
1195 | case 10: |
---|
1196 | YY_RULE_SETUP |
---|
1197 | #line 228 "scanner.l" |
---|
1198 | { if(yyleng == 1) sscanf(yytext, "%d", &lvalp->i); |
---|
1199 | else { |
---|
1200 | if(strcasecmp(yytext, "yes")==0) lvalp->i = 1; |
---|
1201 | else lvalp->i = 0; |
---|
1202 | } |
---|
1203 | return BOOLTOK; } |
---|
1204 | YY_BREAK |
---|
1205 | case 11: |
---|
1206 | YY_RULE_SETUP |
---|
1207 | #line 234 "scanner.l" |
---|
1208 | { |
---|
1209 | yylineno++; |
---|
1210 | push_state(YYSTATE, CODEBLOCK, "CODEBLOCK"); |
---|
1211 | fprintf(module_def.fmtfp, "#line %d \"%s\"\n", |
---|
1212 | yylineno, module_def.filename); |
---|
1213 | } |
---|
1214 | YY_BREAK |
---|
1215 | case 12: |
---|
1216 | YY_RULE_SETUP |
---|
1217 | #line 240 "scanner.l" |
---|
1218 | { |
---|
1219 | yylineno++; |
---|
1220 | push_state(YYSTATE, MODINITIAL, "MODINITIAL"); |
---|
1221 | fprintf(module_def.fmtfp, "#line %d \"%s\"\n", |
---|
1222 | yylineno, module_def.filename); |
---|
1223 | } |
---|
1224 | YY_BREAK |
---|
1225 | case 13: |
---|
1226 | YY_RULE_SETUP |
---|
1227 | #line 246 "scanner.l" |
---|
1228 | /* discard */ |
---|
1229 | YY_BREAK |
---|
1230 | case 14: |
---|
1231 | YY_RULE_SETUP |
---|
1232 | #line 247 "scanner.l" |
---|
1233 | { yylineno++; } |
---|
1234 | YY_BREAK |
---|
1235 | case 15: |
---|
1236 | YY_RULE_SETUP |
---|
1237 | #line 249 "scanner.l" |
---|
1238 | { return '='; } |
---|
1239 | YY_BREAK |
---|
1240 | case 16: |
---|
1241 | YY_RULE_SETUP |
---|
1242 | #line 250 "scanner.l" |
---|
1243 | { return ';'; } |
---|
1244 | YY_BREAK |
---|
1245 | case 17: |
---|
1246 | YY_RULE_SETUP |
---|
1247 | #line 251 "scanner.l" |
---|
1248 | { return ','; } |
---|
1249 | YY_BREAK |
---|
1250 | case 18: |
---|
1251 | YY_RULE_SETUP |
---|
1252 | #line 253 "scanner.l" |
---|
1253 | { do_return++; |
---|
1254 | lvalp->sv.lineno = yylineno; |
---|
1255 | push_state(YYSTATE, STRING, "string"); |
---|
1256 | } |
---|
1257 | YY_BREAK |
---|
1258 | case 19: |
---|
1259 | YY_RULE_SETUP |
---|
1260 | #line 258 "scanner.l" |
---|
1261 | { |
---|
1262 | lvalp->name = strdup(yytext); |
---|
1263 | return NAME; |
---|
1264 | } |
---|
1265 | YY_BREAK |
---|
1266 | case 20: |
---|
1267 | YY_RULE_SETUP |
---|
1268 | #line 262 "scanner.l" |
---|
1269 | { |
---|
1270 | lvalp->name = strdup(yytext); |
---|
1271 | return FILENAME; |
---|
1272 | } |
---|
1273 | YY_BREAK |
---|
1274 | |
---|
1275 | |
---|
1276 | case 21: |
---|
1277 | YY_RULE_SETUP |
---|
1278 | #line 269 "scanner.l" |
---|
1279 | { |
---|
1280 | char * s, *t; |
---|
1281 | |
---|
1282 | yylineno++; |
---|
1283 | pop_state(); |
---|
1284 | s = t = lvalp->name = dupyytext(); |
---|
1285 | while (*yytext) |
---|
1286 | { |
---|
1287 | if (*yytext == '\\') yytext++; |
---|
1288 | *s++ = *yytext++; |
---|
1289 | } |
---|
1290 | if(s-t>2 && *(s-1)=='}' && *(s-2)=='%') *(s-2)='\0'; |
---|
1291 | return MCCODETOK; |
---|
1292 | } |
---|
1293 | YY_BREAK |
---|
1294 | case 22: |
---|
1295 | YY_RULE_SETUP |
---|
1296 | #line 283 "scanner.l" |
---|
1297 | { yylineno++; yymore(); } |
---|
1298 | YY_BREAK |
---|
1299 | case 23: |
---|
1300 | YY_RULE_SETUP |
---|
1301 | #line 284 "scanner.l" |
---|
1302 | { yymore(); } |
---|
1303 | YY_BREAK |
---|
1304 | |
---|
1305 | |
---|
1306 | case 24: |
---|
1307 | YY_RULE_SETUP |
---|
1308 | #line 287 "scanner.l" |
---|
1309 | { |
---|
1310 | yylineno++; |
---|
1311 | pop_state(); |
---|
1312 | } |
---|
1313 | YY_BREAK |
---|
1314 | case 25: |
---|
1315 | YY_RULE_SETUP |
---|
1316 | #line 291 "scanner.l" |
---|
1317 | { yylineno++; |
---|
1318 | lvalp->name = yytext; |
---|
1319 | return CODEPART; } |
---|
1320 | YY_BREAK |
---|
1321 | |
---|
1322 | |
---|
1323 | case 26: |
---|
1324 | YY_RULE_SETUP |
---|
1325 | #line 296 "scanner.l" |
---|
1326 | { yylineno++; yymore(); } |
---|
1327 | YY_BREAK |
---|
1328 | case 27: |
---|
1329 | YY_RULE_SETUP |
---|
1330 | #line 297 "scanner.l" |
---|
1331 | { yymore(); } |
---|
1332 | YY_BREAK |
---|
1333 | case 28: |
---|
1334 | YY_RULE_SETUP |
---|
1335 | #line 298 "scanner.l" |
---|
1336 | { yymore(); } |
---|
1337 | YY_BREAK |
---|
1338 | case 29: |
---|
1339 | YY_RULE_SETUP |
---|
1340 | #line 299 "scanner.l" |
---|
1341 | { yymore(); } |
---|
1342 | YY_BREAK |
---|
1343 | case 30: |
---|
1344 | YY_RULE_SETUP |
---|
1345 | #line 300 "scanner.l" |
---|
1346 | { |
---|
1347 | char * s, *t; |
---|
1348 | pop_state(); |
---|
1349 | if(do_return) { |
---|
1350 | s = t = lvalp->sv.string = dupyytext(); |
---|
1351 | while (*yytext) |
---|
1352 | { |
---|
1353 | if (*yytext == '\\') yytext++; |
---|
1354 | *s++ = *yytext++; |
---|
1355 | } |
---|
1356 | *s++ = *yytext++; |
---|
1357 | do_return = 0; |
---|
1358 | return MSTRINGTOK; |
---|
1359 | } else { |
---|
1360 | do_return = 0; |
---|
1361 | yymore(); |
---|
1362 | } |
---|
1363 | } |
---|
1364 | YY_BREAK |
---|
1365 | |
---|
1366 | |
---|
1367 | case 31: |
---|
1368 | YY_RULE_SETUP |
---|
1369 | #line 321 "scanner.l" |
---|
1370 | ACTION_ECHO; pop_state(); yymore(); |
---|
1371 | YY_BREAK |
---|
1372 | case 32: |
---|
1373 | YY_RULE_SETUP |
---|
1374 | #line 322 "scanner.l" |
---|
1375 | yymore(); |
---|
1376 | YY_BREAK |
---|
1377 | case 33: |
---|
1378 | YY_RULE_SETUP |
---|
1379 | #line 323 "scanner.l" |
---|
1380 | { yylineno++; yymore(); } |
---|
1381 | YY_BREAK |
---|
1382 | case 34: |
---|
1383 | YY_RULE_SETUP |
---|
1384 | #line 324 "scanner.l" |
---|
1385 | { yymore(); } |
---|
1386 | YY_BREAK |
---|
1387 | |
---|
1388 | |
---|
1389 | case 35: |
---|
1390 | YY_RULE_SETUP |
---|
1391 | #line 328 "scanner.l" |
---|
1392 | { yylineno++; } |
---|
1393 | YY_BREAK |
---|
1394 | case 36: |
---|
1395 | YY_RULE_SETUP |
---|
1396 | #line 329 "scanner.l" |
---|
1397 | /* ignore */ |
---|
1398 | YY_BREAK |
---|
1399 | case 37: |
---|
1400 | YY_RULE_SETUP |
---|
1401 | #line 330 "scanner.l" |
---|
1402 | /* ignore */ |
---|
1403 | YY_BREAK |
---|
1404 | case 38: |
---|
1405 | YY_RULE_SETUP |
---|
1406 | #line 331 "scanner.l" |
---|
1407 | push_state(YYSTATE, COMMENT, "COMMENT"); yymore(); |
---|
1408 | YY_BREAK |
---|
1409 | case 39: |
---|
1410 | YY_RULE_SETUP |
---|
1411 | #line 332 "scanner.l" |
---|
1412 | ++yylineno; ACTION_ECHO; |
---|
1413 | YY_BREAK |
---|
1414 | case 40: |
---|
1415 | YY_RULE_SETUP |
---|
1416 | #line 333 "scanner.l" |
---|
1417 | { |
---|
1418 | brace1 = 0; /* { */ |
---|
1419 | brace2 = 0; /* ( */ |
---|
1420 | brace3 = 0; /* [ */ |
---|
1421 | push_state(YYSTATE, PROCDECL, "PROCDECL"); |
---|
1422 | return PROCDECLTOK; |
---|
1423 | } |
---|
1424 | YY_BREAK |
---|
1425 | case 41: |
---|
1426 | YY_RULE_SETUP |
---|
1427 | #line 340 "scanner.l" |
---|
1428 | { |
---|
1429 | #if DEBUG > 1 |
---|
1430 | printf(">>>EXAMPLE\n"); |
---|
1431 | #endif |
---|
1432 | brace1 = 0; /* { */ |
---|
1433 | brace2 = 0; /* ( */ |
---|
1434 | brace3 = 0; /* [ */ |
---|
1435 | push_state(YYSTATE, EXAMPLE, "EXAMPLE"); |
---|
1436 | return EXAMPLETOK; |
---|
1437 | } |
---|
1438 | YY_BREAK |
---|
1439 | case 42: |
---|
1440 | YY_RULE_SETUP |
---|
1441 | #line 350 "scanner.l" |
---|
1442 | { return STATICTOK; } |
---|
1443 | YY_BREAK |
---|
1444 | case 43: |
---|
1445 | YY_RULE_SETUP |
---|
1446 | #line 351 "scanner.l" |
---|
1447 | { printf("SG(%d) <<<'%s' ", yylineno, yytext); } |
---|
1448 | YY_BREAK |
---|
1449 | |
---|
1450 | |
---|
1451 | case 44: |
---|
1452 | YY_RULE_SETUP |
---|
1453 | #line 355 "scanner.l" |
---|
1454 | { yylineno++; } |
---|
1455 | YY_BREAK |
---|
1456 | case 45: |
---|
1457 | YY_RULE_SETUP |
---|
1458 | #line 356 "scanner.l" |
---|
1459 | /* ignore */ |
---|
1460 | YY_BREAK |
---|
1461 | case 46: |
---|
1462 | YY_RULE_SETUP |
---|
1463 | #line 357 "scanner.l" |
---|
1464 | /* ignore */ |
---|
1465 | YY_BREAK |
---|
1466 | case 47: |
---|
1467 | YY_RULE_SETUP |
---|
1468 | #line 358 "scanner.l" |
---|
1469 | push_state(YYSTATE, COMMENT, "COMMENT"); yymore(); |
---|
1470 | YY_BREAK |
---|
1471 | case 48: |
---|
1472 | YY_RULE_SETUP |
---|
1473 | #line 359 "scanner.l" |
---|
1474 | ++yylineno; ACTION_ECHO; |
---|
1475 | YY_BREAK |
---|
1476 | case 49: |
---|
1477 | YY_RULE_SETUP |
---|
1478 | #line 360 "scanner.l" |
---|
1479 | { |
---|
1480 | #if DEBUG > 1 |
---|
1481 | printf(">>>EXAMPLE\n"); |
---|
1482 | #endif |
---|
1483 | brace1 = 0; /* { */ |
---|
1484 | brace2 = 0; /* ( */ |
---|
1485 | brace3 = 0; /* [ */ |
---|
1486 | push_state(YYSTATE, EXAMPLE, "EXAMPLE"); |
---|
1487 | return EXAMPLETOK; |
---|
1488 | } |
---|
1489 | YY_BREAK |
---|
1490 | case 50: |
---|
1491 | YY_RULE_SETUP |
---|
1492 | #line 370 "scanner.l" |
---|
1493 | { return STATICTOK; } |
---|
1494 | YY_BREAK |
---|
1495 | case 51: |
---|
1496 | YY_RULE_SETUP |
---|
1497 | #line 371 "scanner.l" |
---|
1498 | { |
---|
1499 | int i,tok; |
---|
1500 | #if DEBUG > 1 |
---|
1501 | printf("(%d) VAR: %s\n", yylineno, yytext); |
---|
1502 | #endif |
---|
1503 | i = IsCmd(yytext, tok); |
---|
1504 | #if DEBUG > 1 |
---|
1505 | printf("Res=%d, %d => %s\n", i, tok, |
---|
1506 | i ? "VARTYPETOK" : "NAME"); |
---|
1507 | #endif |
---|
1508 | if(i) { |
---|
1509 | lvalp->tp.name = strdup(yytext); |
---|
1510 | lvalp->tp.typ = tok; |
---|
1511 | push_state(YYSTATE, PROCDECL, "PROCDECL"); |
---|
1512 | return VARTYPETOK; |
---|
1513 | } |
---|
1514 | else { |
---|
1515 | //do_return++; |
---|
1516 | lvalp->name = strdup(yytext); |
---|
1517 | push_state(YYSTATE, PROCDECL, "PROCDECL"); |
---|
1518 | return NAME; |
---|
1519 | } |
---|
1520 | } |
---|
1521 | YY_BREAK |
---|
1522 | case 52: |
---|
1523 | YY_RULE_SETUP |
---|
1524 | #line 394 "scanner.l" |
---|
1525 | { printf("PR(%d) <<<'%s' ", yylineno, yytext); } |
---|
1526 | YY_BREAK |
---|
1527 | |
---|
1528 | |
---|
1529 | case 53: |
---|
1530 | YY_RULE_SETUP |
---|
1531 | #line 398 "scanner.l" |
---|
1532 | { yylineno++; } |
---|
1533 | YY_BREAK |
---|
1534 | case 54: |
---|
1535 | YY_RULE_SETUP |
---|
1536 | #line 399 "scanner.l" |
---|
1537 | /* ignore */ |
---|
1538 | YY_BREAK |
---|
1539 | case 55: |
---|
1540 | YY_RULE_SETUP |
---|
1541 | #line 400 "scanner.l" |
---|
1542 | { brace1++; |
---|
1543 | switch_state(YYSTATE, CODEBLOCK2, "CODEBLOCK2"); |
---|
1544 | return '{'; |
---|
1545 | } |
---|
1546 | YY_BREAK |
---|
1547 | case 56: |
---|
1548 | YY_RULE_SETUP |
---|
1549 | #line 404 "scanner.l" |
---|
1550 | { printf("ERROR <<<'%s' ", yytext); } |
---|
1551 | YY_BREAK |
---|
1552 | |
---|
1553 | |
---|
1554 | case 57: |
---|
1555 | YY_RULE_SETUP |
---|
1556 | #line 408 "scanner.l" |
---|
1557 | { yylineno++; } |
---|
1558 | YY_BREAK |
---|
1559 | case 58: |
---|
1560 | YY_RULE_SETUP |
---|
1561 | #line 409 "scanner.l" |
---|
1562 | { lvalp->name = yytext; |
---|
1563 | return CODEPART; } |
---|
1564 | YY_BREAK |
---|
1565 | case YY_STATE_EOF(SECT4): |
---|
1566 | #line 412 "scanner.l" |
---|
1567 | { sectnum = 0; |
---|
1568 | iseof=1; |
---|
1569 | lvalp->name = yytext; |
---|
1570 | return SECT4END; |
---|
1571 | /* yyterminate(); */ |
---|
1572 | } |
---|
1573 | YY_BREAK |
---|
1574 | |
---|
1575 | |
---|
1576 | case 59: |
---|
1577 | YY_RULE_SETUP |
---|
1578 | #line 421 "scanner.l" |
---|
1579 | { brace1++; |
---|
1580 | switch_state(YYSTATE, CODEBLOCK2, "CODEBLOCK2"); |
---|
1581 | return '{'; |
---|
1582 | } |
---|
1583 | YY_BREAK |
---|
1584 | case 60: |
---|
1585 | YY_RULE_SETUP |
---|
1586 | #line 425 "scanner.l" |
---|
1587 | push_state(YYSTATE, COMMENT, "COMMENT");yymore(); |
---|
1588 | YY_BREAK |
---|
1589 | case 61: |
---|
1590 | YY_RULE_SETUP |
---|
1591 | #line 426 "scanner.l" |
---|
1592 | ++yylineno; ACTION_ECHO; |
---|
1593 | YY_BREAK |
---|
1594 | case 62: |
---|
1595 | YY_RULE_SETUP |
---|
1596 | #line 427 "scanner.l" |
---|
1597 | { do_return++; |
---|
1598 | lvalp->sv.lineno = yylineno; |
---|
1599 | push_state(YYSTATE, STRING, "string"); |
---|
1600 | } |
---|
1601 | YY_BREAK |
---|
1602 | case 63: |
---|
1603 | YY_RULE_SETUP |
---|
1604 | #line 431 "scanner.l" |
---|
1605 | { if(yyleng == 1) sscanf(yytext, "%d", &lvalp->i); |
---|
1606 | else { |
---|
1607 | if(strcasecmp(yytext, "yes")==0) lvalp->i = 1; |
---|
1608 | else lvalp->i = 0; |
---|
1609 | } |
---|
1610 | return BOOLTOK; } |
---|
1611 | YY_BREAK |
---|
1612 | case 64: |
---|
1613 | YY_RULE_SETUP |
---|
1614 | #line 437 "scanner.l" |
---|
1615 | { sscanf(yytext, "%d", &lvalp->i); return NUMTOK; } |
---|
1616 | YY_BREAK |
---|
1617 | case 65: |
---|
1618 | YY_RULE_SETUP |
---|
1619 | #line 438 "scanner.l" |
---|
1620 | { |
---|
1621 | int i,tok; |
---|
1622 | #if DEBUG > 1 |
---|
1623 | printf("(%d) VAR: %s\n", yylineno, yytext); |
---|
1624 | #endif |
---|
1625 | i = IsCmd(yytext, tok); |
---|
1626 | #if DEBUG > 1 |
---|
1627 | printf("Res=%d, %d => %s\n", i, tok, |
---|
1628 | i ? "VARTYPETOK" : "NAME"); |
---|
1629 | #endif |
---|
1630 | if(i) { |
---|
1631 | lvalp->tp.name = strdup(yytext); |
---|
1632 | lvalp->tp.typ = tok; |
---|
1633 | return VARTYPETOK; |
---|
1634 | } |
---|
1635 | else { |
---|
1636 | //do_return++; |
---|
1637 | lvalp->name = strdup(yytext); |
---|
1638 | return NAME; |
---|
1639 | } |
---|
1640 | } |
---|
1641 | YY_BREAK |
---|
1642 | case 66: |
---|
1643 | YY_RULE_SETUP |
---|
1644 | #line 459 "scanner.l" |
---|
1645 | { yylineno++; } |
---|
1646 | YY_BREAK |
---|
1647 | case 67: |
---|
1648 | YY_RULE_SETUP |
---|
1649 | #line 460 "scanner.l" |
---|
1650 | { return '('; } |
---|
1651 | YY_BREAK |
---|
1652 | case 68: |
---|
1653 | YY_RULE_SETUP |
---|
1654 | #line 461 "scanner.l" |
---|
1655 | { return ')'; } |
---|
1656 | YY_BREAK |
---|
1657 | case 69: |
---|
1658 | YY_RULE_SETUP |
---|
1659 | #line 462 "scanner.l" |
---|
1660 | { return ','; } |
---|
1661 | YY_BREAK |
---|
1662 | case 70: |
---|
1663 | YY_RULE_SETUP |
---|
1664 | #line 463 "scanner.l" |
---|
1665 | { return '#'; } |
---|
1666 | YY_BREAK |
---|
1667 | case 71: |
---|
1668 | YY_RULE_SETUP |
---|
1669 | #line 464 "scanner.l" |
---|
1670 | { return '='; } |
---|
1671 | YY_BREAK |
---|
1672 | case 72: |
---|
1673 | YY_RULE_SETUP |
---|
1674 | #line 465 "scanner.l" |
---|
1675 | { return ';'; } |
---|
1676 | YY_BREAK |
---|
1677 | case 73: |
---|
1678 | YY_RULE_SETUP |
---|
1679 | #line 466 "scanner.l" |
---|
1680 | { } |
---|
1681 | YY_BREAK |
---|
1682 | |
---|
1683 | |
---|
1684 | case 74: |
---|
1685 | YY_RULE_SETUP |
---|
1686 | #line 471 "scanner.l" |
---|
1687 | { ACTION_ECHO; |
---|
1688 | pop_state(); |
---|
1689 | lvalp->name = yytext; |
---|
1690 | return CMTPART; |
---|
1691 | yymore(); |
---|
1692 | } |
---|
1693 | YY_BREAK |
---|
1694 | case 75: |
---|
1695 | YY_RULE_SETUP |
---|
1696 | #line 477 "scanner.l" |
---|
1697 | yymore(); |
---|
1698 | YY_BREAK |
---|
1699 | case 76: |
---|
1700 | YY_RULE_SETUP |
---|
1701 | #line 478 "scanner.l" |
---|
1702 | { yylineno++; yymore(); } |
---|
1703 | YY_BREAK |
---|
1704 | case 77: |
---|
1705 | YY_RULE_SETUP |
---|
1706 | #line 479 "scanner.l" |
---|
1707 | { yymore(); } |
---|
1708 | YY_BREAK |
---|
1709 | |
---|
1710 | |
---|
1711 | case 78: |
---|
1712 | YY_RULE_SETUP |
---|
1713 | #line 483 "scanner.l" |
---|
1714 | push_state(YYSTATE, COMMENT, "COMMENT"); yymore(); |
---|
1715 | YY_BREAK |
---|
1716 | case 79: |
---|
1717 | YY_RULE_SETUP |
---|
1718 | #line 484 "scanner.l" |
---|
1719 | { yylineno++; lvalp->name = yytext; return CODEPART; } |
---|
1720 | YY_BREAK |
---|
1721 | case 80: |
---|
1722 | YY_RULE_SETUP |
---|
1723 | #line 485 "scanner.l" |
---|
1724 | { |
---|
1725 | lvalp->sv.lineno = yylineno; |
---|
1726 | push_state(YYSTATE, STRING, "string"); yymore();} |
---|
1727 | YY_BREAK |
---|
1728 | case 81: |
---|
1729 | YY_RULE_SETUP |
---|
1730 | #line 488 "scanner.l" |
---|
1731 | { brace1++; yymore();} |
---|
1732 | YY_BREAK |
---|
1733 | case 82: |
---|
1734 | YY_RULE_SETUP |
---|
1735 | #line 489 "scanner.l" |
---|
1736 | { brace1--; |
---|
1737 | if(brace1<=0) { |
---|
1738 | char * s, *t; |
---|
1739 | |
---|
1740 | pop_state(); |
---|
1741 | #if 0 |
---|
1742 | s = t = lvalp->name = dupyytext(); |
---|
1743 | while (*yytext) |
---|
1744 | { |
---|
1745 | if (*yytext == '\\') yytext++; |
---|
1746 | *s++ = *yytext++; |
---|
1747 | } |
---|
1748 | if(s-t>2 && *(s-1)=='}' && *(s-2)=='%') *(s-2)='\0'; |
---|
1749 | #else |
---|
1750 | lvalp->name = yytext; |
---|
1751 | #endif |
---|
1752 | #if DEBUG > 1 |
---|
1753 | printf("2 BRACE DOWN=%d\n", brace1); |
---|
1754 | #endif |
---|
1755 | return MCODETOK; |
---|
1756 | } else { |
---|
1757 | yymore(); |
---|
1758 | } |
---|
1759 | } |
---|
1760 | YY_BREAK |
---|
1761 | case 83: |
---|
1762 | YY_RULE_SETUP |
---|
1763 | #line 513 "scanner.l" |
---|
1764 | { yylineno++; lvalp->name = yytext; return CODEPART; } |
---|
1765 | YY_BREAK |
---|
1766 | case 84: |
---|
1767 | YY_RULE_SETUP |
---|
1768 | #line 514 "scanner.l" |
---|
1769 | { push_state(YYSTATE, PROCCMDBLOCK, "PROCCMDBLOCK"); |
---|
1770 | procedure_decl.flags.start_of_code = 1; |
---|
1771 | return '%'; } |
---|
1772 | YY_BREAK |
---|
1773 | case 85: |
---|
1774 | YY_RULE_SETUP |
---|
1775 | #line 517 "scanner.l" |
---|
1776 | { yymore(); } |
---|
1777 | YY_BREAK |
---|
1778 | case 86: |
---|
1779 | YY_RULE_SETUP |
---|
1780 | #line 518 "scanner.l" |
---|
1781 | { yymore(); procedure_decl.flags.start_of_code = 1; } |
---|
1782 | YY_BREAK |
---|
1783 | |
---|
1784 | |
---|
1785 | case 87: |
---|
1786 | YY_RULE_SETUP |
---|
1787 | #line 523 "scanner.l" |
---|
1788 | { pop_state(); return ';'; } |
---|
1789 | YY_BREAK |
---|
1790 | case 88: |
---|
1791 | YY_RULE_SETUP |
---|
1792 | #line 524 "scanner.l" |
---|
1793 | { return '('; } |
---|
1794 | YY_BREAK |
---|
1795 | case 89: |
---|
1796 | YY_RULE_SETUP |
---|
1797 | #line 525 "scanner.l" |
---|
1798 | { return ')'; } |
---|
1799 | YY_BREAK |
---|
1800 | case 90: |
---|
1801 | YY_RULE_SETUP |
---|
1802 | #line 526 "scanner.l" |
---|
1803 | { return ','; } |
---|
1804 | YY_BREAK |
---|
1805 | case 91: |
---|
1806 | YY_RULE_SETUP |
---|
1807 | #line 527 "scanner.l" |
---|
1808 | /* ignore */ |
---|
1809 | YY_BREAK |
---|
1810 | case 92: |
---|
1811 | YY_RULE_SETUP |
---|
1812 | #line 528 "scanner.l" |
---|
1813 | { lvalp->name = strdup(yytext); return NAME; } |
---|
1814 | YY_BREAK |
---|
1815 | case 93: |
---|
1816 | YY_RULE_SETUP |
---|
1817 | #line 529 "scanner.l" |
---|
1818 | { yylineno++; } |
---|
1819 | YY_BREAK |
---|
1820 | case 94: |
---|
1821 | YY_RULE_SETUP |
---|
1822 | #line 530 "scanner.l" |
---|
1823 | { return MCOLONCOLON; } |
---|
1824 | YY_BREAK |
---|
1825 | case 95: |
---|
1826 | YY_RULE_SETUP |
---|
1827 | #line 531 "scanner.l" |
---|
1828 | { switch_state(YYSTATE, ANYLINE, "ANYLINE"); return MEQUAL; } |
---|
1829 | YY_BREAK |
---|
1830 | case 96: |
---|
1831 | YY_RULE_SETUP |
---|
1832 | #line 532 "scanner.l" |
---|
1833 | { printf("PCB: '%s'\n", yytext); } |
---|
1834 | YY_BREAK |
---|
1835 | |
---|
1836 | |
---|
1837 | case 97: |
---|
1838 | YY_RULE_SETUP |
---|
1839 | #line 536 "scanner.l" |
---|
1840 | { lvalp->name = yytext; |
---|
1841 | pop_state(); |
---|
1842 | return ANYTOK; } |
---|
1843 | YY_BREAK |
---|
1844 | case 98: |
---|
1845 | YY_RULE_SETUP |
---|
1846 | #line 539 "scanner.l" |
---|
1847 | { yylineno++; } |
---|
1848 | YY_BREAK |
---|
1849 | case 99: |
---|
1850 | YY_RULE_SETUP |
---|
1851 | #line 540 "scanner.l" |
---|
1852 | { yymore(); } |
---|
1853 | YY_BREAK |
---|
1854 | |
---|
1855 | case 100: |
---|
1856 | YY_RULE_SETUP |
---|
1857 | #line 543 "scanner.l" |
---|
1858 | ECHO; |
---|
1859 | YY_BREAK |
---|
1860 | #line 1861 "scanner.cc" |
---|
1861 | case YY_STATE_EOF(preamble): |
---|
1862 | case YY_STATE_EOF(MODINITIAL): |
---|
1863 | case YY_STATE_EOF(PROCCMDBLOCK): |
---|
1864 | case YY_STATE_EOF(CODEBLOCK): |
---|
1865 | case YY_STATE_EOF(CODEBLOCK2): |
---|
1866 | case YY_STATE_EOF(module): |
---|
1867 | case YY_STATE_EOF(SECT2): |
---|
1868 | case YY_STATE_EOF(SECT3): |
---|
1869 | case YY_STATE_EOF(PROCDECL): |
---|
1870 | case YY_STATE_EOF(EXAMPLE): |
---|
1871 | case YY_STATE_EOF(ANYLINE): |
---|
1872 | case YY_STATE_EOF(pdef): |
---|
1873 | case YY_STATE_EOF(procopt): |
---|
1874 | case YY_STATE_EOF(procdef): |
---|
1875 | case YY_STATE_EOF(ctext): |
---|
1876 | case YY_STATE_EOF(cstring): |
---|
1877 | yyterminate(); |
---|
1878 | |
---|
1879 | case YY_END_OF_BUFFER: |
---|
1880 | { |
---|
1881 | /* Amount of text matched not including the EOB char. */ |
---|
1882 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
---|
1883 | |
---|
1884 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
---|
1885 | *yy_cp = yy_hold_char; |
---|
1886 | YY_RESTORE_YY_MORE_OFFSET |
---|
1887 | |
---|
1888 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
---|
1889 | { |
---|
1890 | /* We're scanning a new file or input source. It's |
---|
1891 | * possible that this happened because the user |
---|
1892 | * just pointed yyin at a new source and called |
---|
1893 | * yylex(). If so, then we have to assure |
---|
1894 | * consistency between yy_current_buffer and our |
---|
1895 | * globals. Here is the right place to do so, because |
---|
1896 | * this is the first action (other than possibly a |
---|
1897 | * back-up) that will match for the new input source. |
---|
1898 | */ |
---|
1899 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
1900 | yy_current_buffer->yy_input_file = yyin; |
---|
1901 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
---|
1902 | } |
---|
1903 | |
---|
1904 | /* Note that here we test for yy_c_buf_p "<=" to the position |
---|
1905 | * of the first EOB in the buffer, since yy_c_buf_p will |
---|
1906 | * already have been incremented past the NUL character |
---|
1907 | * (since all states make transitions on EOB to the |
---|
1908 | * end-of-buffer state). Contrast this with the test |
---|
1909 | * in input(). |
---|
1910 | */ |
---|
1911 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
1912 | { /* This was really a NUL. */ |
---|
1913 | yy_state_type yy_next_state; |
---|
1914 | |
---|
1915 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
---|
1916 | |
---|
1917 | yy_current_state = yy_get_previous_state(); |
---|
1918 | |
---|
1919 | /* Okay, we're now positioned to make the NUL |
---|
1920 | * transition. We couldn't have |
---|
1921 | * yy_get_previous_state() go ahead and do it |
---|
1922 | * for us because it doesn't know how to deal |
---|
1923 | * with the possibility of jamming (and we don't |
---|
1924 | * want to build jamming into it because then it |
---|
1925 | * will run more slowly). |
---|
1926 | */ |
---|
1927 | |
---|
1928 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
---|
1929 | |
---|
1930 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
1931 | |
---|
1932 | if ( yy_next_state ) |
---|
1933 | { |
---|
1934 | /* Consume the NUL. */ |
---|
1935 | yy_cp = ++yy_c_buf_p; |
---|
1936 | yy_current_state = yy_next_state; |
---|
1937 | goto yy_match; |
---|
1938 | } |
---|
1939 | |
---|
1940 | else |
---|
1941 | { |
---|
1942 | yy_cp = yy_c_buf_p; |
---|
1943 | goto yy_find_action; |
---|
1944 | } |
---|
1945 | } |
---|
1946 | |
---|
1947 | else switch ( yy_get_next_buffer() ) |
---|
1948 | { |
---|
1949 | case EOB_ACT_END_OF_FILE: |
---|
1950 | { |
---|
1951 | yy_did_buffer_switch_on_eof = 0; |
---|
1952 | |
---|
1953 | if ( yywrap() ) |
---|
1954 | { |
---|
1955 | /* Note: because we've taken care in |
---|
1956 | * yy_get_next_buffer() to have set up |
---|
1957 | * yytext, we can now set up |
---|
1958 | * yy_c_buf_p so that if some total |
---|
1959 | * hoser (like flex itself) wants to |
---|
1960 | * call the scanner after we return the |
---|
1961 | * YY_NULL, it'll still work - another |
---|
1962 | * YY_NULL will get returned. |
---|
1963 | */ |
---|
1964 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
---|
1965 | |
---|
1966 | yy_act = YY_STATE_EOF(YY_START); |
---|
1967 | goto do_action; |
---|
1968 | } |
---|
1969 | |
---|
1970 | else |
---|
1971 | { |
---|
1972 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
1973 | YY_NEW_FILE; |
---|
1974 | } |
---|
1975 | break; |
---|
1976 | } |
---|
1977 | |
---|
1978 | case EOB_ACT_CONTINUE_SCAN: |
---|
1979 | yy_c_buf_p = |
---|
1980 | yytext_ptr + yy_amount_of_matched_text; |
---|
1981 | |
---|
1982 | yy_current_state = yy_get_previous_state(); |
---|
1983 | |
---|
1984 | yy_cp = yy_c_buf_p; |
---|
1985 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
1986 | goto yy_match; |
---|
1987 | |
---|
1988 | case EOB_ACT_LAST_MATCH: |
---|
1989 | yy_c_buf_p = |
---|
1990 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
---|
1991 | |
---|
1992 | yy_current_state = yy_get_previous_state(); |
---|
1993 | |
---|
1994 | yy_cp = yy_c_buf_p; |
---|
1995 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
1996 | goto yy_find_action; |
---|
1997 | } |
---|
1998 | break; |
---|
1999 | } |
---|
2000 | |
---|
2001 | default: |
---|
2002 | YY_FATAL_ERROR( |
---|
2003 | "fatal flex scanner internal error--no action found" ); |
---|
2004 | } /* end of action switch */ |
---|
2005 | } /* end of scanning one token */ |
---|
2006 | } /* end of yylex */ |
---|
2007 | |
---|
2008 | |
---|
2009 | /* yy_get_next_buffer - try to read in a new buffer |
---|
2010 | * |
---|
2011 | * Returns a code representing an action: |
---|
2012 | * EOB_ACT_LAST_MATCH - |
---|
2013 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
---|
2014 | * EOB_ACT_END_OF_FILE - end of file |
---|
2015 | */ |
---|
2016 | |
---|
2017 | static int yy_get_next_buffer() |
---|
2018 | { |
---|
2019 | register char *dest = yy_current_buffer->yy_ch_buf; |
---|
2020 | register char *source = yytext_ptr; |
---|
2021 | register int number_to_move, i; |
---|
2022 | int ret_val; |
---|
2023 | |
---|
2024 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) |
---|
2025 | YY_FATAL_ERROR( |
---|
2026 | "fatal flex scanner internal error--end of buffer missed" ); |
---|
2027 | |
---|
2028 | if ( yy_current_buffer->yy_fill_buffer == 0 ) |
---|
2029 | { /* Don't try to fill the buffer, so this is an EOF. */ |
---|
2030 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
---|
2031 | { |
---|
2032 | /* We matched a single character, the EOB, so |
---|
2033 | * treat this as a final EOF. |
---|
2034 | */ |
---|
2035 | return EOB_ACT_END_OF_FILE; |
---|
2036 | } |
---|
2037 | |
---|
2038 | else |
---|
2039 | { |
---|
2040 | /* We matched some text prior to the EOB, first |
---|
2041 | * process it. |
---|
2042 | */ |
---|
2043 | return EOB_ACT_LAST_MATCH; |
---|
2044 | } |
---|
2045 | } |
---|
2046 | |
---|
2047 | /* Try to read more data. */ |
---|
2048 | |
---|
2049 | /* First move last chars to start of buffer. */ |
---|
2050 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
---|
2051 | |
---|
2052 | for ( i = 0; i < number_to_move; ++i ) |
---|
2053 | *(dest++) = *(source++); |
---|
2054 | |
---|
2055 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
---|
2056 | /* don't do the read, it's not guaranteed to return an EOF, |
---|
2057 | * just force an EOF |
---|
2058 | */ |
---|
2059 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
---|
2060 | |
---|
2061 | else |
---|
2062 | { |
---|
2063 | int num_to_read = |
---|
2064 | yy_current_buffer->yy_buf_size - number_to_move - 1; |
---|
2065 | |
---|
2066 | while ( num_to_read <= 0 ) |
---|
2067 | { /* Not enough room in the buffer - grow it. */ |
---|
2068 | #ifdef YY_USES_REJECT |
---|
2069 | YY_FATAL_ERROR( |
---|
2070 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); |
---|
2071 | #else |
---|
2072 | |
---|
2073 | /* just a shorter name for the current buffer */ |
---|
2074 | YY_BUFFER_STATE b = yy_current_buffer; |
---|
2075 | |
---|
2076 | int yy_c_buf_p_offset = |
---|
2077 | (int) (yy_c_buf_p - b->yy_ch_buf); |
---|
2078 | |
---|
2079 | if ( b->yy_is_our_buffer ) |
---|
2080 | { |
---|
2081 | int new_size = b->yy_buf_size * 2; |
---|
2082 | |
---|
2083 | if ( new_size <= 0 ) |
---|
2084 | b->yy_buf_size += b->yy_buf_size / 8; |
---|
2085 | else |
---|
2086 | b->yy_buf_size *= 2; |
---|
2087 | |
---|
2088 | b->yy_ch_buf = (char *) |
---|
2089 | /* Include room in for 2 EOB chars. */ |
---|
2090 | yy_flex_realloc( (void *) b->yy_ch_buf, |
---|
2091 | b->yy_buf_size + 2 ); |
---|
2092 | } |
---|
2093 | else |
---|
2094 | /* Can't grow it, we don't own it. */ |
---|
2095 | b->yy_ch_buf = 0; |
---|
2096 | |
---|
2097 | if ( ! b->yy_ch_buf ) |
---|
2098 | YY_FATAL_ERROR( |
---|
2099 | "fatal error - scanner input buffer overflow" ); |
---|
2100 | |
---|
2101 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
---|
2102 | |
---|
2103 | num_to_read = yy_current_buffer->yy_buf_size - |
---|
2104 | number_to_move - 1; |
---|
2105 | #endif |
---|
2106 | } |
---|
2107 | |
---|
2108 | if ( num_to_read > YY_READ_BUF_SIZE ) |
---|
2109 | num_to_read = YY_READ_BUF_SIZE; |
---|
2110 | |
---|
2111 | /* Read in more data. */ |
---|
2112 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
---|
2113 | yy_n_chars, num_to_read ); |
---|
2114 | |
---|
2115 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
2116 | } |
---|
2117 | |
---|
2118 | if ( yy_n_chars == 0 ) |
---|
2119 | { |
---|
2120 | if ( number_to_move == YY_MORE_ADJ ) |
---|
2121 | { |
---|
2122 | ret_val = EOB_ACT_END_OF_FILE; |
---|
2123 | yyrestart( yyin ); |
---|
2124 | } |
---|
2125 | |
---|
2126 | else |
---|
2127 | { |
---|
2128 | ret_val = EOB_ACT_LAST_MATCH; |
---|
2129 | yy_current_buffer->yy_buffer_status = |
---|
2130 | YY_BUFFER_EOF_PENDING; |
---|
2131 | } |
---|
2132 | } |
---|
2133 | |
---|
2134 | else |
---|
2135 | ret_val = EOB_ACT_CONTINUE_SCAN; |
---|
2136 | |
---|
2137 | yy_n_chars += number_to_move; |
---|
2138 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
---|
2139 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
---|
2140 | |
---|
2141 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
---|
2142 | |
---|
2143 | return ret_val; |
---|
2144 | } |
---|
2145 | |
---|
2146 | |
---|
2147 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
---|
2148 | |
---|
2149 | static yy_state_type yy_get_previous_state() |
---|
2150 | { |
---|
2151 | register yy_state_type yy_current_state; |
---|
2152 | register char *yy_cp; |
---|
2153 | |
---|
2154 | yy_current_state = yy_start; |
---|
2155 | yy_current_state += YY_AT_BOL(); |
---|
2156 | |
---|
2157 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) |
---|
2158 | { |
---|
2159 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
---|
2160 | if ( yy_accept[yy_current_state] ) |
---|
2161 | { |
---|
2162 | yy_last_accepting_state = yy_current_state; |
---|
2163 | yy_last_accepting_cpos = yy_cp; |
---|
2164 | } |
---|
2165 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
2166 | { |
---|
2167 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
2168 | if ( yy_current_state >= 384 ) |
---|
2169 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
2170 | } |
---|
2171 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
2172 | } |
---|
2173 | |
---|
2174 | return yy_current_state; |
---|
2175 | } |
---|
2176 | |
---|
2177 | |
---|
2178 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
---|
2179 | * |
---|
2180 | * synopsis |
---|
2181 | * next_state = yy_try_NUL_trans( current_state ); |
---|
2182 | */ |
---|
2183 | |
---|
2184 | #ifdef YY_USE_PROTOS |
---|
2185 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) |
---|
2186 | #else |
---|
2187 | static yy_state_type yy_try_NUL_trans( yy_current_state ) |
---|
2188 | yy_state_type yy_current_state; |
---|
2189 | #endif |
---|
2190 | { |
---|
2191 | register int yy_is_jam; |
---|
2192 | register char *yy_cp = yy_c_buf_p; |
---|
2193 | |
---|
2194 | register YY_CHAR yy_c = 1; |
---|
2195 | if ( yy_accept[yy_current_state] ) |
---|
2196 | { |
---|
2197 | yy_last_accepting_state = yy_current_state; |
---|
2198 | yy_last_accepting_cpos = yy_cp; |
---|
2199 | } |
---|
2200 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
2201 | { |
---|
2202 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
2203 | if ( yy_current_state >= 384 ) |
---|
2204 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
2205 | } |
---|
2206 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
2207 | yy_is_jam = (yy_current_state == 383); |
---|
2208 | |
---|
2209 | return yy_is_jam ? 0 : yy_current_state; |
---|
2210 | } |
---|
2211 | |
---|
2212 | |
---|
2213 | #ifndef YY_NO_UNPUT |
---|
2214 | #ifdef YY_USE_PROTOS |
---|
2215 | static void yyunput( int c, register char *yy_bp ) |
---|
2216 | #else |
---|
2217 | static void yyunput( c, yy_bp ) |
---|
2218 | int c; |
---|
2219 | register char *yy_bp; |
---|
2220 | #endif |
---|
2221 | { |
---|
2222 | register char *yy_cp = yy_c_buf_p; |
---|
2223 | |
---|
2224 | /* undo effects of setting up yytext */ |
---|
2225 | *yy_cp = yy_hold_char; |
---|
2226 | |
---|
2227 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
2228 | { /* need to shift things up to make room */ |
---|
2229 | /* +2 for EOB chars. */ |
---|
2230 | register int number_to_move = yy_n_chars + 2; |
---|
2231 | register char *dest = &yy_current_buffer->yy_ch_buf[ |
---|
2232 | yy_current_buffer->yy_buf_size + 2]; |
---|
2233 | register char *source = |
---|
2234 | &yy_current_buffer->yy_ch_buf[number_to_move]; |
---|
2235 | |
---|
2236 | while ( source > yy_current_buffer->yy_ch_buf ) |
---|
2237 | *--dest = *--source; |
---|
2238 | |
---|
2239 | yy_cp += (int) (dest - source); |
---|
2240 | yy_bp += (int) (dest - source); |
---|
2241 | yy_current_buffer->yy_n_chars = |
---|
2242 | yy_n_chars = yy_current_buffer->yy_buf_size; |
---|
2243 | |
---|
2244 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
2245 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
---|
2246 | } |
---|
2247 | |
---|
2248 | *--yy_cp = (char) c; |
---|
2249 | |
---|
2250 | |
---|
2251 | yytext_ptr = yy_bp; |
---|
2252 | yy_hold_char = *yy_cp; |
---|
2253 | yy_c_buf_p = yy_cp; |
---|
2254 | } |
---|
2255 | #endif /* ifndef YY_NO_UNPUT */ |
---|
2256 | |
---|
2257 | |
---|
2258 | #ifdef __cplusplus |
---|
2259 | static int yyinput() |
---|
2260 | #else |
---|
2261 | static int input() |
---|
2262 | #endif |
---|
2263 | { |
---|
2264 | int c; |
---|
2265 | |
---|
2266 | *yy_c_buf_p = yy_hold_char; |
---|
2267 | |
---|
2268 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
---|
2269 | { |
---|
2270 | /* yy_c_buf_p now points to the character we want to return. |
---|
2271 | * If this occurs *before* the EOB characters, then it's a |
---|
2272 | * valid NUL; if not, then we've hit the end of the buffer. |
---|
2273 | */ |
---|
2274 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
2275 | /* This was really a NUL. */ |
---|
2276 | *yy_c_buf_p = '\0'; |
---|
2277 | |
---|
2278 | else |
---|
2279 | { /* need more input */ |
---|
2280 | int offset = yy_c_buf_p - yytext_ptr; |
---|
2281 | ++yy_c_buf_p; |
---|
2282 | |
---|
2283 | switch ( yy_get_next_buffer() ) |
---|
2284 | { |
---|
2285 | case EOB_ACT_LAST_MATCH: |
---|
2286 | /* This happens because yy_g_n_b() |
---|
2287 | * sees that we've accumulated a |
---|
2288 | * token and flags that we need to |
---|
2289 | * try matching the token before |
---|
2290 | * proceeding. But for input(), |
---|
2291 | * there's no matching to consider. |
---|
2292 | * So convert the EOB_ACT_LAST_MATCH |
---|
2293 | * to EOB_ACT_END_OF_FILE. |
---|
2294 | */ |
---|
2295 | |
---|
2296 | /* Reset buffer status. */ |
---|
2297 | yyrestart( yyin ); |
---|
2298 | |
---|
2299 | /* fall through */ |
---|
2300 | |
---|
2301 | case EOB_ACT_END_OF_FILE: |
---|
2302 | { |
---|
2303 | if ( yywrap() ) |
---|
2304 | return EOF; |
---|
2305 | |
---|
2306 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
2307 | YY_NEW_FILE; |
---|
2308 | #ifdef __cplusplus |
---|
2309 | return yyinput(); |
---|
2310 | #else |
---|
2311 | return input(); |
---|
2312 | #endif |
---|
2313 | } |
---|
2314 | |
---|
2315 | case EOB_ACT_CONTINUE_SCAN: |
---|
2316 | yy_c_buf_p = yytext_ptr + offset; |
---|
2317 | break; |
---|
2318 | } |
---|
2319 | } |
---|
2320 | } |
---|
2321 | |
---|
2322 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
---|
2323 | *yy_c_buf_p = '\0'; /* preserve yytext */ |
---|
2324 | yy_hold_char = *++yy_c_buf_p; |
---|
2325 | |
---|
2326 | yy_current_buffer->yy_at_bol = (c == '\n'); |
---|
2327 | |
---|
2328 | return c; |
---|
2329 | } |
---|
2330 | |
---|
2331 | |
---|
2332 | #ifdef YY_USE_PROTOS |
---|
2333 | void yyrestart( FILE *input_file ) |
---|
2334 | #else |
---|
2335 | void yyrestart( input_file ) |
---|
2336 | FILE *input_file; |
---|
2337 | #endif |
---|
2338 | { |
---|
2339 | if ( ! yy_current_buffer ) |
---|
2340 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
2341 | |
---|
2342 | yy_init_buffer( yy_current_buffer, input_file ); |
---|
2343 | yy_load_buffer_state(); |
---|
2344 | } |
---|
2345 | |
---|
2346 | |
---|
2347 | #ifdef YY_USE_PROTOS |
---|
2348 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) |
---|
2349 | #else |
---|
2350 | void yy_switch_to_buffer( new_buffer ) |
---|
2351 | YY_BUFFER_STATE new_buffer; |
---|
2352 | #endif |
---|
2353 | { |
---|
2354 | if ( yy_current_buffer == new_buffer ) |
---|
2355 | return; |
---|
2356 | |
---|
2357 | if ( yy_current_buffer ) |
---|
2358 | { |
---|
2359 | /* Flush out information for old buffer. */ |
---|
2360 | *yy_c_buf_p = yy_hold_char; |
---|
2361 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
---|
2362 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
2363 | } |
---|
2364 | |
---|
2365 | yy_current_buffer = new_buffer; |
---|
2366 | yy_load_buffer_state(); |
---|
2367 | |
---|
2368 | /* We don't actually know whether we did this switch during |
---|
2369 | * EOF (yywrap()) processing, but the only time this flag |
---|
2370 | * is looked at is after yywrap() is called, so it's safe |
---|
2371 | * to go ahead and always set it. |
---|
2372 | */ |
---|
2373 | yy_did_buffer_switch_on_eof = 1; |
---|
2374 | } |
---|
2375 | |
---|
2376 | |
---|
2377 | #ifdef YY_USE_PROTOS |
---|
2378 | void yy_load_buffer_state( void ) |
---|
2379 | #else |
---|
2380 | void yy_load_buffer_state() |
---|
2381 | #endif |
---|
2382 | { |
---|
2383 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
2384 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
---|
2385 | yyin = yy_current_buffer->yy_input_file; |
---|
2386 | yy_hold_char = *yy_c_buf_p; |
---|
2387 | } |
---|
2388 | |
---|
2389 | |
---|
2390 | #ifdef YY_USE_PROTOS |
---|
2391 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) |
---|
2392 | #else |
---|
2393 | YY_BUFFER_STATE yy_create_buffer( file, size ) |
---|
2394 | FILE *file; |
---|
2395 | int size; |
---|
2396 | #endif |
---|
2397 | { |
---|
2398 | YY_BUFFER_STATE b; |
---|
2399 | |
---|
2400 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
2401 | if ( ! b ) |
---|
2402 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
2403 | |
---|
2404 | b->yy_buf_size = size; |
---|
2405 | |
---|
2406 | /* yy_ch_buf has to be 2 characters longer than the size given because |
---|
2407 | * we need to put in 2 end-of-buffer characters. |
---|
2408 | */ |
---|
2409 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); |
---|
2410 | if ( ! b->yy_ch_buf ) |
---|
2411 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
2412 | |
---|
2413 | b->yy_is_our_buffer = 1; |
---|
2414 | |
---|
2415 | yy_init_buffer( b, file ); |
---|
2416 | |
---|
2417 | return b; |
---|
2418 | } |
---|
2419 | |
---|
2420 | |
---|
2421 | #ifdef YY_USE_PROTOS |
---|
2422 | void yy_delete_buffer( YY_BUFFER_STATE b ) |
---|
2423 | #else |
---|
2424 | void yy_delete_buffer( b ) |
---|
2425 | YY_BUFFER_STATE b; |
---|
2426 | #endif |
---|
2427 | { |
---|
2428 | if ( ! b ) |
---|
2429 | return; |
---|
2430 | |
---|
2431 | if ( b == yy_current_buffer ) |
---|
2432 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
---|
2433 | |
---|
2434 | if ( b->yy_is_our_buffer ) |
---|
2435 | yy_flex_free( (void *) b->yy_ch_buf ); |
---|
2436 | |
---|
2437 | yy_flex_free( (void *) b ); |
---|
2438 | } |
---|
2439 | |
---|
2440 | |
---|
2441 | #ifndef YY_ALWAYS_INTERACTIVE |
---|
2442 | #ifndef YY_NEVER_INTERACTIVE |
---|
2443 | extern int isatty YY_PROTO(( int )); |
---|
2444 | #endif |
---|
2445 | #endif |
---|
2446 | |
---|
2447 | #ifdef YY_USE_PROTOS |
---|
2448 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) |
---|
2449 | #else |
---|
2450 | void yy_init_buffer( b, file ) |
---|
2451 | YY_BUFFER_STATE b; |
---|
2452 | FILE *file; |
---|
2453 | #endif |
---|
2454 | |
---|
2455 | |
---|
2456 | { |
---|
2457 | yy_flush_buffer( b ); |
---|
2458 | |
---|
2459 | b->yy_input_file = file; |
---|
2460 | b->yy_fill_buffer = 1; |
---|
2461 | |
---|
2462 | #if YY_ALWAYS_INTERACTIVE |
---|
2463 | b->yy_is_interactive = 1; |
---|
2464 | #else |
---|
2465 | #if YY_NEVER_INTERACTIVE |
---|
2466 | b->yy_is_interactive = 0; |
---|
2467 | #else |
---|
2468 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
---|
2469 | #endif |
---|
2470 | #endif |
---|
2471 | } |
---|
2472 | |
---|
2473 | |
---|
2474 | #ifdef YY_USE_PROTOS |
---|
2475 | void yy_flush_buffer( YY_BUFFER_STATE b ) |
---|
2476 | #else |
---|
2477 | void yy_flush_buffer( b ) |
---|
2478 | YY_BUFFER_STATE b; |
---|
2479 | #endif |
---|
2480 | |
---|
2481 | { |
---|
2482 | if ( ! b ) |
---|
2483 | return; |
---|
2484 | |
---|
2485 | b->yy_n_chars = 0; |
---|
2486 | |
---|
2487 | /* We always need two end-of-buffer characters. The first causes |
---|
2488 | * a transition to the end-of-buffer state. The second causes |
---|
2489 | * a jam in that state. |
---|
2490 | */ |
---|
2491 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
---|
2492 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
---|
2493 | |
---|
2494 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
---|
2495 | |
---|
2496 | b->yy_at_bol = 1; |
---|
2497 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
2498 | |
---|
2499 | if ( b == yy_current_buffer ) |
---|
2500 | yy_load_buffer_state(); |
---|
2501 | } |
---|
2502 | |
---|
2503 | |
---|
2504 | #ifndef YY_NO_SCAN_BUFFER |
---|
2505 | #ifdef YY_USE_PROTOS |
---|
2506 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) |
---|
2507 | #else |
---|
2508 | YY_BUFFER_STATE yy_scan_buffer( base, size ) |
---|
2509 | char *base; |
---|
2510 | yy_size_t size; |
---|
2511 | #endif |
---|
2512 | { |
---|
2513 | YY_BUFFER_STATE b; |
---|
2514 | |
---|
2515 | if ( size < 2 || |
---|
2516 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
---|
2517 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
---|
2518 | /* They forgot to leave room for the EOB's. */ |
---|
2519 | return 0; |
---|
2520 | |
---|
2521 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
2522 | if ( ! b ) |
---|
2523 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
---|
2524 | |
---|
2525 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
---|
2526 | b->yy_buf_pos = b->yy_ch_buf = base; |
---|
2527 | b->yy_is_our_buffer = 0; |
---|
2528 | b->yy_input_file = 0; |
---|
2529 | b->yy_n_chars = b->yy_buf_size; |
---|
2530 | b->yy_is_interactive = 0; |
---|
2531 | b->yy_at_bol = 1; |
---|
2532 | b->yy_fill_buffer = 0; |
---|
2533 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
2534 | |
---|
2535 | yy_switch_to_buffer( b ); |
---|
2536 | |
---|
2537 | return b; |
---|
2538 | } |
---|
2539 | #endif |
---|
2540 | |
---|
2541 | |
---|
2542 | #ifndef YY_NO_SCAN_STRING |
---|
2543 | #ifdef YY_USE_PROTOS |
---|
2544 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
---|
2545 | #else |
---|
2546 | YY_BUFFER_STATE yy_scan_string( yy_str ) |
---|
2547 | yyconst char *yy_str; |
---|
2548 | #endif |
---|
2549 | { |
---|
2550 | int len; |
---|
2551 | for ( len = 0; yy_str[len]; ++len ) |
---|
2552 | ; |
---|
2553 | |
---|
2554 | return yy_scan_bytes( yy_str, len ); |
---|
2555 | } |
---|
2556 | #endif |
---|
2557 | |
---|
2558 | |
---|
2559 | #ifndef YY_NO_SCAN_BYTES |
---|
2560 | #ifdef YY_USE_PROTOS |
---|
2561 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
---|
2562 | #else |
---|
2563 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
---|
2564 | yyconst char *bytes; |
---|
2565 | int len; |
---|
2566 | #endif |
---|
2567 | { |
---|
2568 | YY_BUFFER_STATE b; |
---|
2569 | char *buf; |
---|
2570 | yy_size_t n; |
---|
2571 | int i; |
---|
2572 | |
---|
2573 | /* Get memory for full buffer, including space for trailing EOB's. */ |
---|
2574 | n = len + 2; |
---|
2575 | buf = (char *) yy_flex_alloc( n ); |
---|
2576 | if ( ! buf ) |
---|
2577 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
---|
2578 | |
---|
2579 | for ( i = 0; i < len; ++i ) |
---|
2580 | buf[i] = bytes[i]; |
---|
2581 | |
---|
2582 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; |
---|
2583 | |
---|
2584 | b = yy_scan_buffer( buf, n ); |
---|
2585 | if ( ! b ) |
---|
2586 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
---|
2587 | |
---|
2588 | /* It's okay to grow etc. this buffer, and we should throw it |
---|
2589 | * away when we're done. |
---|
2590 | */ |
---|
2591 | b->yy_is_our_buffer = 1; |
---|
2592 | |
---|
2593 | return b; |
---|
2594 | } |
---|
2595 | #endif |
---|
2596 | |
---|
2597 | |
---|
2598 | #ifndef YY_NO_PUSH_STATE |
---|
2599 | #ifdef YY_USE_PROTOS |
---|
2600 | static void yy_push_state( int new_state ) |
---|
2601 | #else |
---|
2602 | static void yy_push_state( new_state ) |
---|
2603 | int new_state; |
---|
2604 | #endif |
---|
2605 | { |
---|
2606 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) |
---|
2607 | { |
---|
2608 | yy_size_t new_size; |
---|
2609 | |
---|
2610 | yy_start_stack_depth += YY_START_STACK_INCR; |
---|
2611 | new_size = yy_start_stack_depth * sizeof( int ); |
---|
2612 | |
---|
2613 | if ( ! yy_start_stack ) |
---|
2614 | yy_start_stack = (int *) yy_flex_alloc( new_size ); |
---|
2615 | |
---|
2616 | else |
---|
2617 | yy_start_stack = (int *) yy_flex_realloc( |
---|
2618 | (void *) yy_start_stack, new_size ); |
---|
2619 | |
---|
2620 | if ( ! yy_start_stack ) |
---|
2621 | YY_FATAL_ERROR( |
---|
2622 | "out of memory expanding start-condition stack" ); |
---|
2623 | } |
---|
2624 | |
---|
2625 | yy_start_stack[yy_start_stack_ptr++] = YY_START; |
---|
2626 | |
---|
2627 | BEGIN(new_state); |
---|
2628 | } |
---|
2629 | #endif |
---|
2630 | |
---|
2631 | |
---|
2632 | #ifndef YY_NO_POP_STATE |
---|
2633 | static void yy_pop_state() |
---|
2634 | { |
---|
2635 | if ( --yy_start_stack_ptr < 0 ) |
---|
2636 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
---|
2637 | |
---|
2638 | BEGIN(yy_start_stack[yy_start_stack_ptr]); |
---|
2639 | } |
---|
2640 | #endif |
---|
2641 | |
---|
2642 | |
---|
2643 | #ifndef YY_NO_TOP_STATE |
---|
2644 | static int yy_top_state() |
---|
2645 | { |
---|
2646 | return yy_start_stack[yy_start_stack_ptr - 1]; |
---|
2647 | } |
---|
2648 | #endif |
---|
2649 | |
---|
2650 | #ifndef YY_EXIT_FAILURE |
---|
2651 | #define YY_EXIT_FAILURE 2 |
---|
2652 | #endif |
---|
2653 | |
---|
2654 | #ifdef YY_USE_PROTOS |
---|
2655 | static void yy_fatal_error( yyconst char msg[] ) |
---|
2656 | #else |
---|
2657 | static void yy_fatal_error( msg ) |
---|
2658 | char msg[]; |
---|
2659 | #endif |
---|
2660 | { |
---|
2661 | (void) fprintf( stderr, "%s\n", msg ); |
---|
2662 | exit( YY_EXIT_FAILURE ); |
---|
2663 | } |
---|
2664 | |
---|
2665 | |
---|
2666 | |
---|
2667 | /* Redefine yyless() so it works in section 3 code. */ |
---|
2668 | |
---|
2669 | #undef yyless |
---|
2670 | #define yyless(n) \ |
---|
2671 | do \ |
---|
2672 | { \ |
---|
2673 | /* Undo effects of setting up yytext. */ \ |
---|
2674 | yytext[yyleng] = yy_hold_char; \ |
---|
2675 | yy_c_buf_p = yytext + n; \ |
---|
2676 | yy_hold_char = *yy_c_buf_p; \ |
---|
2677 | *yy_c_buf_p = '\0'; \ |
---|
2678 | yyleng = n; \ |
---|
2679 | } \ |
---|
2680 | while ( 0 ) |
---|
2681 | |
---|
2682 | |
---|
2683 | /* Internal utility routines. */ |
---|
2684 | |
---|
2685 | #ifndef yytext_ptr |
---|
2686 | #ifdef YY_USE_PROTOS |
---|
2687 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
---|
2688 | #else |
---|
2689 | static void yy_flex_strncpy( s1, s2, n ) |
---|
2690 | char *s1; |
---|
2691 | yyconst char *s2; |
---|
2692 | int n; |
---|
2693 | #endif |
---|
2694 | { |
---|
2695 | register int i; |
---|
2696 | for ( i = 0; i < n; ++i ) |
---|
2697 | s1[i] = s2[i]; |
---|
2698 | } |
---|
2699 | #endif |
---|
2700 | |
---|
2701 | #ifdef YY_NEED_STRLEN |
---|
2702 | #ifdef YY_USE_PROTOS |
---|
2703 | static int yy_flex_strlen( yyconst char *s ) |
---|
2704 | #else |
---|
2705 | static int yy_flex_strlen( s ) |
---|
2706 | yyconst char *s; |
---|
2707 | #endif |
---|
2708 | { |
---|
2709 | register int n; |
---|
2710 | for ( n = 0; s[n]; ++n ) |
---|
2711 | ; |
---|
2712 | |
---|
2713 | return n; |
---|
2714 | } |
---|
2715 | #endif |
---|
2716 | |
---|
2717 | |
---|
2718 | #ifdef YY_USE_PROTOS |
---|
2719 | static void *yy_flex_alloc( yy_size_t size ) |
---|
2720 | #else |
---|
2721 | static void *yy_flex_alloc( size ) |
---|
2722 | yy_size_t size; |
---|
2723 | #endif |
---|
2724 | { |
---|
2725 | return (void *) malloc( size ); |
---|
2726 | } |
---|
2727 | |
---|
2728 | #ifdef YY_USE_PROTOS |
---|
2729 | static void *yy_flex_realloc( void *ptr, yy_size_t size ) |
---|
2730 | #else |
---|
2731 | static void *yy_flex_realloc( ptr, size ) |
---|
2732 | void *ptr; |
---|
2733 | yy_size_t size; |
---|
2734 | #endif |
---|
2735 | { |
---|
2736 | /* The cast to (char *) in the following accommodates both |
---|
2737 | * implementations that use char* generic pointers, and those |
---|
2738 | * that use void* generic pointers. It works with the latter |
---|
2739 | * because both ANSI C and C++ allow castless assignment from |
---|
2740 | * any pointer type to void*, and deal with argument conversions |
---|
2741 | * as though doing an assignment. |
---|
2742 | */ |
---|
2743 | return (void *) realloc( (char *) ptr, size ); |
---|
2744 | } |
---|
2745 | |
---|
2746 | #ifdef YY_USE_PROTOS |
---|
2747 | static void yy_flex_free( void *ptr ) |
---|
2748 | #else |
---|
2749 | static void yy_flex_free( ptr ) |
---|
2750 | void *ptr; |
---|
2751 | #endif |
---|
2752 | { |
---|
2753 | free( ptr ); |
---|
2754 | } |
---|
2755 | |
---|
2756 | #if YY_MAIN |
---|
2757 | int main() |
---|
2758 | { |
---|
2759 | yylex(); |
---|
2760 | return 0; |
---|
2761 | } |
---|
2762 | #endif |
---|
2763 | #line 543 "scanner.l" |
---|
2764 | |
---|
2765 | /* |
---|
2766 | [^*\n]+ ++yylineno; yymore(); /*ACTION_ECHO;* / |
---|
2767 | [^*\n]*{NL} ++yylineno; yymore(); /*ACTION_ECHO;* / |
---|
2768 | .*(\n?) { yylineno++; lvalp->name = yytext; return CODEPART; } |
---|
2769 | */ |
---|
2770 | |
---|
2771 | extern "C" { |
---|
2772 | int yywrap() { |
---|
2773 | return 1; |
---|
2774 | } |
---|
2775 | } |
---|
2776 | |
---|
2777 | int libread(FILE* f, char* buf, int max_size) |
---|
2778 | { int rc; |
---|
2779 | |
---|
2780 | offset = ftell(f); |
---|
2781 | rc = fread( buf, 1, max_size, f ); |
---|
2782 | #if YYLPDEBUG >2 |
---|
2783 | printf("fread: %d of %d\n", rc, max_size); |
---|
2784 | #endif |
---|
2785 | yylp_buffer_start = buf; |
---|
2786 | return rc; |
---|
2787 | } |
---|
2788 | |
---|
2789 | void switch_state(int state, int new_state, char *name) |
---|
2790 | { |
---|
2791 | #if DEBUG > 2 |
---|
2792 | printf("====>SWITCH to new state %d/%d l=%d, [%s] at %d\n", |
---|
2793 | state, new_state, state_level, name, yylineno); |
---|
2794 | #endif |
---|
2795 | strncpy(old_states[state_level].name, name, |
---|
2796 | sizeof(old_states[state_level].name)); |
---|
2797 | BEGIN(new_state); |
---|
2798 | } |
---|
2799 | |
---|
2800 | void push_state(int state, int new_state, char *name) |
---|
2801 | { |
---|
2802 | state_level++; |
---|
2803 | #if DEBUG > 2 |
---|
2804 | printf("====>PUSH to new state %d/%d l=%d, [%s] at %d\n", |
---|
2805 | state, new_state, state_level, name, yylineno); |
---|
2806 | #endif |
---|
2807 | if(state_level>=state_max) { |
---|
2808 | state_max++; |
---|
2809 | if(old_states == NULL) |
---|
2810 | old_states = (struct _states *)malloc(sizeof(struct _states)); |
---|
2811 | else { |
---|
2812 | old_states = (struct _states *)realloc(old_states, |
---|
2813 | state_max*sizeof(struct _states)); |
---|
2814 | } |
---|
2815 | } |
---|
2816 | old_states[state_level].state = state; |
---|
2817 | strncpy(old_states[state_level].name, name, |
---|
2818 | sizeof(old_states[state_level].name)); |
---|
2819 | BEGIN(new_state); |
---|
2820 | } |
---|
2821 | |
---|
2822 | void pop_state() |
---|
2823 | { |
---|
2824 | #if DEBUG > 2 |
---|
2825 | printf("====>Back to old state %d, l=%d [%s] at %d\n", |
---|
2826 | old_states[state_level].state, |
---|
2827 | state_level, |
---|
2828 | (state_level>0) ? old_states[state_level-1].name : "INITIAL", |
---|
2829 | yylineno); |
---|
2830 | #endif |
---|
2831 | if(state_level<0) return; |
---|
2832 | BEGIN(old_states[state_level].state); |
---|
2833 | state_level--; |
---|
2834 | if(state_level<0) state_level = -1; |
---|
2835 | } |
---|
2836 | |
---|
2837 | int return_sect_token( |
---|
2838 | int passed, |
---|
2839 | int old_sect, |
---|
2840 | int new_sect |
---|
2841 | ) |
---|
2842 | { |
---|
2843 | if(passed) { |
---|
2844 | #if DEBUG |
---|
2845 | printf("Go to section '%s' (%d)\n", sectname[new_sect], new_sect); |
---|
2846 | #endif |
---|
2847 | switch(new_sect) { |
---|
2848 | case 2: return SECT2START; |
---|
2849 | case 3: return SECT3START; |
---|
2850 | case 4: return SECT4START; |
---|
2851 | default: return SECTEND; |
---|
2852 | } |
---|
2853 | } else { |
---|
2854 | #if DEBUG |
---|
2855 | printf("End of section '%s' (%d)\n", sectname[old_sect], old_sect); |
---|
2856 | #endif |
---|
2857 | switch(old_sect) { |
---|
2858 | case 2: return SECT2END; |
---|
2859 | case 3: return SECT3END; |
---|
2860 | case 4: return SECT4END; |
---|
2861 | default: return SECTEND; |
---|
2862 | } |
---|
2863 | } |
---|
2864 | } |
---|
2865 | |
---|
2866 | void add_action(char *new_text) |
---|
2867 | { |
---|
2868 | return; |
---|
2869 | switch(sectnum) { |
---|
2870 | case 1: |
---|
2871 | printf("1>%s<#\n", new_text); |
---|
2872 | break; |
---|
2873 | case 2: |
---|
2874 | printf("2>%s<#\n", new_text); |
---|
2875 | break; |
---|
2876 | case 3: |
---|
2877 | printf("3>%s<#\n", new_text); |
---|
2878 | break; |
---|
2879 | case 4: |
---|
2880 | printf("4>%s<#\n", new_text); |
---|
2881 | break; |
---|
2882 | } |
---|
2883 | } |
---|