Debian Codegraph @

texk/gregorio/gregorio-src/src/vowel/vowel-rules-l.c

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