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