1 #line 2 "guidolex.c++"
2
3 #line 4 "guidolex.c++"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define yy_create_buffer guidoar_create_buffer
10 #define yy_delete_buffer guidoar_delete_buffer
11 #define yy_flex_debug guidoar_flex_debug
12 #define yy_init_buffer guidoar_init_buffer
13 #define yy_flush_buffer guidoar_flush_buffer
14 #define yy_load_buffer_state guidoar_load_buffer_state
15 #define yy_switch_to_buffer guidoar_switch_to_buffer
16 #define yyin guidoarin
17 #define yyleng guidoarleng
18 #define yylex guidoarlex
19 #define yylineno guidoarlineno
20 #define yyout guidoarout
21 #define yyrestart guidoarrestart
22 #define yytext guidoartext
23 #define yywrap guidoarwrap
24 #define yyalloc guidoaralloc
25 #define yyrealloc guidoarrealloc
26 #define yyfree guidoarfree
27
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35
36 /* First, we deal with platform-specific or compiler-specific issues. */
37
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43
44 /* end standard C headers. */
45
46 /* flex integer type definitions */
47
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
57 */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 typedef uint64_t flex_uint64_t;
70 #else
71 typedef signed char flex_int8_t;
72 typedef short int flex_int16_t;
73 typedef int flex_int32_t;
74 typedef unsigned char flex_uint8_t;
75 typedef unsigned short int flex_uint16_t;
76 typedef unsigned int flex_uint32_t;
77 #endif /* ! C99 */
78
79 /* Limits of integral types. */
80 #ifndef INT8_MIN
81 #define INT8_MIN (-128)
82 #endif
83 #ifndef INT16_MIN
84 #define INT16_MIN (-32767-1)
85 #endif
86 #ifndef INT32_MIN
87 #define INT32_MIN (-2147483647-1)
88 #endif
89 #ifndef INT8_MAX
90 #define INT8_MAX (127)
91 #endif
92 #ifndef INT16_MAX
93 #define INT16_MAX (32767)
94 #endif
95 #ifndef INT32_MAX
96 #define INT32_MAX (2147483647)
97 #endif
98 #ifndef UINT8_MAX
99 #define UINT8_MAX (255U)
100 #endif
101 #ifndef UINT16_MAX
102 #define UINT16_MAX (65535U)
103 #endif
104 #ifndef UINT32_MAX
105 #define UINT32_MAX (4294967295U)
106 #endif
107
108 #endif /* ! FLEXINT_H */
109
110 #ifdef __cplusplus
111
112 /* The "const" storage-class-modifier is valid. */
113 #define YY_USE_CONST
114
115 #else /* ! __cplusplus */
116
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
119
120 #define YY_USE_CONST
121
122 #endif /* defined (__STDC__) */
123 #endif /* ! __cplusplus */
124
125 #ifdef YY_USE_CONST
126 #define yyconst const
127 #else
128 #define yyconst
129 #endif
130
131 /* Returned upon end-of-file. */
132 #define YY_NULL 0
133
134 /* Promotes a possibly negative, possibly signed char to an unsigned
135 * integer for use as an array index. If the signed char is negative,
136 * we want to instead treat it as an 8-bit unsigned char, hence the
137 * double cast.
138 */
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
144 */
145 #define BEGIN (yy_start) = 1 + 2 *
146
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 * compatibility.
150 */
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
153
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE guidoarrestart(guidoarin )
159
160 #define YY_END_OF_BUFFER_CHAR 0
161
162 /* Size of default input buffer. */
163 #ifndef YY_BUF_SIZE
164 #define YY_BUF_SIZE 16384
165 #endif
166
167 /* The state buf must be large enough to hold one state per character in the main buffer.
168 */
169 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170
171 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
172 #define YY_TYPEDEF_YY_BUFFER_STATE
173 typedef struct yy_buffer_state *YY_BUFFER_STATE;
174 #endif
175
176 #ifndef YY_TYPEDEF_YY_SIZE_T
177 #define YY_TYPEDEF_YY_SIZE_T
178 typedef size_t yy_size_t;
179 #endif
180
181 extern yy_size_t guidoarleng;
182
183 extern FILE *guidoarin, *guidoarout;
184
185 #define EOB_ACT_CONTINUE_SCAN 0
186 #define EOB_ACT_END_OF_FILE 1
187 #define EOB_ACT_LAST_MATCH 2
188
189 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
190 * access to the local variable yy_act. Since yyless() is a macro, it would break
191 * existing scanners that call yyless() from OUTSIDE guidoarlex.
192 * One obvious solution it to make yy_act a global. I tried that, and saw
193 * a 5% performance hit in a non-guidoarlineno scanner, because yy_act is
194 * normally declared as a register variable-- so it is not worth it.
195 */
196 #define YY_LESS_LINENO(n) \
197 do { \
198 yy_size_t yyl;\
199 for ( yyl = n; yyl < guidoarleng; ++yyl )\
200 if ( guidoartext[yyl] == '\n' )\
201 --guidoarlineno;\
202 }while(0)
203
204 /* Return all but the first "n" matched characters back to the input stream. */
205 #define yyless(n) \
206 do \
207 { \
208 /* Undo effects of setting up guidoartext. */ \
209 int yyless_macro_arg = (n); \
210 YY_LESS_LINENO(yyless_macro_arg);\
211 *yy_cp = (yy_hold_char); \
212 YY_RESTORE_YY_MORE_OFFSET \
213 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
214 YY_DO_BEFORE_ACTION; /* set up guidoartext again */ \
215 } \
216 while ( 0 )
217
218 #define unput(c) yyunput( c, (yytext_ptr) )
219
220 #ifndef YY_STRUCT_YY_BUFFER_STATE
221 #define YY_STRUCT_YY_BUFFER_STATE
222 struct yy_buffer_state
223 {
224 FILE *yy_input_file;
225
226 char *yy_ch_buf; /* input buffer */
227 char *yy_buf_pos; /* current position in input buffer */
228
229 /* Size of input buffer in bytes, not including room for EOB
230 * characters.
231 */
232 yy_size_t yy_buf_size;
233
234 /* Number of characters read into yy_ch_buf, not including EOB
235 * characters.
236 */
237 yy_size_t yy_n_chars;
238
239 /* Whether we "own" the buffer - i.e., we know we created it,
240 * and can realloc() it to grow it, and should free() it to
241 * delete it.
242 */
243 int yy_is_our_buffer;
244
245 /* Whether this is an "interactive" input source; if so, and
246 * if we're using stdio for input, then we want to use getc()
247 * instead of fread(), to make sure we stop fetching input after
248 * each newline.
249 */
250 int yy_is_interactive;
251
252 /* Whether we're considered to be at the beginning of a line.
253 * If so, '^' rules will be active on the next match, otherwise
254 * not.
255 */
256 int yy_at_bol;
257
258 int yy_bs_lineno; /**< The line count. */
259 int yy_bs_column; /**< The column count. */
260
261 /* Whether to try to fill the input buffer when we reach the
262 * end of it.
263 */
264 int yy_fill_buffer;
265
266 int yy_buffer_status;
267
268 #define YY_BUFFER_NEW 0
269 #define YY_BUFFER_NORMAL 1
270 /* When an EOF's been seen but there's still some text to process
271 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
272 * shouldn't try reading from the input source any more. We might
273 * still have a bunch of tokens to match, though, because of
274 * possible backing-up.
275 *
276 * When we actually see the EOF, we change the status to "new"
277 * (via guidoarrestart()), so that the user can continue scanning by
278 * just pointing guidoarin at a new input file.
279 */
280 #define YY_BUFFER_EOF_PENDING 2
281
282 };
283 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
284
285 /* Stack of input buffers. */
286 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
287 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
288 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
289
290 /* We provide macros for accessing buffer states in case in the
291 * future we want to put the buffer states in a more general
292 * "scanner state".
293 *
294 * Returns the top of the stack, or NULL.
295 */
296 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
297 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
298 : NULL)
299
300 /* Same as previous macro, but useful when we know that the buffer stack is not
301 * NULL or when we need an lvalue. For internal use only.
302 */
303 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
304
305 /* yy_hold_char holds the character lost when guidoartext is formed. */
306 static char yy_hold_char;
307 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
308 yy_size_t guidoarleng;
309
310 /* Points to current character in buffer. */
311 static char *yy_c_buf_p = (char *) 0;
312 static int yy_init = 0; /* whether we need to initialize */
313 static int yy_start = 0; /* start state number */
314
315 /* Flag which is used to allow guidoarwrap()'s to do buffer switches
316 * instead of setting up a fresh guidoarin. A bit of a hack ...
317 */
318 static int yy_did_buffer_switch_on_eof;
319
320 void guidoarrestart (FILE *input_file );
321 void guidoar_switch_to_buffer (YY_BUFFER_STATE new_buffer );
322 YY_BUFFER_STATE guidoar_create_buffer (FILE *file,int size );
323 void guidoar_delete_buffer (YY_BUFFER_STATE b );
324 void guidoar_flush_buffer (YY_BUFFER_STATE b );
325 void guidoarpush_buffer_state (YY_BUFFER_STATE new_buffer );
326 void guidoarpop_buffer_state (void );
327
328 static void guidoarensure_buffer_stack (void );
329 static void guidoar_load_buffer_state (void );
330 static void guidoar_init_buffer (YY_BUFFER_STATE b,FILE *file );
331
332 #define YY_FLUSH_BUFFER guidoar_flush_buffer(YY_CURRENT_BUFFER )
333
334 YY_BUFFER_STATE guidoar_scan_buffer (char *base,yy_size_t size );
335 YY_BUFFER_STATE guidoar_scan_string (yyconst char *yy_str );
336 YY_BUFFER_STATE guidoar_scan_bytes (yyconst char *bytes,yy_size_t len );
337
338 void *guidoaralloc (yy_size_t );
339 void *guidoarrealloc (void *,yy_size_t );
340 void guidoarfree (void * );
341
342 #define yy_new_buffer guidoar_create_buffer
343
344 #define yy_set_interactive(is_interactive) \
345 { \
346 if ( ! YY_CURRENT_BUFFER ){ \
347 guidoarensure_buffer_stack (); \
348 YY_CURRENT_BUFFER_LVALUE = \
349 guidoar_create_buffer(guidoarin,YY_BUF_SIZE ); \
350 } \
351 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
352 }
353
354 #define yy_set_bol(at_bol) \
355 { \
356 if ( ! YY_CURRENT_BUFFER ){\
357 guidoarensure_buffer_stack (); \
358 YY_CURRENT_BUFFER_LVALUE = \
359 guidoar_create_buffer(guidoarin,YY_BUF_SIZE ); \
360 } \
361 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
362 }
363
364 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
365
366 typedef unsigned char YY_CHAR;
367
368 FILE *guidoarin = (FILE *) 0, *guidoarout = (FILE *) 0;
369
370 typedef int yy_state_type;
371
372 extern int guidoarlineno;
373
374 int guidoarlineno = 1;
375
376 extern char *guidoartext;
377 #define yytext_ptr guidoartext
378
379 static yy_state_type yy_get_previous_state (void );
380 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
381 static int yy_get_next_buffer (void );
382 static void yy_fatal_error (yyconst char msg[] );
383
384 /* Done after the current pattern has been matched and before the
385 * corresponding action - sets up guidoartext.
386 */
387 #define YY_DO_BEFORE_ACTION \
388 (yytext_ptr) = yy_bp; \
389 guidoarleng = (yy_size_t) (yy_cp - yy_bp); \
390 (yy_hold_char) = *yy_cp; \
391 *yy_cp = '\0'; \
392 (yy_c_buf_p) = yy_cp;
393
394 #define YY_NUM_RULES 45
395 #define YY_END_OF_BUFFER 46
396 /* This struct is not used in this scanner,
397 but its presence is necessary. */
398 struct yy_trans_info
399 {
400 flex_int32_t yy_verify;
401 flex_int32_t yy_nxt;
402 };
403 static yyconst flex_int16_t yy_accept[132] =
404 { 0,
405 0, 0, 8, 8, 10, 10, 0, 0, 46, 44,
406 43, 43, 44, 25, 7, 26, 20, 21, 27, 44,
407 16, 44, 23, 28, 1, 17, 33, 29, 18, 44,
408 19, 41, 39, 39, 39, 39, 39, 39, 39, 39,
409 44, 44, 32, 44, 44, 31, 44, 14, 22, 15,
410 8, 9, 8, 10, 10, 10, 10, 34, 35, 34,
411 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
412 32, 34, 34, 31, 34, 43, 7, 0, 0, 42,
413 0, 13, 0, 2, 0, 3, 24, 4, 0, 1,
414 36, 0, 0, 32, 0, 37, 0, 0, 0, 30,
415
416 0, 8, 9, 8, 10, 11, 12, 34, 34, 34,
417 32, 34, 34, 34, 34, 34, 30, 34, 0, 5,
418 6, 36, 38, 0, 34, 34, 0, 34, 40, 34,
419 0
420 } ;
421
422 static yyconst flex_int32_t yy_ec[256] =
423 { 0,
424 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
425 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 2, 1, 5, 6, 7, 8, 9, 1, 10,
428 11, 12, 13, 14, 15, 16, 17, 18, 18, 18,
429 18, 18, 18, 18, 18, 18, 18, 19, 1, 20,
430 21, 22, 1, 1, 23, 23, 23, 23, 23, 23,
431 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
432 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
433 24, 25, 26, 1, 27, 1, 28, 29, 30, 31,
434
435 32, 33, 34, 35, 36, 23, 23, 37, 38, 39,
436 40, 41, 23, 42, 43, 44, 23, 23, 23, 23,
437 45, 23, 46, 47, 48, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1
452 } ;
453
454 static yyconst flex_int32_t yy_meta[49] =
455 { 0,
456 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 4, 1, 1,
458 1, 1, 5, 1, 1, 1, 5, 5, 5, 5,
459 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
460 5, 5, 5, 5, 5, 1, 1, 1
461 } ;
462
463 static yyconst flex_int16_t yy_base[139] =
464 { 0,
465 0, 0, 46, 48, 50, 53, 59, 0, 229, 230,
466 65, 68, 54, 230, 230, 230, 216, 230, 230, 67,
467 230, 89, 90, 230, 93, 230, 230, 230, 230, 0,
468 230, 230, 191, 230, 74, 44, 188, 85, 189, 181,
469 184, 194, 79, 84, 86, 80, 185, 230, 230, 230,
470 0, 121, 123, 230, 126, 208, 208, 0, 230, 0,
471 182, 0, 95, 96, 179, 106, 180, 172, 175, 185,
472 101, 105, 106, 105, 176, 144, 230, 199, 135, 230,
473 52, 230, 192, 135, 191, 139, 230, 190, 189, 140,
474 0, 163, 162, 230, 161, 230, 162, 159, 158, 230,
475
476 163, 0, 158, 160, 162, 230, 230, 0, 156, 155,
477 0, 147, 0, 146, 126, 125, 0, 130, 145, 141,
478 101, 0, 230, 30, 0, 20, 16, 13, 230, 0,
479 230, 170, 175, 180, 183, 188, 190, 192
480 } ;
481
482 static yyconst flex_int16_t yy_def[139] =
483 { 0,
484 131, 1, 132, 132, 133, 133, 1, 7, 131, 131,
485 131, 131, 134, 131, 131, 131, 131, 131, 131, 131,
486 131, 131, 131, 131, 131, 131, 131, 131, 131, 135,
487 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
488 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
489 136, 131, 136, 131, 131, 131, 131, 137, 131, 137,
490 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
491 137, 137, 137, 137, 137, 131, 131, 131, 134, 131,
492 134, 131, 131, 131, 131, 131, 131, 131, 131, 131,
493 138, 131, 131, 131, 131, 131, 131, 131, 131, 131,
494
495 131, 136, 131, 136, 131, 131, 131, 137, 137, 137,
496 137, 137, 137, 137, 137, 137, 137, 137, 134, 131,
497 131, 138, 131, 131, 137, 137, 131, 137, 131, 137,
498 0, 131, 131, 131, 131, 131, 131, 131
499 } ;
500
501 static yyconst flex_int16_t yy_nxt[279] =
502 { 0,
503 10, 11, 12, 11, 13, 14, 10, 15, 16, 17,
504 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
505 28, 10, 10, 29, 30, 31, 32, 33, 34, 35,
506 36, 37, 38, 39, 40, 41, 42, 43, 10, 10,
507 44, 45, 46, 47, 10, 48, 49, 50, 52, 53,
508 52, 53, 55, 55, 131, 55, 55, 130, 80, 56,
509 129, 57, 56, 128, 57, 58, 76, 76, 76, 76,
510 76, 76, 77, 127, 78, 77, 119, 78, 81, 95,
511 59, 58, 83, 96, 84, 60, 61, 62, 63, 64,
512 65, 66, 67, 68, 69, 70, 71, 58, 58, 72,
513
514 73, 74, 75, 58, 85, 87, 86, 88, 89, 93,
515 90, 94, 96, 94, 96, 96, 94, 96, 121, 101,
516 98, 100, 94, 103, 103, 103, 104, 94, 105, 105,
517 110, 112, 111, 113, 111, 113, 113, 113, 111, 80,
518 113, 115, 111, 117, 118, 76, 76, 76, 111, 80,
519 83, 77, 84, 78, 85, 89, 86, 90, 120, 81,
520 103, 103, 103, 104, 105, 105, 113, 125, 125, 81,
521 51, 51, 51, 51, 51, 54, 54, 54, 54, 54,
522 79, 79, 79, 79, 79, 91, 126, 91, 102, 125,
523 102, 102, 102, 108, 108, 122, 122, 125, 125, 96,
524
525 123, 123, 124, 123, 123, 123, 88, 88, 121, 120,
526 82, 113, 113, 111, 111, 116, 114, 109, 107, 106,
527 96, 96, 94, 94, 99, 97, 92, 82, 131, 9,
528 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
529 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
530 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
531 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
532 131, 131, 131, 131, 131, 131, 131, 131
533 } ;
534
535 static yyconst flex_int16_t yy_chk[279] =
536 { 0,
537 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
538 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
539 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
540 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
541 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
542 4, 4, 5, 5, 81, 6, 6, 128, 13, 5,
543 127, 5, 6, 126, 6, 7, 11, 11, 11, 12,
544 12, 12, 11, 124, 11, 12, 81, 12, 13, 36,
545 7, 7, 20, 36, 20, 7, 7, 7, 7, 7,
546 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
547
548 7, 7, 7, 7, 22, 23, 22, 23, 25, 35,
549 25, 35, 38, 44, 43, 46, 43, 45, 121, 46,
550 38, 43, 45, 52, 52, 53, 53, 44, 55, 55,
551 63, 64, 63, 66, 72, 64, 71, 73, 71, 79,
552 74, 66, 73, 71, 74, 76, 76, 76, 72, 119,
553 84, 76, 84, 76, 86, 90, 86, 90, 120, 79,
554 103, 103, 104, 104, 105, 105, 118, 116, 115, 119,
555 132, 132, 132, 132, 132, 133, 133, 133, 133, 133,
556 134, 134, 134, 134, 134, 135, 114, 135, 136, 112,
557 136, 136, 136, 137, 137, 138, 138, 110, 109, 101,
558
559 99, 98, 97, 95, 93, 92, 89, 88, 85, 83,
560 78, 75, 70, 69, 68, 67, 65, 61, 57, 56,
561 47, 42, 41, 40, 39, 37, 33, 17, 9, 131,
562 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
563 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
564 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
565 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
566 131, 131, 131, 131, 131, 131, 131, 131
567 } ;
568
569 /* Table of booleans, true if rule could match eol. */
570 static yyconst flex_int32_t yy_rule_can_match_eol[46] =
571 { 0,
572 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0,
573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
574 0, 0, 1, 1, 0, 0, };
575
576 static yy_state_type yy_last_accepting_state;
577 static char *yy_last_accepting_cpos;
578
579 extern int guidoar_flex_debug;
580 int guidoar_flex_debug = 0;
581
582 /* The intent behind this definition is that it'll catch
583 * any uses of REJECT which flex missed.
584 */
585 #define REJECT reject_used_but_not_detected
586 #define yymore() yymore_used_but_not_detected
587 #define YY_MORE_ADJ 0
588 #define YY_RESTORE_YY_MORE_OFFSET
589 char *guidoartext;
590 #line 1 "guido.l"
591 #line 2 "guido.l"
592
593 #include <stdlib.h>
594 #include <string.h>
595
596 #define YY_NO_UNISTD_H
597 extern YYSTYPE guidoarlval;
598
599 #define register // intended to get rid of the deprecated register warning
600
601 static int nested;
602
unescape(char * str)603 static char* unescape (char * str) {
604 size_t n = strlen(str);
605 for (int i=0, j=0; i <= n; i++) {
606 if (str[i] == '\\') {
607 if (str[i+1] == '\\') {
608 str[j++] = str[i++];
609 }
610 else if (str[i+1] != '"') {
611 str[j++] = str[i];
612 }
613 }
614 else str[j++] = str[i];
615 }
616 return str;
617 }
618
unquote(char * str)619 static char* unquote (char * str) {
620 size_t n = strlen(str);
621 for (int i=0; i < n; i++)
622 str[i] = str[i+1];
623 str[n-2] = 0;
624 return str;
625 }
626
untag(char * str)627 static char* untag (char * str) {
628 size_t n = strlen(str);
629 for (int i=0; i < n; i++)
630 str[i] = str[i+1];
631 return str;
632 }
633
634
635
636
637 #line 638 "guidolex.c++"
638
639 #define INITIAL 0
640 #define CMNTLN 1
641 #define COMMENT 2
642 #define PARAM 3
643
644 #ifndef YY_NO_UNISTD_H
645 /* Special case for "unistd.h", since it is non-ANSI. We include it way
646 * down here because we want the user's section 1 to have been scanned first.
647 * The user has a chance to override it with an option.
648 */
649 #include <unistd.h>
650 #endif
651
652 #ifndef YY_EXTRA_TYPE
653 #define YY_EXTRA_TYPE void *
654 #endif
655
656 static int yy_init_globals (void );
657
658 /* Accessor methods to globals.
659 These are made visible to non-reentrant scanners for convenience. */
660
661 int guidoarlex_destroy (void );
662
663 int guidoarget_debug (void );
664
665 void guidoarset_debug (int debug_flag );
666
667 YY_EXTRA_TYPE guidoarget_extra (void );
668
669 void guidoarset_extra (YY_EXTRA_TYPE user_defined );
670
671 FILE *guidoarget_in (void );
672
673 void guidoarset_in (FILE * in_str );
674
675 FILE *guidoarget_out (void );
676
677 void guidoarset_out (FILE * out_str );
678
679 yy_size_t guidoarget_leng (void );
680
681 char *guidoarget_text (void );
682
683 int guidoarget_lineno (void );
684
685 void guidoarset_lineno (int line_number );
686
687 /* Macros after this point can all be overridden by user definitions in
688 * section 1.
689 */
690
691 #ifndef YY_SKIP_YYWRAP
692 #ifdef __cplusplus
693 extern "C" int guidoarwrap (void );
694 #else
695 extern int guidoarwrap (void );
696 #endif
697 #endif
698
699 static void yyunput (int c,char *buf_ptr );
700
701 #ifndef yytext_ptr
702 static void yy_flex_strncpy (char *,yyconst char *,int );
703 #endif
704
705 #ifdef YY_NEED_STRLEN
706 static int yy_flex_strlen (yyconst char * );
707 #endif
708
709 #ifndef YY_NO_INPUT
710
711 #ifdef __cplusplus
712 static int yyinput (void );
713 #else
714 static int input (void );
715 #endif
716
717 #endif
718
719 /* Amount of stuff to slurp up with each read. */
720 #ifndef YY_READ_BUF_SIZE
721 #define YY_READ_BUF_SIZE 8192
722 #endif
723
724 /* Copy whatever the last rule matched to the standard output. */
725 #ifndef ECHO
726 /* This used to be an fputs(), but since the string might contain NUL's,
727 * we now use fwrite().
728 */
729 #define ECHO fwrite( guidoartext, guidoarleng, 1, guidoarout )
730 #endif
731
732 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
733 * is returned in "result".
734 */
735 #ifndef YY_INPUT
736 #define YY_INPUT(buf,result,max_size) \
737 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
738 { \
739 int c = '*'; \
740 yy_size_t n; \
741 for ( n = 0; n < max_size && \
742 (c = getc( guidoarin )) != EOF && c != '\n'; ++n ) \
743 buf[n] = (char) c; \
744 if ( c == '\n' ) \
745 buf[n++] = (char) c; \
746 if ( c == EOF && ferror( guidoarin ) ) \
747 YY_FATAL_ERROR( "input in flex scanner failed" ); \
748 result = n; \
749 } \
750 else \
751 { \
752 errno=0; \
753 while ( (result = fread(buf, 1, max_size, guidoarin))==0 && ferror(guidoarin)) \
754 { \
755 if( errno != EINTR) \
756 { \
757 YY_FATAL_ERROR( "input in flex scanner failed" ); \
758 break; \
759 } \
760 errno=0; \
761 clearerr(guidoarin); \
762 } \
763 }\
764 \
765
766 #endif
767
768 /* No semi-colon after return; correct usage is to write "yyterminate();" -
769 * we don't want an extra ';' after the "return" because that will cause
770 * some compilers to complain about unreachable statements.
771 */
772 #ifndef yyterminate
773 #define yyterminate() return YY_NULL
774 #endif
775
776 /* Number of entries by which start-condition stack grows. */
777 #ifndef YY_START_STACK_INCR
778 #define YY_START_STACK_INCR 25
779 #endif
780
781 /* Report a fatal error. */
782 #ifndef YY_FATAL_ERROR
783 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
784 #endif
785
786 /* end tables serialization structures and prototypes */
787
788 /* Default declaration of generated scanner - a define so the user can
789 * easily add parameters.
790 */
791 #ifndef YY_DECL
792 #define YY_DECL_IS_OURS 1
793
794 extern int guidoarlex (void);
795
796 #define YY_DECL int guidoarlex (void)
797 #endif /* !YY_DECL */
798
799 /* Code executed at the beginning of each rule, after guidoartext and guidoarleng
800 * have been set up.
801 */
802 #ifndef YY_USER_ACTION
803 #define YY_USER_ACTION
804 #endif
805
806 /* Code executed at the end of each rule. */
807 #ifndef YY_BREAK
808 #define YY_BREAK break;
809 #endif
810
811 #define YY_RULE_SETUP \
812 YY_USER_ACTION
813
814 /** The main scanner function which does all the work.
815 */
816 YY_DECL
817 {
818 register yy_state_type yy_current_state;
819 register char *yy_cp, *yy_bp;
820 register int yy_act;
821
822 #line 60 "guido.l"
823
824 #line 825 "guidolex.c++"
825
826 if ( !(yy_init) )
827 {
828 (yy_init) = 1;
829
830 #ifdef YY_USER_INIT
831 YY_USER_INIT;
832 #endif
833
834 if ( ! (yy_start) )
835 (yy_start) = 1; /* first start state */
836
837 if ( ! guidoarin )
838 guidoarin = stdin;
839
840 if ( ! guidoarout )
841 guidoarout = stdout;
842
843 if ( ! YY_CURRENT_BUFFER ) {
844 guidoarensure_buffer_stack ();
845 YY_CURRENT_BUFFER_LVALUE =
846 guidoar_create_buffer(guidoarin,YY_BUF_SIZE );
847 }
848
849 guidoar_load_buffer_state( );
850 }
851
852 while ( 1 ) /* loops until end-of-file is reached */
853 {
854 yy_cp = (yy_c_buf_p);
855
856 /* Support of guidoartext. */
857 *yy_cp = (yy_hold_char);
858
859 /* yy_bp points to the position in yy_ch_buf of the start of
860 * the current run.
861 */
862 yy_bp = yy_cp;
863
864 yy_current_state = (yy_start);
865 yy_match:
866 do
867 {
868 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
869 if ( yy_accept[yy_current_state] )
870 {
871 (yy_last_accepting_state) = yy_current_state;
872 (yy_last_accepting_cpos) = yy_cp;
873 }
874 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
875 {
876 yy_current_state = (int) yy_def[yy_current_state];
877 if ( yy_current_state >= 132 )
878 yy_c = yy_meta[(unsigned int) yy_c];
879 }
880 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
881 ++yy_cp;
882 }
883 while ( yy_current_state != 131 );
884 yy_cp = (yy_last_accepting_cpos);
885 yy_current_state = (yy_last_accepting_state);
886
887 yy_find_action:
888 yy_act = yy_accept[yy_current_state];
889
890 YY_DO_BEFORE_ACTION;
891
892 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
893 {
894 yy_size_t yyl;
895 for ( yyl = 0; yyl < guidoarleng; ++yyl )
896 if ( guidoartext[yyl] == '\n' )
897
898 guidoarlineno++;
899 ;
900 }
901
902 do_action: /* This label is used only to access EOF actions. */
903
904 switch ( yy_act )
905 { /* beginning of action switch */
906 case 0: /* must back up */
907 /* undo the effects of YY_DO_BEFORE_ACTION */
908 *yy_cp = (yy_hold_char);
909 yy_cp = (yy_last_accepting_cpos);
910 yy_current_state = (yy_last_accepting_state);
911 goto yy_find_action;
912
913 case 1:
914 YY_RULE_SETUP
915 #line 61 "guido.l"
916 return NUMBER;
917 YY_BREAK
918 case 2:
919 YY_RULE_SETUP
920 #line 62 "guido.l"
921 return PNUMBER;
922 YY_BREAK
923 case 3:
924 YY_RULE_SETUP
925 #line 63 "guido.l"
926 return NNUMBER;
927 YY_BREAK
928 case 4:
929 YY_RULE_SETUP
930 #line 65 "guido.l"
931 return FLOAT;
932 YY_BREAK
933 case 5:
934 YY_RULE_SETUP
935 #line 66 "guido.l"
936 return FLOAT;
937 YY_BREAK
938 case 6:
939 YY_RULE_SETUP
940 #line 67 "guido.l"
941 return FLOAT;
942 YY_BREAK
943 case 7:
944 /* rule 7 can match eol */
945 YY_RULE_SETUP
946 #line 69 "guido.l"
947 BEGIN CMNTLN;
948 YY_BREAK
949 case 8:
950 YY_RULE_SETUP
951 #line 70 "guido.l"
952
953 YY_BREAK
954 case 9:
955 /* rule 9 can match eol */
956 YY_RULE_SETUP
957 #line 71 "guido.l"
958 BEGIN INITIAL;
959 YY_BREAK
960 case 10:
961 /* rule 10 can match eol */
962 YY_RULE_SETUP
963 #line 73 "guido.l"
964
965 YY_BREAK
966 case 11:
967 YY_RULE_SETUP
968 #line 74 "guido.l"
969 nested++;
970 YY_BREAK
971 case 12:
972 YY_RULE_SETUP
973 #line 75 "guido.l"
974 if (--nested==0) BEGIN INITIAL;
975 YY_BREAK
976 case 13:
977 /* rule 13 can match eol */
978 YY_RULE_SETUP
979 #line 76 "guido.l"
980 nested=1; BEGIN COMMENT;
981 YY_BREAK
982 case 14:
983 YY_RULE_SETUP
984 #line 78 "guido.l"
985 return STARTCHORD;
986 YY_BREAK
987 case 15:
988 YY_RULE_SETUP
989 #line 79 "guido.l"
990 return ENDCHORD;
991 YY_BREAK
992 case 16:
993 YY_RULE_SETUP
994 #line 80 "guido.l"
995 return SEP;
996 YY_BREAK
997 case 17:
998 YY_RULE_SETUP
999 #line 81 "guido.l"
1000 return IDSEP;
1001 YY_BREAK
1002 case 18:
1003 YY_RULE_SETUP
1004 #line 82 "guido.l"
1005 return STARTSEQ;
1006 YY_BREAK
1007 case 19:
1008 YY_RULE_SETUP
1009 #line 83 "guido.l"
1010 return ENDSEQ;
1011 YY_BREAK
1012 case 20:
1013 YY_RULE_SETUP
1014 #line 84 "guido.l"
1015 return STARTRANGE;
1016 YY_BREAK
1017 case 21:
1018 YY_RULE_SETUP
1019 #line 85 "guido.l"
1020 return ENDRANGE;
1021 YY_BREAK
1022 case 22:
1023 YY_RULE_SETUP
1024 #line 86 "guido.l"
1025 return BAR;
1026 YY_BREAK
1027 case 23:
1028 YY_RULE_SETUP
1029 #line 88 "guido.l"
1030 return DOT;
1031 YY_BREAK
1032 case 24:
1033 YY_RULE_SETUP
1034 #line 89 "guido.l"
1035 return DDOT;
1036 YY_BREAK
1037 case 25:
1038 YY_RULE_SETUP
1039 #line 90 "guido.l"
1040 return SHARP;
1041 YY_BREAK
1042 case 26:
1043 YY_RULE_SETUP
1044 #line 91 "guido.l"
1045 return FLAT;
1046 YY_BREAK
1047 case 27:
1048 YY_RULE_SETUP
1049 #line 92 "guido.l"
1050 return MULT;
1051 YY_BREAK
1052 case 28:
1053 YY_RULE_SETUP
1054 #line 93 "guido.l"
1055 return DIV;
1056 YY_BREAK
1057 case 29:
1058 YY_RULE_SETUP
1059 #line 94 "guido.l"
1060 return EQUAL;
1061 YY_BREAK
1062 case 30:
1063 YY_RULE_SETUP
1064 #line 96 "guido.l"
1065 return MLS;
1066 YY_BREAK
1067 case 31:
1068 YY_RULE_SETUP
1069 #line 97 "guido.l"
1070 return SEC;
1071 YY_BREAK
1072 case 32:
1073 YY_RULE_SETUP
1074 #line 98 "guido.l"
1075 return UNIT;
1076 YY_BREAK
1077 case 33:
1078 YY_RULE_SETUP
1079 #line 100 "guido.l"
1080 BEGIN PARAM; return STARTPARAM;
1081 YY_BREAK
1082 case 34:
1083 YY_RULE_SETUP
1084 #line 101 "guido.l"
1085 return ID;
1086 YY_BREAK
1087 case 35:
1088 YY_RULE_SETUP
1089 #line 102 "guido.l"
1090 BEGIN INITIAL; return ENDPARAM;
1091 YY_BREAK
1092 case 36:
1093 YY_RULE_SETUP
1094 #line 104 "guido.l"
1095 untag(guidoartext); return TAGNAME;
1096 YY_BREAK
1097 case 37:
1098 YY_RULE_SETUP
1099 #line 106 "guido.l"
1100 return SOLFEGE;
1101 YY_BREAK
1102 case 38:
1103 YY_RULE_SETUP
1104 #line 107 "guido.l"
1105 return CHROMATIC;
1106 YY_BREAK
1107 case 39:
1108 YY_RULE_SETUP
1109 #line 108 "guido.l"
1110 return DIATONIC;
1111 YY_BREAK
1112 case 40:
1113 YY_RULE_SETUP
1114 #line 109 "guido.l"
1115 return EMPTY;
1116 YY_BREAK
1117 case 41:
1118 YY_RULE_SETUP
1119 #line 110 "guido.l"
1120 return REST;
1121 YY_BREAK
1122 case 42:
1123 /* rule 42 can match eol */
1124 YY_RULE_SETUP
1125 #line 112 "guido.l"
1126 unescape(guidoartext); unquote(guidoartext); return STRING;
1127 YY_BREAK
1128 case 43:
1129 /* rule 43 can match eol */
1130 YY_RULE_SETUP
1131 #line 114 "guido.l"
1132 /* eat up space */
1133 YY_BREAK
1134 case 44:
1135 YY_RULE_SETUP
1136 #line 115 "guido.l"
1137 printf("guido extra text is : %s\n", guidoartext); return EXTRA;
1138 YY_BREAK
1139 case 45:
1140 YY_RULE_SETUP
1141 #line 117 "guido.l"
1142 ECHO;
1143 YY_BREAK
1144 #line 1145 "guidolex.c++"
1145 case YY_STATE_EOF(INITIAL):
1146 case YY_STATE_EOF(CMNTLN):
1147 case YY_STATE_EOF(COMMENT):
1148 case YY_STATE_EOF(PARAM):
1149 yyterminate();
1150
1151 case YY_END_OF_BUFFER:
1152 {
1153 /* Amount of text matched not including the EOB char. */
1154 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1155
1156 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1157 *yy_cp = (yy_hold_char);
1158 YY_RESTORE_YY_MORE_OFFSET
1159
1160 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1161 {
1162 /* We're scanning a new file or input source. It's
1163 * possible that this happened because the user
1164 * just pointed guidoarin at a new source and called
1165 * guidoarlex(). If so, then we have to assure
1166 * consistency between YY_CURRENT_BUFFER and our
1167 * globals. Here is the right place to do so, because
1168 * this is the first action (other than possibly a
1169 * back-up) that will match for the new input source.
1170 */
1171 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1172 YY_CURRENT_BUFFER_LVALUE->yy_input_file = guidoarin;
1173 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1174 }
1175
1176 /* Note that here we test for yy_c_buf_p "<=" to the position
1177 * of the first EOB in the buffer, since yy_c_buf_p will
1178 * already have been incremented past the NUL character
1179 * (since all states make transitions on EOB to the
1180 * end-of-buffer state). Contrast this with the test
1181 * in input().
1182 */
1183 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1184 { /* This was really a NUL. */
1185 yy_state_type yy_next_state;
1186
1187 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1188
1189 yy_current_state = yy_get_previous_state( );
1190
1191 /* Okay, we're now positioned to make the NUL
1192 * transition. We couldn't have
1193 * yy_get_previous_state() go ahead and do it
1194 * for us because it doesn't know how to deal
1195 * with the possibility of jamming (and we don't
1196 * want to build jamming into it because then it
1197 * will run more slowly).
1198 */
1199
1200 yy_next_state = yy_try_NUL_trans( yy_current_state );
1201
1202 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1203
1204 if ( yy_next_state )
1205 {
1206 /* Consume the NUL. */
1207 yy_cp = ++(yy_c_buf_p);
1208 yy_current_state = yy_next_state;
1209 goto yy_match;
1210 }
1211
1212 else
1213 {
1214 yy_cp = (yy_last_accepting_cpos);
1215 yy_current_state = (yy_last_accepting_state);
1216 goto yy_find_action;
1217 }
1218 }
1219
1220 else switch ( yy_get_next_buffer( ) )
1221 {
1222 case EOB_ACT_END_OF_FILE:
1223 {
1224 (yy_did_buffer_switch_on_eof) = 0;
1225
1226 if ( guidoarwrap( ) )
1227 {
1228 /* Note: because we've taken care in
1229 * yy_get_next_buffer() to have set up
1230 * guidoartext, we can now set up
1231 * yy_c_buf_p so that if some total
1232 * hoser (like flex itself) wants to
1233 * call the scanner after we return the
1234 * YY_NULL, it'll still work - another
1235 * YY_NULL will get returned.
1236 */
1237 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1238
1239 yy_act = YY_STATE_EOF(YY_START);
1240 goto do_action;
1241 }
1242
1243 else
1244 {
1245 if ( ! (yy_did_buffer_switch_on_eof) )
1246 YY_NEW_FILE;
1247 }
1248 break;
1249 }
1250
1251 case EOB_ACT_CONTINUE_SCAN:
1252 (yy_c_buf_p) =
1253 (yytext_ptr) + yy_amount_of_matched_text;
1254
1255 yy_current_state = yy_get_previous_state( );
1256
1257 yy_cp = (yy_c_buf_p);
1258 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1259 goto yy_match;
1260
1261 case EOB_ACT_LAST_MATCH:
1262 (yy_c_buf_p) =
1263 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1264
1265 yy_current_state = yy_get_previous_state( );
1266
1267 yy_cp = (yy_c_buf_p);
1268 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1269 goto yy_find_action;
1270 }
1271 break;
1272 }
1273
1274 default:
1275 YY_FATAL_ERROR(
1276 "fatal flex scanner internal error--no action found" );
1277 } /* end of action switch */
1278 } /* end of scanning one token */
1279 } /* end of guidoarlex */
1280
1281 /* yy_get_next_buffer - try to read in a new buffer
1282 *
1283 * Returns a code representing an action:
1284 * EOB_ACT_LAST_MATCH -
1285 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1286 * EOB_ACT_END_OF_FILE - end of file
1287 */
1288 static int yy_get_next_buffer (void)
1289 {
1290 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1291 register char *source = (yytext_ptr);
1292 register int number_to_move, i;
1293 int ret_val;
1294
1295 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1296 YY_FATAL_ERROR(
1297 "fatal flex scanner internal error--end of buffer missed" );
1298
1299 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1300 { /* Don't try to fill the buffer, so this is an EOF. */
1301 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1302 {
1303 /* We matched a single character, the EOB, so
1304 * treat this as a final EOF.
1305 */
1306 return EOB_ACT_END_OF_FILE;
1307 }
1308
1309 else
1310 {
1311 /* We matched some text prior to the EOB, first
1312 * process it.
1313 */
1314 return EOB_ACT_LAST_MATCH;
1315 }
1316 }
1317
1318 /* Try to read more data. */
1319
1320 /* First move last chars to start of buffer. */
1321 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1322
1323 for ( i = 0; i < number_to_move; ++i )
1324 *(dest++) = *(source++);
1325
1326 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1327 /* don't do the read, it's not guaranteed to return an EOF,
1328 * just force an EOF
1329 */
1330 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1331
1332 else
1333 {
1334 yy_size_t num_to_read =
1335 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1336
1337 while ( num_to_read <= 0 )
1338 { /* Not enough room in the buffer - grow it. */
1339
1340 /* just a shorter name for the current buffer */
1341 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1342
1343 int yy_c_buf_p_offset =
1344 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1345
1346 if ( b->yy_is_our_buffer )
1347 {
1348 yy_size_t new_size = b->yy_buf_size * 2;
1349
1350 if ( new_size <= 0 )
1351 b->yy_buf_size += b->yy_buf_size / 8;
1352 else
1353 b->yy_buf_size *= 2;
1354
1355 b->yy_ch_buf = (char *)
1356 /* Include room in for 2 EOB chars. */
1357 guidoarrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1358 }
1359 else
1360 /* Can't grow it, we don't own it. */
1361 b->yy_ch_buf = 0;
1362
1363 if ( ! b->yy_ch_buf )
1364 YY_FATAL_ERROR(
1365 "fatal error - scanner input buffer overflow" );
1366
1367 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1368
1369 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1370 number_to_move - 1;
1371
1372 }
1373
1374 if ( num_to_read > YY_READ_BUF_SIZE )
1375 num_to_read = YY_READ_BUF_SIZE;
1376
1377 /* Read in more data. */
1378 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1379 (yy_n_chars), num_to_read );
1380
1381 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1382 }
1383
1384 if ( (yy_n_chars) == 0 )
1385 {
1386 if ( number_to_move == YY_MORE_ADJ )
1387 {
1388 ret_val = EOB_ACT_END_OF_FILE;
1389 guidoarrestart(guidoarin );
1390 }
1391
1392 else
1393 {
1394 ret_val = EOB_ACT_LAST_MATCH;
1395 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1396 YY_BUFFER_EOF_PENDING;
1397 }
1398 }
1399
1400 else
1401 ret_val = EOB_ACT_CONTINUE_SCAN;
1402
1403 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1404 /* Extend the array by 50%, plus the number we really need. */
1405 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1406 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) guidoarrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1407 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1408 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1409 }
1410
1411 (yy_n_chars) += number_to_move;
1412 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1413 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1414
1415 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1416
1417 return ret_val;
1418 }
1419
1420 /* yy_get_previous_state - get the state just before the EOB char was reached */
1421
yy_get_previous_state(void)1422 static yy_state_type yy_get_previous_state (void)
1423 {
1424 register yy_state_type yy_current_state;
1425 register char *yy_cp;
1426
1427 yy_current_state = (yy_start);
1428
1429 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1430 {
1431 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1432 if ( yy_accept[yy_current_state] )
1433 {
1434 (yy_last_accepting_state) = yy_current_state;
1435 (yy_last_accepting_cpos) = yy_cp;
1436 }
1437 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1438 {
1439 yy_current_state = (int) yy_def[yy_current_state];
1440 if ( yy_current_state >= 132 )
1441 yy_c = yy_meta[(unsigned int) yy_c];
1442 }
1443 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1444 }
1445
1446 return yy_current_state;
1447 }
1448
1449 /* yy_try_NUL_trans - try to make a transition on the NUL character
1450 *
1451 * synopsis
1452 * next_state = yy_try_NUL_trans( current_state );
1453 */
yy_try_NUL_trans(yy_state_type yy_current_state)1454 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1455 {
1456 register int yy_is_jam;
1457 register char *yy_cp = (yy_c_buf_p);
1458
1459 register YY_CHAR yy_c = 1;
1460 if ( yy_accept[yy_current_state] )
1461 {
1462 (yy_last_accepting_state) = yy_current_state;
1463 (yy_last_accepting_cpos) = yy_cp;
1464 }
1465 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1466 {
1467 yy_current_state = (int) yy_def[yy_current_state];
1468 if ( yy_current_state >= 132 )
1469 yy_c = yy_meta[(unsigned int) yy_c];
1470 }
1471 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1472 yy_is_jam = (yy_current_state == 131);
1473
1474 return yy_is_jam ? 0 : yy_current_state;
1475 }
1476
yyunput(int c,register char * yy_bp)1477 static void yyunput (int c, register char * yy_bp )
1478 {
1479 register char *yy_cp;
1480
1481 yy_cp = (yy_c_buf_p);
1482
1483 /* undo effects of setting up guidoartext */
1484 *yy_cp = (yy_hold_char);
1485
1486 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1487 { /* need to shift things up to make room */
1488 /* +2 for EOB chars. */
1489 register yy_size_t number_to_move = (yy_n_chars) + 2;
1490 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1491 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1492 register char *source =
1493 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1494
1495 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1496 *--dest = *--source;
1497
1498 yy_cp += (int) (dest - source);
1499 yy_bp += (int) (dest - source);
1500 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1501 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1502
1503 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1504 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1505 }
1506
1507 *--yy_cp = (char) c;
1508
1509 if ( c == '\n' ){
1510 --guidoarlineno;
1511 }
1512
1513 (yytext_ptr) = yy_bp;
1514 (yy_hold_char) = *yy_cp;
1515 (yy_c_buf_p) = yy_cp;
1516 }
1517
1518 #ifndef YY_NO_INPUT
1519 #ifdef __cplusplus
yyinput(void)1520 static int yyinput (void)
1521 #else
1522 static int input (void)
1523 #endif
1524
1525 {
1526 int c;
1527
1528 *(yy_c_buf_p) = (yy_hold_char);
1529
1530 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1531 {
1532 /* yy_c_buf_p now points to the character we want to return.
1533 * If this occurs *before* the EOB characters, then it's a
1534 * valid NUL; if not, then we've hit the end of the buffer.
1535 */
1536 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1537 /* This was really a NUL. */
1538 *(yy_c_buf_p) = '\0';
1539
1540 else
1541 { /* need more input */
1542 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1543 ++(yy_c_buf_p);
1544
1545 switch ( yy_get_next_buffer( ) )
1546 {
1547 case EOB_ACT_LAST_MATCH:
1548 /* This happens because yy_g_n_b()
1549 * sees that we've accumulated a
1550 * token and flags that we need to
1551 * try matching the token before
1552 * proceeding. But for input(),
1553 * there's no matching to consider.
1554 * So convert the EOB_ACT_LAST_MATCH
1555 * to EOB_ACT_END_OF_FILE.
1556 */
1557
1558 /* Reset buffer status. */
1559 guidoarrestart(guidoarin );
1560
1561 /*FALLTHROUGH*/
1562
1563 case EOB_ACT_END_OF_FILE:
1564 {
1565 if ( guidoarwrap( ) )
1566 return 0;
1567
1568 if ( ! (yy_did_buffer_switch_on_eof) )
1569 YY_NEW_FILE;
1570 #ifdef __cplusplus
1571 return yyinput();
1572 #else
1573 return input();
1574 #endif
1575 }
1576
1577 case EOB_ACT_CONTINUE_SCAN:
1578 (yy_c_buf_p) = (yytext_ptr) + offset;
1579 break;
1580 }
1581 }
1582 }
1583
1584 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1585 *(yy_c_buf_p) = '\0'; /* preserve guidoartext */
1586 (yy_hold_char) = *++(yy_c_buf_p);
1587
1588 if ( c == '\n' )
1589
1590 guidoarlineno++;
1591 ;
1592
1593 return c;
1594 }
1595 #endif /* ifndef YY_NO_INPUT */
1596
1597 /** Immediately switch to a different input stream.
1598 * @param input_file A readable stream.
1599 *
1600 * @note This function does not reset the start condition to @c INITIAL .
1601 */
guidoarrestart(FILE * input_file)1602 void guidoarrestart (FILE * input_file )
1603 {
1604
1605 if ( ! YY_CURRENT_BUFFER ){
1606 guidoarensure_buffer_stack ();
1607 YY_CURRENT_BUFFER_LVALUE =
1608 guidoar_create_buffer(guidoarin,YY_BUF_SIZE );
1609 }
1610
1611 guidoar_init_buffer(YY_CURRENT_BUFFER,input_file );
1612 guidoar_load_buffer_state( );
1613 }
1614
1615 /** Switch to a different input buffer.
1616 * @param new_buffer The new input buffer.
1617 *
1618 */
guidoar_switch_to_buffer(YY_BUFFER_STATE new_buffer)1619 void guidoar_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1620 {
1621
1622 /* TODO. We should be able to replace this entire function body
1623 * with
1624 * guidoarpop_buffer_state();
1625 * guidoarpush_buffer_state(new_buffer);
1626 */
1627 guidoarensure_buffer_stack ();
1628 if ( YY_CURRENT_BUFFER == new_buffer )
1629 return;
1630
1631 if ( YY_CURRENT_BUFFER )
1632 {
1633 /* Flush out information for old buffer. */
1634 *(yy_c_buf_p) = (yy_hold_char);
1635 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1636 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1637 }
1638
1639 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1640 guidoar_load_buffer_state( );
1641
1642 /* We don't actually know whether we did this switch during
1643 * EOF (guidoarwrap()) processing, but the only time this flag
1644 * is looked at is after guidoarwrap() is called, so it's safe
1645 * to go ahead and always set it.
1646 */
1647 (yy_did_buffer_switch_on_eof) = 1;
1648 }
1649
guidoar_load_buffer_state(void)1650 static void guidoar_load_buffer_state (void)
1651 {
1652 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1653 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1654 guidoarin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1655 (yy_hold_char) = *(yy_c_buf_p);
1656 }
1657
1658 /** Allocate and initialize an input buffer state.
1659 * @param file A readable stream.
1660 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1661 *
1662 * @return the allocated buffer state.
1663 */
guidoar_create_buffer(FILE * file,int size)1664 YY_BUFFER_STATE guidoar_create_buffer (FILE * file, int size )
1665 {
1666 YY_BUFFER_STATE b;
1667
1668 b = (YY_BUFFER_STATE) guidoaralloc(sizeof( struct yy_buffer_state ) );
1669 if ( ! b )
1670 YY_FATAL_ERROR( "out of dynamic memory in guidoar_create_buffer()" );
1671
1672 b->yy_buf_size = size;
1673
1674 /* yy_ch_buf has to be 2 characters longer than the size given because
1675 * we need to put in 2 end-of-buffer characters.
1676 */
1677 b->yy_ch_buf = (char *) guidoaralloc(b->yy_buf_size + 2 );
1678 if ( ! b->yy_ch_buf )
1679 YY_FATAL_ERROR( "out of dynamic memory in guidoar_create_buffer()" );
1680
1681 b->yy_is_our_buffer = 1;
1682
1683 guidoar_init_buffer(b,file );
1684
1685 return b;
1686 }
1687
1688 /** Destroy the buffer.
1689 * @param b a buffer created with guidoar_create_buffer()
1690 *
1691 */
guidoar_delete_buffer(YY_BUFFER_STATE b)1692 void guidoar_delete_buffer (YY_BUFFER_STATE b )
1693 {
1694
1695 if ( ! b )
1696 return;
1697
1698 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1699 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1700
1701 if ( b->yy_is_our_buffer )
1702 guidoarfree((void *) b->yy_ch_buf );
1703
1704 guidoarfree((void *) b );
1705 }
1706
1707 /* Initializes or reinitializes a buffer.
1708 * This function is sometimes called more than once on the same buffer,
1709 * such as during a guidoarrestart() or at EOF.
1710 */
guidoar_init_buffer(YY_BUFFER_STATE b,FILE * file)1711 static void guidoar_init_buffer (YY_BUFFER_STATE b, FILE * file )
1712
1713 {
1714 int oerrno = errno;
1715
1716 guidoar_flush_buffer(b );
1717
1718 b->yy_input_file = file;
1719 b->yy_fill_buffer = 1;
1720
1721 /* If b is the current buffer, then guidoar_init_buffer was _probably_
1722 * called from guidoarrestart() or through yy_get_next_buffer.
1723 * In that case, we don't want to reset the lineno or column.
1724 */
1725 if (b != YY_CURRENT_BUFFER){
1726 b->yy_bs_lineno = 1;
1727 b->yy_bs_column = 0;
1728 }
1729
1730 b->yy_is_interactive = 0;
1731
1732 errno = oerrno;
1733 }
1734
1735 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1736 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1737 *
1738 */
guidoar_flush_buffer(YY_BUFFER_STATE b)1739 void guidoar_flush_buffer (YY_BUFFER_STATE b )
1740 {
1741 if ( ! b )
1742 return;
1743
1744 b->yy_n_chars = 0;
1745
1746 /* We always need two end-of-buffer characters. The first causes
1747 * a transition to the end-of-buffer state. The second causes
1748 * a jam in that state.
1749 */
1750 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1751 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1752
1753 b->yy_buf_pos = &b->yy_ch_buf[0];
1754
1755 b->yy_at_bol = 1;
1756 b->yy_buffer_status = YY_BUFFER_NEW;
1757
1758 if ( b == YY_CURRENT_BUFFER )
1759 guidoar_load_buffer_state( );
1760 }
1761
1762 /** Pushes the new state onto the stack. The new state becomes
1763 * the current state. This function will allocate the stack
1764 * if necessary.
1765 * @param new_buffer The new state.
1766 *
1767 */
guidoarpush_buffer_state(YY_BUFFER_STATE new_buffer)1768 void guidoarpush_buffer_state (YY_BUFFER_STATE new_buffer )
1769 {
1770 if (new_buffer == NULL)
1771 return;
1772
1773 guidoarensure_buffer_stack();
1774
1775 /* This block is copied from guidoar_switch_to_buffer. */
1776 if ( YY_CURRENT_BUFFER )
1777 {
1778 /* Flush out information for old buffer. */
1779 *(yy_c_buf_p) = (yy_hold_char);
1780 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1781 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1782 }
1783
1784 /* Only push if top exists. Otherwise, replace top. */
1785 if (YY_CURRENT_BUFFER)
1786 (yy_buffer_stack_top)++;
1787 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1788
1789 /* copied from guidoar_switch_to_buffer. */
1790 guidoar_load_buffer_state( );
1791 (yy_did_buffer_switch_on_eof) = 1;
1792 }
1793
1794 /** Removes and deletes the top of the stack, if present.
1795 * The next element becomes the new top.
1796 *
1797 */
guidoarpop_buffer_state(void)1798 void guidoarpop_buffer_state (void)
1799 {
1800 if (!YY_CURRENT_BUFFER)
1801 return;
1802
1803 guidoar_delete_buffer(YY_CURRENT_BUFFER );
1804 YY_CURRENT_BUFFER_LVALUE = NULL;
1805 if ((yy_buffer_stack_top) > 0)
1806 --(yy_buffer_stack_top);
1807
1808 if (YY_CURRENT_BUFFER) {
1809 guidoar_load_buffer_state( );
1810 (yy_did_buffer_switch_on_eof) = 1;
1811 }
1812 }
1813
1814 /* Allocates the stack if it does not exist.
1815 * Guarantees space for at least one push.
1816 */
guidoarensure_buffer_stack(void)1817 static void guidoarensure_buffer_stack (void)
1818 {
1819 yy_size_t num_to_alloc;
1820
1821 if (!(yy_buffer_stack)) {
1822
1823 /* First allocation is just for 2 elements, since we don't know if this
1824 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1825 * immediate realloc on the next call.
1826 */
1827 num_to_alloc = 1;
1828 (yy_buffer_stack) = (struct yy_buffer_state**)guidoaralloc
1829 (num_to_alloc * sizeof(struct yy_buffer_state*)
1830 );
1831 if ( ! (yy_buffer_stack) )
1832 YY_FATAL_ERROR( "out of dynamic memory in guidoarensure_buffer_stack()" );
1833
1834 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1835
1836 (yy_buffer_stack_max) = num_to_alloc;
1837 (yy_buffer_stack_top) = 0;
1838 return;
1839 }
1840
1841 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1842
1843 /* Increase the buffer to prepare for a possible push. */
1844 int grow_size = 8 /* arbitrary grow size */;
1845
1846 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1847 (yy_buffer_stack) = (struct yy_buffer_state**)guidoarrealloc
1848 ((yy_buffer_stack),
1849 num_to_alloc * sizeof(struct yy_buffer_state*)
1850 );
1851 if ( ! (yy_buffer_stack) )
1852 YY_FATAL_ERROR( "out of dynamic memory in guidoarensure_buffer_stack()" );
1853
1854 /* zero only the new slots.*/
1855 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1856 (yy_buffer_stack_max) = num_to_alloc;
1857 }
1858 }
1859
1860 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1861 * @param base the character buffer
1862 * @param size the size in bytes of the character buffer
1863 *
1864 * @return the newly allocated buffer state object.
1865 */
guidoar_scan_buffer(char * base,yy_size_t size)1866 YY_BUFFER_STATE guidoar_scan_buffer (char * base, yy_size_t size )
1867 {
1868 YY_BUFFER_STATE b;
1869
1870 if ( size < 2 ||
1871 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1872 base[size-1] != YY_END_OF_BUFFER_CHAR )
1873 /* They forgot to leave room for the EOB's. */
1874 return 0;
1875
1876 b = (YY_BUFFER_STATE) guidoaralloc(sizeof( struct yy_buffer_state ) );
1877 if ( ! b )
1878 YY_FATAL_ERROR( "out of dynamic memory in guidoar_scan_buffer()" );
1879
1880 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1881 b->yy_buf_pos = b->yy_ch_buf = base;
1882 b->yy_is_our_buffer = 0;
1883 b->yy_input_file = 0;
1884 b->yy_n_chars = b->yy_buf_size;
1885 b->yy_is_interactive = 0;
1886 b->yy_at_bol = 1;
1887 b->yy_fill_buffer = 0;
1888 b->yy_buffer_status = YY_BUFFER_NEW;
1889
1890 guidoar_switch_to_buffer(b );
1891
1892 return b;
1893 }
1894
1895 /** Setup the input buffer state to scan a string. The next call to guidoarlex() will
1896 * scan from a @e copy of @a str.
1897 * @param yystr a NUL-terminated string to scan
1898 *
1899 * @return the newly allocated buffer state object.
1900 * @note If you want to scan bytes that may contain NUL values, then use
1901 * guidoar_scan_bytes() instead.
1902 */
guidoar_scan_string(yyconst char * yystr)1903 YY_BUFFER_STATE guidoar_scan_string (yyconst char * yystr )
1904 {
1905
1906 return guidoar_scan_bytes(yystr,strlen(yystr) );
1907 }
1908
1909 /** Setup the input buffer state to scan the given bytes. The next call to guidoarlex() will
1910 * scan from a @e copy of @a bytes.
1911 * @param bytes the byte buffer to scan
1912 * @param len the number of bytes in the buffer pointed to by @a bytes.
1913 *
1914 * @return the newly allocated buffer state object.
1915 */
guidoar_scan_bytes(yyconst char * yybytes,yy_size_t _yybytes_len)1916 YY_BUFFER_STATE guidoar_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1917 {
1918 YY_BUFFER_STATE b;
1919 char *buf;
1920 yy_size_t n, i;
1921
1922 /* Get memory for full buffer, including space for trailing EOB's. */
1923 n = _yybytes_len + 2;
1924 buf = (char *) guidoaralloc(n );
1925 if ( ! buf )
1926 YY_FATAL_ERROR( "out of dynamic memory in guidoar_scan_bytes()" );
1927
1928 for ( i = 0; i < _yybytes_len; ++i )
1929 buf[i] = yybytes[i];
1930
1931 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1932
1933 b = guidoar_scan_buffer(buf,n );
1934 if ( ! b )
1935 YY_FATAL_ERROR( "bad buffer in guidoar_scan_bytes()" );
1936
1937 /* It's okay to grow etc. this buffer, and we should throw it
1938 * away when we're done.
1939 */
1940 b->yy_is_our_buffer = 1;
1941
1942 return b;
1943 }
1944
1945 #ifndef YY_EXIT_FAILURE
1946 #define YY_EXIT_FAILURE 2
1947 #endif
1948
yy_fatal_error(yyconst char * msg)1949 static void yy_fatal_error (yyconst char* msg )
1950 {
1951 (void) fprintf( stderr, "%s\n", msg );
1952 exit( YY_EXIT_FAILURE );
1953 }
1954
1955 /* Redefine yyless() so it works in section 3 code. */
1956
1957 #undef yyless
1958 #define yyless(n) \
1959 do \
1960 { \
1961 /* Undo effects of setting up guidoartext. */ \
1962 int yyless_macro_arg = (n); \
1963 YY_LESS_LINENO(yyless_macro_arg);\
1964 guidoartext[guidoarleng] = (yy_hold_char); \
1965 (yy_c_buf_p) = guidoartext + yyless_macro_arg; \
1966 (yy_hold_char) = *(yy_c_buf_p); \
1967 *(yy_c_buf_p) = '\0'; \
1968 guidoarleng = yyless_macro_arg; \
1969 } \
1970 while ( 0 )
1971
1972 /* Accessor methods (get/set functions) to struct members. */
1973
1974 /** Get the current line number.
1975 *
1976 */
guidoarget_lineno(void)1977 int guidoarget_lineno (void)
1978 {
1979
1980 return guidoarlineno;
1981 }
1982
1983 /** Get the input stream.
1984 *
1985 */
guidoarget_in(void)1986 FILE *guidoarget_in (void)
1987 {
1988 return guidoarin;
1989 }
1990
1991 /** Get the output stream.
1992 *
1993 */
guidoarget_out(void)1994 FILE *guidoarget_out (void)
1995 {
1996 return guidoarout;
1997 }
1998
1999 /** Get the length of the current token.
2000 *
2001 */
guidoarget_leng(void)2002 yy_size_t guidoarget_leng (void)
2003 {
2004 return guidoarleng;
2005 }
2006
2007 /** Get the current token.
2008 *
2009 */
2010
guidoarget_text(void)2011 char *guidoarget_text (void)
2012 {
2013 return guidoartext;
2014 }
2015
2016 /** Set the current line number.
2017 * @param line_number
2018 *
2019 */
guidoarset_lineno(int line_number)2020 void guidoarset_lineno (int line_number )
2021 {
2022
2023 guidoarlineno = line_number;
2024 }
2025
2026 /** Set the input stream. This does not discard the current
2027 * input buffer.
2028 * @param in_str A readable stream.
2029 *
2030 * @see guidoar_switch_to_buffer
2031 */
guidoarset_in(FILE * in_str)2032 void guidoarset_in (FILE * in_str )
2033 {
2034 guidoarin = in_str ;
2035 }
2036
guidoarset_out(FILE * out_str)2037 void guidoarset_out (FILE * out_str )
2038 {
2039 guidoarout = out_str ;
2040 }
2041
guidoarget_debug(void)2042 int guidoarget_debug (void)
2043 {
2044 return guidoar_flex_debug;
2045 }
2046
guidoarset_debug(int bdebug)2047 void guidoarset_debug (int bdebug )
2048 {
2049 guidoar_flex_debug = bdebug ;
2050 }
2051
yy_init_globals(void)2052 static int yy_init_globals (void)
2053 {
2054 /* Initialization is the same as for the non-reentrant scanner.
2055 * This function is called from guidoarlex_destroy(), so don't allocate here.
2056 */
2057
2058 /* We do not touch guidoarlineno unless the option is enabled. */
2059 guidoarlineno = 1;
2060
2061 (yy_buffer_stack) = 0;
2062 (yy_buffer_stack_top) = 0;
2063 (yy_buffer_stack_max) = 0;
2064 (yy_c_buf_p) = (char *) 0;
2065 (yy_init) = 0;
2066 (yy_start) = 0;
2067
2068 /* Defined in main.c */
2069 #ifdef YY_STDINIT
2070 guidoarin = stdin;
2071 guidoarout = stdout;
2072 #else
2073 guidoarin = (FILE *) 0;
2074 guidoarout = (FILE *) 0;
2075 #endif
2076
2077 /* For future reference: Set errno on error, since we are called by
2078 * guidoarlex_init()
2079 */
2080 return 0;
2081 }
2082
2083 /* guidoarlex_destroy is for both reentrant and non-reentrant scanners. */
guidoarlex_destroy(void)2084 int guidoarlex_destroy (void)
2085 {
2086
2087 /* Pop the buffer stack, destroying each element. */
2088 while(YY_CURRENT_BUFFER){
2089 guidoar_delete_buffer(YY_CURRENT_BUFFER );
2090 YY_CURRENT_BUFFER_LVALUE = NULL;
2091 guidoarpop_buffer_state();
2092 }
2093
2094 /* Destroy the stack itself. */
2095 guidoarfree((yy_buffer_stack) );
2096 (yy_buffer_stack) = NULL;
2097
2098 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2099 * guidoarlex() is called, initialization will occur. */
2100 yy_init_globals( );
2101
2102 return 0;
2103 }
2104
2105 /*
2106 * Internal utility routines.
2107 */
2108
2109 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,yyconst char * s2,int n)2110 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2111 {
2112 register int i;
2113 for ( i = 0; i < n; ++i )
2114 s1[i] = s2[i];
2115 }
2116 #endif
2117
2118 #ifdef YY_NEED_STRLEN
yy_flex_strlen(yyconst char * s)2119 static int yy_flex_strlen (yyconst char * s )
2120 {
2121 register int n;
2122 for ( n = 0; s[n]; ++n )
2123 ;
2124
2125 return n;
2126 }
2127 #endif
2128
guidoaralloc(yy_size_t size)2129 void *guidoaralloc (yy_size_t size )
2130 {
2131 return (void *) malloc( size );
2132 }
2133
guidoarrealloc(void * ptr,yy_size_t size)2134 void *guidoarrealloc (void * ptr, yy_size_t size )
2135 {
2136 /* The cast to (char *) in the following accommodates both
2137 * implementations that use char* generic pointers, and those
2138 * that use void* generic pointers. It works with the latter
2139 * because both ANSI C and C++ allow castless assignment from
2140 * any pointer type to void*, and deal with argument conversions
2141 * as though doing an assignment.
2142 */
2143 return (void *) realloc( (char *) ptr, size );
2144 }
2145
guidoarfree(void * ptr)2146 void guidoarfree (void * ptr )
2147 {
2148 free( (char *) ptr ); /* see guidoarrealloc() for (char *) cast */
2149 }
2150
2151 #define YYTABLES_NAME "yytables"
2152
2153 #line 117 "guido.l"
2154