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