SphinxBase  5prealpha
jsgf_scanner.c
1 #line 2 "jsgf_scanner.c"
2 
3 #line 4 "jsgf_scanner.c"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 6
12 #define YY_FLEX_SUBMINOR_VERSION 1
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16 
17 /* First, we deal with platform-specific or compiler-specific issues. */
18 
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24 
25 /* end standard C headers. */
26 
27 /* flex integer type definitions */
28 
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31 
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37  * if you want the limit (max/min) macros for int types.
38  */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42 
43 #include <inttypes.h>
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 
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX (4294967295U)
85 #endif
86 
87 #endif /* ! C99 */
88 
89 #endif /* ! FLEXINT_H */
90 
91 /* TODO: this is always defined, so inline it */
92 #define yyconst const
93 
94 #if defined(__GNUC__) && __GNUC__ >= 3
95 #define yynoreturn __attribute__((__noreturn__))
96 #else
97 #define yynoreturn
98 #endif
99 
100 /* Returned upon end-of-file. */
101 #define YY_NULL 0
102 
103 /* Promotes a possibly negative, possibly signed char to an unsigned
104  * integer for use as an array index. If the signed char is negative,
105  * we want to instead treat it as an 8-bit unsigned char, hence the
106  * double cast.
107  */
108 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
109 
110 /* An opaque pointer. */
111 #ifndef YY_TYPEDEF_YY_SCANNER_T
112 #define YY_TYPEDEF_YY_SCANNER_T
113 typedef void* yyscan_t;
114 #endif
115 
116 /* For convenience, these vars (plus the bison vars far below)
117  are macros in the reentrant scanner. */
118 #define yyin yyg->yyin_r
119 #define yyout yyg->yyout_r
120 #define yyextra yyg->yyextra_r
121 #define yyleng yyg->yyleng_r
122 #define yytext yyg->yytext_r
123 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
124 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
125 #define yy_flex_debug yyg->yy_flex_debug_r
126 
127 /* Enter a start condition. This macro really ought to take a parameter,
128  * but we do it the disgusting crufty way forced on us by the ()-less
129  * definition of BEGIN.
130  */
131 #define BEGIN yyg->yy_start = 1 + 2 *
132 
133 /* Translate the current start state into a value that can be later handed
134  * to BEGIN to return to the state. The YYSTATE alias is for lex
135  * compatibility.
136  */
137 #define YY_START ((yyg->yy_start - 1) / 2)
138 #define YYSTATE YY_START
139 
140 /* Action number for EOF rule of a given start state. */
141 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
142 
143 /* Special action meaning "start processing a new file". */
144 #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
145 
146 #define YY_END_OF_BUFFER_CHAR 0
147 
148 /* Size of default input buffer. */
149 #ifndef YY_BUF_SIZE
150 #ifdef __ia64__
151 /* On IA-64, the buffer size is 16k, not 8k.
152  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
153  * Ditto for the __ia64__ case accordingly.
154  */
155 #define YY_BUF_SIZE 32768
156 #else
157 #define YY_BUF_SIZE 16384
158 #endif /* __ia64__ */
159 #endif
160 
161 /* The state buf must be large enough to hold one state per character in the main buffer.
162  */
163 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
164 
165 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
166 #define YY_TYPEDEF_YY_BUFFER_STATE
167 typedef struct yy_buffer_state *YY_BUFFER_STATE;
168 #endif
169 
170 #ifndef YY_TYPEDEF_YY_SIZE_T
171 #define YY_TYPEDEF_YY_SIZE_T
172 typedef size_t yy_size_t;
173 #endif
174 
175 #define EOB_ACT_CONTINUE_SCAN 0
176 #define EOB_ACT_END_OF_FILE 1
177 #define EOB_ACT_LAST_MATCH 2
178 
179  /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
180  * access to the local variable yy_act. Since yyless() is a macro, it would break
181  * existing scanners that call yyless() from OUTSIDE yylex.
182  * One obvious solution it to make yy_act a global. I tried that, and saw
183  * a 5% performance hit in a non-yylineno scanner, because yy_act is
184  * normally declared as a register variable-- so it is not worth it.
185  */
186  #define YY_LESS_LINENO(n) \
187  do { \
188  int yyl;\
189  for ( yyl = n; yyl < yyleng; ++yyl )\
190  if ( yytext[yyl] == '\n' )\
191  --yylineno;\
192  }while(0)
193  #define YY_LINENO_REWIND_TO(dst) \
194  do {\
195  const char *p;\
196  for ( p = yy_cp-1; p >= (dst); --p)\
197  if ( *p == '\n' )\
198  --yylineno;\
199  }while(0)
200 
201 /* Return all but the first "n" matched characters back to the input stream. */
202 #define yyless(n) \
203  do \
204  { \
205  /* Undo effects of setting up yytext. */ \
206  int yyless_macro_arg = (n); \
207  YY_LESS_LINENO(yyless_macro_arg);\
208  *yy_cp = yyg->yy_hold_char; \
209  YY_RESTORE_YY_MORE_OFFSET \
210  yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
211  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
212  } \
213  while ( 0 )
214 
215 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
216 
217 #ifndef YY_STRUCT_YY_BUFFER_STATE
218 #define YY_STRUCT_YY_BUFFER_STATE
220  {
221  FILE *yy_input_file;
222 
223  char *yy_ch_buf; /* input buffer */
224  char *yy_buf_pos; /* current position in input buffer */
225 
226  /* Size of input buffer in bytes, not including room for EOB
227  * characters.
228  */
229  int yy_buf_size;
230 
231  /* Number of characters read into yy_ch_buf, not including EOB
232  * characters.
233  */
234  int yy_n_chars;
235 
236  /* Whether we "own" the buffer - i.e., we know we created it,
237  * and can realloc() it to grow it, and should free() it to
238  * delete it.
239  */
240  int yy_is_our_buffer;
241 
242  /* Whether this is an "interactive" input source; if so, and
243  * if we're using stdio for input, then we want to use getc()
244  * instead of fread(), to make sure we stop fetching input after
245  * each newline.
246  */
247  int yy_is_interactive;
248 
249  /* Whether we're considered to be at the beginning of a line.
250  * If so, '^' rules will be active on the next match, otherwise
251  * not.
252  */
253  int yy_at_bol;
254 
258  /* Whether to try to fill the input buffer when we reach the
259  * end of it.
260  */
261  int yy_fill_buffer;
262 
263  int yy_buffer_status;
264 
265 #define YY_BUFFER_NEW 0
266 #define YY_BUFFER_NORMAL 1
267  /* When an EOF's been seen but there's still some text to process
268  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
269  * shouldn't try reading from the input source any more. We might
270  * still have a bunch of tokens to match, though, because of
271  * possible backing-up.
272  *
273  * When we actually see the EOF, we change the status to "new"
274  * (via yyrestart()), so that the user can continue scanning by
275  * just pointing yyin at a new input file.
276  */
277 #define YY_BUFFER_EOF_PENDING 2
278 
279  };
280 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
281 
282 /* We provide macros for accessing buffer states in case in the
283  * future we want to put the buffer states in a more general
284  * "scanner state".
285  *
286  * Returns the top of the stack, or NULL.
287  */
288 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
289  ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
290  : NULL)
291 
292 /* Same as previous macro, but useful when we know that the buffer stack is not
293  * NULL or when we need an lvalue. For internal use only.
294  */
295 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
296 
297 void yyrestart (FILE *input_file ,yyscan_t yyscanner );
298 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
299 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
300 void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
301 void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
302 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
303 void yypop_buffer_state (yyscan_t yyscanner );
304 
305 static void yyensure_buffer_stack (yyscan_t yyscanner );
306 static void yy_load_buffer_state (yyscan_t yyscanner );
307 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
308 
309 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
310 
311 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
312 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
313 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int