Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: third_party/wds/gen/errorscanner.cpp

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

Powered by Google App Engine
This is Rietveld 408576698