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