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