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

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

Powered by Google App Engine
This is Rietveld 408576698