Debian Codegraph @

texk/gregorio/gregorio-src/src/gabc/gabc-score-determination-l.c

raw
1 #line 1 "gabc/gabc-score-determination-l.c"
2
3 #line 3 "gabc/gabc-score-determination-l.c"
4
5 #define YY_INT_ALIGNED long int
6
7 /* A lexical scanner generated by flex */
8
9 #define yy_create_buffer gabc_score_determination__create_buffer
10 #define yy_delete_buffer gabc_score_determination__delete_buffer
11 #define yy_scan_buffer gabc_score_determination__scan_buffer
12 #define yy_scan_string gabc_score_determination__scan_string
13 #define yy_scan_bytes gabc_score_determination__scan_bytes
14 #define yy_init_buffer gabc_score_determination__init_buffer
15 #define yy_flush_buffer gabc_score_determination__flush_buffer
16 #define yy_load_buffer_state gabc_score_determination__load_buffer_state
17 #define yy_switch_to_buffer gabc_score_determination__switch_to_buffer
18 #define yypush_buffer_state gabc_score_determination_push_buffer_state
19 #define yypop_buffer_state gabc_score_determination_pop_buffer_state
20 #define yyensure_buffer_stack gabc_score_determination_ensure_buffer_stack
21 #define yy_flex_debug gabc_score_determination__flex_debug
22 #define yyin gabc_score_determination_in
23 #define yyleng gabc_score_determination_leng
24 #define yylex gabc_score_determination_lex
25 #define yylineno gabc_score_determination_lineno
26 #define yyout gabc_score_determination_out
27 #define yyrestart gabc_score_determination_restart
28 #define yytext gabc_score_determination_text
29 #define yywrap gabc_score_determination_wrap
30 #define yyalloc gabc_score_determination_alloc
31 #define yyrealloc gabc_score_determination_realloc
32 #define yyfree gabc_score_determination_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 gabc_score_determination__create_buffer_ALREADY_DEFINED
44 #else
45 #define yy_create_buffer gabc_score_determination__create_buffer
46 #endif
47
48 #ifdef yy_delete_buffer
49 #define gabc_score_determination__delete_buffer_ALREADY_DEFINED
50 #else
51 #define yy_delete_buffer gabc_score_determination__delete_buffer
52 #endif
53
54 #ifdef yy_scan_buffer
55 #define gabc_score_determination__scan_buffer_ALREADY_DEFINED
56 #else
57 #define yy_scan_buffer gabc_score_determination__scan_buffer
58 #endif
59
60 #ifdef yy_scan_string
61 #define gabc_score_determination__scan_string_ALREADY_DEFINED
62 #else
63 #define yy_scan_string gabc_score_determination__scan_string
64 #endif
65
66 #ifdef yy_scan_bytes
67 #define gabc_score_determination__scan_bytes_ALREADY_DEFINED
68 #else
69 #define yy_scan_bytes gabc_score_determination__scan_bytes
70 #endif
71
72 #ifdef yy_init_buffer
73 #define gabc_score_determination__init_buffer_ALREADY_DEFINED
74 #else
75 #define yy_init_buffer gabc_score_determination__init_buffer
76 #endif
77
78 #ifdef yy_flush_buffer
79 #define gabc_score_determination__flush_buffer_ALREADY_DEFINED
80 #else
81 #define yy_flush_buffer gabc_score_determination__flush_buffer
82 #endif
83
84 #ifdef yy_load_buffer_state
85 #define gabc_score_determination__load_buffer_state_ALREADY_DEFINED
86 #else
87 #define yy_load_buffer_state gabc_score_determination__load_buffer_state
88 #endif
89
90 #ifdef yy_switch_to_buffer
91 #define gabc_score_determination__switch_to_buffer_ALREADY_DEFINED
92 #else
93 #define yy_switch_to_buffer gabc_score_determination__switch_to_buffer
94 #endif
95
96 #ifdef yypush_buffer_state
97 #define gabc_score_determination_push_buffer_state_ALREADY_DEFINED
98 #else
99 #define yypush_buffer_state gabc_score_determination_push_buffer_state
100 #endif
101
102 #ifdef yypop_buffer_state
103 #define gabc_score_determination_pop_buffer_state_ALREADY_DEFINED
104 #else
105 #define yypop_buffer_state gabc_score_determination_pop_buffer_state
106 #endif
107
108 #ifdef yyensure_buffer_stack
109 #define gabc_score_determination_ensure_buffer_stack_ALREADY_DEFINED
110 #else
111 #define yyensure_buffer_stack gabc_score_determination_ensure_buffer_stack
112 #endif
113
114 #ifdef yylex
115 #define gabc_score_determination_lex_ALREADY_DEFINED
116 #else
117 #define yylex gabc_score_determination_lex
118 #endif
119
120 #ifdef yyrestart
121 #define gabc_score_determination_restart_ALREADY_DEFINED
122 #else
123 #define yyrestart gabc_score_determination_restart
124 #endif
125
126 #ifdef yylex_init
127 #define gabc_score_determination_lex_init_ALREADY_DEFINED
128 #else
129 #define yylex_init gabc_score_determination_lex_init
130 #endif
131
132 #ifdef yylex_init_extra
133 #define gabc_score_determination_lex_init_extra_ALREADY_DEFINED
134 #else
135 #define yylex_init_extra gabc_score_determination_lex_init_extra
136 #endif
137
138 #ifdef yylex_destroy
139 #define gabc_score_determination_lex_destroy_ALREADY_DEFINED
140 #else
141 #define yylex_destroy gabc_score_determination_lex_destroy
142 #endif
143
144 #ifdef yyget_debug
145 #define gabc_score_determination_get_debug_ALREADY_DEFINED
146 #else
147 #define yyget_debug gabc_score_determination_get_debug
148 #endif
149
150 #ifdef yyset_debug
151 #define gabc_score_determination_set_debug_ALREADY_DEFINED
152 #else
153 #define yyset_debug gabc_score_determination_set_debug
154 #endif
155
156 #ifdef yyget_extra
157 #define gabc_score_determination_get_extra_ALREADY_DEFINED
158 #else
159 #define yyget_extra gabc_score_determination_get_extra
160 #endif
161
162 #ifdef yyset_extra
163 #define gabc_score_determination_set_extra_ALREADY_DEFINED
164 #else
165 #define yyset_extra gabc_score_determination_set_extra
166 #endif
167
168 #ifdef yyget_in
169 #define gabc_score_determination_get_in_ALREADY_DEFINED
170 #else
171 #define yyget_in gabc_score_determination_get_in
172 #endif
173
174 #ifdef yyset_in
175 #define gabc_score_determination_set_in_ALREADY_DEFINED
176 #else
177 #define yyset_in gabc_score_determination_set_in
178 #endif
179
180 #ifdef yyget_out
181 #define gabc_score_determination_get_out_ALREADY_DEFINED
182 #else
183 #define yyget_out gabc_score_determination_get_out
184 #endif
185
186 #ifdef yyset_out
187 #define gabc_score_determination_set_out_ALREADY_DEFINED
188 #else
189 #define yyset_out gabc_score_determination_set_out
190 #endif
191
192 #ifdef yyget_leng
193 #define gabc_score_determination_get_leng_ALREADY_DEFINED
194 #else
195 #define yyget_leng gabc_score_determination_get_leng
196 #endif
197
198 #ifdef yyget_text
199 #define gabc_score_determination_get_text_ALREADY_DEFINED
200 #else
201 #define yyget_text gabc_score_determination_get_text
202 #endif
203
204 #ifdef yyget_lineno
205 #define gabc_score_determination_get_lineno_ALREADY_DEFINED
206 #else
207 #define yyget_lineno gabc_score_determination_get_lineno
208 #endif
209
210 #ifdef yyset_lineno
211 #define gabc_score_determination_set_lineno_ALREADY_DEFINED
212 #else
213 #define yyset_lineno gabc_score_determination_set_lineno
214 #endif
215
216 #ifdef yywrap
217 #define gabc_score_determination_wrap_ALREADY_DEFINED
218 #else
219 #define yywrap gabc_score_determination_wrap
220 #endif
221
222 #ifdef yyalloc
223 #define gabc_score_determination_alloc_ALREADY_DEFINED
224 #else
225 #define yyalloc gabc_score_determination_alloc
226 #endif
227
228 #ifdef yyrealloc
229 #define gabc_score_determination_realloc_ALREADY_DEFINED
230 #else
231 #define yyrealloc gabc_score_determination_realloc
232 #endif
233
234 #ifdef yyfree
235 #define gabc_score_determination_free_ALREADY_DEFINED
236 #else
237 #define yyfree gabc_score_determination_free
238 #endif
239
240 #ifdef yytext
241 #define gabc_score_determination_text_ALREADY_DEFINED
242 #else
243 #define yytext gabc_score_determination_text
244 #endif
245
246 #ifdef yyleng
247 #define gabc_score_determination_leng_ALREADY_DEFINED
248 #else
249 #define yyleng gabc_score_determination_leng
250 #endif
251
252 #ifdef yyin
253 #define gabc_score_determination_in_ALREADY_DEFINED
254 #else
255 #define yyin gabc_score_determination_in
256 #endif
257
258 #ifdef yyout
259 #define gabc_score_determination_out_ALREADY_DEFINED
260 #else
261 #define yyout gabc_score_determination_out
262 #endif
263
264 #ifdef yy_flex_debug
265 #define gabc_score_determination__flex_debug_ALREADY_DEFINED
266 #else
267 #define yy_flex_debug gabc_score_determination__flex_debug
268 #endif
269
270 #ifdef yylineno
271 #define gabc_score_determination_lineno_ALREADY_DEFINED
272 #else
273 #define yylineno gabc_score_determination_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 gabc_score_determination_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 77
618 #define YY_END_OF_BUFFER 78
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[325] =
627 { 0,
628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
629 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
630 0, 0, 78, 25, 76, 25, 23, 6, 23, 23,
631 23, 23, 23, 23, 23, 23, 2, 2, 3, 3,
632 1, 8, 9, 27, 26, 27, 50, 71, 29, 28,
633 56, 64, 65, 57, 58, 72, 72, 74, 73, 49,
634 48, 49, 77, 77, 55, 55, 56, 52, 51, 5,
635 4, 56, 77, 69, 77, 77, 70, 0, 0, 23,
636 6, 23, 23, 23, 23, 23, 23, 23, 23, 23,
637 23, 2, 1, 8, 0, 7, 0, 27, 27, 26,
638
639 27, 27, 0, 0, 0, 0, 0, 0, 0, 0,
640 0, 0, 0, 0, 0, 0, 72, 72, 72, 72,
641 75, 49, 49, 48, 49, 49, 0, 55, 55, 55,
642 55, 0, 52, 51, 5, 4, 0, 69, 69, 69,
643 0, 0, 70, 0, 24, 23, 23, 23, 23, 23,
644 23, 23, 23, 23, 23, 23, 23, 0, 0, 0,
645 0, 0, 0, 0, 0, 0, 0, 40, 38, 0,
646 44, 0, 32, 0, 0, 0, 0, 0, 0, 53,
647 63, 0, 0, 0, 23, 23, 0, 23, 23, 14,
648 23, 11, 23, 23, 23, 41, 39, 45, 0, 33,
649
650 0, 0, 0, 0, 0, 0, 61, 0, 0, 0,
651 68, 67, 42, 46, 34, 36, 0, 54, 0, 23,
652 23, 23, 0, 23, 0, 0, 23, 23, 23, 62,
653 0, 43, 35, 37, 59, 0, 0, 0, 68, 47,
654 0, 23, 18, 10, 23, 23, 23, 23, 23, 23,
655 0, 0, 0, 0, 30, 60, 23, 23, 23, 23,
656 23, 23, 23, 23, 23, 31, 0, 0, 66, 23,
657 23, 19, 23, 23, 23, 0, 23, 23, 0, 23,
658 23, 23, 23, 23, 23, 23, 23, 17, 23, 23,
659 23, 21, 23, 23, 23, 23, 23, 23, 23, 23,
660
661 20, 23, 23, 23, 23, 23, 23, 23, 15, 23,
662 23, 13, 23, 23, 23, 23, 23, 12, 16, 23,
663 23, 23, 22, 0
664 } ;
665
666 static const YY_CHAR yy_ec[256] =
667 { 0,
668 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
669 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
670 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
671 1, 5, 1, 1, 6, 7, 8, 1, 1, 9,
672 10, 1, 1, 11, 12, 13, 14, 15, 15, 15,
673 15, 15, 15, 15, 15, 15, 15, 16, 17, 18,
674 1, 19, 1, 1, 20, 20, 20, 20, 20, 20,
675 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
676 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
677 21, 1, 22, 1, 20, 1, 23, 24, 25, 26,
678
679 27, 28, 29, 30, 31, 20, 20, 32, 33, 34,
680 35, 36, 20, 37, 38, 39, 40, 41, 20, 20,
681 42, 20, 43, 44, 45, 1, 1, 1, 1, 1,
682 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
683 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
684 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
685 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
686 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
687 1, 1, 1, 1, 1, 1, 46, 1, 1, 1,
688 47, 1, 1, 1, 1, 1, 1, 1, 1, 1,
689
690 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
691 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
692 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
693 1, 1, 1, 1, 1, 1, 1, 1, 48, 1,
694 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
695 1, 1, 1, 1, 1
696 } ;
697
698 static const YY_CHAR yy_meta[49] =
699 { 0,
700 1, 1, 2, 3, 1, 1, 1, 4, 4, 5,
701 4, 6, 4, 1, 7, 4, 8, 9, 1, 7,
702 4, 4, 7, 7, 7, 7, 7, 7, 7, 7,
703 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
704 7, 7, 10, 5, 10, 1, 1, 1
705 } ;
706
707 static const flex_int32_t yy_base[346] =
708 { 0,
709 0, 46, 842, 841, 92, 135, 46, 53, 73, 80,
710 44, 48, 54, 61, 64, 66, 54, 64, 60, 66,
711 117, 156, 857, 860, 860, 848, 843, 849, 77, 47,
712 103, 117, 95, 122, 90, 116, 82, 129, 860, 845,
713 116, 0, 164, 845, 169, 178, 860, 860, 860, 860,
714 222, 837, 860, 860, 860, 843, 194, 203, 860, 842,
715 207, 212, 834, 860, 840, 147, 832, 0, 173, 0,
716 180, 831, 829, 200, 229, 262, 860, 214, 0, 831,
717 860, 180, 181, 216, 100, 217, 176, 247, 167, 238,
718 229, 236, 222, 0, 272, 280, 284, 835, 286, 307,
719
720 834, 0, 311, 324, 808, 820, 259, 260, 819, 805,
721 799, 281, 796, 802, 814, 810, 824, 315, 823, 316,
722 330, 822, 323, 335, 821, 338, 789, 819, 343, 818,
723 362, 783, 0, 317, 0, 340, 800, 807, 806, 222,
724 368, 372, 860, 390, 349, 808, 289, 76, 807, 280,
725 355, 373, 374, 376, 316, 367, 377, 786, 798, 797,
726 338, 796, 782, 788, 773, 779, 771, 860, 860, 782,
727 860, 789, 860, 783, 408, 787, 786, 785, 784, 860,
728 860, 766, 782, 768, 378, 384, 766, 786, 385, 785,
729 784, 776, 389, 394, 390, 860, 860, 860, 768, 860,
730
731 754, 758, 745, 728, 721, 716, 860, 699, 426, 430,
732 434, 860, 860, 860, 860, 860, 690, 860, 667, 403,
733 386, 429, 679, 431, 420, 671, 408, 690, 686, 860,
734 581, 860, 860, 860, 860, 566, 583, 453, 457, 860,
735 579, 435, 585, 583, 438, 439, 440, 451, 452, 453,
736 568, 560, 571, 473, 860, 860, 454, 260, 455, 467,
737 458, 468, 575, 469, 457, 860, 494, 507, 860, 481,
738 477, 574, 478, 489, 488, 550, 482, 491, 519, 493,
739 495, 502, 505, 516, 518, 519, 522, 532, 525, 523,
740 527, 404, 528, 529, 524, 534, 530, 538, 540, 533,
741
742 396, 539, 536, 531, 541, 559, 535, 560, 395, 561,
743 564, 242, 565, 566, 567, 568, 569, 230, 191, 570,
744 572, 571, 137, 860, 608, 618, 628, 638, 648, 658,
745 668, 678, 683, 690, 700, 707, 717, 727, 737, 745,
746 755, 765, 775, 785, 71
747 } ;
748
749 static const flex_int32_t yy_def[346] =
750 { 0,
751 324, 1, 325, 325, 326, 326, 327, 327, 328, 328,
752 329, 329, 330, 330, 331, 331, 329, 329, 332, 332,
753 332, 332, 324, 324, 324, 324, 333, 324, 333, 333,
754 333, 333, 333, 333, 333, 333, 324, 324, 324, 324,
755 324, 334, 324, 335, 324, 336, 324, 324, 324, 324,
756 324, 324, 324, 324, 324, 337, 338, 324, 324, 339,
757 324, 340, 324, 324, 341, 342, 324, 343, 324, 344,
758 324, 324, 324, 324, 324, 324, 324, 324, 345, 333,
759 324, 333, 333, 333, 333, 333, 333, 333, 333, 333,
760 333, 324, 324, 334, 324, 324, 324, 335, 336, 324,
761
762 335, 99, 324, 324, 324, 324, 324, 324, 324, 324,
763 324, 324, 324, 324, 324, 324, 337, 338, 337, 338,
764 324, 339, 340, 324, 339, 340, 324, 341, 342, 341,
765 342, 324, 343, 324, 344, 324, 324, 324, 324, 324,
766 324, 324, 324, 324, 324, 345, 333, 333, 333, 333,
767 333, 333, 333, 333, 333, 333, 333, 324, 324, 324,
768 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
769 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
770 324, 324, 324, 324, 333, 333, 345, 333, 333, 333,
771 333, 333, 333, 333, 333, 324, 324, 324, 324, 324,
772
773 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
774 324, 324, 324, 324, 324, 324, 324, 324, 324, 333,
775 333, 345, 345, 333, 345, 345, 333, 333, 333, 324,
776 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
777 324, 333, 333, 345, 345, 333, 345, 345, 345, 333,
778 345, 345, 324, 324, 324, 324, 333, 345, 333, 345,
779 345, 345, 333, 345, 345, 324, 324, 324, 324, 333,
780 345, 333, 345, 345, 345, 345, 345, 345, 324, 333,
781 345, 345, 345, 345, 345, 345, 345, 333, 345, 345,
782 345, 345, 345, 345, 345, 345, 345, 345, 345, 345,
783
784 345, 345, 345, 345, 345, 345, 345, 345, 345, 345,
785 345, 345, 345, 345, 345, 345, 345, 345, 345, 345,
786 345, 345, 345, 0, 324, 324, 324, 324, 324, 324,
787 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
788 324, 324, 324, 324, 324
789 } ;
790
791 static const flex_int32_t yy_nxt[909] =
792 { 0,
793 24, 24, 25, 24, 24, 24, 24, 26, 24, 24,
794 24, 24, 24, 24, 27, 28, 24, 24, 24, 27,
795 24, 24, 29, 27, 27, 30, 27, 27, 31, 27,
796 27, 32, 33, 34, 35, 27, 27, 36, 27, 27,
797 27, 27, 24, 24, 24, 24, 24, 24, 37, 38,
798 66, 39, 57, 40, 66, 58, 69, 69, 79, 57,
799 66, 67, 58, 69, 69, 67, 71, 71, 71, 71,
800 66, 72, 73, 84, 74, 61, 61, 146, 73, 62,
801 74, 72, 61, 61, 92, 92, 62, 79, 79, 59,
802 63, 41, 41, 41, 45, 45, 59, 63, 46, 47,
803
804 48, 79, 49, 50, 49, 186, 79, 49, 49, 51,
805 82, 79, 52, 53, 79, 64, 83, 64, 75, 75,
806 75, 75, 64, 150, 64, 85, 89, 79, 79, 87,
807 76, 92, 92, 79, 54, 77, 55, 45, 45, 86,
808 90, 46, 47, 48, 88, 49, 50, 49, 79, 128,
809 49, 49, 51, 131, 91, 52, 53, 75, 75, 75,
810 75, 93, 93, 93, 128, 95, 96, 96, 95, 76,
811 100, 100, 100, 100, 77, 134, 134, 54, 79, 55,
812 97, 98, 136, 136, 102, 98, 98, 79, 98, 98,
813 98, 79, 79, 98, 98, 98, 117, 155, 98, 98,
814
815 120, 152, 79, 117, 121, 121, 121, 121, 124, 124,
816 124, 124, 139, 147, 140, 122, 145, 145, 126, 148,
817 98, 78, 98, 103, 103, 103, 103, 79, 79, 122,
818 141, 141, 141, 141, 139, 104, 140, 117, 92, 92,
819 79, 79, 142, 149, 105, 106, 107, 143, 108, 79,
820 151, 157, 109, 79, 122, 110, 122, 111, 79, 112,
821 113, 114, 115, 144, 144, 144, 144, 93, 93, 93,
822 153, 79, 156, 95, 96, 96, 95, 169, 171, 154,
823 143, 95, 96, 96, 95, 95, 96, 96, 95, 98,
824 170, 79, 102, 98, 98, 271, 98, 98, 98, 172,
825
826 79, 98, 98, 98, 188, 176, 98, 98, 100, 100,
827 100, 100, 103, 103, 103, 103, 177, 117, 117, 134,
828 134, 120, 120, 185, 117, 117, 122, 79, 98, 126,
829 98, 121, 121, 121, 121, 158, 124, 124, 124, 124,
830 122, 122, 136, 136, 126, 128, 111, 159, 160, 131,
831 161, 145, 145, 193, 162, 122, 198, 163, 117, 117,
832 128, 164, 165, 166, 128, 122, 79, 122, 131, 141,
833 141, 141, 141, 144, 144, 144, 144, 199, 79, 128,
834 122, 142, 122, 189, 79, 79, 143, 79, 79, 79,
835 143, 144, 144, 144, 144, 79, 79, 79, 191, 190,
836
837 79, 79, 192, 194, 195, 79, 79, 79, 143, 209,
838 209, 209, 209, 227, 79, 79, 220, 229, 221, 79,
839 228, 210, 243, 211, 224, 242, 212, 209, 209, 209,
840 209, 238, 238, 238, 238, 239, 239, 239, 239, 210,
841 79, 211, 79, 244, 212, 247, 79, 250, 212, 79,
842 79, 79, 248, 246, 238, 238, 238, 238, 239, 239,
843 239, 239, 79, 79, 79, 79, 79, 259, 79, 79,
844 260, 212, 258, 257, 267, 267, 267, 267, 79, 79,
845 79, 272, 262, 274, 270, 261, 268, 278, 79, 79,
846 263, 269, 79, 79, 273, 267, 267, 267, 267, 79,
847
848 79, 275, 79, 277, 79, 282, 79, 268, 279, 279,
849 279, 279, 269, 79, 284, 280, 79, 286, 281, 283,
850 279, 279, 279, 279, 287, 269, 288, 79, 290, 79,
851 79, 289, 291, 79, 79, 79, 79, 269, 79, 79,
852 79, 79, 79, 79, 79, 79, 79, 79, 295, 79,
853 79, 79, 79, 292, 293, 296, 303, 298, 299, 297,
854 294, 301, 302, 306, 304, 300, 305, 309, 307, 308,
855 79, 79, 79, 312, 310, 79, 79, 79, 79, 79,
856 79, 79, 79, 79, 285, 79, 276, 311, 317, 266,
857 319, 265, 264, 315, 79, 316, 79, 256, 313, 314,
858
859 321, 255, 254, 253, 323, 318, 322, 320, 42, 42,
860 42, 42, 42, 42, 42, 42, 42, 42, 44, 44,
861 44, 44, 44, 44, 44, 44, 44, 44, 56, 56,
862 56, 56, 56, 56, 56, 56, 56, 56, 60, 60,
863 60, 60, 60, 60, 60, 60, 60, 60, 65, 65,
864 65, 65, 65, 65, 65, 65, 65, 65, 68, 68,
865 68, 68, 68, 68, 68, 68, 68, 68, 70, 70,
866 70, 70, 70, 70, 70, 70, 70, 70, 64, 64,
867 64, 64, 64, 64, 64, 64, 64, 64, 80, 80,
868 94, 94, 94, 94, 94, 94, 94, 252, 94, 94,
869
870 98, 251, 249, 245, 98, 241, 98, 101, 240, 101,
871 101, 101, 101, 101, 101, 101, 101, 117, 117, 117,
872 117, 237, 117, 117, 117, 117, 117, 119, 119, 119,
873 119, 119, 119, 119, 119, 119, 119, 122, 236, 235,
874 122, 122, 122, 122, 122, 125, 234, 125, 125, 125,
875 125, 125, 125, 125, 125, 128, 128, 128, 128, 128,
876 128, 128, 128, 233, 128, 130, 130, 130, 130, 130,
877 130, 130, 130, 130, 130, 133, 232, 231, 133, 133,
878 133, 133, 133, 133, 133, 135, 230, 79, 135, 135,
879 135, 135, 135, 135, 135, 226, 225, 223, 222, 219,
880
881 218, 217, 216, 215, 214, 213, 208, 207, 206, 205,
882 204, 203, 202, 201, 200, 197, 196, 170, 187, 79,
883 138, 138, 184, 183, 129, 129, 182, 123, 123, 118,
884 118, 181, 180, 179, 178, 175, 174, 173, 168, 167,
885 99, 99, 79, 138, 137, 132, 129, 127, 123, 118,
886 116, 99, 78, 81, 79, 78, 324, 43, 43, 23,
887 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
888 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
889 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
890 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
891
892 324, 324, 324, 324, 324, 324, 324, 324
893 } ;
894
895 static const flex_int32_t yy_chk[909] =
896 { 0,
897 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
898 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
899 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
900 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
901 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
902 11, 2, 7, 2, 12, 7, 13, 13, 30, 8,
903 17, 11, 8, 14, 14, 12, 15, 15, 16, 16,
904 18, 17, 19, 30, 19, 9, 9, 345, 20, 9,
905 20, 18, 10, 10, 37, 37, 10, 148, 29, 7,
906 9, 2, 2, 2, 5, 5, 8, 10, 5, 5,
907
908 5, 35, 5, 5, 5, 148, 33, 5, 5, 5,
909 29, 85, 5, 5, 31, 9, 29, 9, 21, 21,
910 21, 21, 10, 85, 10, 31, 35, 36, 32, 33,
911 21, 38, 38, 34, 5, 21, 5, 6, 6, 32,
912 36, 6, 6, 6, 34, 6, 6, 6, 323, 66,
913 6, 6, 6, 66, 36, 6, 6, 22, 22, 22,
914 22, 41, 41, 41, 66, 43, 43, 43, 43, 22,
915 45, 45, 45, 45, 22, 69, 69, 6, 89, 6,
916 43, 46, 71, 71, 46, 46, 46, 87, 46, 46,
917 46, 82, 83, 46, 46, 46, 57, 89, 46, 46,
918
919 57, 87, 319, 57, 58, 58, 58, 58, 61, 61,
920 61, 61, 74, 82, 74, 62, 78, 78, 62, 83,
921 46, 78, 46, 51, 51, 51, 51, 84, 86, 62,
922 75, 75, 75, 75, 140, 51, 140, 57, 92, 92,
923 91, 318, 75, 84, 51, 51, 51, 75, 51, 90,
924 86, 91, 51, 312, 62, 51, 62, 51, 88, 51,
925 51, 51, 51, 76, 76, 76, 76, 93, 93, 93,
926 88, 258, 90, 95, 95, 95, 95, 107, 108, 88,
927 76, 96, 96, 96, 96, 97, 97, 97, 97, 99,
928 107, 150, 99, 99, 99, 258, 99, 99, 99, 108,
929
930 147, 99, 99, 99, 150, 112, 99, 99, 100, 100,
931 100, 100, 103, 103, 103, 103, 112, 118, 120, 134,
932 134, 118, 120, 147, 118, 120, 123, 155, 99, 123,
933 99, 121, 121, 121, 121, 103, 124, 124, 124, 124,
934 123, 126, 136, 136, 126, 129, 103, 104, 104, 129,
935 104, 145, 145, 155, 104, 126, 161, 104, 118, 120,
936 129, 104, 104, 104, 131, 123, 151, 123, 131, 141,
937 141, 141, 141, 142, 142, 142, 142, 161, 156, 131,
938 126, 141, 126, 151, 152, 153, 141, 154, 157, 185,
939 142, 144, 144, 144, 144, 186, 189, 221, 153, 152,
940
941 193, 195, 154, 156, 157, 194, 309, 301, 144, 175,
942 175, 175, 175, 193, 220, 292, 185, 195, 186, 227,
943 194, 175, 221, 175, 189, 220, 175, 209, 209, 209,
944 209, 210, 210, 210, 210, 211, 211, 211, 211, 209,
945 222, 209, 224, 222, 209, 225, 242, 227, 210, 245,
946 246, 247, 225, 224, 238, 238, 238, 238, 239, 239,
947 239, 239, 248, 249, 250, 257, 259, 246, 265, 261,
948 247, 238, 245, 242, 254, 254, 254, 254, 260, 262,
949 264, 259, 249, 261, 257, 248, 254, 265, 271, 273,
950 250, 254, 270, 277, 260, 267, 267, 267, 267, 275,
951
952 274, 262, 278, 264, 280, 273, 281, 267, 268, 268,
953 268, 268, 267, 282, 275, 270, 283, 277, 271, 274,
954 279, 279, 279, 279, 278, 268, 280, 284, 282, 285,
955 286, 281, 283, 287, 290, 295, 289, 279, 291, 293,
956 294, 297, 304, 288, 300, 296, 307, 303, 287, 298,
957 302, 299, 305, 284, 285, 289, 297, 291, 293, 290,
958 286, 295, 296, 300, 298, 294, 299, 304, 302, 303,
959 306, 308, 310, 307, 305, 311, 313, 314, 315, 316,
960 317, 320, 322, 321, 276, 272, 263, 306, 314, 253,
961 316, 252, 251, 311, 244, 313, 243, 241, 308, 310,
962
963 320, 237, 236, 231, 322, 315, 321, 317, 325, 325,
964 325, 325, 325, 325, 325, 325, 325, 325, 326, 326,
965 326, 326, 326, 326, 326, 326, 326, 326, 327, 327,
966 327, 327, 327, 327, 327, 327, 327, 327, 328, 328,
967 328, 328, 328, 328, 328, 328, 328, 328, 329, 329,
968 329, 329, 329, 329, 329, 329, 329, 329, 330, 330,
969 330, 330, 330, 330, 330, 330, 330, 330, 331, 331,
970 331, 331, 331, 331, 331, 331, 331, 331, 332, 332,
971 332, 332, 332, 332, 332, 332, 332, 332, 333, 333,
972 334, 334, 334, 334, 334, 334, 334, 229, 334, 334,
973
974 335, 228, 226, 223, 335, 219, 335, 336, 217, 336,
975 336, 336, 336, 336, 336, 336, 336, 337, 337, 337,
976 337, 208, 337, 337, 337, 337, 337, 338, 338, 338,
977 338, 338, 338, 338, 338, 338, 338, 339, 206, 205,
978 339, 339, 339, 339, 339, 340, 204, 340, 340, 340,
979 340, 340, 340, 340, 340, 341, 341, 341, 341, 341,
980 341, 341, 341, 203, 341, 342, 342, 342, 342, 342,
981 342, 342, 342, 342, 342, 343, 202, 201, 343, 343,
982 343, 343, 343, 343, 343, 344, 199, 192, 344, 344,
983 344, 344, 344, 344, 344, 191, 190, 188, 187, 184,
984
985 183, 182, 179, 178, 177, 176, 174, 172, 170, 167,
986 166, 165, 164, 163, 162, 160, 159, 158, 149, 146,
987 139, 138, 137, 132, 130, 128, 127, 125, 122, 119,
988 117, 116, 115, 114, 113, 111, 110, 109, 106, 105,
989 101, 98, 80, 73, 72, 67, 65, 63, 60, 56,
990 52, 44, 40, 28, 27, 26, 23, 4, 3, 324,
991 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
992 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
993 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
994 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
995
996 324, 324, 324, 324, 324, 324, 324, 324
997 } ;
998
999 static yy_state_type yy_last_accepting_state;
1000 static char *yy_last_accepting_cpos;
1001
1002 extern int yy_flex_debug;
1003 int yy_flex_debug = 0;
1004
1005 /* The intent behind this definition is that it'll catch
1006 * any uses of REJECT which flex missed.
1007 */
1008 #define REJECT reject_used_but_not_detected
1009 #define yymore() yymore_used_but_not_detected
1010 #define YY_MORE_ADJ 0
1011 #define YY_RESTORE_YY_MORE_OFFSET
1012 char *yytext;
1013 #line 1 "gabc/gabc-score-determination.l"
1014 #line 2 "gabc/gabc-score-determination.l"
1015 /*
1016 * Gregorio is a program that translates gabc files to GregorioTeX
1017 * This file implements the score lexer.
1018 *
1019 * Gregorio score determination in gabc input.
1020 * Copyright (C) 2006-2025 The Gregorio Project (see CONTRIBUTORS.md)
1021 *
1022 * This file is part of Gregorio.
1023 *
1024 * This program is free software: you can redistribute it and/or modify it
1025 * under the terms of the GNU General Public License as published by the Free
1026 * Software Foundation, either version 3 of the License, or (at your option)
1027 * any later version.
1028 *
1029 * This program is distributed in the hope that it will be useful, but WITHOUT
1030 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1031 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
1032 * more details.
1033 *
1034 * You should have received a copy of the GNU General Public License along with
1035 * this program. If not, see <http://www.gnu.org/licenses/>.
1036 */
1037
1038 #include "config.h"
1039 #include <stdio.h>
1040 #include <stdlib.h>
1041 #include <string.h>
1042 #include "struct.h"
1043 #include "messages.h"
1044 #include "bool.h"
1045 #include "support.h"
1046
1047 #include "gabc.h"
1048 #include "gabc-score-determination.h"
1049 #include "gabc-score-determination-y.h"
1050
1051 static bool eof_found = false;
1052
1053 #define START_STYLE(STYLE) return STYLE ## _BEGIN
1054
1055 #define END_STYLE(STYLE) return STYLE ## _END
1056
1057 #define RETURN_CHARACTERS \
1058 gabc_score_determination_lval.text = \
1059 gabc_unescape(gabc_score_determination_text); \
1060 return CHARACTERS
1061
1062 #define RETURN_SPACE \
1063 gabc_score_determination_lval.text = gregorio_strdup(" "); \
1064 return CHARACTERS
1065
1066 #define YY_NO_INPUT
1067
1068 #define YY_INPUT(buf,result,max_size) \
1069 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) { \
1070 int c = '*'; \
1071 int n; \
1072 for (n = 0; n < max_size \
1073 && (c = getc(gabc_score_determination_in)) != EOF \
1074 && c != '\n'; ++n ) { \
1075 buf[n] = (char) c; \
1076 } \
1077 if (c == '\n') { \
1078 buf[n++] = (char) c; \
1079 } \
1080 if (c == EOF && ferror(gabc_score_determination_in)) { \
1081 YY_FATAL_ERROR("input in flex scanner failed"); \
1082 } \
1083 result = n; \
1084 } else { \
1085 errno=0; \
1086 while ((result = fread(buf, 1, max_size, gabc_score_determination_in)) \
1087 == 0 && ferror(gabc_score_determination_in)) { \
1088 if (errno != EINTR) { \
1089 YY_FATAL_ERROR("input in flex scanner failed"); \
1090 break; \
1091 } \
1092 errno = 0; \
1093 clearerr(gabc_score_determination_in); \
1094 } \
1095 } \
1096 gabc_digest(buf, result)
1097
1098 #define YY_USER_ACTION gabc_update_location(&gabc_score_determination_lloc, \
1099 gabc_score_determination_text, gabc_score_determination_leng);
1100
1101 #line 1101 "gabc/gabc-score-determination-l.c"
1102
1103 /* The expression for attribute below is rather messy because we allow
1104 for (a) single-line values, ending with a semicolon at end of line or a
1105 double semicolon, (b) multi-line values, which end at a double
1106 semicolon. */
1107 #line 1107 "gabc/gabc-score-determination-l.c"
1108
1109 #define INITIAL 0
1110 #define attribute 1
1111 #define score 2
1112 #define notes 3
1113 #define sp 4
1114 #define verb 5
1115 #define comments 6
1116 #define inicomments 7
1117 #define alt 8
1118 #define protrusion_value 9
1119 #define protrusion_end 10
1120
1121 #ifndef YY_NO_UNISTD_H
1122 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1123 * down here because we want the user's section 1 to have been scanned first.
1124 * The user has a chance to override it with an option.
1125 */
1126 #include <unistd.h>
1127 #endif
1128
1129 #ifndef YY_EXTRA_TYPE
1130 #define YY_EXTRA_TYPE void *
1131 #endif
1132
1133 static int yy_init_globals ( void );
1134
1135 /* Accessor methods to globals.
1136 These are made visible to non-reentrant scanners for convenience. */
1137
1138 int yylex_destroy ( void );
1139
1140 int yyget_debug ( void );
1141
1142 void yyset_debug ( int debug_flag );
1143
1144 YY_EXTRA_TYPE yyget_extra ( void );
1145
1146 void yyset_extra ( YY_EXTRA_TYPE user_defined );
1147
1148 FILE *yyget_in ( void );
1149
1150 void yyset_in ( FILE * _in_str );
1151
1152 FILE *yyget_out ( void );
1153
1154 void yyset_out ( FILE * _out_str );
1155
1156 int yyget_leng ( void );
1157
1158 char *yyget_text ( void );
1159
1160 int yyget_lineno ( void );
1161
1162 void yyset_lineno ( int _line_number );
1163
1164 /* Macros after this point can all be overridden by user definitions in
1165 * section 1.
1166 */
1167
1168 #ifndef YY_SKIP_YYWRAP
1169 #ifdef __cplusplus
1170 extern "C" int yywrap ( void );
1171 #else
1172 extern int yywrap ( void );
1173 #endif
1174 #endif
1175
1176 #ifndef YY_NO_UNPUT
1177
1178 #endif
1179
1180 #ifndef yytext_ptr
1181 static void yy_flex_strncpy ( char *, const char *, int );
1182 #endif
1183
1184 #ifdef YY_NEED_STRLEN
1185 static int yy_flex_strlen ( const char * );
1186 #endif
1187
1188 #ifndef YY_NO_INPUT
1189 #ifdef __cplusplus
1190 static int yyinput ( void );
1191 #else
1192 static int input ( void );
1193 #endif
1194
1195 #endif
1196
1197 static int yy_start_stack_ptr = 0;
1198 static int yy_start_stack_depth = 0;
1199 static int *yy_start_stack = NULL;
1200
1201 /* Amount of stuff to slurp up with each read. */
1202 #ifndef YY_READ_BUF_SIZE
1203 #ifdef __ia64__
1204 /* On IA-64, the buffer size is 16k, not 8k */
1205 #define YY_READ_BUF_SIZE 16384
1206 #else
1207 #define YY_READ_BUF_SIZE 8192
1208 #endif /* __ia64__ */
1209 #endif
1210
1211 /* Copy whatever the last rule matched to the standard output. */
1212 #ifndef ECHO
1213 /* This used to be an fputs(), but since the string might contain NUL's,
1214 * we now use fwrite().
1215 */
1216 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1217 #endif
1218
1219 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1220 * is returned in "result".
1221 */
1222 #ifndef YY_INPUT
1223 #define YY_INPUT(buf,result,max_size) \
1224 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1225 { \
1226 int c = '*'; \
1227 int n; \
1228 for ( n = 0; n < max_size && \
1229 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1230 buf[n] = (char) c; \
1231 if ( c == '\n' ) \
1232 buf[n++] = (char) c; \
1233 if ( c == EOF && ferror( yyin ) ) \
1234 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1235 result = n; \
1236 } \
1237 else \
1238 { \
1239 errno=0; \
1240 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1241 { \
1242 if( errno != EINTR) \
1243 { \
1244 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1245 break; \
1246 } \
1247 errno=0; \
1248 clearerr(yyin); \
1249 } \
1250 }\
1251 \
1252
1253 #endif
1254
1255 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1256 * we don't want an extra ';' after the "return" because that will cause
1257 * some compilers to complain about unreachable statements.
1258 */
1259 #ifndef yyterminate
1260 #define yyterminate() return YY_NULL
1261 #endif
1262
1263 /* Number of entries by which start-condition stack grows. */
1264 #ifndef YY_START_STACK_INCR
1265 #define YY_START_STACK_INCR 25
1266 #endif
1267
1268 /* Report a fatal error. */
1269 #ifndef YY_FATAL_ERROR
1270 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1271 #endif
1272
1273 /* end tables serialization structures and prototypes */
1274
1275 /* Default declaration of generated scanner - a define so the user can
1276 * easily add parameters.
1277 */
1278 #ifndef YY_DECL
1279 #define YY_DECL_IS_OURS 1
1280
1281 extern int yylex (void);
1282
1283 #define YY_DECL int yylex (void)
1284 #endif /* !YY_DECL */
1285
1286 /* Code executed at the beginning of each rule, after yytext and yyleng
1287 * have been set up.
1288 */
1289 #ifndef YY_USER_ACTION
1290 #define YY_USER_ACTION
1291 #endif
1292
1293 /* Code executed at the end of each rule. */
1294 #ifndef YY_BREAK
1295 #define YY_BREAK /*LINTED*/break;
1296 #endif
1297
1298 #define YY_RULE_SETUP \
1299 if ( yyleng > 0 ) \
1300 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1301 (yytext[yyleng - 1] == '\n'); \
1302 YY_USER_ACTION
1303
1304 /** The main scanner function which does all the work.
1305 */
1306 YY_DECL
1307 {
1308 yy_state_type yy_current_state;
1309 char *yy_cp, *yy_bp;
1310 int yy_act;
1311
1312 if ( !(yy_init) )
1313 {
1314 (yy_init) = 1;
1315
1316 #ifdef YY_USER_INIT
1317 YY_USER_INIT;
1318 #endif
1319
1320 if ( ! (yy_start) )
1321 (yy_start) = 1; /* first start state */
1322
1323 if ( ! yyin )
1324 yyin = stdin;
1325
1326 if ( ! yyout )
1327 yyout = stdout;
1328
1329 if ( ! YY_CURRENT_BUFFER ) {
1330 yyensure_buffer_stack ();
1331 YY_CURRENT_BUFFER_LVALUE =
1332 yy_create_buffer( yyin, YY_BUF_SIZE );
1333 }
1334
1335 yy_load_buffer_state( );
1336 }
1337
1338 {
1339 #line 122 "gabc/gabc-score-determination.l"
1340
1341 #line 1341 "gabc/gabc-score-determination-l.c"
1342
1343 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1344 {
1345 yy_cp = (yy_c_buf_p);
1346
1347 /* Support of yytext. */
1348 *yy_cp = (yy_hold_char);
1349
1350 /* yy_bp points to the position in yy_ch_buf of the start of
1351 * the current run.
1352 */
1353 yy_bp = yy_cp;
1354
1355 yy_current_state = (yy_start);
1356 yy_current_state += YY_AT_BOL();
1357 yy_match:
1358 do
1359 {
1360 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1361 if ( yy_accept[yy_current_state] )
1362 {
1363 (yy_last_accepting_state) = yy_current_state;
1364 (yy_last_accepting_cpos) = yy_cp;
1365 }
1366 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1367 {
1368 yy_current_state = (int) yy_def[yy_current_state];
1369 if ( yy_current_state >= 325 )
1370 yy_c = yy_meta[yy_c];
1371 }
1372 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1373 ++yy_cp;
1374 }
1375 while ( yy_base[yy_current_state] != 860 );
1376
1377 yy_find_action:
1378 yy_act = yy_accept[yy_current_state];
1379 if ( yy_act == 0 )
1380 { /* have to back up */
1381 yy_cp = (yy_last_accepting_cpos);
1382 yy_current_state = (yy_last_accepting_state);
1383 yy_act = yy_accept[yy_current_state];
1384 }
1385
1386 YY_DO_BEFORE_ACTION;
1387
1388 do_action: /* This label is used only to access EOF actions. */
1389
1390 switch ( yy_act )
1391 { /* beginning of action switch */
1392 case 0: /* must back up */
1393 /* undo the effects of YY_DO_BEFORE_ACTION */
1394 *yy_cp = (yy_hold_char);
1395 yy_cp = (yy_last_accepting_cpos);
1396 yy_current_state = (yy_last_accepting_state);
1397 goto yy_find_action;
1398
1399 case 1:
1400 YY_RULE_SETUP
1401 #line 123 "gabc/gabc-score-determination.l"
1402 {
1403 /* BOM written by a lot of windows softwares when they write UTF-8 */
1404 }
1405 YY_BREAK
1406 case 2:
1407 /* rule 2 can match eol */
1408 YY_RULE_SETUP
1409 #line 126 "gabc/gabc-score-determination.l"
1410 {
1411 /* ignoring empty lines */
1412 }
1413 YY_BREAK
1414 case 3:
1415 YY_RULE_SETUP
1416 #line 129 "gabc/gabc-score-determination.l"
1417 {
1418 BEGIN(inicomments);
1419 }
1420 YY_BREAK
1421 case 4:
1422 /* rule 4 can match eol */
1423 YY_RULE_SETUP
1424 #line 132 "gabc/gabc-score-determination.l"
1425 {
1426 BEGIN(INITIAL);
1427 }
1428 YY_BREAK
1429 case 5:
1430 YY_RULE_SETUP
1431 #line 135 "gabc/gabc-score-determination.l"
1432 {
1433 /* ignored */
1434 }
1435 YY_BREAK
1436 case 6:
1437 YY_RULE_SETUP
1438 #line 138 "gabc/gabc-score-determination.l"
1439 {
1440 BEGIN(attribute);
1441 return COLON;
1442 }
1443 YY_BREAK
1444 case 7:
1445 /* rule 7 can match eol */
1446 YY_RULE_SETUP
1447 #line 142 "gabc/gabc-score-determination.l"
1448 {
1449 BEGIN(INITIAL);
1450 return SEMICOLON;
1451 }
1452 YY_BREAK
1453 case 8:
1454 /* rule 8 can match eol */
1455 YY_RULE_SETUP
1456 #line 146 "gabc/gabc-score-determination.l"
1457 {
1458 gabc_score_determination_lval.text =
1459 gregorio_strdup(gabc_score_determination_text);
1460 return ATTRIBUTE;
1461 }
1462 YY_BREAK
1463 case 9:
1464 YY_RULE_SETUP
1465 #line 151 "gabc/gabc-score-determination.l"
1466 {
1467 gabc_score_determination_lval.text =
1468 gregorio_strdup(gabc_score_determination_text);
1469 return ATTRIBUTE;
1470 }
1471 YY_BREAK
1472 case 10:
1473 YY_RULE_SETUP
1474 #line 156 "gabc/gabc-score-determination.l"
1475 {
1476 gabc_score_determination_lval.character = gabc_score_determination_text[5];
1477 return DEF_MACRO;
1478 }
1479 YY_BREAK
1480 case 11:
1481 YY_RULE_SETUP
1482 #line 160 "gabc/gabc-score-determination.l"
1483 {
1484 gabc_score_determination_lval.text =
1485 gregorio_strdup(gabc_score_determination_text);
1486 return NAME;
1487 }
1488 YY_BREAK
1489 case 12:
1490 YY_RULE_SETUP
1491 #line 165 "gabc/gabc-score-determination.l"
1492 {
1493 gabc_score_determination_lval.text =
1494 gregorio_strdup(gabc_score_determination_text);
1495 return SCORE_COPYRIGHT;
1496 }
1497 YY_BREAK
1498 case 13:
1499 YY_RULE_SETUP
1500 #line 170 "gabc/gabc-score-determination.l"
1501 {
1502 gabc_score_determination_lval.text =
1503 gregorio_strdup(gabc_score_determination_text);
1504 return GABC_COPYRIGHT;
1505 }
1506 YY_BREAK
1507 case 14:
1508 YY_RULE_SETUP
1509 #line 175 "gabc/gabc-score-determination.l"
1510 {
1511 gabc_score_determination_lval.text =
1512 gregorio_strdup(gabc_score_determination_text);
1513 return MODE;
1514 }
1515 YY_BREAK
1516 case 15:
1517 YY_RULE_SETUP
1518 #line 180 "gabc/gabc-score-determination.l"
1519 {
1520 gabc_score_determination_lval.text =
1521 gregorio_strdup(gabc_score_determination_text);
1522 return MODE_MODIFIER;
1523 }
1524 YY_BREAK
1525 case 16:
1526 YY_RULE_SETUP
1527 #line 185 "gabc/gabc-score-determination.l"
1528 {
1529 gabc_score_determination_lval.text =
1530 gregorio_strdup(gabc_score_determination_text);
1531 return MODE_DIFFERENTIA;
1532 }
1533 YY_BREAK
1534 case 17:
1535 YY_RULE_SETUP
1536 #line 190 "gabc/gabc-score-determination.l"
1537 {
1538 gabc_score_determination_lval.text =
1539 gregorio_strdup(gabc_score_determination_text);
1540 return ANNOTATION;
1541 }
1542 YY_BREAK
1543 case 18:
1544 YY_RULE_SETUP
1545 #line 195 "gabc/gabc-score-determination.l"
1546 {
1547 gabc_score_determination_lval.text =
1548 gregorio_strdup(gabc_score_determination_text);
1549 return AUTHOR;
1550 }
1551 YY_BREAK
1552 case 19:
1553 YY_RULE_SETUP
1554 #line 200 "gabc/gabc-score-determination.l"
1555 {
1556 gabc_score_determination_lval.text =
1557 gregorio_strdup(gabc_score_determination_text);
1558 return LANGUAGE;
1559 }
1560 YY_BREAK
1561 case 20:
1562 YY_RULE_SETUP
1563 #line 205 "gabc/gabc-score-determination.l"
1564 {
1565 gabc_score_determination_lval.text =
1566 gregorio_strdup(gabc_score_determination_text);
1567 return STAFF_LINES;
1568 }
1569 YY_BREAK
1570 case 21:
1571 YY_RULE_SETUP
1572 #line 210 "gabc/gabc-score-determination.l"
1573 {
1574 gabc_score_determination_lval.text =
1575 gregorio_strdup(gabc_score_determination_text);
1576 return NABC_LINES;
1577 }
1578 YY_BREAK
1579 case 22:
1580 YY_RULE_SETUP
1581 #line 215 "gabc/gabc-score-determination.l"
1582 {
1583 gabc_score_determination_lval.text =
1584 gregorio_strdup(gabc_score_determination_text);
1585 return ORISCUS_ORIENTATION;
1586 }
1587 YY_BREAK
1588 case 23:
1589 YY_RULE_SETUP
1590 #line 220 "gabc/gabc-score-determination.l"
1591 {
1592 gabc_score_determination_lval.text =
1593 gregorio_strdup(gabc_score_determination_text);
1594 return OTHER_HEADER;
1595 }
1596 YY_BREAK
1597 case 24:
1598 /* rule 24 can match eol */
1599 YY_RULE_SETUP
1600 #line 225 "gabc/gabc-score-determination.l"
1601 {
1602 BEGIN(score);
1603 return END_OF_DEFINITIONS;
1604 }
1605 YY_BREAK
1606 case 25:
1607 YY_RULE_SETUP
1608 #line 229 "gabc/gabc-score-determination.l"
1609 {
1610 gregorio_messagef("det_score", VERBOSITY_ERROR, 0,
1611 _("unrecognized character: \"%c\" in definition part"),
1612 gabc_score_determination_text[0]);
1613 }
1614 YY_BREAK
1615 case 26:
1616 /* rule 26 can match eol */
1617 YY_RULE_SETUP
1618 #line 234 "gabc/gabc-score-determination.l"
1619 {
1620 RETURN_SPACE;
1621 }
1622 YY_BREAK
1623 case 27:
1624 YY_RULE_SETUP
1625 #line 237 "gabc/gabc-score-determination.l"
1626 {
1627 RETURN_CHARACTERS;
1628 }
1629 YY_BREAK
1630 case 28:
1631 YY_RULE_SETUP
1632 #line 240 "gabc/gabc-score-determination.l"
1633 {
1634 return HYPHEN;
1635 }
1636 YY_BREAK
1637 case 29:
1638 YY_RULE_SETUP
1639 #line 243 "gabc/gabc-score-determination.l"
1640 {
1641 gabc_score_determination_lval.text =
1642 gregorio_strdup(gabc_score_determination_text);
1643 return PROTRUDING_PUNCTUATION;
1644 }
1645 YY_BREAK
1646 case 30:
1647 YY_RULE_SETUP
1648 #line 248 "gabc/gabc-score-determination.l"
1649 {
1650 return NLBA_B;
1651 }
1652 YY_BREAK
1653 case 31:
1654 YY_RULE_SETUP
1655 #line 251 "gabc/gabc-score-determination.l"
1656 {
1657 return NLBA_E;
1658 }
1659 YY_BREAK
1660 case 32:
1661 YY_RULE_SETUP
1662 #line 254 "gabc/gabc-score-determination.l"
1663 {
1664 START_STYLE(I);
1665 }
1666 YY_BREAK
1667 case 33:
1668 YY_RULE_SETUP
1669 #line 257 "gabc/gabc-score-determination.l"
1670 {
1671 END_STYLE(I);
1672 }
1673 YY_BREAK
1674 case 34:
1675 YY_RULE_SETUP
1676 #line 260 "gabc/gabc-score-determination.l"
1677 {
1678 START_STYLE(TT);
1679 }
1680 YY_BREAK
1681 case 35:
1682 YY_RULE_SETUP
1683 #line 263 "gabc/gabc-score-determination.l"
1684 {
1685 END_STYLE(TT);
1686 }
1687 YY_BREAK
1688 case 36:
1689 YY_RULE_SETUP
1690 #line 266 "gabc/gabc-score-determination.l"
1691 {
1692 START_STYLE(UL);
1693 }
1694 YY_BREAK
1695 case 37:
1696 YY_RULE_SETUP
1697 #line 269 "gabc/gabc-score-determination.l"
1698 {
1699 END_STYLE(UL);
1700 }
1701 YY_BREAK
1702 case 38:
1703 YY_RULE_SETUP
1704 #line 272 "gabc/gabc-score-determination.l"
1705 {
1706 START_STYLE(C);
1707 }
1708 YY_BREAK
1709 case 39:
1710 YY_RULE_SETUP
1711 #line 275 "gabc/gabc-score-determination.l"
1712 {
1713 END_STYLE(C);
1714 }
1715 YY_BREAK
1716 case 40:
1717 YY_RULE_SETUP
1718 #line 278 "gabc/gabc-score-determination.l"
1719 {
1720 START_STYLE(B);
1721 }
1722 YY_BREAK
1723 case 41:
1724 YY_RULE_SETUP
1725 #line 281 "gabc/gabc-score-determination.l"
1726 {
1727 END_STYLE(B);
1728 }
1729 YY_BREAK
1730 case 42:
1731 YY_RULE_SETUP
1732 #line 284 "gabc/gabc-score-determination.l"
1733 {
1734 START_STYLE(SC);
1735 }
1736 YY_BREAK
1737 case 43:
1738 YY_RULE_SETUP
1739 #line 287 "gabc/gabc-score-determination.l"
1740 {
1741 END_STYLE(SC);
1742 }
1743 YY_BREAK
1744 case 44:
1745 YY_RULE_SETUP
1746 #line 290 "gabc/gabc-score-determination.l"
1747 {
1748 START_STYLE(ELISION);
1749 }
1750 YY_BREAK
1751 case 45:
1752 YY_RULE_SETUP
1753 #line 293 "gabc/gabc-score-determination.l"
1754 {
1755 END_STYLE(ELISION);
1756 }
1757 YY_BREAK
1758 case 46:
1759 YY_RULE_SETUP
1760 #line 296 "gabc/gabc-score-determination.l"
1761 {
1762 BEGIN(sp);
1763 return SP_BEGIN;
1764 }
1765 YY_BREAK
1766 case 47:
1767 YY_RULE_SETUP
1768 #line 300 "gabc/gabc-score-determination.l"
1769 {
1770 BEGIN(score);
1771 return SP_END;
1772 }
1773 YY_BREAK
1774 case 48:
1775 /* rule 48 can match eol */
1776 YY_RULE_SETUP
1777 #line 304 "gabc/gabc-score-determination.l"
1778 {
1779 RETURN_SPACE;
1780 }
1781 YY_BREAK
1782 case 49:
1783 YY_RULE_SETUP
1784 #line 307 "gabc/gabc-score-determination.l"
1785 {
1786 RETURN_CHARACTERS;
1787 }
1788 YY_BREAK
1789 case 50:
1790 YY_RULE_SETUP
1791 #line 310 "gabc/gabc-score-determination.l"
1792 {
1793 BEGIN(comments);
1794 }
1795 YY_BREAK
1796 case 51:
1797 /* rule 51 can match eol */
1798 YY_RULE_SETUP
1799 #line 313 "gabc/gabc-score-determination.l"
1800 {
1801 BEGIN(score);
1802 }
1803 YY_BREAK
1804 case 52:
1805 YY_RULE_SETUP
1806 #line 316 "gabc/gabc-score-determination.l"
1807 {
1808 /* ignored */
1809 }
1810 YY_BREAK
1811 case 53:
1812 YY_RULE_SETUP
1813 #line 319 "gabc/gabc-score-determination.l"
1814 {
1815 BEGIN(verb);
1816 return VERB_BEGIN;
1817 }
1818 YY_BREAK
1819 case 54:
1820 YY_RULE_SETUP
1821 #line 323 "gabc/gabc-score-determination.l"
1822 {
1823 BEGIN(score);
1824 return VERB_END;
1825 }
1826 YY_BREAK
1827 case 55:
1828 /* rule 55 can match eol */
1829 YY_RULE_SETUP
1830 #line 327 "gabc/gabc-score-determination.l"
1831 {
1832 RETURN_CHARACTERS;
1833 }
1834 YY_BREAK
1835 case 56:
1836 YY_RULE_SETUP
1837 #line 330 "gabc/gabc-score-determination.l"
1838 {
1839 RETURN_CHARACTERS;
1840 }
1841 YY_BREAK
1842 case 57:
1843 YY_RULE_SETUP
1844 #line 333 "gabc/gabc-score-determination.l"
1845 {
1846 return CENTER_BEGIN;
1847 }
1848 YY_BREAK
1849 case 58:
1850 YY_RULE_SETUP
1851 #line 336 "gabc/gabc-score-determination.l"
1852 {
1853 return CENTER_END;
1854 }
1855 YY_BREAK
1856 case 59:
1857 YY_RULE_SETUP
1858 #line 339 "gabc/gabc-score-determination.l"
1859 {
1860 BEGIN(alt);
1861 return ALT_BEGIN;
1862 }
1863 YY_BREAK
1864 case 60:
1865 YY_RULE_SETUP
1866 #line 343 "gabc/gabc-score-determination.l"
1867 {
1868 BEGIN(score);
1869 return ALT_END;
1870 }
1871 YY_BREAK
1872 case 61:
1873 YY_RULE_SETUP
1874 #line 347 "gabc/gabc-score-determination.l"
1875 {
1876 return EUOUAE_B;
1877 }
1878 YY_BREAK
1879 case 62:
1880 YY_RULE_SETUP
1881 #line 350 "gabc/gabc-score-determination.l"
1882 {
1883 return EUOUAE_E;
1884 }
1885 YY_BREAK
1886 case 63:
1887 YY_RULE_SETUP
1888 #line 353 "gabc/gabc-score-determination.l"
1889 {
1890 return TRANSLATION_CENTER_END;
1891 }
1892 YY_BREAK
1893 case 64:
1894 YY_RULE_SETUP
1895 #line 356 "gabc/gabc-score-determination.l"
1896 {
1897 return TRANSLATION_BEGIN;
1898 }
1899 YY_BREAK
1900 case 65:
1901 YY_RULE_SETUP
1902 #line 359 "gabc/gabc-score-determination.l"
1903 {
1904 return TRANSLATION_END;
1905 }
1906 YY_BREAK
1907 case 66:
1908 /* rule 66 can match eol */
1909 YY_RULE_SETUP
1910 #line 362 "gabc/gabc-score-determination.l"
1911 {
1912 return CLEAR;
1913 }
1914 YY_BREAK
1915 case 67:
1916 /* rule 67 can match eol */
1917 YY_RULE_SETUP
1918 #line 365 "gabc/gabc-score-determination.l"
1919 {
1920 return PROTRUSION;
1921 }
1922 YY_BREAK
1923 case 68:
1924 /* rule 68 can match eol */
1925 YY_RULE_SETUP
1926 #line 368 "gabc/gabc-score-determination.l"
1927 {
1928 BEGIN(protrusion_value);
1929 return PROTRUSION;
1930 }
1931 YY_BREAK
1932 case 69:
1933 YY_RULE_SETUP
1934 #line 372 "gabc/gabc-score-determination.l"
1935 {
1936 BEGIN(protrusion_end);
1937 gabc_score_determination_lval.text =
1938 gregorio_strdup(gabc_score_determination_text);
1939 return PROTRUSION_VALUE;
1940 }
1941 YY_BREAK
1942 case 70:
1943 /* rule 70 can match eol */
1944 YY_RULE_SETUP
1945 #line 378 "gabc/gabc-score-determination.l"
1946 {
1947 BEGIN(score);
1948 return PROTRUSION_END;
1949 }
1950 YY_BREAK
1951 case 71:
1952 YY_RULE_SETUP
1953 #line 382 "gabc/gabc-score-determination.l"
1954 {
1955 BEGIN(notes);
1956 return OPENING_BRACKET;
1957 }
1958 YY_BREAK
1959 case 72:
1960 /* rule 72 can match eol */
1961 YY_RULE_SETUP
1962 #line 386 "gabc/gabc-score-determination.l"
1963 {
1964 gabc_score_determination_lval.text =
1965 gregorio_strdup(gabc_score_determination_text);
1966 return NOTES;
1967 }
1968 YY_BREAK
1969 case 73:
1970 YY_RULE_SETUP
1971 #line 391 "gabc/gabc-score-determination.l"
1972 {
1973 return NABC_CUT;
1974 }
1975 YY_BREAK
1976 case 74:
1977 YY_RULE_SETUP
1978 #line 394 "gabc/gabc-score-determination.l"
1979 {
1980 BEGIN(score);
1981 return CLOSING_BRACKET;
1982 }
1983 YY_BREAK
1984 case 75:
1985 /* rule 75 can match eol */
1986 YY_RULE_SETUP
1987 #line 398 "gabc/gabc-score-determination.l"
1988 {
1989 BEGIN(score);
1990 return CLOSING_BRACKET_WITH_SPACE;
1991 }
1992 YY_BREAK
1993 case YY_STATE_EOF(INITIAL):
1994 case YY_STATE_EOF(attribute):
1995 case YY_STATE_EOF(score):
1996 case YY_STATE_EOF(notes):
1997 case YY_STATE_EOF(sp):
1998 case YY_STATE_EOF(verb):
1999 case YY_STATE_EOF(comments):
2000 case YY_STATE_EOF(inicomments):
2001 case YY_STATE_EOF(alt):
2002 case YY_STATE_EOF(protrusion_value):
2003 case YY_STATE_EOF(protrusion_end):
2004 #line 402 "gabc/gabc-score-determination.l"
2005 {
2006 if (!eof_found) {
2007 eof_found = true;
2008 return END_OF_FILE;
2009 } else {
2010 yyterminate();
2011 }
2012 }
2013 YY_BREAK
2014 case 76:
2015 /* rule 76 can match eol */
2016 YY_RULE_SETUP
2017 #line 410 "gabc/gabc-score-determination.l"
2018 {
2019 gregorio_messagef("gabc_score_determination_lex", VERBOSITY_ERROR, 0,
2020 _("unrecognized character: \"%c\""),
2021 gabc_score_determination_text[0]);
2022 }
2023 YY_BREAK
2024 case 77:
2025 YY_RULE_SETUP
2026 #line 415 "gabc/gabc-score-determination.l"
2027 ECHO;
2028 YY_BREAK
2029 #line 2029 "gabc/gabc-score-determination-l.c"
2030
2031 case YY_END_OF_BUFFER:
2032 {
2033 /* Amount of text matched not including the EOB char. */
2034 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2035
2036 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2037 *yy_cp = (yy_hold_char);
2038 YY_RESTORE_YY_MORE_OFFSET
2039
2040 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2041 {
2042 /* We're scanning a new file or input source. It's
2043 * possible that this happened because the user
2044 * just pointed yyin at a new source and called
2045 * yylex(). If so, then we have to assure
2046 * consistency between YY_CURRENT_BUFFER and our
2047 * globals. Here is the right place to do so, because
2048 * this is the first action (other than possibly a
2049 * back-up) that will match for the new input source.
2050 */
2051 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2052 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2053 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2054 }
2055
2056 /* Note that here we test for yy_c_buf_p "<=" to the position
2057 * of the first EOB in the buffer, since yy_c_buf_p will
2058 * already have been incremented past the NUL character
2059 * (since all states make transitions on EOB to the
2060 * end-of-buffer state). Contrast this with the test
2061 * in input().
2062 */
2063 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2064 { /* This was really a NUL. */
2065 yy_state_type yy_next_state;
2066
2067 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2068
2069 yy_current_state = yy_get_previous_state( );
2070
2071 /* Okay, we're now positioned to make the NUL
2072 * transition. We couldn't have
2073 * yy_get_previous_state() go ahead and do it
2074 * for us because it doesn't know how to deal
2075 * with the possibility of jamming (and we don't
2076 * want to build jamming into it because then it
2077 * will run more slowly).
2078 */
2079
2080 yy_next_state = yy_try_NUL_trans( yy_current_state );
2081
2082 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2083
2084 if ( yy_next_state )
2085 {
2086 /* Consume the NUL. */
2087 yy_cp = ++(yy_c_buf_p);
2088 yy_current_state = yy_next_state;
2089 goto yy_match;
2090 }
2091
2092 else
2093 {
2094 yy_cp = (yy_c_buf_p);
2095 goto yy_find_action;
2096 }
2097 }
2098
2099 else switch ( yy_get_next_buffer( ) )
2100 {
2101 case EOB_ACT_END_OF_FILE:
2102 {
2103 (yy_did_buffer_switch_on_eof) = 0;
2104
2105 if ( yywrap( ) )
2106 {
2107 /* Note: because we've taken care in
2108 * yy_get_next_buffer() to have set up
2109 * yytext, we can now set up
2110 * yy_c_buf_p so that if some total
2111 * hoser (like flex itself) wants to
2112 * call the scanner after we return the
2113 * YY_NULL, it'll still work - another
2114 * YY_NULL will get returned.
2115 */
2116 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2117
2118 yy_act = YY_STATE_EOF(YY_START);
2119 goto do_action;
2120 }
2121
2122 else
2123 {
2124 if ( ! (yy_did_buffer_switch_on_eof) )
2125 YY_NEW_FILE;
2126 }
2127 break;
2128 }
2129
2130 case EOB_ACT_CONTINUE_SCAN:
2131 (yy_c_buf_p) =
2132 (yytext_ptr) + yy_amount_of_matched_text;
2133
2134 yy_current_state = yy_get_previous_state( );
2135
2136 yy_cp = (yy_c_buf_p);
2137 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2138 goto yy_match;
2139
2140 case EOB_ACT_LAST_MATCH:
2141 (yy_c_buf_p) =
2142 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2143
2144 yy_current_state = yy_get_previous_state( );
2145
2146 yy_cp = (yy_c_buf_p);
2147 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2148 goto yy_find_action;
2149 }
2150 break;
2151 }
2152
2153 default:
2154 YY_FATAL_ERROR(
2155 "fatal flex scanner internal error--no action found" );
2156 } /* end of action switch */
2157 } /* end of scanning one token */
2158 } /* end of user's declarations */
2159 } /* end of yylex */
2160
2161 /* yy_get_next_buffer - try to read in a new buffer
2162 *
2163 * Returns a code representing an action:
2164 * EOB_ACT_LAST_MATCH -
2165 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2166 * EOB_ACT_END_OF_FILE - end of file
2167 */
2168 static int yy_get_next_buffer (void)
2169 {
2170 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2171 char *source = (yytext_ptr);
2172 int number_to_move, i;
2173 int ret_val;
2174
2175 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2176 YY_FATAL_ERROR(
2177 "fatal flex scanner internal error--end of buffer missed" );
2178
2179 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2180 { /* Don't try to fill the buffer, so this is an EOF. */
2181 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2182 {
2183 /* We matched a single character, the EOB, so
2184 * treat this as a final EOF.
2185 */
2186 return EOB_ACT_END_OF_FILE;
2187 }
2188
2189 else
2190 {
2191 /* We matched some text prior to the EOB, first
2192 * process it.
2193 */
2194 return EOB_ACT_LAST_MATCH;
2195 }
2196 }
2197
2198 /* Try to read more data. */
2199
2200 /* First move last chars to start of buffer. */
2201 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
2202
2203 for ( i = 0; i < number_to_move; ++i )
2204 *(dest++) = *(source++);
2205
2206 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2207 /* don't do the read, it's not guaranteed to return an EOF,
2208 * just force an EOF
2209 */
2210 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2211
2212 else
2213 {
2214 int num_to_read =
2215 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2216
2217 while ( num_to_read <= 0 )
2218 { /* Not enough room in the buffer - grow it. */
2219
2220 /* just a shorter name for the current buffer */
2221 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
2222
2223 int yy_c_buf_p_offset =
2224 (int) ((yy_c_buf_p) - b->yy_ch_buf);
2225
2226 if ( b->yy_is_our_buffer )
2227 {
2228 int new_size = b->yy_buf_size * 2;
2229
2230 if ( new_size <= 0 )
2231 b->yy_buf_size += b->yy_buf_size / 8;
2232 else
2233 b->yy_buf_size *= 2;
2234
2235 b->yy_ch_buf = (char *)
2236 /* Include room in for 2 EOB chars. */
2237 yyrealloc( (void *) b->yy_ch_buf,
2238 (yy_size_t) (b->yy_buf_size + 2) );
2239 }
2240 else
2241 /* Can't grow it, we don't own it. */
2242 b->yy_ch_buf = NULL;
2243
2244 if ( ! b->yy_ch_buf )
2245 YY_FATAL_ERROR(
2246 "fatal error - scanner input buffer overflow" );
2247
2248 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2249
2250 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2251 number_to_move - 1;
2252
2253 }
2254
2255 if ( num_to_read > YY_READ_BUF_SIZE )
2256 num_to_read = YY_READ_BUF_SIZE;
2257
2258 /* Read in more data. */
2259 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2260 (yy_n_chars), num_to_read );
2261
2262 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2263 }
2264
2265 if ( (yy_n_chars) == 0 )
2266 {
2267 if ( number_to_move == YY_MORE_ADJ )
2268 {
2269 ret_val = EOB_ACT_END_OF_FILE;
2270 yyrestart( yyin );
2271 }
2272
2273 else
2274 {
2275 ret_val = EOB_ACT_LAST_MATCH;
2276 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2277 YY_BUFFER_EOF_PENDING;
2278 }
2279 }
2280
2281 else
2282 ret_val = EOB_ACT_CONTINUE_SCAN;
2283
2284 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2285 /* Extend the array by 50%, plus the number we really need. */
2286 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2287 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2288 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
2289 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2290 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2291 /* "- 2" to take care of EOB's */
2292 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2293 }
2294
2295 (yy_n_chars) += number_to_move;
2296 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2297 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2298
2299 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2300
2301 return ret_val;
2302 }
2303
2304 /* yy_get_previous_state - get the state just before the EOB char was reached */
2305
2306 static yy_state_type yy_get_previous_state (void)
2307 {
2308 yy_state_type yy_current_state;
2309 char *yy_cp;
2310
2311 yy_current_state = (yy_start);
2312 yy_current_state += YY_AT_BOL();
2313
2314 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2315 {
2316 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2317 if ( yy_accept[yy_current_state] )
2318 {
2319 (yy_last_accepting_state) = yy_current_state;
2320 (yy_last_accepting_cpos) = yy_cp;
2321 }
2322 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2323 {
2324 yy_current_state = (int) yy_def[yy_current_state];
2325 if ( yy_current_state >= 325 )
2326 yy_c = yy_meta[yy_c];
2327 }
2328 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2329 }
2330
2331 return yy_current_state;
2332 }
2333
2334 /* yy_try_NUL_trans - try to make a transition on the NUL character
2335 *
2336 * synopsis
2337 * next_state = yy_try_NUL_trans( current_state );
2338 */
2339 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2340 {
2341 int yy_is_jam;
2342 char *yy_cp = (yy_c_buf_p);
2343
2344 YY_CHAR yy_c = 1;
2345 if ( yy_accept[yy_current_state] )
2346 {
2347 (yy_last_accepting_state) = yy_current_state;
2348 (yy_last_accepting_cpos) = yy_cp;
2349 }
2350 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2351 {
2352 yy_current_state = (int) yy_def[yy_current_state];
2353 if ( yy_current_state >= 325 )
2354 yy_c = yy_meta[yy_c];
2355 }
2356 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2357 yy_is_jam = (yy_current_state == 324);
2358
2359 return yy_is_jam ? 0 : yy_current_state;
2360 }
2361
2362 #ifndef YY_NO_UNPUT
2363
2364 #endif
2365
2366 #ifndef YY_NO_INPUT
2367 #ifdef __cplusplus
2368 static int yyinput (void)
2369 #else
2370 static int input (void)
2371 #endif
2372
2373 {
2374 int c;
2375
2376 *(yy_c_buf_p) = (yy_hold_char);
2377
2378 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2379 {
2380 /* yy_c_buf_p now points to the character we want to return.
2381 * If this occurs *before* the EOB characters, then it's a
2382 * valid NUL; if not, then we've hit the end of the buffer.
2383 */
2384 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2385 /* This was really a NUL. */
2386 *(yy_c_buf_p) = '\0';
2387
2388 else
2389 { /* need more input */
2390 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2391 ++(yy_c_buf_p);
2392
2393 switch ( yy_get_next_buffer( ) )
2394 {
2395 case EOB_ACT_LAST_MATCH:
2396 /* This happens because yy_g_n_b()
2397 * sees that we've accumulated a
2398 * token and flags that we need to
2399 * try matching the token before
2400 * proceeding. But for input(),
2401 * there's no matching to consider.
2402 * So convert the EOB_ACT_LAST_MATCH
2403 * to EOB_ACT_END_OF_FILE.
2404 */
2405
2406 /* Reset buffer status. */
2407 yyrestart( yyin );
2408
2409 /*FALLTHROUGH*/
2410
2411 case EOB_ACT_END_OF_FILE:
2412 {
2413 if ( yywrap( ) )
2414 return 0;
2415
2416 if ( ! (yy_did_buffer_switch_on_eof) )
2417 YY_NEW_FILE;
2418 #ifdef __cplusplus
2419 return yyinput();
2420 #else
2421 return input();
2422 #endif
2423 }
2424
2425 case EOB_ACT_CONTINUE_SCAN:
2426 (yy_c_buf_p) = (yytext_ptr) + offset;
2427 break;
2428 }
2429 }
2430 }
2431
2432 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2433 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2434 (yy_hold_char) = *++(yy_c_buf_p);
2435
2436 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2437
2438 return c;
2439 }
2440 #endif /* ifndef YY_NO_INPUT */
2441
2442 /** Immediately switch to a different input stream.
2443 * @param input_file A readable stream.
2444 *
2445 * @note This function does not reset the start condition to @c INITIAL .
2446 */
2447 void yyrestart (FILE * input_file )
2448 {
2449
2450 if ( ! YY_CURRENT_BUFFER ){
2451 yyensure_buffer_stack ();
2452 YY_CURRENT_BUFFER_LVALUE =
2453 yy_create_buffer( yyin, YY_BUF_SIZE );
2454 }
2455
2456 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2457 yy_load_buffer_state( );
2458 }
2459
2460 /** Switch to a different input buffer.
2461 * @param new_buffer The new input buffer.
2462 *
2463 */
2464 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2465 {
2466
2467 /* TODO. We should be able to replace this entire function body
2468 * with
2469 * yypop_buffer_state();
2470 * yypush_buffer_state(new_buffer);
2471 */
2472 yyensure_buffer_stack ();
2473 if ( YY_CURRENT_BUFFER == new_buffer )
2474 return;
2475
2476 if ( YY_CURRENT_BUFFER )
2477 {
2478 /* Flush out information for old buffer. */
2479 *(yy_c_buf_p) = (yy_hold_char);
2480 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2481 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2482 }
2483
2484 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2485 yy_load_buffer_state( );
2486
2487 /* We don't actually know whether we did this switch during
2488 * EOF (yywrap()) processing, but the only time this flag
2489 * is looked at is after yywrap() is called, so it's safe
2490 * to go ahead and always set it.
2491 */
2492 (yy_did_buffer_switch_on_eof) = 1;
2493 }
2494
2495 static void yy_load_buffer_state (void)
2496 {
2497 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2498 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2499 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2500 (yy_hold_char) = *(yy_c_buf_p);
2501 }
2502
2503 /** Allocate and initialize an input buffer state.
2504 * @param file A readable stream.
2505 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2506 *
2507 * @return the allocated buffer state.
2508 */
2509 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2510 {
2511 YY_BUFFER_STATE b;
2512
2513 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2514 if ( ! b )
2515 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2516
2517 b->yy_buf_size = size;
2518
2519 /* yy_ch_buf has to be 2 characters longer than the size given because
2520 * we need to put in 2 end-of-buffer characters.
2521 */
2522 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
2523 if ( ! b->yy_ch_buf )
2524 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2525
2526 b->yy_is_our_buffer = 1;
2527
2528 yy_init_buffer( b, file );
2529
2530 return b;
2531 }
2532
2533 /** Destroy the buffer.
2534 * @param b a buffer created with yy_create_buffer()
2535 *
2536 */
2537 void yy_delete_buffer (YY_BUFFER_STATE b )
2538 {
2539
2540 if ( ! b )
2541 return;
2542
2543 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2544 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2545
2546 if ( b->yy_is_our_buffer )
2547 yyfree( (void *) b->yy_ch_buf );
2548
2549 yyfree( (void *) b );
2550 }
2551
2552 /* Initializes or reinitializes a buffer.
2553 * This function is sometimes called more than once on the same buffer,
2554 * such as during a yyrestart() or at EOF.
2555 */
2556 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2557
2558 {
2559 int oerrno = errno;
2560
2561 yy_flush_buffer( b );
2562
2563 b->yy_input_file = file;
2564 b->yy_fill_buffer = 1;
2565
2566 /* If b is the current buffer, then yy_init_buffer was _probably_
2567 * called from yyrestart() or through yy_get_next_buffer.
2568 * In that case, we don't want to reset the lineno or column.
2569 */
2570 if (b != YY_CURRENT_BUFFER){
2571 b->yy_bs_lineno = 1;
2572 b->yy_bs_column = 0;
2573 }
2574
2575 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2576
2577 errno = oerrno;
2578 }
2579
2580 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2581 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2582 *
2583 */
2584 void yy_flush_buffer (YY_BUFFER_STATE b )
2585 {
2586 if ( ! b )
2587 return;
2588
2589 b->yy_n_chars = 0;
2590
2591 /* We always need two end-of-buffer characters. The first causes
2592 * a transition to the end-of-buffer state. The second causes
2593 * a jam in that state.
2594 */
2595 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2596 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2597
2598 b->yy_buf_pos = &b->yy_ch_buf[0];
2599
2600 b->yy_at_bol = 1;
2601 b->yy_buffer_status = YY_BUFFER_NEW;
2602
2603 if ( b == YY_CURRENT_BUFFER )
2604 yy_load_buffer_state( );
2605 }
2606
2607 /** Pushes the new state onto the stack. The new state becomes
2608 * the current state. This function will allocate the stack
2609 * if necessary.
2610 * @param new_buffer The new state.
2611 *
2612 */
2613 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2614 {
2615 if (new_buffer == NULL)
2616 return;
2617
2618 yyensure_buffer_stack();
2619
2620 /* This block is copied from yy_switch_to_buffer. */
2621 if ( YY_CURRENT_BUFFER )
2622 {
2623 /* Flush out information for old buffer. */
2624 *(yy_c_buf_p) = (yy_hold_char);
2625 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2626 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2627 }
2628
2629 /* Only push if top exists. Otherwise, replace top. */
2630 if (YY_CURRENT_BUFFER)
2631 (yy_buffer_stack_top)++;
2632 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2633
2634 /* copied from yy_switch_to_buffer. */
2635 yy_load_buffer_state( );
2636 (yy_did_buffer_switch_on_eof) = 1;
2637 }
2638
2639 /** Removes and deletes the top of the stack, if present.
2640 * The next element becomes the new top.
2641 *
2642 */
2643 void yypop_buffer_state (void)
2644 {
2645 if (!YY_CURRENT_BUFFER)
2646 return;
2647
2648 yy_delete_buffer(YY_CURRENT_BUFFER );
2649 YY_CURRENT_BUFFER_LVALUE = NULL;
2650 if ((yy_buffer_stack_top) > 0)
2651 --(yy_buffer_stack_top);
2652
2653 if (YY_CURRENT_BUFFER) {
2654 yy_load_buffer_state( );
2655 (yy_did_buffer_switch_on_eof) = 1;
2656 }
2657 }
2658
2659 /* Allocates the stack if it does not exist.
2660 * Guarantees space for at least one push.
2661 */
2662 static void yyensure_buffer_stack (void)
2663 {
2664 yy_size_t num_to_alloc;
2665
2666 if (!(yy_buffer_stack)) {
2667
2668 /* First allocation is just for 2 elements, since we don't know if this
2669 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2670 * immediate realloc on the next call.
2671 */
2672 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2673 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2674 (num_to_alloc * sizeof(struct yy_buffer_state*)
2675 );
2676 if ( ! (yy_buffer_stack) )
2677 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2678
2679 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2680
2681 (yy_buffer_stack_max) = num_to_alloc;
2682 (yy_buffer_stack_top) = 0;
2683 return;
2684 }
2685
2686 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2687
2688 /* Increase the buffer to prepare for a possible push. */
2689 yy_size_t grow_size = 8 /* arbitrary grow size */;
2690
2691 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2692 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2693 ((yy_buffer_stack),
2694 num_to_alloc * sizeof(struct yy_buffer_state*)
2695 );
2696 if ( ! (yy_buffer_stack) )
2697 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2698
2699 /* zero only the new slots.*/
2700 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2701 (yy_buffer_stack_max) = num_to_alloc;
2702 }
2703 }
2704
2705 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2706 * @param base the character buffer
2707 * @param size the size in bytes of the character buffer
2708 *
2709 * @return the newly allocated buffer state object.
2710 */
2711 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2712 {
2713 YY_BUFFER_STATE b;
2714
2715 if ( size < 2 ||
2716 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2717 base[size-1] != YY_END_OF_BUFFER_CHAR )
2718 /* They forgot to leave room for the EOB's. */
2719 return NULL;
2720
2721 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2722 if ( ! b )
2723 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2724
2725 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2726 b->yy_buf_pos = b->yy_ch_buf = base;
2727 b->yy_is_our_buffer = 0;
2728 b->yy_input_file = NULL;
2729 b->yy_n_chars = b->yy_buf_size;
2730 b->yy_is_interactive = 0;
2731 b->yy_at_bol = 1;
2732 b->yy_fill_buffer = 0;
2733 b->yy_buffer_status = YY_BUFFER_NEW;
2734
2735 yy_switch_to_buffer( b );
2736
2737 return b;
2738 }
2739
2740 /** Setup the input buffer state to scan a string. The next call to yylex() will
2741 * scan from a @e copy of @a str.
2742 * @param yystr a NUL-terminated string to scan
2743 *
2744 * @return the newly allocated buffer state object.
2745 * @note If you want to scan bytes that may contain NUL values, then use
2746 * yy_scan_bytes() instead.
2747 */
2748 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2749 {
2750
2751 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2752 }
2753
2754 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2755 * scan from a @e copy of @a bytes.
2756 * @param yybytes the byte buffer to scan
2757 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2758 *
2759 * @return the newly allocated buffer state object.
2760 */
2761 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2762 {
2763 YY_BUFFER_STATE b;
2764 char *buf;
2765 yy_size_t n;
2766 int i;
2767
2768 /* Get memory for full buffer, including space for trailing EOB's. */
2769 n = (yy_size_t) (_yybytes_len + 2);
2770 buf = (char *) yyalloc( n );
2771 if ( ! buf )
2772 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2773
2774 for ( i = 0; i < _yybytes_len; ++i )
2775 buf[i] = yybytes[i];
2776
2777 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2778
2779 b = yy_scan_buffer( buf, n );
2780 if ( ! b )
2781 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2782
2783 /* It's okay to grow etc. this buffer, and we should throw it
2784 * away when we're done.
2785 */
2786 b->yy_is_our_buffer = 1;
2787
2788 return b;
2789 }
2790
2791 #ifndef YY_EXIT_FAILURE
2792 #define YY_EXIT_FAILURE 2
2793 #endif
2794
2795 static void yynoreturn yy_fatal_error (const char* msg )
2796 {
2797 fprintf( stderr, "%s\n", msg );
2798 exit( YY_EXIT_FAILURE );
2799 }
2800
2801 /* Redefine yyless() so it works in section 3 code. */
2802
2803 #undef yyless
2804 #define yyless(n) \
2805 do \
2806 { \
2807 /* Undo effects of setting up yytext. */ \
2808 int yyless_macro_arg = (n); \
2809 YY_LESS_LINENO(yyless_macro_arg);\
2810 yytext[yyleng] = (yy_hold_char); \
2811 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2812 (yy_hold_char) = *(yy_c_buf_p); \
2813 *(yy_c_buf_p) = '\0'; \
2814 yyleng = yyless_macro_arg; \
2815 } \
2816 while ( 0 )
2817
2818 /* Accessor methods (get/set functions) to struct members. */
2819
2820 /** Get the current line number.
2821 *
2822 */
2823 int yyget_lineno (void)
2824 {
2825
2826 return yylineno;
2827 }
2828
2829 /** Get the input stream.
2830 *
2831 */
2832 FILE *yyget_in (void)
2833 {
2834 return yyin;
2835 }
2836
2837 /** Get the output stream.
2838 *
2839 */
2840 FILE *yyget_out (void)
2841 {
2842 return yyout;
2843 }
2844
2845 /** Get the length of the current token.
2846 *
2847 */
2848 int yyget_leng (void)
2849 {
2850 return yyleng;
2851 }
2852
2853 /** Get the current token.
2854 *
2855 */
2856
2857 char *yyget_text (void)
2858 {
2859 return yytext;
2860 }
2861
2862 /** Set the current line number.
2863 * @param _line_number line number
2864 *
2865 */
2866 void yyset_lineno (int _line_number )
2867 {
2868
2869 yylineno = _line_number;
2870 }
2871
2872 /** Set the input stream. This does not discard the current
2873 * input buffer.
2874 * @param _in_str A readable stream.
2875 *
2876 * @see yy_switch_to_buffer
2877 */
2878 void yyset_in (FILE * _in_str )
2879 {
2880 yyin = _in_str ;
2881 }
2882
2883 void yyset_out (FILE * _out_str )
2884 {
2885 yyout = _out_str ;
2886 }
2887
2888 int yyget_debug (void)
2889 {
2890 return yy_flex_debug;
2891 }
2892
2893 void yyset_debug (int _bdebug )
2894 {
2895 yy_flex_debug = _bdebug ;
2896 }
2897
2898 static int yy_init_globals (void)
2899 {
2900 /* Initialization is the same as for the non-reentrant scanner.
2901 * This function is called from yylex_destroy(), so don't allocate here.
2902 */
2903
2904 (yy_buffer_stack) = NULL;
2905 (yy_buffer_stack_top) = 0;
2906 (yy_buffer_stack_max) = 0;
2907 (yy_c_buf_p) = NULL;
2908 (yy_init) = 0;
2909 (yy_start) = 0;
2910
2911 (yy_start_stack_ptr) = 0;
2912 (yy_start_stack_depth) = 0;
2913 (yy_start_stack) = NULL;
2914
2915 /* Defined in main.c */
2916 #ifdef YY_STDINIT
2917 yyin = stdin;
2918 yyout = stdout;
2919 #else
2920 yyin = NULL;
2921 yyout = NULL;
2922 #endif
2923
2924 /* For future reference: Set errno on error, since we are called by
2925 * yylex_init()
2926 */
2927 return 0;
2928 }
2929
2930 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2931 int yylex_destroy (void)
2932 {
2933
2934 /* Pop the buffer stack, destroying each element. */
2935 while(YY_CURRENT_BUFFER){
2936 yy_delete_buffer( YY_CURRENT_BUFFER );
2937 YY_CURRENT_BUFFER_LVALUE = NULL;
2938 yypop_buffer_state();
2939 }
2940
2941 /* Destroy the stack itself. */
2942 yyfree((yy_buffer_stack) );
2943 (yy_buffer_stack) = NULL;
2944
2945 /* Destroy the start condition stack. */
2946 yyfree( (yy_start_stack) );
2947 (yy_start_stack) = NULL;
2948
2949 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2950 * yylex() is called, initialization will occur. */
2951 yy_init_globals( );
2952
2953 return 0;
2954 }
2955
2956 /*
2957 * Internal utility routines.
2958 */
2959
2960 #ifndef yytext_ptr
2961 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2962 {
2963
2964 int i;
2965 for ( i = 0; i < n; ++i )
2966 s1[i] = s2[i];
2967 }
2968 #endif
2969
2970 #ifdef YY_NEED_STRLEN
2971 static int yy_flex_strlen (const char * s )
2972 {
2973 int n;
2974 for ( n = 0; s[n]; ++n )
2975 ;
2976
2977 return n;
2978 }
2979 #endif
2980
2981 void *yyalloc (yy_size_t size )
2982 {
2983 return malloc(size);
2984 }
2985
2986 void *yyrealloc (void * ptr, yy_size_t size )
2987 {
2988
2989 /* The cast to (char *) in the following accommodates both
2990 * implementations that use char* generic pointers, and those
2991 * that use void* generic pointers. It works with the latter
2992 * because both ANSI C and C++ allow castless assignment from
2993 * any pointer type to void*, and deal with argument conversions
2994 * as though doing an assignment.
2995 */
2996 return realloc(ptr, size);
2997 }
2998
2999 void yyfree (void * ptr )
3000 {
3001 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3002 }
3003
3004 #define YYTABLES_NAME "yytables"
3005
3006 #line 415 "gabc/gabc-score-determination.l"
3007
3008
3009