/work/build/epan/protobuf_lang_scanner.c
Line | Count | Source (jump to first uncovered line) |
1 | | #line 2 "/work/build/epan/protobuf_lang_scanner.c" |
2 | | /* Include this before everything else, for various large-file definitions */ |
3 | | #include "config.h" |
4 | | #include <wireshark.h> |
5 | | |
6 | | #line 7 "/work/build/epan/protobuf_lang_scanner.c" |
7 | | |
8 | | #define YY_INT_ALIGNED short int |
9 | | |
10 | | /* A lexical scanner generated by flex */ |
11 | | |
12 | | /* %not-for-header */ |
13 | | /* %if-c-only */ |
14 | | /* %if-not-reentrant */ |
15 | | /* %endif */ |
16 | | /* %endif */ |
17 | | /* %ok-for-header */ |
18 | | |
19 | | #define FLEX_SCANNER |
20 | | #define YY_FLEX_MAJOR_VERSION 2 |
21 | | #define YY_FLEX_MINOR_VERSION 6 |
22 | | #define YY_FLEX_SUBMINOR_VERSION 4 |
23 | | #if YY_FLEX_SUBMINOR_VERSION > 0 |
24 | | #define FLEX_BETA |
25 | | #endif |
26 | | |
27 | | /* %if-c++-only */ |
28 | | /* %endif */ |
29 | | |
30 | | /* %if-c-only */ |
31 | | #ifdef yy_create_buffer |
32 | | #define protobuf_lang__create_buffer_ALREADY_DEFINED |
33 | | #else |
34 | 0 | #define yy_create_buffer protobuf_lang__create_buffer |
35 | | #endif |
36 | | |
37 | | #ifdef yy_delete_buffer |
38 | | #define protobuf_lang__delete_buffer_ALREADY_DEFINED |
39 | | #else |
40 | 0 | #define yy_delete_buffer protobuf_lang__delete_buffer |
41 | | #endif |
42 | | |
43 | | #ifdef yy_scan_buffer |
44 | | #define protobuf_lang__scan_buffer_ALREADY_DEFINED |
45 | | #else |
46 | 0 | #define yy_scan_buffer protobuf_lang__scan_buffer |
47 | | #endif |
48 | | |
49 | | #ifdef yy_scan_string |
50 | | #define protobuf_lang__scan_string_ALREADY_DEFINED |
51 | | #else |
52 | | #define yy_scan_string protobuf_lang__scan_string |
53 | | #endif |
54 | | |
55 | | #ifdef yy_scan_bytes |
56 | | #define protobuf_lang__scan_bytes_ALREADY_DEFINED |
57 | | #else |
58 | 0 | #define yy_scan_bytes protobuf_lang__scan_bytes |
59 | | #endif |
60 | | |
61 | | #ifdef yy_init_buffer |
62 | | #define protobuf_lang__init_buffer_ALREADY_DEFINED |
63 | | #else |
64 | 0 | #define yy_init_buffer protobuf_lang__init_buffer |
65 | | #endif |
66 | | |
67 | | #ifdef yy_flush_buffer |
68 | | #define protobuf_lang__flush_buffer_ALREADY_DEFINED |
69 | | #else |
70 | 0 | #define yy_flush_buffer protobuf_lang__flush_buffer |
71 | | #endif |
72 | | |
73 | | #ifdef yy_load_buffer_state |
74 | | #define protobuf_lang__load_buffer_state_ALREADY_DEFINED |
75 | | #else |
76 | 0 | #define yy_load_buffer_state protobuf_lang__load_buffer_state |
77 | | #endif |
78 | | |
79 | | #ifdef yy_switch_to_buffer |
80 | | #define protobuf_lang__switch_to_buffer_ALREADY_DEFINED |
81 | | #else |
82 | 0 | #define yy_switch_to_buffer protobuf_lang__switch_to_buffer |
83 | | #endif |
84 | | |
85 | | #ifdef yypush_buffer_state |
86 | | #define protobuf_lang_push_buffer_state_ALREADY_DEFINED |
87 | | #else |
88 | | #define yypush_buffer_state protobuf_lang_push_buffer_state |
89 | | #endif |
90 | | |
91 | | #ifdef yypop_buffer_state |
92 | | #define protobuf_lang_pop_buffer_state_ALREADY_DEFINED |
93 | | #else |
94 | 0 | #define yypop_buffer_state protobuf_lang_pop_buffer_state |
95 | | #endif |
96 | | |
97 | | #ifdef yyensure_buffer_stack |
98 | | #define protobuf_lang_ensure_buffer_stack_ALREADY_DEFINED |
99 | | #else |
100 | 0 | #define yyensure_buffer_stack protobuf_lang_ensure_buffer_stack |
101 | | #endif |
102 | | |
103 | | #ifdef yylex |
104 | | #define protobuf_lang_lex_ALREADY_DEFINED |
105 | | #else |
106 | | #define yylex protobuf_lang_lex |
107 | | #endif |
108 | | |
109 | | #ifdef yyrestart |
110 | | #define protobuf_lang_restart_ALREADY_DEFINED |
111 | | #else |
112 | 0 | #define yyrestart protobuf_lang_restart |
113 | | #endif |
114 | | |
115 | | #ifdef yylex_init |
116 | | #define protobuf_lang_lex_init_ALREADY_DEFINED |
117 | | #else |
118 | | #define yylex_init protobuf_lang_lex_init |
119 | | #endif |
120 | | |
121 | | #ifdef yylex_init_extra |
122 | | #define protobuf_lang_lex_init_extra_ALREADY_DEFINED |
123 | | #else |
124 | | #define yylex_init_extra protobuf_lang_lex_init_extra |
125 | | #endif |
126 | | |
127 | | #ifdef yylex_destroy |
128 | | #define protobuf_lang_lex_destroy_ALREADY_DEFINED |
129 | | #else |
130 | | #define yylex_destroy protobuf_lang_lex_destroy |
131 | | #endif |
132 | | |
133 | | #ifdef yyget_debug |
134 | | #define protobuf_lang_get_debug_ALREADY_DEFINED |
135 | | #else |
136 | | #define yyget_debug protobuf_lang_get_debug |
137 | | #endif |
138 | | |
139 | | #ifdef yyset_debug |
140 | | #define protobuf_lang_set_debug_ALREADY_DEFINED |
141 | | #else |
142 | | #define yyset_debug protobuf_lang_set_debug |
143 | | #endif |
144 | | |
145 | | #ifdef yyget_extra |
146 | | #define protobuf_lang_get_extra_ALREADY_DEFINED |
147 | | #else |
148 | | #define yyget_extra protobuf_lang_get_extra |
149 | | #endif |
150 | | |
151 | | #ifdef yyset_extra |
152 | | #define protobuf_lang_set_extra_ALREADY_DEFINED |
153 | | #else |
154 | 0 | #define yyset_extra protobuf_lang_set_extra |
155 | | #endif |
156 | | |
157 | | #ifdef yyget_in |
158 | | #define protobuf_lang_get_in_ALREADY_DEFINED |
159 | | #else |
160 | | #define yyget_in protobuf_lang_get_in |
161 | | #endif |
162 | | |
163 | | #ifdef yyset_in |
164 | | #define protobuf_lang_set_in_ALREADY_DEFINED |
165 | | #else |
166 | | #define yyset_in protobuf_lang_set_in |
167 | | #endif |
168 | | |
169 | | #ifdef yyget_out |
170 | | #define protobuf_lang_get_out_ALREADY_DEFINED |
171 | | #else |
172 | | #define yyget_out protobuf_lang_get_out |
173 | | #endif |
174 | | |
175 | | #ifdef yyset_out |
176 | | #define protobuf_lang_set_out_ALREADY_DEFINED |
177 | | #else |
178 | | #define yyset_out protobuf_lang_set_out |
179 | | #endif |
180 | | |
181 | | #ifdef yyget_leng |
182 | | #define protobuf_lang_get_leng_ALREADY_DEFINED |
183 | | #else |
184 | | #define yyget_leng protobuf_lang_get_leng |
185 | | #endif |
186 | | |
187 | | #ifdef yyget_text |
188 | | #define protobuf_lang_get_text_ALREADY_DEFINED |
189 | | #else |
190 | | #define yyget_text protobuf_lang_get_text |
191 | | #endif |
192 | | |
193 | | #ifdef yyget_lineno |
194 | | #define protobuf_lang_get_lineno_ALREADY_DEFINED |
195 | | #else |
196 | | #define yyget_lineno protobuf_lang_get_lineno |
197 | | #endif |
198 | | |
199 | | #ifdef yyset_lineno |
200 | | #define protobuf_lang_set_lineno_ALREADY_DEFINED |
201 | | #else |
202 | | #define yyset_lineno protobuf_lang_set_lineno |
203 | | #endif |
204 | | |
205 | | #ifdef yyget_column |
206 | | #define protobuf_lang_get_column_ALREADY_DEFINED |
207 | | #else |
208 | | #define yyget_column protobuf_lang_get_column |
209 | | #endif |
210 | | |
211 | | #ifdef yyset_column |
212 | | #define protobuf_lang_set_column_ALREADY_DEFINED |
213 | | #else |
214 | | #define yyset_column protobuf_lang_set_column |
215 | | #endif |
216 | | |
217 | | #ifdef yywrap |
218 | | #define protobuf_lang_wrap_ALREADY_DEFINED |
219 | | #else |
220 | 0 | #define yywrap protobuf_lang_wrap |
221 | | #endif |
222 | | |
223 | | /* %endif */ |
224 | | |
225 | | #ifdef yyalloc |
226 | | #define protobuf_lang_alloc_ALREADY_DEFINED |
227 | | #else |
228 | 0 | #define yyalloc protobuf_lang_alloc |
229 | | #endif |
230 | | |
231 | | #ifdef yyrealloc |
232 | | #define protobuf_lang_realloc_ALREADY_DEFINED |
233 | | #else |
234 | 0 | #define yyrealloc protobuf_lang_realloc |
235 | | #endif |
236 | | |
237 | | #ifdef yyfree |
238 | | #define protobuf_lang_free_ALREADY_DEFINED |
239 | | #else |
240 | 0 | #define yyfree protobuf_lang_free |
241 | | #endif |
242 | | |
243 | | /* %if-c-only */ |
244 | | |
245 | | /* %endif */ |
246 | | |
247 | | /* First, we deal with platform-specific or compiler-specific issues. */ |
248 | | |
249 | | /* begin standard C headers. */ |
250 | | /* %if-c-only */ |
251 | | #include <stdio.h> |
252 | | #include <string.h> |
253 | | #include <errno.h> |
254 | | #include <stdlib.h> |
255 | | /* %endif */ |
256 | | |
257 | | /* %if-tables-serialization */ |
258 | | /* %endif */ |
259 | | /* end standard C headers. */ |
260 | | |
261 | | /* %if-c-or-c++ */ |
262 | | /* flex integer type definitions */ |
263 | | |
264 | | #ifndef FLEXINT_H |
265 | | #define FLEXINT_H |
266 | | |
267 | | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
268 | | |
269 | | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
270 | | |
271 | | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
272 | | * if you want the limit (max/min) macros for int types. |
273 | | */ |
274 | | #ifndef __STDC_LIMIT_MACROS |
275 | | #define __STDC_LIMIT_MACROS 1 |
276 | | #endif |
277 | | |
278 | | #include <inttypes.h> |
279 | | typedef int8_t flex_int8_t; |
280 | | typedef uint8_t flex_uint8_t; |
281 | | typedef int16_t flex_int16_t; |
282 | | typedef uint16_t flex_uint16_t; |
283 | | typedef int32_t flex_int32_t; |
284 | | typedef uint32_t flex_uint32_t; |
285 | | #else |
286 | | typedef signed char flex_int8_t; |
287 | | typedef short int flex_int16_t; |
288 | | typedef int flex_int32_t; |
289 | | typedef unsigned char flex_uint8_t; |
290 | | typedef unsigned short int flex_uint16_t; |
291 | | typedef unsigned int flex_uint32_t; |
292 | | |
293 | | /* Limits of integral types. */ |
294 | | #ifndef INT8_MIN |
295 | | #define INT8_MIN (-128) |
296 | | #endif |
297 | | #ifndef INT16_MIN |
298 | | #define INT16_MIN (-32767-1) |
299 | | #endif |
300 | | #ifndef INT32_MIN |
301 | | #define INT32_MIN (-2147483647-1) |
302 | | #endif |
303 | | #ifndef INT8_MAX |
304 | | #define INT8_MAX (127) |
305 | | #endif |
306 | | #ifndef INT16_MAX |
307 | | #define INT16_MAX (32767) |
308 | | #endif |
309 | | #ifndef INT32_MAX |
310 | | #define INT32_MAX (2147483647) |
311 | | #endif |
312 | | #ifndef UINT8_MAX |
313 | | #define UINT8_MAX (255U) |
314 | | #endif |
315 | | #ifndef UINT16_MAX |
316 | | #define UINT16_MAX (65535U) |
317 | | #endif |
318 | | #ifndef UINT32_MAX |
319 | | #define UINT32_MAX (4294967295U) |
320 | | #endif |
321 | | |
322 | | #ifndef SIZE_MAX |
323 | | #define SIZE_MAX (~(size_t)0) |
324 | | #endif |
325 | | |
326 | | #endif /* ! C99 */ |
327 | | |
328 | | #endif /* ! FLEXINT_H */ |
329 | | |
330 | | /* %endif */ |
331 | | |
332 | | /* begin standard C++ headers. */ |
333 | | /* %if-c++-only */ |
334 | | /* %endif */ |
335 | | |
336 | | /* TODO: this is always defined, so inline it */ |
337 | | #define yyconst const |
338 | | |
339 | | #if defined(__GNUC__) && __GNUC__ >= 3 |
340 | | #define yynoreturn __attribute__((__noreturn__)) |
341 | | #else |
342 | | #define yynoreturn |
343 | | #endif |
344 | | |
345 | | /* %not-for-header */ |
346 | | /* Returned upon end-of-file. */ |
347 | 0 | #define YY_NULL 0 |
348 | | /* %ok-for-header */ |
349 | | |
350 | | /* %not-for-header */ |
351 | | /* Promotes a possibly negative, possibly signed char to an |
352 | | * integer in range [0..255] for use as an array index. |
353 | | */ |
354 | 0 | #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) |
355 | | /* %ok-for-header */ |
356 | | |
357 | | /* %if-reentrant */ |
358 | | |
359 | | /* An opaque pointer. */ |
360 | | #ifndef YY_TYPEDEF_YY_SCANNER_T |
361 | | #define YY_TYPEDEF_YY_SCANNER_T |
362 | | typedef void* yyscan_t; |
363 | | #endif |
364 | | |
365 | | /* For convenience, these vars (plus the bison vars far below) |
366 | | are macros in the reentrant scanner. */ |
367 | 0 | #define yyin yyg->yyin_r |
368 | 0 | #define yyout yyg->yyout_r |
369 | 0 | #define yyextra yyg->yyextra_r |
370 | 0 | #define yyleng yyg->yyleng_r |
371 | 0 | #define yytext yyg->yytext_r |
372 | 0 | #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
373 | 0 | #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
374 | 0 | #define yy_flex_debug yyg->yy_flex_debug_r |
375 | | |
376 | | /* %endif */ |
377 | | |
378 | | /* %if-not-reentrant */ |
379 | | /* %endif */ |
380 | | |
381 | | /* Enter a start condition. This macro really ought to take a parameter, |
382 | | * but we do it the disgusting crufty way forced on us by the ()-less |
383 | | * definition of BEGIN. |
384 | | */ |
385 | 0 | #define BEGIN yyg->yy_start = 1 + 2 * |
386 | | /* Translate the current start state into a value that can be later handed |
387 | | * to BEGIN to return to the state. The YYSTATE alias is for lex |
388 | | * compatibility. |
389 | | */ |
390 | 0 | #define YY_START ((yyg->yy_start - 1) / 2) |
391 | | #define YYSTATE YY_START |
392 | | /* Action number for EOF rule of a given start state. */ |
393 | 0 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
394 | | /* Special action meaning "start processing a new file". */ |
395 | 0 | #define YY_NEW_FILE yyrestart( yyin , yyscanner ) |
396 | 0 | #define YY_END_OF_BUFFER_CHAR 0 |
397 | | |
398 | | /* Size of default input buffer. */ |
399 | | #ifndef YY_BUF_SIZE |
400 | | #ifdef __ia64__ |
401 | | /* On IA-64, the buffer size is 16k, not 8k. |
402 | | * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. |
403 | | * Ditto for the __ia64__ case accordingly. |
404 | | */ |
405 | | #define YY_BUF_SIZE 32768 |
406 | | #else |
407 | 0 | #define YY_BUF_SIZE 16384 |
408 | | #endif /* __ia64__ */ |
409 | | #endif |
410 | | |
411 | | /* The state buf must be large enough to hold one state per character in the main buffer. |
412 | | */ |
413 | | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
414 | | |
415 | | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
416 | | #define YY_TYPEDEF_YY_BUFFER_STATE |
417 | | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
418 | | #endif |
419 | | |
420 | | #ifndef YY_TYPEDEF_YY_SIZE_T |
421 | | #define YY_TYPEDEF_YY_SIZE_T |
422 | | typedef size_t yy_size_t; |
423 | | #endif |
424 | | |
425 | | /* %if-not-reentrant */ |
426 | | /* %endif */ |
427 | | |
428 | | /* %if-c-only */ |
429 | | /* %if-not-reentrant */ |
430 | | /* %endif */ |
431 | | /* %endif */ |
432 | | |
433 | 0 | #define EOB_ACT_CONTINUE_SCAN 0 |
434 | 0 | #define EOB_ACT_END_OF_FILE 1 |
435 | 0 | #define EOB_ACT_LAST_MATCH 2 |
436 | | |
437 | | /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires |
438 | | * access to the local variable yy_act. Since yyless() is a macro, it would break |
439 | | * existing scanners that call yyless() from OUTSIDE yylex. |
440 | | * One obvious solution it to make yy_act a global. I tried that, and saw |
441 | | * a 5% performance hit in a non-yylineno scanner, because yy_act is |
442 | | * normally declared as a register variable-- so it is not worth it. |
443 | | */ |
444 | | #define YY_LESS_LINENO(n) \ |
445 | | do { \ |
446 | | int yyl;\ |
447 | | for ( yyl = n; yyl < yyleng; ++yyl )\ |
448 | | if ( yytext[yyl] == '\n' )\ |
449 | | --yylineno;\ |
450 | | }while(0) |
451 | | #define YY_LINENO_REWIND_TO(dst) \ |
452 | | do {\ |
453 | | const char *p;\ |
454 | | for ( p = yy_cp-1; p >= (dst); --p)\ |
455 | | if ( *p == '\n' )\ |
456 | | --yylineno;\ |
457 | | }while(0) |
458 | | |
459 | | /* Return all but the first "n" matched characters back to the input stream. */ |
460 | | #define yyless(n) \ |
461 | | do \ |
462 | | { \ |
463 | | /* Undo effects of setting up yytext. */ \ |
464 | | int yyless_macro_arg = (n); \ |
465 | | YY_LESS_LINENO(yyless_macro_arg);\ |
466 | | *yy_cp = yyg->yy_hold_char; \ |
467 | | YY_RESTORE_YY_MORE_OFFSET \ |
468 | | yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ |
469 | | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
470 | | } \ |
471 | | while ( 0 ) |
472 | | #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) |
473 | | |
474 | | #ifndef YY_STRUCT_YY_BUFFER_STATE |
475 | | #define YY_STRUCT_YY_BUFFER_STATE |
476 | | struct yy_buffer_state |
477 | | { |
478 | | /* %if-c-only */ |
479 | | FILE *yy_input_file; |
480 | | /* %endif */ |
481 | | |
482 | | /* %if-c++-only */ |
483 | | /* %endif */ |
484 | | |
485 | | char *yy_ch_buf; /* input buffer */ |
486 | | char *yy_buf_pos; /* current position in input buffer */ |
487 | | |
488 | | /* Size of input buffer in bytes, not including room for EOB |
489 | | * characters. |
490 | | */ |
491 | | int yy_buf_size; |
492 | | |
493 | | /* Number of characters read into yy_ch_buf, not including EOB |
494 | | * characters. |
495 | | */ |
496 | | int yy_n_chars; |
497 | | |
498 | | /* Whether we "own" the buffer - i.e., we know we created it, |
499 | | * and can realloc() it to grow it, and should free() it to |
500 | | * delete it. |
501 | | */ |
502 | | int yy_is_our_buffer; |
503 | | |
504 | | /* Whether this is an "interactive" input source; if so, and |
505 | | * if we're using stdio for input, then we want to use getc() |
506 | | * instead of fread(), to make sure we stop fetching input after |
507 | | * each newline. |
508 | | */ |
509 | | int yy_is_interactive; |
510 | | |
511 | | /* Whether we're considered to be at the beginning of a line. |
512 | | * If so, '^' rules will be active on the next match, otherwise |
513 | | * not. |
514 | | */ |
515 | | int yy_at_bol; |
516 | | |
517 | | int yy_bs_lineno; /**< The line count. */ |
518 | | int yy_bs_column; /**< The column count. */ |
519 | | |
520 | | /* Whether to try to fill the input buffer when we reach the |
521 | | * end of it. |
522 | | */ |
523 | | int yy_fill_buffer; |
524 | | |
525 | | int yy_buffer_status; |
526 | | |
527 | 0 | #define YY_BUFFER_NEW 0 |
528 | 0 | #define YY_BUFFER_NORMAL 1 |
529 | | /* When an EOF's been seen but there's still some text to process |
530 | | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
531 | | * shouldn't try reading from the input source any more. We might |
532 | | * still have a bunch of tokens to match, though, because of |
533 | | * possible backing-up. |
534 | | * |
535 | | * When we actually see the EOF, we change the status to "new" |
536 | | * (via yyrestart()), so that the user can continue scanning by |
537 | | * just pointing yyin at a new input file. |
538 | | */ |
539 | 0 | #define YY_BUFFER_EOF_PENDING 2 |
540 | | |
541 | | }; |
542 | | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
543 | | |
544 | | /* %if-c-only Standard (non-C++) definition */ |
545 | | /* %not-for-header */ |
546 | | /* %if-not-reentrant */ |
547 | | /* %endif */ |
548 | | /* %ok-for-header */ |
549 | | |
550 | | /* %endif */ |
551 | | |
552 | | /* We provide macros for accessing buffer states in case in the |
553 | | * future we want to put the buffer states in a more general |
554 | | * "scanner state". |
555 | | * |
556 | | * Returns the top of the stack, or NULL. |
557 | | */ |
558 | 0 | #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ |
559 | 0 | ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ |
560 | 0 | : NULL) |
561 | | /* Same as previous macro, but useful when we know that the buffer stack is not |
562 | | * NULL or when we need an lvalue. For internal use only. |
563 | | */ |
564 | 0 | #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
565 | | |
566 | | /* %if-c-only Standard (non-C++) definition */ |
567 | | |
568 | | /* %if-not-reentrant */ |
569 | | /* %not-for-header */ |
570 | | /* %ok-for-header */ |
571 | | |
572 | | /* %endif */ |
573 | | |
574 | | void yyrestart ( FILE *input_file , yyscan_t yyscanner ); |
575 | | void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); |
576 | | YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); |
577 | | void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); |
578 | | void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); |
579 | | void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); |
580 | | void yypop_buffer_state ( yyscan_t yyscanner ); |
581 | | |
582 | | static void yyensure_buffer_stack ( yyscan_t yyscanner ); |
583 | | static void yy_load_buffer_state ( yyscan_t yyscanner ); |
584 | | static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); |
585 | | #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) |
586 | | |
587 | | YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); |
588 | | YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); |
589 | | YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); |
590 | | |
591 | | /* %endif */ |
592 | | |
593 | | void *yyalloc ( yy_size_t , yyscan_t yyscanner ); |
594 | | void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); |
595 | | void yyfree ( void * , yyscan_t yyscanner ); |
596 | | |
597 | | #define yy_new_buffer yy_create_buffer |
598 | | #define yy_set_interactive(is_interactive) \ |
599 | | { \ |
600 | | if ( ! YY_CURRENT_BUFFER ){ \ |
601 | | yyensure_buffer_stack (yyscanner); \ |
602 | | YY_CURRENT_BUFFER_LVALUE = \ |
603 | | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ |
604 | | } \ |
605 | | YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
606 | | } |
607 | | #define yy_set_bol(at_bol) \ |
608 | | { \ |
609 | | if ( ! YY_CURRENT_BUFFER ){\ |
610 | | yyensure_buffer_stack (yyscanner); \ |
611 | | YY_CURRENT_BUFFER_LVALUE = \ |
612 | | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ |
613 | | } \ |
614 | | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
615 | | } |
616 | | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
617 | | |
618 | | /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ |
619 | | /* Begin user sect3 */ |
620 | | |
621 | 0 | #define protobuf_lang_wrap(yyscanner) (/*CONSTCOND*/1) |
622 | | #define YY_SKIP_YYWRAP |
623 | | |
624 | | #define FLEX_DEBUG |
625 | | typedef flex_uint8_t YY_CHAR; |
626 | | |
627 | | typedef int yy_state_type; |
628 | | |
629 | 0 | #define yytext_ptr yytext_r |
630 | | |
631 | | /* %% [1.5] DFA */ |
632 | | |
633 | | /* %if-c-only Standard (non-C++) definition */ |
634 | | |
635 | | static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); |
636 | | static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); |
637 | | static int yy_get_next_buffer ( yyscan_t yyscanner ); |
638 | | static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); |
639 | | |
640 | | /* %endif */ |
641 | | |
642 | | /* Done after the current pattern has been matched and before the |
643 | | * corresponding action - sets up yytext. |
644 | | */ |
645 | | #define YY_DO_BEFORE_ACTION \ |
646 | 0 | yyg->yytext_ptr = yy_bp; \ |
647 | 0 | /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ |
648 | 0 | yyleng = (int) (yy_cp - yy_bp); \ |
649 | 0 | yyg->yy_hold_char = *yy_cp; \ |
650 | 0 | *yy_cp = '\0'; \ |
651 | 0 | /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ |
652 | 0 | yyg->yy_c_buf_p = yy_cp; |
653 | | /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ |
654 | | #define YY_NUM_RULES 71 |
655 | 0 | #define YY_END_OF_BUFFER 72 |
656 | | /* This struct is not used in this scanner, |
657 | | but its presence is necessary. */ |
658 | | struct yy_trans_info |
659 | | { |
660 | | flex_int32_t yy_verify; |
661 | | flex_int32_t yy_nxt; |
662 | | }; |
663 | | static const flex_int16_t yy_accept[187] = |
664 | | { 0, |
665 | | 0, 0, 0, 0, 72, 70, 69, 69, 22, 70, |
666 | | 28, 27, 21, 70, 1, 2, 16, 14, 32, 15, |
667 | | 31, 17, 59, 59, 33, 30, 34, 13, 35, 29, |
668 | | 62, 3, 4, 24, 62, 62, 62, 62, 62, 62, |
669 | | 62, 62, 62, 62, 5, 19, 6, 23, 68, 68, |
670 | | 68, 8, 0, 63, 0, 0, 20, 0, 64, 0, |
671 | | 12, 62, 66, 65, 60, 62, 59, 25, 11, 9, |
672 | | 7, 10, 26, 62, 62, 62, 62, 62, 62, 62, |
673 | | 62, 62, 62, 62, 62, 62, 62, 62, 62, 58, |
674 | | 62, 18, 68, 68, 67, 63, 64, 65, 61, 62, |
675 | | |
676 | | 62, 62, 62, 62, 47, 62, 62, 62, 62, 62, |
677 | | 62, 62, 62, 62, 55, 62, 62, 62, 62, 62, |
678 | | 49, 62, 62, 62, 62, 62, 62, 62, 62, 62, |
679 | | 62, 62, 62, 62, 62, 62, 39, 62, 62, 50, |
680 | | 62, 62, 46, 62, 62, 62, 62, 62, 62, 62, |
681 | | 62, 62, 62, 62, 51, 62, 38, 62, 42, 62, |
682 | | 40, 62, 62, 62, 62, 62, 56, 36, 37, 62, |
683 | | 53, 62, 41, 62, 62, 62, 57, 54, 62, 44, |
684 | | 45, 43, 48, 62, 52, 0 |
685 | | } ; |
686 | | |
687 | | static const YY_CHAR yy_ec[256] = |
688 | | { 0, |
689 | | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
690 | | 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, |
691 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
692 | | 1, 2, 5, 6, 1, 7, 8, 9, 10, 11, |
693 | | 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, |
694 | | 20, 20, 20, 20, 20, 21, 21, 22, 23, 24, |
695 | | 25, 26, 27, 1, 28, 28, 28, 28, 28, 28, |
696 | | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, |
697 | | 29, 29, 29, 29, 29, 29, 29, 30, 29, 29, |
698 | | 31, 32, 33, 34, 29, 1, 35, 36, 37, 38, |
699 | | |
700 | | 39, 40, 41, 29, 42, 29, 43, 44, 45, 46, |
701 | | 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
702 | | 57, 29, 58, 59, 60, 61, 1, 1, 1, 1, |
703 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
704 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
705 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
706 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
707 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
708 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
709 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
710 | | |
711 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
712 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
713 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
714 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
715 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
716 | | 1, 1, 1, 1, 1 |
717 | | } ; |
718 | | |
719 | | static const YY_CHAR yy_meta[62] = |
720 | | { 0, |
721 | | 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, |
722 | | 1, 1, 4, 5, 1, 5, 5, 1, 5, 5, |
723 | | 5, 1, 1, 1, 1, 1, 1, 5, 5, 5, |
724 | | 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, |
725 | | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
726 | | 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, |
727 | | 1 |
728 | | } ; |
729 | | |
730 | | static const flex_int16_t yy_base[193] = |
731 | | { 0, |
732 | | 0, 0, 59, 60, 253, 254, 254, 254, 227, 58, |
733 | | 254, 254, 242, 55, 254, 254, 254, 225, 254, 254, |
734 | | 0, 53, 50, 55, 254, 254, 53, 224, 56, 254, |
735 | | 0, 254, 254, 254, 45, 198, 202, 49, 46, 32, |
736 | | 47, 50, 199, 206, 254, 185, 254, 254, 240, 239, |
737 | | 223, 254, 87, 254, 90, 93, 254, 88, 254, 94, |
738 | | 254, 0, 254, 0, 89, 108, 91, 254, 254, 254, |
739 | | 254, 254, 254, 198, 186, 186, 190, 188, 187, 183, |
740 | | 194, 180, 194, 194, 65, 192, 178, 177, 180, 0, |
741 | | 190, 254, 221, 220, 254, 124, 105, 0, 0, 170, |
742 | | |
743 | | 176, 181, 166, 171, 0, 166, 169, 173, 171, 169, |
744 | | 173, 158, 171, 156, 0, 154, 168, 154, 162, 162, |
745 | | 0, 157, 154, 151, 165, 159, 151, 162, 154, 160, |
746 | | 152, 143, 142, 149, 155, 154, 0, 141, 67, 0, |
747 | | 135, 145, 0, 139, 143, 146, 130, 129, 124, 129, |
748 | | 131, 118, 99, 108, 0, 111, 0, 113, 116, 111, |
749 | | 0, 110, 103, 102, 89, 100, 0, 0, 0, 91, |
750 | | 0, 91, 0, 95, 94, 93, 0, 0, 78, 0, |
751 | | 0, 0, 0, 72, 0, 254, 156, 161, 166, 116, |
752 | | 171, 176 |
753 | | |
754 | | } ; |
755 | | |
756 | | static const flex_int16_t yy_def[193] = |
757 | | { 0, |
758 | | 186, 1, 187, 187, 186, 186, 186, 186, 186, 188, |
759 | | 186, 186, 186, 189, 186, 186, 186, 186, 186, 186, |
760 | | 190, 186, 190, 190, 186, 186, 186, 186, 186, 186, |
761 | | 190, 186, 186, 186, 190, 190, 190, 190, 190, 190, |
762 | | 190, 190, 190, 190, 186, 186, 186, 186, 191, 191, |
763 | | 186, 186, 188, 186, 188, 188, 186, 189, 186, 189, |
764 | | 186, 190, 186, 192, 190, 190, 190, 186, 186, 186, |
765 | | 186, 186, 186, 190, 190, 190, 190, 190, 190, 190, |
766 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
767 | | 190, 186, 191, 191, 186, 188, 189, 192, 66, 190, |
768 | | |
769 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
770 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
771 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
772 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
773 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
774 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
775 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
776 | | 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, |
777 | | 190, 190, 190, 190, 190, 0, 186, 186, 186, 186, |
778 | | 186, 186 |
779 | | |
780 | | } ; |
781 | | |
782 | | static const flex_int16_t yy_nxt[316] = |
783 | | { 0, |
784 | | 6, 7, 8, 7, 9, 10, 11, 12, 13, 14, |
785 | | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
786 | | 24, 25, 26, 27, 28, 29, 30, 31, 31, 31, |
787 | | 32, 6, 33, 34, 31, 31, 31, 31, 35, 31, |
788 | | 36, 37, 31, 31, 38, 31, 39, 40, 31, 41, |
789 | | 42, 43, 31, 31, 44, 31, 31, 45, 46, 47, |
790 | | 48, 50, 50, 54, 59, 63, 83, 55, 65, 65, |
791 | | 64, 51, 51, 67, 67, 67, 68, 69, 70, 66, |
792 | | 72, 73, 74, 79, 84, 85, 60, 80, 87, 56, |
793 | | 75, 81, 54, 82, 86, 54, 55, 59, 96, 55, |
794 | | |
795 | | 76, 88, 55, 97, 155, 66, 89, 65, 65, 67, |
796 | | 67, 67, 111, 112, 59, 113, 114, 156, 56, 60, |
797 | | 62, 56, 185, 184, 56, 60, 99, 99, 99, 54, |
798 | | 183, 182, 181, 55, 180, 99, 60, 179, 178, 177, |
799 | | 176, 175, 99, 99, 99, 99, 99, 99, 174, 173, |
800 | | 172, 171, 170, 169, 168, 56, 49, 49, 49, 49, |
801 | | 49, 53, 167, 53, 53, 53, 58, 166, 58, 58, |
802 | | 58, 93, 93, 93, 165, 93, 98, 164, 163, 98, |
803 | | 98, 162, 161, 160, 159, 158, 157, 154, 153, 152, |
804 | | 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, |
805 | | |
806 | | 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, |
807 | | 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, |
808 | | 121, 120, 94, 94, 119, 118, 117, 116, 115, 110, |
809 | | 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, |
810 | | 95, 94, 94, 92, 91, 90, 78, 77, 71, 61, |
811 | | 57, 52, 186, 5, 186, 186, 186, 186, 186, 186, |
812 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
813 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
814 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
815 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
816 | | |
817 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
818 | | 186, 186, 186, 186, 186 |
819 | | } ; |
820 | | |
821 | | static const flex_int16_t yy_chk[316] = |
822 | | { 0, |
823 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
824 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
825 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
826 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
827 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
828 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
829 | | 1, 3, 4, 10, 14, 22, 40, 10, 23, 23, |
830 | | 22, 3, 4, 24, 24, 24, 27, 27, 27, 23, |
831 | | 29, 29, 35, 38, 40, 41, 14, 38, 42, 10, |
832 | | 35, 39, 53, 39, 41, 55, 53, 58, 56, 55, |
833 | | |
834 | | 35, 42, 56, 60, 139, 23, 42, 65, 65, 67, |
835 | | 67, 67, 85, 85, 97, 85, 85, 139, 53, 58, |
836 | | 190, 55, 184, 179, 56, 60, 66, 66, 66, 96, |
837 | | 176, 175, 174, 96, 172, 66, 97, 170, 166, 165, |
838 | | 164, 163, 66, 66, 66, 66, 66, 66, 162, 160, |
839 | | 159, 158, 156, 154, 153, 96, 187, 187, 187, 187, |
840 | | 187, 188, 152, 188, 188, 188, 189, 151, 189, 189, |
841 | | 189, 191, 191, 191, 150, 191, 192, 149, 148, 192, |
842 | | 192, 147, 146, 145, 144, 142, 141, 138, 136, 135, |
843 | | 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, |
844 | | |
845 | | 124, 123, 122, 120, 119, 118, 117, 116, 114, 113, |
846 | | 112, 111, 110, 109, 108, 107, 106, 104, 103, 102, |
847 | | 101, 100, 94, 93, 91, 89, 88, 87, 86, 84, |
848 | | 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, |
849 | | 51, 50, 49, 46, 44, 43, 37, 36, 28, 18, |
850 | | 13, 9, 5, 186, 186, 186, 186, 186, 186, 186, |
851 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
852 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
853 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
854 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
855 | | |
856 | | 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, |
857 | | 186, 186, 186, 186, 186 |
858 | | } ; |
859 | | |
860 | | /* Table of booleans, true if rule could match eol. */ |
861 | | static const flex_int32_t yy_rule_can_match_eol[72] = |
862 | | { 0, |
863 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
864 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
865 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
866 | | 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, }; |
867 | | |
868 | | static const flex_int16_t yy_rule_linenum[71] = |
869 | | { 0, |
870 | | 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, |
871 | | 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, |
872 | | 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, |
873 | | 134, 135, 136, 137, 138, 141, 142, 143, 144, 145, |
874 | | 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, |
875 | | 156, 157, 158, 159, 160, 161, 162, 163, 166, 167, |
876 | | 168, 171, 172, 173, 176, 177, 178, 179, 182, 184 |
877 | | } ; |
878 | | |
879 | | /* The intent behind this definition is that it'll catch |
880 | | * any uses of REJECT which flex missed. |
881 | | */ |
882 | | #define REJECT reject_used_but_not_detected |
883 | | #define yymore() yymore_used_but_not_detected |
884 | 0 | #define YY_MORE_ADJ 0 |
885 | | #define YY_RESTORE_YY_MORE_OFFSET |
886 | | #line 1 "/src/wireshark/epan/protobuf_lang_scanner.l" |
887 | | |
888 | | /* |
889 | | * We want a reentrant scanner. |
890 | | */ |
891 | | /* |
892 | | * We don't read interactively from the terminal. |
893 | | */ |
894 | | /* |
895 | | * We want to stop processing when we get to the end of the input. |
896 | | */ |
897 | | /* |
898 | | * The type for the state we keep for the scanner (and parser). |
899 | | */ |
900 | | /* |
901 | | * Prefix scanner routines with "protobuf_lang_" rather than "yy", so this scanner |
902 | | * can coexist with other scanners. |
903 | | */ |
904 | | /* |
905 | | * We have to override the memory allocators so that we don't get |
906 | | * "unused argument" warnings from the yyscanner argument (which |
907 | | * we don't use, as we have a global memory allocator). |
908 | | * |
909 | | * We provide, as macros, our own versions of the routines generated by Flex, |
910 | | * which just call malloc()/realloc()/free() (as the Flex versions do), |
911 | | * discarding the extra argument. |
912 | | */ |
913 | | #define YY_NO_INPUT 1 |
914 | | #line 50 "/src/wireshark/epan/protobuf_lang_scanner.l" |
915 | | /* protobuf_lang_scanner.l |
916 | | * |
917 | | * C Protocol Buffers Language Lexer (for *.proto files) |
918 | | * Copyright 2020, Huang Qiangxiong <qiangxiong.huang@qq.com> |
919 | | * |
920 | | * SPDX-License-Identifier: GPL-2.0-or-later |
921 | | */ |
922 | | |
923 | | #include <stdio.h> |
924 | | #include <stdlib.h> |
925 | | #include <string.h> |
926 | | #include "protobuf_lang_tree.h" |
927 | | #include "protobuf_lang_parser.h" |
928 | | |
929 | | /* |
930 | | * Disable diagnostics in the code generated by Flex. |
931 | | */ |
932 | | DIAG_OFF_FLEX() |
933 | | |
934 | | /* |
935 | | * Sleazy hack to suppress compiler warnings in yy_fatal_error(). |
936 | | */ |
937 | 0 | #define YY_EXIT_FAILURE ((void)yyscanner, 2) |
938 | | |
939 | | /* |
940 | | * Macros for the allocators, to discard the extra argument. |
941 | | */ |
942 | 0 | #define protobuf_lang_alloc(size, yyscanner) (void *)malloc(size) |
943 | 0 | #define protobuf_lang_realloc(ptr, size, yyscanner) (void *)realloc((char *)(ptr), (size)) |
944 | 0 | #define protobuf_lang_free(ptr, yyscanner) free((char *)ptr) |
945 | | |
946 | | int old_status; |
947 | | |
948 | | /* Extended error handling function defined in protobuf_lang_grammar.lemon */ |
949 | | void pbl_parser_error(protobuf_lang_state_t *state, const char *fmt, ...); |
950 | | |
951 | | /* duplicate the text and keep the pointer in parser state for freeing later automatically */ |
952 | | static gchar* |
953 | | strdup_and_store(void* yyscanner, const char* text); |
954 | | |
955 | | #define PROTOBUF_LANG_PARSE(token_type) \ |
956 | 0 | protobuf_lang_get_extra(yyscanner)->tmp_token = g_new0(protobuf_lang_token_t, 1); \ |
957 | 0 | pbl_store_struct_token(protobuf_lang_get_extra(yyscanner), protobuf_lang_get_extra(yyscanner)->tmp_token); \ |
958 | 0 | protobuf_lang_get_extra(yyscanner)->tmp_token->v = strdup_and_store(yyscanner, yytext); \ |
959 | 0 | protobuf_lang_get_extra(yyscanner)->tmp_token->ln = protobuf_lang_get_lineno(yyscanner); \ |
960 | 0 | return (token_type); |
961 | | |
962 | | #line 963 "/work/build/epan/protobuf_lang_scanner.c" |
963 | | |
964 | | #line 965 "/work/build/epan/protobuf_lang_scanner.c" |
965 | | |
966 | | #define INITIAL 0 |
967 | 0 | #define COMMENT 1 |
968 | | |
969 | | #ifndef YY_NO_UNISTD_H |
970 | | /* Special case for "unistd.h", since it is non-ANSI. We include it way |
971 | | * down here because we want the user's section 1 to have been scanned first. |
972 | | * The user has a chance to override it with an option. |
973 | | */ |
974 | | /* %if-c-only */ |
975 | | #include <unistd.h> |
976 | | /* %endif */ |
977 | | /* %if-c++-only */ |
978 | | /* %endif */ |
979 | | #endif |
980 | | |
981 | | #define YY_EXTRA_TYPE protobuf_lang_state_t * |
982 | | |
983 | | /* %if-c-only Reentrant structure and macros (non-C++). */ |
984 | | /* %if-reentrant */ |
985 | | |
986 | | /* Holds the entire state of the reentrant scanner. */ |
987 | | struct yyguts_t |
988 | | { |
989 | | |
990 | | /* User-defined. Not touched by flex. */ |
991 | | YY_EXTRA_TYPE yyextra_r; |
992 | | |
993 | | /* The rest are the same as the globals declared in the non-reentrant scanner. */ |
994 | | FILE *yyin_r, *yyout_r; |
995 | | size_t yy_buffer_stack_top; /**< index of top of stack. */ |
996 | | size_t yy_buffer_stack_max; /**< capacity of stack. */ |
997 | | YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ |
998 | | char yy_hold_char; |
999 | | int yy_n_chars; |
1000 | | int yyleng_r; |
1001 | | char *yy_c_buf_p; |
1002 | | int yy_init; |
1003 | | int yy_start; |
1004 | | int yy_did_buffer_switch_on_eof; |
1005 | | int yy_start_stack_ptr; |
1006 | | int yy_start_stack_depth; |
1007 | | int *yy_start_stack; |
1008 | | yy_state_type yy_last_accepting_state; |
1009 | | char* yy_last_accepting_cpos; |
1010 | | |
1011 | | int yylineno_r; |
1012 | | int yy_flex_debug_r; |
1013 | | |
1014 | | char *yytext_r; |
1015 | | int yy_more_flag; |
1016 | | int yy_more_len; |
1017 | | |
1018 | | }; /* end struct yyguts_t */ |
1019 | | |
1020 | | /* %if-c-only */ |
1021 | | |
1022 | | static int yy_init_globals ( yyscan_t yyscanner ); |
1023 | | |
1024 | | /* %endif */ |
1025 | | |
1026 | | /* %if-reentrant */ |
1027 | | |
1028 | | int yylex_init (yyscan_t* scanner); |
1029 | | |
1030 | | int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); |
1031 | | |
1032 | | /* %endif */ |
1033 | | |
1034 | | /* %endif End reentrant structures and macros. */ |
1035 | | |
1036 | | /* Accessor methods to globals. |
1037 | | These are made visible to non-reentrant scanners for convenience. */ |
1038 | | |
1039 | | int yylex_destroy ( yyscan_t yyscanner ); |
1040 | | |
1041 | | int yyget_debug ( yyscan_t yyscanner ); |
1042 | | |
1043 | | void yyset_debug ( int debug_flag , yyscan_t yyscanner ); |
1044 | | |
1045 | | YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); |
1046 | | |
1047 | | void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); |
1048 | | |
1049 | | FILE *yyget_in ( yyscan_t yyscanner ); |
1050 | | |
1051 | | void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); |
1052 | | |
1053 | | FILE *yyget_out ( yyscan_t yyscanner ); |
1054 | | |
1055 | | void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); |
1056 | | |
1057 | | int yyget_leng ( yyscan_t yyscanner ); |
1058 | | |
1059 | | char *yyget_text ( yyscan_t yyscanner ); |
1060 | | |
1061 | | int yyget_lineno ( yyscan_t yyscanner ); |
1062 | | |
1063 | | void yyset_lineno ( int _line_number , yyscan_t yyscanner ); |
1064 | | |
1065 | | int yyget_column ( yyscan_t yyscanner ); |
1066 | | |
1067 | | void yyset_column ( int _column_no , yyscan_t yyscanner ); |
1068 | | |
1069 | | /* %if-bison-bridge */ |
1070 | | /* %endif */ |
1071 | | |
1072 | | /* Macros after this point can all be overridden by user definitions in |
1073 | | * section 1. |
1074 | | */ |
1075 | | |
1076 | | #ifndef YY_SKIP_YYWRAP |
1077 | | #ifdef __cplusplus |
1078 | | extern "C" int yywrap ( yyscan_t yyscanner ); |
1079 | | #else |
1080 | | extern int yywrap ( yyscan_t yyscanner ); |
1081 | | #endif |
1082 | | #endif |
1083 | | |
1084 | | /* %not-for-header */ |
1085 | | #ifndef YY_NO_UNPUT |
1086 | | |
1087 | | #endif |
1088 | | /* %ok-for-header */ |
1089 | | |
1090 | | /* %endif */ |
1091 | | |
1092 | | #ifndef yytext_ptr |
1093 | | static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); |
1094 | | #endif |
1095 | | |
1096 | | #ifdef YY_NEED_STRLEN |
1097 | | static int yy_flex_strlen ( const char * , yyscan_t yyscanner); |
1098 | | #endif |
1099 | | |
1100 | | #ifndef YY_NO_INPUT |
1101 | | /* %if-c-only Standard (non-C++) definition */ |
1102 | | /* %not-for-header */ |
1103 | | #ifdef __cplusplus |
1104 | | static int yyinput ( yyscan_t yyscanner ); |
1105 | | #else |
1106 | | static int input ( yyscan_t yyscanner ); |
1107 | | #endif |
1108 | | /* %ok-for-header */ |
1109 | | |
1110 | | /* %endif */ |
1111 | | #endif |
1112 | | |
1113 | | /* %if-c-only */ |
1114 | | |
1115 | | /* %endif */ |
1116 | | |
1117 | | /* Amount of stuff to slurp up with each read. */ |
1118 | | #ifndef YY_READ_BUF_SIZE |
1119 | | #ifdef __ia64__ |
1120 | | /* On IA-64, the buffer size is 16k, not 8k */ |
1121 | | #define YY_READ_BUF_SIZE 16384 |
1122 | | #else |
1123 | 0 | #define YY_READ_BUF_SIZE 8192 |
1124 | | #endif /* __ia64__ */ |
1125 | | #endif |
1126 | | |
1127 | | /* Copy whatever the last rule matched to the standard output. */ |
1128 | | #ifndef ECHO |
1129 | | /* %if-c-only Standard (non-C++) definition */ |
1130 | | /* This used to be an fputs(), but since the string might contain NUL's, |
1131 | | * we now use fwrite(). |
1132 | | */ |
1133 | 0 | #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) |
1134 | | /* %endif */ |
1135 | | /* %if-c++-only C++ definition */ |
1136 | | /* %endif */ |
1137 | | #endif |
1138 | | |
1139 | | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
1140 | | * is returned in "result". |
1141 | | */ |
1142 | | #ifndef YY_INPUT |
1143 | | #define YY_INPUT(buf,result,max_size) \ |
1144 | | /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ |
1145 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
1146 | 0 | { \ |
1147 | 0 | int c = '*'; \ |
1148 | 0 | int n; \ |
1149 | 0 | for ( n = 0; n < max_size && \ |
1150 | 0 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
1151 | 0 | buf[n] = (char) c; \ |
1152 | 0 | if ( c == '\n' ) \ |
1153 | 0 | buf[n++] = (char) c; \ |
1154 | 0 | if ( c == EOF && ferror( yyin ) ) \ |
1155 | 0 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
1156 | 0 | result = n; \ |
1157 | 0 | } \ |
1158 | 0 | else \ |
1159 | 0 | { \ |
1160 | 0 | errno=0; \ |
1161 | 0 | while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ |
1162 | 0 | { \ |
1163 | 0 | if( errno != EINTR) \ |
1164 | 0 | { \ |
1165 | 0 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
1166 | 0 | break; \ |
1167 | 0 | } \ |
1168 | 0 | errno=0; \ |
1169 | 0 | clearerr(yyin); \ |
1170 | 0 | } \ |
1171 | 0 | }\ |
1172 | | \ |
1173 | | /* %if-c++-only C++ definition \ */\ |
1174 | | /* %endif */ |
1175 | | |
1176 | | #endif |
1177 | | |
1178 | | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
1179 | | * we don't want an extra ';' after the "return" because that will cause |
1180 | | * some compilers to complain about unreachable statements. |
1181 | | */ |
1182 | | #ifndef yyterminate |
1183 | 0 | #define yyterminate() return YY_NULL |
1184 | | #endif |
1185 | | |
1186 | | /* Number of entries by which start-condition stack grows. */ |
1187 | | #ifndef YY_START_STACK_INCR |
1188 | | #define YY_START_STACK_INCR 25 |
1189 | | #endif |
1190 | | |
1191 | | /* Report a fatal error. */ |
1192 | | #ifndef YY_FATAL_ERROR |
1193 | | /* %if-c-only */ |
1194 | 0 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) |
1195 | | /* %endif */ |
1196 | | /* %if-c++-only */ |
1197 | | /* %endif */ |
1198 | | #endif |
1199 | | |
1200 | | /* %if-tables-serialization structures and prototypes */ |
1201 | | /* %not-for-header */ |
1202 | | /* %ok-for-header */ |
1203 | | |
1204 | | /* %not-for-header */ |
1205 | | /* %tables-yydmap generated elements */ |
1206 | | /* %endif */ |
1207 | | /* end tables serialization structures and prototypes */ |
1208 | | |
1209 | | /* %ok-for-header */ |
1210 | | |
1211 | | /* Default declaration of generated scanner - a define so the user can |
1212 | | * easily add parameters. |
1213 | | */ |
1214 | | #ifndef YY_DECL |
1215 | | #define YY_DECL_IS_OURS 1 |
1216 | | /* %if-c-only Standard (non-C++) definition */ |
1217 | | |
1218 | | extern int yylex (yyscan_t yyscanner); |
1219 | | |
1220 | | #define YY_DECL int yylex (yyscan_t yyscanner) |
1221 | | /* %endif */ |
1222 | | /* %if-c++-only C++ definition */ |
1223 | | /* %endif */ |
1224 | | #endif /* !YY_DECL */ |
1225 | | |
1226 | | /* Code executed at the beginning of each rule, after yytext and yyleng |
1227 | | * have been set up. |
1228 | | */ |
1229 | | #ifndef YY_USER_ACTION |
1230 | | #define YY_USER_ACTION |
1231 | | #endif |
1232 | | |
1233 | | /* Code executed at the end of each rule. */ |
1234 | | #ifndef YY_BREAK |
1235 | 0 | #define YY_BREAK /*LINTED*/break; |
1236 | | #endif |
1237 | | |
1238 | | /* %% [6.0] YY_RULE_SETUP definition goes here */ |
1239 | | #define YY_RULE_SETUP \ |
1240 | | YY_USER_ACTION |
1241 | | |
1242 | | /* %not-for-header */ |
1243 | | /** The main scanner function which does all the work. |
1244 | | */ |
1245 | | YY_DECL |
1246 | 0 | { |
1247 | 0 | yy_state_type yy_current_state; |
1248 | 0 | char *yy_cp, *yy_bp; |
1249 | 0 | int yy_act; |
1250 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
1251 | |
|
1252 | 0 | if ( !yyg->yy_init ) |
1253 | 0 | { |
1254 | 0 | yyg->yy_init = 1; |
1255 | |
|
1256 | | #ifdef YY_USER_INIT |
1257 | | YY_USER_INIT; |
1258 | | #endif |
1259 | |
|
1260 | 0 | if ( ! yyg->yy_start ) |
1261 | 0 | yyg->yy_start = 1; /* first start state */ |
1262 | |
|
1263 | 0 | if ( ! yyin ) |
1264 | | /* %if-c-only */ |
1265 | 0 | yyin = stdin; |
1266 | | /* %endif */ |
1267 | | /* %if-c++-only */ |
1268 | | /* %endif */ |
1269 | |
|
1270 | 0 | if ( ! yyout ) |
1271 | | /* %if-c-only */ |
1272 | 0 | yyout = stdout; |
1273 | | /* %endif */ |
1274 | | /* %if-c++-only */ |
1275 | | /* %endif */ |
1276 | |
|
1277 | 0 | if ( ! YY_CURRENT_BUFFER ) { |
1278 | 0 | yyensure_buffer_stack (yyscanner); |
1279 | 0 | YY_CURRENT_BUFFER_LVALUE = |
1280 | 0 | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
1281 | 0 | } |
1282 | |
|
1283 | 0 | yy_load_buffer_state( yyscanner ); |
1284 | 0 | } |
1285 | |
|
1286 | 0 | { |
1287 | | /* %% [7.0] user's declarations go here */ |
1288 | 0 | #line 101 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1289 | |
|
1290 | 0 | #line 103 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1291 | | /* operations or symbols (PT_ means PBL Token) */ |
1292 | 0 | #line 1293 "/work/build/epan/protobuf_lang_scanner.c" |
1293 | |
|
1294 | 0 | while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ |
1295 | 0 | { |
1296 | | /* %% [8.0] yymore()-related code goes here */ |
1297 | 0 | yy_cp = yyg->yy_c_buf_p; |
1298 | | |
1299 | | /* Support of yytext. */ |
1300 | 0 | *yy_cp = yyg->yy_hold_char; |
1301 | | |
1302 | | /* yy_bp points to the position in yy_ch_buf of the start of |
1303 | | * the current run. |
1304 | | */ |
1305 | 0 | yy_bp = yy_cp; |
1306 | | |
1307 | | /* %% [9.0] code to set up and find next match goes here */ |
1308 | 0 | yy_current_state = yyg->yy_start; |
1309 | 0 | yy_match: |
1310 | 0 | do |
1311 | 0 | { |
1312 | 0 | YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; |
1313 | 0 | if ( yy_accept[yy_current_state] ) |
1314 | 0 | { |
1315 | 0 | yyg->yy_last_accepting_state = yy_current_state; |
1316 | 0 | yyg->yy_last_accepting_cpos = yy_cp; |
1317 | 0 | } |
1318 | 0 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
1319 | 0 | { |
1320 | 0 | yy_current_state = (int) yy_def[yy_current_state]; |
1321 | 0 | if ( yy_current_state >= 187 ) |
1322 | 0 | yy_c = yy_meta[yy_c]; |
1323 | 0 | } |
1324 | 0 | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
1325 | 0 | ++yy_cp; |
1326 | 0 | } |
1327 | 0 | while ( yy_current_state != 186 ); |
1328 | 0 | yy_cp = yyg->yy_last_accepting_cpos; |
1329 | 0 | yy_current_state = yyg->yy_last_accepting_state; |
1330 | |
|
1331 | 0 | yy_find_action: |
1332 | | /* %% [10.0] code to find the action number goes here */ |
1333 | 0 | yy_act = yy_accept[yy_current_state]; |
1334 | |
|
1335 | 0 | YY_DO_BEFORE_ACTION; |
1336 | | |
1337 | | /* %% [11.0] code for yylineno update goes here */ |
1338 | |
|
1339 | 0 | if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) |
1340 | 0 | { |
1341 | 0 | int yyl; |
1342 | 0 | for ( yyl = 0; yyl < yyleng; ++yyl ) |
1343 | 0 | if ( yytext[yyl] == '\n' ) |
1344 | | |
1345 | 0 | do{ yylineno++; |
1346 | 0 | yycolumn=0; |
1347 | 0 | }while(0) |
1348 | 0 | ; |
1349 | 0 | } |
1350 | |
|
1351 | 0 | do_action: /* This label is used only to access EOF actions. */ |
1352 | | |
1353 | | /* %% [12.0] debug code goes here */ |
1354 | 0 | if ( yy_flex_debug ) |
1355 | 0 | { |
1356 | 0 | if ( yy_act == 0 ) |
1357 | 0 | fprintf( stderr, "--scanner backing up\n" ); |
1358 | 0 | else if ( yy_act < 71 ) |
1359 | 0 | fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", |
1360 | 0 | (long)yy_rule_linenum[yy_act], yytext ); |
1361 | 0 | else if ( yy_act == 71 ) |
1362 | 0 | fprintf( stderr, "--accepting default rule (\"%s\")\n", |
1363 | 0 | yytext ); |
1364 | 0 | else if ( yy_act == 72 ) |
1365 | 0 | fprintf( stderr, "--(end of buffer or a NUL)\n" ); |
1366 | 0 | else |
1367 | 0 | fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); |
1368 | 0 | } |
1369 | |
|
1370 | 0 | switch ( yy_act ) |
1371 | 0 | { /* beginning of action switch */ |
1372 | | /* %% [13.0] actions go here */ |
1373 | 0 | case 0: /* must back up */ |
1374 | | /* undo the effects of YY_DO_BEFORE_ACTION */ |
1375 | 0 | *yy_cp = yyg->yy_hold_char; |
1376 | 0 | yy_cp = yyg->yy_last_accepting_cpos; |
1377 | 0 | yy_current_state = yyg->yy_last_accepting_state; |
1378 | 0 | goto yy_find_action; |
1379 | | |
1380 | 0 | case 1: |
1381 | 0 | YY_RULE_SETUP |
1382 | 0 | #line 104 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1383 | 0 | PROTOBUF_LANG_PARSE(PT_LPAREN); |
1384 | 0 | YY_BREAK |
1385 | 0 | case 2: |
1386 | 0 | YY_RULE_SETUP |
1387 | 0 | #line 105 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1388 | 0 | PROTOBUF_LANG_PARSE(PT_RPAREN); |
1389 | 0 | YY_BREAK |
1390 | 0 | case 3: |
1391 | 0 | YY_RULE_SETUP |
1392 | 0 | #line 106 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1393 | 0 | PROTOBUF_LANG_PARSE(PT_LBRACKET); |
1394 | 0 | YY_BREAK |
1395 | 0 | case 4: |
1396 | 0 | YY_RULE_SETUP |
1397 | 0 | #line 107 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1398 | 0 | PROTOBUF_LANG_PARSE(PT_RBRACKET); |
1399 | 0 | YY_BREAK |
1400 | 0 | case 5: |
1401 | 0 | YY_RULE_SETUP |
1402 | 0 | #line 108 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1403 | 0 | PROTOBUF_LANG_PARSE(PT_LCURLY); |
1404 | 0 | YY_BREAK |
1405 | 0 | case 6: |
1406 | 0 | YY_RULE_SETUP |
1407 | 0 | #line 109 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1408 | 0 | PROTOBUF_LANG_PARSE(PT_RCURLY); |
1409 | 0 | YY_BREAK |
1410 | 0 | case 7: |
1411 | 0 | YY_RULE_SETUP |
1412 | 0 | #line 110 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1413 | 0 | PROTOBUF_LANG_PARSE(PT_EQUAL); |
1414 | 0 | YY_BREAK |
1415 | 0 | case 8: |
1416 | 0 | YY_RULE_SETUP |
1417 | 0 | #line 111 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1418 | 0 | PROTOBUF_LANG_PARSE(PT_NOTEQUAL); |
1419 | 0 | YY_BREAK |
1420 | 0 | case 9: |
1421 | 0 | YY_RULE_SETUP |
1422 | 0 | #line 112 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1423 | 0 | PROTOBUF_LANG_PARSE(PT_NOTEQUAL2); |
1424 | 0 | YY_BREAK |
1425 | 0 | case 10: |
1426 | 0 | YY_RULE_SETUP |
1427 | 0 | #line 113 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1428 | 0 | PROTOBUF_LANG_PARSE(PT_GEQUAL); |
1429 | 0 | YY_BREAK |
1430 | 0 | case 11: |
1431 | 0 | YY_RULE_SETUP |
1432 | 0 | #line 114 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1433 | 0 | PROTOBUF_LANG_PARSE(PT_LEQUAL); |
1434 | 0 | YY_BREAK |
1435 | 0 | case 12: |
1436 | 0 | YY_RULE_SETUP |
1437 | 0 | #line 115 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1438 | 0 | PROTOBUF_LANG_PARSE(PT_ASSIGN_PLUS); |
1439 | 0 | YY_BREAK |
1440 | 0 | case 13: |
1441 | 0 | YY_RULE_SETUP |
1442 | 0 | #line 116 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1443 | 0 | PROTOBUF_LANG_PARSE(PT_ASSIGN); |
1444 | 0 | YY_BREAK |
1445 | 0 | case 14: |
1446 | 0 | YY_RULE_SETUP |
1447 | 0 | #line 117 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1448 | 0 | PROTOBUF_LANG_PARSE(PT_PLUS); |
1449 | 0 | YY_BREAK |
1450 | 0 | case 15: |
1451 | 0 | YY_RULE_SETUP |
1452 | 0 | #line 118 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1453 | 0 | PROTOBUF_LANG_PARSE(PT_MINUS); |
1454 | 0 | YY_BREAK |
1455 | 0 | case 16: |
1456 | 0 | YY_RULE_SETUP |
1457 | 0 | #line 119 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1458 | 0 | PROTOBUF_LANG_PARSE(PT_MULTIPLY); |
1459 | 0 | YY_BREAK |
1460 | 0 | case 17: |
1461 | 0 | YY_RULE_SETUP |
1462 | 0 | #line 120 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1463 | 0 | PROTOBUF_LANG_PARSE(PT_DIV); |
1464 | 0 | YY_BREAK |
1465 | 0 | case 18: |
1466 | 0 | YY_RULE_SETUP |
1467 | 0 | #line 121 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1468 | 0 | PROTOBUF_LANG_PARSE(PT_LOGIC_OR); |
1469 | 0 | YY_BREAK |
1470 | 0 | case 19: |
1471 | 0 | YY_RULE_SETUP |
1472 | 0 | #line 122 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1473 | 0 | PROTOBUF_LANG_PARSE(PT_OR); |
1474 | 0 | YY_BREAK |
1475 | 0 | case 20: |
1476 | 0 | YY_RULE_SETUP |
1477 | 0 | #line 123 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1478 | 0 | PROTOBUF_LANG_PARSE(PT_LOGIC_AND); |
1479 | 0 | YY_BREAK |
1480 | 0 | case 21: |
1481 | 0 | YY_RULE_SETUP |
1482 | 0 | #line 124 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1483 | 0 | PROTOBUF_LANG_PARSE(PT_AND); |
1484 | 0 | YY_BREAK |
1485 | 0 | case 22: |
1486 | 0 | YY_RULE_SETUP |
1487 | 0 | #line 125 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1488 | 0 | PROTOBUF_LANG_PARSE(PT_NOT); |
1489 | 0 | YY_BREAK |
1490 | 0 | case 23: |
1491 | 0 | YY_RULE_SETUP |
1492 | 0 | #line 126 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1493 | 0 | PROTOBUF_LANG_PARSE(PT_NEG); |
1494 | 0 | YY_BREAK |
1495 | 0 | case 24: |
1496 | 0 | YY_RULE_SETUP |
1497 | 0 | #line 127 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1498 | 0 | PROTOBUF_LANG_PARSE(PT_XOR); |
1499 | 0 | YY_BREAK |
1500 | 0 | case 25: |
1501 | 0 | YY_RULE_SETUP |
1502 | 0 | #line 128 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1503 | 0 | PROTOBUF_LANG_PARSE(PT_SHL); |
1504 | 0 | YY_BREAK |
1505 | 0 | case 26: |
1506 | 0 | YY_RULE_SETUP |
1507 | 0 | #line 129 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1508 | 0 | PROTOBUF_LANG_PARSE(PT_SHR); |
1509 | 0 | YY_BREAK |
1510 | 0 | case 27: |
1511 | 0 | YY_RULE_SETUP |
1512 | 0 | #line 130 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1513 | 0 | PROTOBUF_LANG_PARSE(PT_PERCENT); |
1514 | 0 | YY_BREAK |
1515 | 0 | case 28: |
1516 | 0 | YY_RULE_SETUP |
1517 | 0 | #line 131 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1518 | 0 | PROTOBUF_LANG_PARSE(PT_DOLLAR); |
1519 | 0 | YY_BREAK |
1520 | 0 | case 29: |
1521 | 0 | YY_RULE_SETUP |
1522 | 0 | #line 132 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1523 | 0 | PROTOBUF_LANG_PARSE(PT_COND); |
1524 | 0 | YY_BREAK |
1525 | 0 | case 30: |
1526 | 0 | YY_RULE_SETUP |
1527 | 0 | #line 133 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1528 | 0 | PROTOBUF_LANG_PARSE(PT_SEMICOLON); |
1529 | 0 | YY_BREAK |
1530 | 0 | case 31: |
1531 | 0 | YY_RULE_SETUP |
1532 | 0 | #line 134 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1533 | 0 | PROTOBUF_LANG_PARSE(PT_DOT); |
1534 | 0 | YY_BREAK |
1535 | 0 | case 32: |
1536 | 0 | YY_RULE_SETUP |
1537 | 0 | #line 135 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1538 | 0 | PROTOBUF_LANG_PARSE(PT_COMMA); |
1539 | 0 | YY_BREAK |
1540 | 0 | case 33: |
1541 | 0 | YY_RULE_SETUP |
1542 | 0 | #line 136 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1543 | 0 | PROTOBUF_LANG_PARSE(PT_COLON); |
1544 | 0 | YY_BREAK |
1545 | 0 | case 34: |
1546 | 0 | YY_RULE_SETUP |
1547 | 0 | #line 137 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1548 | 0 | PROTOBUF_LANG_PARSE(PT_LESS); |
1549 | 0 | YY_BREAK |
1550 | 0 | case 35: |
1551 | 0 | YY_RULE_SETUP |
1552 | 0 | #line 138 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1553 | 0 | PROTOBUF_LANG_PARSE(PT_GREATER); |
1554 | 0 | YY_BREAK |
1555 | | /* key words */ |
1556 | 0 | case 36: |
1557 | 0 | YY_RULE_SETUP |
1558 | 0 | #line 141 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1559 | 0 | PROTOBUF_LANG_PARSE(PT_SYNTAX); |
1560 | 0 | YY_BREAK |
1561 | 0 | case 37: |
1562 | 0 | YY_RULE_SETUP |
1563 | 0 | #line 142 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1564 | 0 | PROTOBUF_LANG_PARSE(PT_EDITION); |
1565 | 0 | YY_BREAK |
1566 | 0 | case 38: |
1567 | 0 | YY_RULE_SETUP |
1568 | 0 | #line 143 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1569 | 0 | PROTOBUF_LANG_PARSE(PT_IMPORT); |
1570 | 0 | YY_BREAK |
1571 | 0 | case 39: |
1572 | 0 | YY_RULE_SETUP |
1573 | 0 | #line 144 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1574 | 0 | PROTOBUF_LANG_PARSE(PT_WEAK); |
1575 | 0 | YY_BREAK |
1576 | 0 | case 40: |
1577 | 0 | YY_RULE_SETUP |
1578 | 0 | #line 145 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1579 | 0 | PROTOBUF_LANG_PARSE(PT_PUBLIC); |
1580 | 0 | YY_BREAK |
1581 | 0 | case 41: |
1582 | 0 | YY_RULE_SETUP |
1583 | 0 | #line 146 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1584 | 0 | PROTOBUF_LANG_PARSE(PT_PACKAGE); |
1585 | 0 | YY_BREAK |
1586 | 0 | case 42: |
1587 | 0 | YY_RULE_SETUP |
1588 | 0 | #line 147 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1589 | 0 | PROTOBUF_LANG_PARSE(PT_OPTION); |
1590 | 0 | YY_BREAK |
1591 | 0 | case 43: |
1592 | 0 | YY_RULE_SETUP |
1593 | 0 | #line 148 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1594 | 0 | PROTOBUF_LANG_PARSE(PT_REQUIRED); |
1595 | 0 | YY_BREAK |
1596 | 0 | case 44: |
1597 | 0 | YY_RULE_SETUP |
1598 | 0 | #line 149 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1599 | 0 | PROTOBUF_LANG_PARSE(PT_OPTIONAL); |
1600 | 0 | YY_BREAK |
1601 | 0 | case 45: |
1602 | 0 | YY_RULE_SETUP |
1603 | 0 | #line 150 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1604 | 0 | PROTOBUF_LANG_PARSE(PT_REPEATED); |
1605 | 0 | YY_BREAK |
1606 | 0 | case 46: |
1607 | 0 | YY_RULE_SETUP |
1608 | 0 | #line 151 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1609 | 0 | PROTOBUF_LANG_PARSE(PT_ONEOF); |
1610 | 0 | YY_BREAK |
1611 | 0 | case 47: |
1612 | 0 | YY_RULE_SETUP |
1613 | 0 | #line 152 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1614 | 0 | PROTOBUF_LANG_PARSE(PT_MAP); |
1615 | 0 | YY_BREAK |
1616 | 0 | case 48: |
1617 | 0 | YY_RULE_SETUP |
1618 | 0 | #line 153 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1619 | 0 | PROTOBUF_LANG_PARSE(PT_RESERVED); |
1620 | 0 | YY_BREAK |
1621 | 0 | case 49: |
1622 | 0 | YY_RULE_SETUP |
1623 | 0 | #line 154 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1624 | 0 | PROTOBUF_LANG_PARSE(PT_ENUM); |
1625 | 0 | YY_BREAK |
1626 | 0 | case 50: |
1627 | 0 | YY_RULE_SETUP |
1628 | 0 | #line 155 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1629 | 0 | PROTOBUF_LANG_PARSE(PT_GROUP); |
1630 | 0 | YY_BREAK |
1631 | 0 | case 51: |
1632 | 0 | YY_RULE_SETUP |
1633 | 0 | #line 156 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1634 | 0 | PROTOBUF_LANG_PARSE(PT_EXTEND); |
1635 | 0 | YY_BREAK |
1636 | 0 | case 52: |
1637 | 0 | YY_RULE_SETUP |
1638 | 0 | #line 157 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1639 | 0 | PROTOBUF_LANG_PARSE(PT_EXTENSIONS); |
1640 | 0 | YY_BREAK |
1641 | 0 | case 53: |
1642 | 0 | YY_RULE_SETUP |
1643 | 0 | #line 158 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1644 | 0 | PROTOBUF_LANG_PARSE(PT_MESSAGE); |
1645 | 0 | YY_BREAK |
1646 | 0 | case 54: |
1647 | 0 | YY_RULE_SETUP |
1648 | 0 | #line 159 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1649 | 0 | PROTOBUF_LANG_PARSE(PT_SERVICE); |
1650 | 0 | YY_BREAK |
1651 | 0 | case 55: |
1652 | 0 | YY_RULE_SETUP |
1653 | 0 | #line 160 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1654 | 0 | PROTOBUF_LANG_PARSE(PT_RPC); |
1655 | 0 | YY_BREAK |
1656 | 0 | case 56: |
1657 | 0 | YY_RULE_SETUP |
1658 | 0 | #line 161 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1659 | 0 | PROTOBUF_LANG_PARSE(PT_STREAM); |
1660 | 0 | YY_BREAK |
1661 | 0 | case 57: |
1662 | 0 | YY_RULE_SETUP |
1663 | 0 | #line 162 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1664 | 0 | PROTOBUF_LANG_PARSE(PT_RETURNS); |
1665 | 0 | YY_BREAK |
1666 | 0 | case 58: |
1667 | 0 | YY_RULE_SETUP |
1668 | 0 | #line 163 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1669 | 0 | PROTOBUF_LANG_PARSE(PT_TO); |
1670 | 0 | YY_BREAK |
1671 | | /* intLit values */ |
1672 | 0 | case 59: |
1673 | 0 | YY_RULE_SETUP |
1674 | 0 | #line 166 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1675 | 0 | PROTOBUF_LANG_PARSE(PT_DECIMALLIT); |
1676 | 0 | YY_BREAK |
1677 | 0 | case 60: |
1678 | 0 | YY_RULE_SETUP |
1679 | 0 | #line 167 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1680 | 0 | PROTOBUF_LANG_PARSE(PT_OCTALLIT); |
1681 | 0 | YY_BREAK |
1682 | 0 | case 61: |
1683 | 0 | YY_RULE_SETUP |
1684 | 0 | #line 168 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1685 | 0 | PROTOBUF_LANG_PARSE(PT_HEXLIT); |
1686 | 0 | YY_BREAK |
1687 | | /* Using extended identifier because we care only about position */ |
1688 | 0 | case 62: |
1689 | 0 | YY_RULE_SETUP |
1690 | 0 | #line 171 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1691 | 0 | PROTOBUF_LANG_PARSE(PT_IDENT); |
1692 | 0 | YY_BREAK |
1693 | 0 | case 63: |
1694 | 0 | YY_RULE_SETUP |
1695 | 0 | #line 172 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1696 | 0 | PROTOBUF_LANG_PARSE(PT_STRLIT); |
1697 | 0 | YY_BREAK |
1698 | 0 | case 64: |
1699 | 0 | YY_RULE_SETUP |
1700 | 0 | #line 173 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1701 | 0 | PROTOBUF_LANG_PARSE(PT_STRLIT); |
1702 | 0 | YY_BREAK |
1703 | | /* comments */ |
1704 | 0 | case 65: |
1705 | 0 | YY_RULE_SETUP |
1706 | 0 | #line 176 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1707 | |
|
1708 | 0 | YY_BREAK |
1709 | 0 | case 66: |
1710 | 0 | YY_RULE_SETUP |
1711 | 0 | #line 177 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1712 | 0 | { old_status = YY_START; BEGIN COMMENT; } |
1713 | 0 | YY_BREAK |
1714 | 0 | case 67: |
1715 | 0 | YY_RULE_SETUP |
1716 | 0 | #line 178 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1717 | 0 | { BEGIN old_status; } |
1718 | 0 | YY_BREAK |
1719 | 0 | case 68: |
1720 | | /* rule 68 can match eol */ |
1721 | 0 | YY_RULE_SETUP |
1722 | 0 | #line 179 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1723 | |
|
1724 | 0 | YY_BREAK |
1725 | | /* space & tab */ |
1726 | 0 | case 69: |
1727 | | /* rule 69 can match eol */ |
1728 | 0 | YY_RULE_SETUP |
1729 | 0 | #line 182 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1730 | |
|
1731 | 0 | YY_BREAK |
1732 | | /* prevent flex jam */ |
1733 | 0 | case 70: |
1734 | 0 | YY_RULE_SETUP |
1735 | 0 | #line 184 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1736 | 0 | { pbl_parser_error(protobuf_lang_get_extra(yyscanner), "unexpected token in proto file!\n"); } |
1737 | 0 | YY_BREAK |
1738 | 0 | case 71: |
1739 | 0 | YY_RULE_SETUP |
1740 | 0 | #line 186 "/src/wireshark/epan/protobuf_lang_scanner.l" |
1741 | 0 | ECHO; |
1742 | 0 | YY_BREAK |
1743 | 0 | #line 1744 "/work/build/epan/protobuf_lang_scanner.c" |
1744 | 0 | case YY_STATE_EOF(INITIAL): |
1745 | 0 | case YY_STATE_EOF(COMMENT): |
1746 | 0 | yyterminate(); |
1747 | | |
1748 | 0 | case YY_END_OF_BUFFER: |
1749 | 0 | { |
1750 | | /* Amount of text matched not including the EOB char. */ |
1751 | 0 | int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; |
1752 | | |
1753 | | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
1754 | 0 | *yy_cp = yyg->yy_hold_char; |
1755 | 0 | YY_RESTORE_YY_MORE_OFFSET |
1756 | |
|
1757 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) |
1758 | 0 | { |
1759 | | /* We're scanning a new file or input source. It's |
1760 | | * possible that this happened because the user |
1761 | | * just pointed yyin at a new source and called |
1762 | | * yylex(). If so, then we have to assure |
1763 | | * consistency between YY_CURRENT_BUFFER and our |
1764 | | * globals. Here is the right place to do so, because |
1765 | | * this is the first action (other than possibly a |
1766 | | * back-up) that will match for the new input source. |
1767 | | */ |
1768 | 0 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
1769 | | /* %if-c-only */ |
1770 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; |
1771 | | /* %endif */ |
1772 | | /* %if-c++-only */ |
1773 | | /* %endif */ |
1774 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; |
1775 | 0 | } |
1776 | | |
1777 | | /* Note that here we test for yy_c_buf_p "<=" to the position |
1778 | | * of the first EOB in the buffer, since yy_c_buf_p will |
1779 | | * already have been incremented past the NUL character |
1780 | | * (since all states make transitions on EOB to the |
1781 | | * end-of-buffer state). Contrast this with the test |
1782 | | * in input(). |
1783 | | */ |
1784 | 0 | if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) |
1785 | 0 | { /* This was really a NUL. */ |
1786 | 0 | yy_state_type yy_next_state; |
1787 | |
|
1788 | 0 | yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; |
1789 | |
|
1790 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
1791 | | |
1792 | | /* Okay, we're now positioned to make the NUL |
1793 | | * transition. We couldn't have |
1794 | | * yy_get_previous_state() go ahead and do it |
1795 | | * for us because it doesn't know how to deal |
1796 | | * with the possibility of jamming (and we don't |
1797 | | * want to build jamming into it because then it |
1798 | | * will run more slowly). |
1799 | | */ |
1800 | |
|
1801 | 0 | yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); |
1802 | |
|
1803 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
1804 | |
|
1805 | 0 | if ( yy_next_state ) |
1806 | 0 | { |
1807 | | /* Consume the NUL. */ |
1808 | 0 | yy_cp = ++yyg->yy_c_buf_p; |
1809 | 0 | yy_current_state = yy_next_state; |
1810 | 0 | goto yy_match; |
1811 | 0 | } |
1812 | | |
1813 | 0 | else |
1814 | 0 | { |
1815 | | /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ |
1816 | 0 | yy_cp = yyg->yy_last_accepting_cpos; |
1817 | 0 | yy_current_state = yyg->yy_last_accepting_state; |
1818 | 0 | goto yy_find_action; |
1819 | 0 | } |
1820 | 0 | } |
1821 | | |
1822 | 0 | else switch ( yy_get_next_buffer( yyscanner ) ) |
1823 | 0 | { |
1824 | 0 | case EOB_ACT_END_OF_FILE: |
1825 | 0 | { |
1826 | 0 | yyg->yy_did_buffer_switch_on_eof = 0; |
1827 | |
|
1828 | 0 | if ( yywrap( yyscanner ) ) |
1829 | 0 | { |
1830 | | /* Note: because we've taken care in |
1831 | | * yy_get_next_buffer() to have set up |
1832 | | * yytext, we can now set up |
1833 | | * yy_c_buf_p so that if some total |
1834 | | * hoser (like flex itself) wants to |
1835 | | * call the scanner after we return the |
1836 | | * YY_NULL, it'll still work - another |
1837 | | * YY_NULL will get returned. |
1838 | | */ |
1839 | 0 | yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; |
1840 | |
|
1841 | 0 | yy_act = YY_STATE_EOF(YY_START); |
1842 | 0 | goto do_action; |
1843 | 0 | } |
1844 | | |
1845 | 0 | else |
1846 | 0 | { |
1847 | 0 | if ( ! yyg->yy_did_buffer_switch_on_eof ) |
1848 | 0 | YY_NEW_FILE; |
1849 | 0 | } |
1850 | 0 | break; |
1851 | 0 | } |
1852 | | |
1853 | 0 | case EOB_ACT_CONTINUE_SCAN: |
1854 | 0 | yyg->yy_c_buf_p = |
1855 | 0 | yyg->yytext_ptr + yy_amount_of_matched_text; |
1856 | |
|
1857 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
1858 | |
|
1859 | 0 | yy_cp = yyg->yy_c_buf_p; |
1860 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
1861 | 0 | goto yy_match; |
1862 | | |
1863 | 0 | case EOB_ACT_LAST_MATCH: |
1864 | 0 | yyg->yy_c_buf_p = |
1865 | 0 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; |
1866 | |
|
1867 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
1868 | |
|
1869 | 0 | yy_cp = yyg->yy_c_buf_p; |
1870 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
1871 | 0 | goto yy_find_action; |
1872 | 0 | } |
1873 | 0 | break; |
1874 | 0 | } |
1875 | | |
1876 | 0 | default: |
1877 | 0 | YY_FATAL_ERROR( |
1878 | 0 | "fatal flex scanner internal error--no action found" ); |
1879 | 0 | } /* end of action switch */ |
1880 | 0 | } /* end of scanning one token */ |
1881 | 0 | } /* end of user's declarations */ |
1882 | 0 | } /* end of yylex */ |
1883 | | /* %ok-for-header */ |
1884 | | |
1885 | | /* %if-c++-only */ |
1886 | | /* %not-for-header */ |
1887 | | /* %ok-for-header */ |
1888 | | |
1889 | | /* %endif */ |
1890 | | |
1891 | | /* yy_get_next_buffer - try to read in a new buffer |
1892 | | * |
1893 | | * Returns a code representing an action: |
1894 | | * EOB_ACT_LAST_MATCH - |
1895 | | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
1896 | | * EOB_ACT_END_OF_FILE - end of file |
1897 | | */ |
1898 | | /* %if-c-only */ |
1899 | | static int yy_get_next_buffer (yyscan_t yyscanner) |
1900 | | /* %endif */ |
1901 | | /* %if-c++-only */ |
1902 | | /* %endif */ |
1903 | 0 | { |
1904 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
1905 | 0 | char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
1906 | 0 | char *source = yyg->yytext_ptr; |
1907 | 0 | int number_to_move, i; |
1908 | 0 | int ret_val; |
1909 | |
|
1910 | 0 | if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) |
1911 | 0 | YY_FATAL_ERROR( |
1912 | 0 | "fatal flex scanner internal error--end of buffer missed" ); |
1913 | | |
1914 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) |
1915 | 0 | { /* Don't try to fill the buffer, so this is an EOF. */ |
1916 | 0 | if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) |
1917 | 0 | { |
1918 | | /* We matched a single character, the EOB, so |
1919 | | * treat this as a final EOF. |
1920 | | */ |
1921 | 0 | return EOB_ACT_END_OF_FILE; |
1922 | 0 | } |
1923 | | |
1924 | 0 | else |
1925 | 0 | { |
1926 | | /* We matched some text prior to the EOB, first |
1927 | | * process it. |
1928 | | */ |
1929 | 0 | return EOB_ACT_LAST_MATCH; |
1930 | 0 | } |
1931 | 0 | } |
1932 | | |
1933 | | /* Try to read more data. */ |
1934 | | |
1935 | | /* First move last chars to start of buffer. */ |
1936 | 0 | number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); |
1937 | |
|
1938 | 0 | for ( i = 0; i < number_to_move; ++i ) |
1939 | 0 | *(dest++) = *(source++); |
1940 | |
|
1941 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
1942 | | /* don't do the read, it's not guaranteed to return an EOF, |
1943 | | * just force an EOF |
1944 | | */ |
1945 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; |
1946 | | |
1947 | 0 | else |
1948 | 0 | { |
1949 | 0 | int num_to_read = |
1950 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
1951 | |
|
1952 | 0 | while ( num_to_read <= 0 ) |
1953 | 0 | { /* Not enough room in the buffer - grow it. */ |
1954 | | |
1955 | | /* just a shorter name for the current buffer */ |
1956 | 0 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
1957 | |
|
1958 | 0 | int yy_c_buf_p_offset = |
1959 | 0 | (int) (yyg->yy_c_buf_p - b->yy_ch_buf); |
1960 | |
|
1961 | 0 | if ( b->yy_is_our_buffer ) |
1962 | 0 | { |
1963 | 0 | int new_size = b->yy_buf_size * 2; |
1964 | |
|
1965 | 0 | if ( new_size <= 0 ) |
1966 | 0 | b->yy_buf_size += b->yy_buf_size / 8; |
1967 | 0 | else |
1968 | 0 | b->yy_buf_size *= 2; |
1969 | |
|
1970 | 0 | b->yy_ch_buf = (char *) |
1971 | | /* Include room in for 2 EOB chars. */ |
1972 | 0 | yyrealloc( (void *) b->yy_ch_buf, |
1973 | 0 | (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
1974 | 0 | } |
1975 | 0 | else |
1976 | | /* Can't grow it, we don't own it. */ |
1977 | 0 | b->yy_ch_buf = NULL; |
1978 | |
|
1979 | 0 | if ( ! b->yy_ch_buf ) |
1980 | 0 | YY_FATAL_ERROR( |
1981 | 0 | "fatal error - scanner input buffer overflow" ); |
1982 | | |
1983 | 0 | yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
1984 | |
|
1985 | 0 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - |
1986 | 0 | number_to_move - 1; |
1987 | |
|
1988 | 0 | } |
1989 | | |
1990 | 0 | if ( num_to_read > YY_READ_BUF_SIZE ) |
1991 | 0 | num_to_read = YY_READ_BUF_SIZE; |
1992 | | |
1993 | | /* Read in more data. */ |
1994 | 0 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), |
1995 | 0 | yyg->yy_n_chars, num_to_read ); |
1996 | |
|
1997 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
1998 | 0 | } |
1999 | | |
2000 | 0 | if ( yyg->yy_n_chars == 0 ) |
2001 | 0 | { |
2002 | 0 | if ( number_to_move == YY_MORE_ADJ ) |
2003 | 0 | { |
2004 | 0 | ret_val = EOB_ACT_END_OF_FILE; |
2005 | 0 | yyrestart( yyin , yyscanner); |
2006 | 0 | } |
2007 | | |
2008 | 0 | else |
2009 | 0 | { |
2010 | 0 | ret_val = EOB_ACT_LAST_MATCH; |
2011 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = |
2012 | 0 | YY_BUFFER_EOF_PENDING; |
2013 | 0 | } |
2014 | 0 | } |
2015 | | |
2016 | 0 | else |
2017 | 0 | ret_val = EOB_ACT_CONTINUE_SCAN; |
2018 | |
|
2019 | 0 | if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
2020 | | /* Extend the array by 50%, plus the number we really need. */ |
2021 | 0 | int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); |
2022 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( |
2023 | 0 | (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); |
2024 | 0 | if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
2025 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); |
2026 | | /* "- 2" to take care of EOB's */ |
2027 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); |
2028 | 0 | } |
2029 | | |
2030 | 0 | yyg->yy_n_chars += number_to_move; |
2031 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
2032 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
2033 | |
|
2034 | 0 | yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
2035 | |
|
2036 | 0 | return ret_val; |
2037 | 0 | } |
2038 | | |
2039 | | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
2040 | | |
2041 | | /* %if-c-only */ |
2042 | | /* %not-for-header */ |
2043 | | static yy_state_type yy_get_previous_state (yyscan_t yyscanner) |
2044 | | /* %endif */ |
2045 | | /* %if-c++-only */ |
2046 | | /* %endif */ |
2047 | 0 | { |
2048 | 0 | yy_state_type yy_current_state; |
2049 | 0 | char *yy_cp; |
2050 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2051 | | |
2052 | | /* %% [15.0] code to get the start state into yy_current_state goes here */ |
2053 | 0 | yy_current_state = yyg->yy_start; |
2054 | |
|
2055 | 0 | for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) |
2056 | 0 | { |
2057 | | /* %% [16.0] code to find the next state goes here */ |
2058 | 0 | YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
2059 | 0 | if ( yy_accept[yy_current_state] ) |
2060 | 0 | { |
2061 | 0 | yyg->yy_last_accepting_state = yy_current_state; |
2062 | 0 | yyg->yy_last_accepting_cpos = yy_cp; |
2063 | 0 | } |
2064 | 0 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
2065 | 0 | { |
2066 | 0 | yy_current_state = (int) yy_def[yy_current_state]; |
2067 | 0 | if ( yy_current_state >= 187 ) |
2068 | 0 | yy_c = yy_meta[yy_c]; |
2069 | 0 | } |
2070 | 0 | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
2071 | 0 | } |
2072 | |
|
2073 | 0 | return yy_current_state; |
2074 | 0 | } |
2075 | | |
2076 | | /* yy_try_NUL_trans - try to make a transition on the NUL character |
2077 | | * |
2078 | | * synopsis |
2079 | | * next_state = yy_try_NUL_trans( current_state ); |
2080 | | */ |
2081 | | /* %if-c-only */ |
2082 | | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) |
2083 | | /* %endif */ |
2084 | | /* %if-c++-only */ |
2085 | | /* %endif */ |
2086 | 0 | { |
2087 | 0 | int yy_is_jam; |
2088 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ |
2089 | | /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ |
2090 | 0 | char *yy_cp = yyg->yy_c_buf_p; |
2091 | |
|
2092 | 0 | YY_CHAR yy_c = 1; |
2093 | 0 | if ( yy_accept[yy_current_state] ) |
2094 | 0 | { |
2095 | 0 | yyg->yy_last_accepting_state = yy_current_state; |
2096 | 0 | yyg->yy_last_accepting_cpos = yy_cp; |
2097 | 0 | } |
2098 | 0 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
2099 | 0 | { |
2100 | 0 | yy_current_state = (int) yy_def[yy_current_state]; |
2101 | 0 | if ( yy_current_state >= 187 ) |
2102 | 0 | yy_c = yy_meta[yy_c]; |
2103 | 0 | } |
2104 | 0 | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
2105 | 0 | yy_is_jam = (yy_current_state == 186); |
2106 | |
|
2107 | 0 | (void)yyg; |
2108 | 0 | return yy_is_jam ? 0 : yy_current_state; |
2109 | 0 | } |
2110 | | |
2111 | | #ifndef YY_NO_UNPUT |
2112 | | /* %if-c-only */ |
2113 | | |
2114 | | /* %endif */ |
2115 | | #endif |
2116 | | |
2117 | | /* %if-c-only */ |
2118 | | #ifndef YY_NO_INPUT |
2119 | | #ifdef __cplusplus |
2120 | | static int yyinput (yyscan_t yyscanner) |
2121 | | #else |
2122 | | static int input (yyscan_t yyscanner) |
2123 | | #endif |
2124 | | |
2125 | | /* %endif */ |
2126 | | /* %if-c++-only */ |
2127 | | /* %endif */ |
2128 | | { |
2129 | | int c; |
2130 | | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2131 | | |
2132 | | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2133 | | |
2134 | | if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
2135 | | { |
2136 | | /* yy_c_buf_p now points to the character we want to return. |
2137 | | * If this occurs *before* the EOB characters, then it's a |
2138 | | * valid NUL; if not, then we've hit the end of the buffer. |
2139 | | */ |
2140 | | if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) |
2141 | | /* This was really a NUL. */ |
2142 | | *yyg->yy_c_buf_p = '\0'; |
2143 | | |
2144 | | else |
2145 | | { /* need more input */ |
2146 | | int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); |
2147 | | ++yyg->yy_c_buf_p; |
2148 | | |
2149 | | switch ( yy_get_next_buffer( yyscanner ) ) |
2150 | | { |
2151 | | case EOB_ACT_LAST_MATCH: |
2152 | | /* This happens because yy_g_n_b() |
2153 | | * sees that we've accumulated a |
2154 | | * token and flags that we need to |
2155 | | * try matching the token before |
2156 | | * proceeding. But for input(), |
2157 | | * there's no matching to consider. |
2158 | | * So convert the EOB_ACT_LAST_MATCH |
2159 | | * to EOB_ACT_END_OF_FILE. |
2160 | | */ |
2161 | | |
2162 | | /* Reset buffer status. */ |
2163 | | yyrestart( yyin , yyscanner); |
2164 | | |
2165 | | /*FALLTHROUGH*/ |
2166 | | |
2167 | | case EOB_ACT_END_OF_FILE: |
2168 | | { |
2169 | | if ( yywrap( yyscanner ) ) |
2170 | | return 0; |
2171 | | |
2172 | | if ( ! yyg->yy_did_buffer_switch_on_eof ) |
2173 | | YY_NEW_FILE; |
2174 | | #ifdef __cplusplus |
2175 | | return yyinput(yyscanner); |
2176 | | #else |
2177 | | return input(yyscanner); |
2178 | | #endif |
2179 | | } |
2180 | | |
2181 | | case EOB_ACT_CONTINUE_SCAN: |
2182 | | yyg->yy_c_buf_p = yyg->yytext_ptr + offset; |
2183 | | break; |
2184 | | } |
2185 | | } |
2186 | | } |
2187 | | |
2188 | | c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ |
2189 | | *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ |
2190 | | yyg->yy_hold_char = *++yyg->yy_c_buf_p; |
2191 | | |
2192 | | /* %% [19.0] update BOL and yylineno */ |
2193 | | if ( c == '\n' ) |
2194 | | |
2195 | | do{ yylineno++; |
2196 | | yycolumn=0; |
2197 | | }while(0) |
2198 | | ; |
2199 | | |
2200 | | return c; |
2201 | | } |
2202 | | /* %if-c-only */ |
2203 | | #endif /* ifndef YY_NO_INPUT */ |
2204 | | /* %endif */ |
2205 | | |
2206 | | /** Immediately switch to a different input stream. |
2207 | | * @param input_file A readable stream. |
2208 | | * @param yyscanner The scanner object. |
2209 | | * @note This function does not reset the start condition to @c INITIAL . |
2210 | | */ |
2211 | | /* %if-c-only */ |
2212 | | void yyrestart (FILE * input_file , yyscan_t yyscanner) |
2213 | | /* %endif */ |
2214 | | /* %if-c++-only */ |
2215 | | /* %endif */ |
2216 | 0 | { |
2217 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2218 | |
|
2219 | 0 | if ( ! YY_CURRENT_BUFFER ){ |
2220 | 0 | yyensure_buffer_stack (yyscanner); |
2221 | 0 | YY_CURRENT_BUFFER_LVALUE = |
2222 | 0 | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
2223 | 0 | } |
2224 | |
|
2225 | 0 | yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); |
2226 | 0 | yy_load_buffer_state( yyscanner ); |
2227 | 0 | } |
2228 | | |
2229 | | /* %if-c++-only */ |
2230 | | /* %endif */ |
2231 | | |
2232 | | /** Switch to a different input buffer. |
2233 | | * @param new_buffer The new input buffer. |
2234 | | * @param yyscanner The scanner object. |
2235 | | */ |
2236 | | /* %if-c-only */ |
2237 | | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
2238 | | /* %endif */ |
2239 | | /* %if-c++-only */ |
2240 | | /* %endif */ |
2241 | 0 | { |
2242 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2243 | | |
2244 | | /* TODO. We should be able to replace this entire function body |
2245 | | * with |
2246 | | * yypop_buffer_state(); |
2247 | | * yypush_buffer_state(new_buffer); |
2248 | | */ |
2249 | 0 | yyensure_buffer_stack (yyscanner); |
2250 | 0 | if ( YY_CURRENT_BUFFER == new_buffer ) |
2251 | 0 | return; |
2252 | | |
2253 | 0 | if ( YY_CURRENT_BUFFER ) |
2254 | 0 | { |
2255 | | /* Flush out information for old buffer. */ |
2256 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2257 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
2258 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
2259 | 0 | } |
2260 | |
|
2261 | 0 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
2262 | 0 | yy_load_buffer_state( yyscanner ); |
2263 | | |
2264 | | /* We don't actually know whether we did this switch during |
2265 | | * EOF (yywrap()) processing, but the only time this flag |
2266 | | * is looked at is after yywrap() is called, so it's safe |
2267 | | * to go ahead and always set it. |
2268 | | */ |
2269 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
2270 | 0 | } |
2271 | | |
2272 | | /* %if-c-only */ |
2273 | | static void yy_load_buffer_state (yyscan_t yyscanner) |
2274 | | /* %endif */ |
2275 | | /* %if-c++-only */ |
2276 | | /* %endif */ |
2277 | 0 | { |
2278 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2279 | 0 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
2280 | 0 | yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
2281 | | /* %if-c-only */ |
2282 | 0 | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
2283 | | /* %endif */ |
2284 | | /* %if-c++-only */ |
2285 | | /* %endif */ |
2286 | 0 | yyg->yy_hold_char = *yyg->yy_c_buf_p; |
2287 | 0 | } |
2288 | | |
2289 | | /** Allocate and initialize an input buffer state. |
2290 | | * @param file A readable stream. |
2291 | | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. |
2292 | | * @param yyscanner The scanner object. |
2293 | | * @return the allocated buffer state. |
2294 | | */ |
2295 | | /* %if-c-only */ |
2296 | | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) |
2297 | | /* %endif */ |
2298 | | /* %if-c++-only */ |
2299 | | /* %endif */ |
2300 | 0 | { |
2301 | 0 | YY_BUFFER_STATE b; |
2302 | | |
2303 | 0 | b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
2304 | 0 | if ( ! b ) |
2305 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
2306 | | |
2307 | 0 | b->yy_buf_size = size; |
2308 | | |
2309 | | /* yy_ch_buf has to be 2 characters longer than the size given because |
2310 | | * we need to put in 2 end-of-buffer characters. |
2311 | | */ |
2312 | 0 | b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
2313 | 0 | if ( ! b->yy_ch_buf ) |
2314 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
2315 | | |
2316 | 0 | b->yy_is_our_buffer = 1; |
2317 | |
|
2318 | 0 | yy_init_buffer( b, file , yyscanner); |
2319 | |
|
2320 | 0 | return b; |
2321 | 0 | } |
2322 | | |
2323 | | /* %if-c++-only */ |
2324 | | /* %endif */ |
2325 | | |
2326 | | /** Destroy the buffer. |
2327 | | * @param b a buffer created with yy_create_buffer() |
2328 | | * @param yyscanner The scanner object. |
2329 | | */ |
2330 | | /* %if-c-only */ |
2331 | | void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
2332 | | /* %endif */ |
2333 | | /* %if-c++-only */ |
2334 | | /* %endif */ |
2335 | 0 | { |
2336 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2337 | |
|
2338 | 0 | if ( ! b ) |
2339 | 0 | return; |
2340 | | |
2341 | 0 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ |
2342 | 0 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
2343 | |
|
2344 | 0 | if ( b->yy_is_our_buffer ) |
2345 | 0 | yyfree( (void *) b->yy_ch_buf , yyscanner ); |
2346 | |
|
2347 | 0 | yyfree( (void *) b , yyscanner ); |
2348 | 0 | } |
2349 | | |
2350 | | /* Initializes or reinitializes a buffer. |
2351 | | * This function is sometimes called more than once on the same buffer, |
2352 | | * such as during a yyrestart() or at EOF. |
2353 | | */ |
2354 | | /* %if-c-only */ |
2355 | | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) |
2356 | | /* %endif */ |
2357 | | /* %if-c++-only */ |
2358 | | /* %endif */ |
2359 | | |
2360 | 0 | { |
2361 | 0 | int oerrno = errno; |
2362 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2363 | |
|
2364 | 0 | yy_flush_buffer( b , yyscanner); |
2365 | | |
2366 | | /* %if-c-only */ |
2367 | 0 | b->yy_input_file = file; |
2368 | | /* %endif */ |
2369 | | /* %if-c++-only */ |
2370 | | /* %endif */ |
2371 | 0 | b->yy_fill_buffer = 1; |
2372 | | |
2373 | | /* If b is the current buffer, then yy_init_buffer was _probably_ |
2374 | | * called from yyrestart() or through yy_get_next_buffer. |
2375 | | * In that case, we don't want to reset the lineno or column. |
2376 | | */ |
2377 | 0 | if (b != YY_CURRENT_BUFFER){ |
2378 | 0 | b->yy_bs_lineno = 1; |
2379 | 0 | b->yy_bs_column = 0; |
2380 | 0 | } |
2381 | | |
2382 | | /* %if-c-only */ |
2383 | |
|
2384 | 0 | b->yy_is_interactive = 0; |
2385 | | |
2386 | | /* %endif */ |
2387 | | /* %if-c++-only */ |
2388 | | /* %endif */ |
2389 | 0 | errno = oerrno; |
2390 | 0 | } |
2391 | | |
2392 | | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
2393 | | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
2394 | | * @param yyscanner The scanner object. |
2395 | | */ |
2396 | | /* %if-c-only */ |
2397 | | void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
2398 | | /* %endif */ |
2399 | | /* %if-c++-only */ |
2400 | | /* %endif */ |
2401 | 0 | { |
2402 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2403 | 0 | if ( ! b ) |
2404 | 0 | return; |
2405 | | |
2406 | 0 | b->yy_n_chars = 0; |
2407 | | |
2408 | | /* We always need two end-of-buffer characters. The first causes |
2409 | | * a transition to the end-of-buffer state. The second causes |
2410 | | * a jam in that state. |
2411 | | */ |
2412 | 0 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
2413 | 0 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
2414 | |
|
2415 | 0 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
2416 | |
|
2417 | 0 | b->yy_at_bol = 1; |
2418 | 0 | b->yy_buffer_status = YY_BUFFER_NEW; |
2419 | |
|
2420 | 0 | if ( b == YY_CURRENT_BUFFER ) |
2421 | 0 | yy_load_buffer_state( yyscanner ); |
2422 | 0 | } |
2423 | | |
2424 | | /* %if-c-or-c++ */ |
2425 | | /** Pushes the new state onto the stack. The new state becomes |
2426 | | * the current state. This function will allocate the stack |
2427 | | * if necessary. |
2428 | | * @param new_buffer The new state. |
2429 | | * @param yyscanner The scanner object. |
2430 | | */ |
2431 | | /* %if-c-only */ |
2432 | | void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
2433 | | /* %endif */ |
2434 | | /* %if-c++-only */ |
2435 | | /* %endif */ |
2436 | 0 | { |
2437 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2438 | 0 | if (new_buffer == NULL) |
2439 | 0 | return; |
2440 | | |
2441 | 0 | yyensure_buffer_stack(yyscanner); |
2442 | | |
2443 | | /* This block is copied from yy_switch_to_buffer. */ |
2444 | 0 | if ( YY_CURRENT_BUFFER ) |
2445 | 0 | { |
2446 | | /* Flush out information for old buffer. */ |
2447 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2448 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
2449 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
2450 | 0 | } |
2451 | | |
2452 | | /* Only push if top exists. Otherwise, replace top. */ |
2453 | 0 | if (YY_CURRENT_BUFFER) |
2454 | 0 | yyg->yy_buffer_stack_top++; |
2455 | 0 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
2456 | | |
2457 | | /* copied from yy_switch_to_buffer. */ |
2458 | 0 | yy_load_buffer_state( yyscanner ); |
2459 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
2460 | 0 | } |
2461 | | /* %endif */ |
2462 | | |
2463 | | /* %if-c-or-c++ */ |
2464 | | /** Removes and deletes the top of the stack, if present. |
2465 | | * The next element becomes the new top. |
2466 | | * @param yyscanner The scanner object. |
2467 | | */ |
2468 | | /* %if-c-only */ |
2469 | | void yypop_buffer_state (yyscan_t yyscanner) |
2470 | | /* %endif */ |
2471 | | /* %if-c++-only */ |
2472 | | /* %endif */ |
2473 | 0 | { |
2474 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2475 | 0 | if (!YY_CURRENT_BUFFER) |
2476 | 0 | return; |
2477 | | |
2478 | 0 | yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); |
2479 | 0 | YY_CURRENT_BUFFER_LVALUE = NULL; |
2480 | 0 | if (yyg->yy_buffer_stack_top > 0) |
2481 | 0 | --yyg->yy_buffer_stack_top; |
2482 | |
|
2483 | 0 | if (YY_CURRENT_BUFFER) { |
2484 | 0 | yy_load_buffer_state( yyscanner ); |
2485 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
2486 | 0 | } |
2487 | 0 | } |
2488 | | /* %endif */ |
2489 | | |
2490 | | /* %if-c-or-c++ */ |
2491 | | /* Allocates the stack if it does not exist. |
2492 | | * Guarantees space for at least one push. |
2493 | | */ |
2494 | | /* %if-c-only */ |
2495 | | static void yyensure_buffer_stack (yyscan_t yyscanner) |
2496 | | /* %endif */ |
2497 | | /* %if-c++-only */ |
2498 | | /* %endif */ |
2499 | 0 | { |
2500 | 0 | yy_size_t num_to_alloc; |
2501 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2502 | |
|
2503 | 0 | if (!yyg->yy_buffer_stack) { |
2504 | | |
2505 | | /* First allocation is just for 2 elements, since we don't know if this |
2506 | | * scanner will even need a stack. We use 2 instead of 1 to avoid an |
2507 | | * immediate realloc on the next call. |
2508 | | */ |
2509 | 0 | num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ |
2510 | 0 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc |
2511 | 0 | (num_to_alloc * sizeof(struct yy_buffer_state*) |
2512 | 0 | , yyscanner); |
2513 | 0 | if ( ! yyg->yy_buffer_stack ) |
2514 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
2515 | | |
2516 | 0 | memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
2517 | |
|
2518 | 0 | yyg->yy_buffer_stack_max = num_to_alloc; |
2519 | 0 | yyg->yy_buffer_stack_top = 0; |
2520 | 0 | return; |
2521 | 0 | } |
2522 | | |
2523 | 0 | if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ |
2524 | | |
2525 | | /* Increase the buffer to prepare for a possible push. */ |
2526 | 0 | yy_size_t grow_size = 8 /* arbitrary grow size */; |
2527 | |
|
2528 | 0 | num_to_alloc = yyg->yy_buffer_stack_max + grow_size; |
2529 | 0 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc |
2530 | 0 | (yyg->yy_buffer_stack, |
2531 | 0 | num_to_alloc * sizeof(struct yy_buffer_state*) |
2532 | 0 | , yyscanner); |
2533 | 0 | if ( ! yyg->yy_buffer_stack ) |
2534 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
2535 | | |
2536 | | /* zero only the new slots.*/ |
2537 | 0 | memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); |
2538 | 0 | yyg->yy_buffer_stack_max = num_to_alloc; |
2539 | 0 | } |
2540 | 0 | } |
2541 | | /* %endif */ |
2542 | | |
2543 | | /* %if-c-only */ |
2544 | | /** Setup the input buffer state to scan directly from a user-specified character buffer. |
2545 | | * @param base the character buffer |
2546 | | * @param size the size in bytes of the character buffer |
2547 | | * @param yyscanner The scanner object. |
2548 | | * @return the newly allocated buffer state object. |
2549 | | */ |
2550 | | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) |
2551 | 0 | { |
2552 | 0 | YY_BUFFER_STATE b; |
2553 | | |
2554 | 0 | if ( size < 2 || |
2555 | 0 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
2556 | 0 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
2557 | | /* They forgot to leave room for the EOB's. */ |
2558 | 0 | return NULL; |
2559 | | |
2560 | 0 | b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
2561 | 0 | if ( ! b ) |
2562 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
2563 | | |
2564 | 0 | b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ |
2565 | 0 | b->yy_buf_pos = b->yy_ch_buf = base; |
2566 | 0 | b->yy_is_our_buffer = 0; |
2567 | 0 | b->yy_input_file = NULL; |
2568 | 0 | b->yy_n_chars = b->yy_buf_size; |
2569 | 0 | b->yy_is_interactive = 0; |
2570 | 0 | b->yy_at_bol = 1; |
2571 | 0 | b->yy_fill_buffer = 0; |
2572 | 0 | b->yy_buffer_status = YY_BUFFER_NEW; |
2573 | |
|
2574 | 0 | yy_switch_to_buffer( b , yyscanner ); |
2575 | |
|
2576 | 0 | return b; |
2577 | 0 | } |
2578 | | /* %endif */ |
2579 | | |
2580 | | /* %if-c-only */ |
2581 | | /** Setup the input buffer state to scan a string. The next call to yylex() will |
2582 | | * scan from a @e copy of @a str. |
2583 | | * @param yystr a NUL-terminated string to scan |
2584 | | * @param yyscanner The scanner object. |
2585 | | * @return the newly allocated buffer state object. |
2586 | | * @note If you want to scan bytes that may contain NUL values, then use |
2587 | | * yy_scan_bytes() instead. |
2588 | | */ |
2589 | | YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) |
2590 | 0 | { |
2591 | | |
2592 | 0 | return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); |
2593 | 0 | } |
2594 | | /* %endif */ |
2595 | | |
2596 | | /* %if-c-only */ |
2597 | | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
2598 | | * scan from a @e copy of @a bytes. |
2599 | | * @param yybytes the byte buffer to scan |
2600 | | * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
2601 | | * @param yyscanner The scanner object. |
2602 | | * @return the newly allocated buffer state object. |
2603 | | */ |
2604 | | YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) |
2605 | 0 | { |
2606 | 0 | YY_BUFFER_STATE b; |
2607 | 0 | char *buf; |
2608 | 0 | yy_size_t n; |
2609 | 0 | int i; |
2610 | | |
2611 | | /* Get memory for full buffer, including space for trailing EOB's. */ |
2612 | 0 | n = (yy_size_t) (_yybytes_len + 2); |
2613 | 0 | buf = (char *) yyalloc( n , yyscanner ); |
2614 | 0 | if ( ! buf ) |
2615 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
2616 | | |
2617 | 0 | for ( i = 0; i < _yybytes_len; ++i ) |
2618 | 0 | buf[i] = yybytes[i]; |
2619 | |
|
2620 | 0 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
2621 | |
|
2622 | 0 | b = yy_scan_buffer( buf, n , yyscanner); |
2623 | 0 | if ( ! b ) |
2624 | 0 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
2625 | | |
2626 | | /* It's okay to grow etc. this buffer, and we should throw it |
2627 | | * away when we're done. |
2628 | | */ |
2629 | 0 | b->yy_is_our_buffer = 1; |
2630 | |
|
2631 | 0 | return b; |
2632 | 0 | } |
2633 | | /* %endif */ |
2634 | | |
2635 | | #ifndef YY_EXIT_FAILURE |
2636 | | #define YY_EXIT_FAILURE 2 |
2637 | | #endif |
2638 | | |
2639 | | /* %if-c-only */ |
2640 | | static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) |
2641 | 0 | { |
2642 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2643 | 0 | (void)yyg; |
2644 | 0 | fprintf( stderr, "%s\n", msg ); |
2645 | 0 | exit( YY_EXIT_FAILURE ); |
2646 | 0 | } |
2647 | | /* %endif */ |
2648 | | /* %if-c++-only */ |
2649 | | /* %endif */ |
2650 | | |
2651 | | /* Redefine yyless() so it works in section 3 code. */ |
2652 | | |
2653 | | #undef yyless |
2654 | | #define yyless(n) \ |
2655 | | do \ |
2656 | | { \ |
2657 | | /* Undo effects of setting up yytext. */ \ |
2658 | | int yyless_macro_arg = (n); \ |
2659 | | YY_LESS_LINENO(yyless_macro_arg);\ |
2660 | | yytext[yyleng] = yyg->yy_hold_char; \ |
2661 | | yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ |
2662 | | yyg->yy_hold_char = *yyg->yy_c_buf_p; \ |
2663 | | *yyg->yy_c_buf_p = '\0'; \ |
2664 | | yyleng = yyless_macro_arg; \ |
2665 | | } \ |
2666 | | while ( 0 ) |
2667 | | |
2668 | | /* Accessor methods (get/set functions) to struct members. */ |
2669 | | |
2670 | | /* %if-c-only */ |
2671 | | /* %if-reentrant */ |
2672 | | |
2673 | | /** Get the user-defined data for this scanner. |
2674 | | * @param yyscanner The scanner object. |
2675 | | */ |
2676 | | YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) |
2677 | 0 | { |
2678 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2679 | 0 | return yyextra; |
2680 | 0 | } |
2681 | | |
2682 | | /* %endif */ |
2683 | | |
2684 | | /** Get the current line number. |
2685 | | * @param yyscanner The scanner object. |
2686 | | */ |
2687 | | int yyget_lineno (yyscan_t yyscanner) |
2688 | 0 | { |
2689 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2690 | |
|
2691 | 0 | if (! YY_CURRENT_BUFFER) |
2692 | 0 | return 0; |
2693 | | |
2694 | 0 | return yylineno; |
2695 | 0 | } |
2696 | | |
2697 | | /** Get the current column number. |
2698 | | * @param yyscanner The scanner object. |
2699 | | */ |
2700 | | int yyget_column (yyscan_t yyscanner) |
2701 | 0 | { |
2702 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2703 | |
|
2704 | 0 | if (! YY_CURRENT_BUFFER) |
2705 | 0 | return 0; |
2706 | | |
2707 | 0 | return yycolumn; |
2708 | 0 | } |
2709 | | |
2710 | | /** Get the input stream. |
2711 | | * @param yyscanner The scanner object. |
2712 | | */ |
2713 | | FILE *yyget_in (yyscan_t yyscanner) |
2714 | 0 | { |
2715 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2716 | 0 | return yyin; |
2717 | 0 | } |
2718 | | |
2719 | | /** Get the output stream. |
2720 | | * @param yyscanner The scanner object. |
2721 | | */ |
2722 | | FILE *yyget_out (yyscan_t yyscanner) |
2723 | 0 | { |
2724 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2725 | 0 | return yyout; |
2726 | 0 | } |
2727 | | |
2728 | | /** Get the length of the current token. |
2729 | | * @param yyscanner The scanner object. |
2730 | | */ |
2731 | | int yyget_leng (yyscan_t yyscanner) |
2732 | 0 | { |
2733 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2734 | 0 | return yyleng; |
2735 | 0 | } |
2736 | | |
2737 | | /** Get the current token. |
2738 | | * @param yyscanner The scanner object. |
2739 | | */ |
2740 | | |
2741 | | char *yyget_text (yyscan_t yyscanner) |
2742 | 0 | { |
2743 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2744 | 0 | return yytext; |
2745 | 0 | } |
2746 | | |
2747 | | /* %if-reentrant */ |
2748 | | |
2749 | | /** Set the user-defined data. This data is never touched by the scanner. |
2750 | | * @param user_defined The data to be associated with this scanner. |
2751 | | * @param yyscanner The scanner object. |
2752 | | */ |
2753 | | void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) |
2754 | 0 | { |
2755 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2756 | 0 | yyextra = user_defined ; |
2757 | 0 | } |
2758 | | |
2759 | | /* %endif */ |
2760 | | |
2761 | | /** Set the current line number. |
2762 | | * @param _line_number line number |
2763 | | * @param yyscanner The scanner object. |
2764 | | */ |
2765 | | void yyset_lineno (int _line_number , yyscan_t yyscanner) |
2766 | 0 | { |
2767 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2768 | | |
2769 | | /* lineno is only valid if an input buffer exists. */ |
2770 | 0 | if (! YY_CURRENT_BUFFER ) |
2771 | 0 | YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); |
2772 | | |
2773 | 0 | yylineno = _line_number; |
2774 | 0 | } |
2775 | | |
2776 | | /** Set the current column. |
2777 | | * @param _column_no column number |
2778 | | * @param yyscanner The scanner object. |
2779 | | */ |
2780 | | void yyset_column (int _column_no , yyscan_t yyscanner) |
2781 | 0 | { |
2782 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2783 | | |
2784 | | /* column is only valid if an input buffer exists. */ |
2785 | 0 | if (! YY_CURRENT_BUFFER ) |
2786 | 0 | YY_FATAL_ERROR( "yyset_column called with no buffer" ); |
2787 | | |
2788 | 0 | yycolumn = _column_no; |
2789 | 0 | } |
2790 | | |
2791 | | /** Set the input stream. This does not discard the current |
2792 | | * input buffer. |
2793 | | * @param _in_str A readable stream. |
2794 | | * @param yyscanner The scanner object. |
2795 | | * @see yy_switch_to_buffer |
2796 | | */ |
2797 | | void yyset_in (FILE * _in_str , yyscan_t yyscanner) |
2798 | 0 | { |
2799 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2800 | 0 | yyin = _in_str ; |
2801 | 0 | } |
2802 | | |
2803 | | void yyset_out (FILE * _out_str , yyscan_t yyscanner) |
2804 | 0 | { |
2805 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2806 | 0 | yyout = _out_str ; |
2807 | 0 | } |
2808 | | |
2809 | | int yyget_debug (yyscan_t yyscanner) |
2810 | 0 | { |
2811 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2812 | 0 | return yy_flex_debug; |
2813 | 0 | } |
2814 | | |
2815 | | void yyset_debug (int _bdebug , yyscan_t yyscanner) |
2816 | 0 | { |
2817 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2818 | 0 | yy_flex_debug = _bdebug ; |
2819 | 0 | } |
2820 | | |
2821 | | /* %endif */ |
2822 | | |
2823 | | /* %if-reentrant */ |
2824 | | /* Accessor methods for yylval and yylloc */ |
2825 | | |
2826 | | /* %if-bison-bridge */ |
2827 | | /* %endif */ |
2828 | | |
2829 | | /* User-visible API */ |
2830 | | |
2831 | | /* yylex_init is special because it creates the scanner itself, so it is |
2832 | | * the ONLY reentrant function that doesn't take the scanner as the last argument. |
2833 | | * That's why we explicitly handle the declaration, instead of using our macros. |
2834 | | */ |
2835 | | int yylex_init(yyscan_t* ptr_yy_globals) |
2836 | 0 | { |
2837 | 0 | if (ptr_yy_globals == NULL){ |
2838 | 0 | errno = EINVAL; |
2839 | 0 | return 1; |
2840 | 0 | } |
2841 | | |
2842 | 0 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); |
2843 | |
|
2844 | 0 | if (*ptr_yy_globals == NULL){ |
2845 | 0 | errno = ENOMEM; |
2846 | 0 | return 1; |
2847 | 0 | } |
2848 | | |
2849 | | /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ |
2850 | 0 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
2851 | |
|
2852 | 0 | return yy_init_globals ( *ptr_yy_globals ); |
2853 | 0 | } |
2854 | | |
2855 | | /* yylex_init_extra has the same functionality as yylex_init, but follows the |
2856 | | * convention of taking the scanner as the last argument. Note however, that |
2857 | | * this is a *pointer* to a scanner, as it will be allocated by this call (and |
2858 | | * is the reason, too, why this function also must handle its own declaration). |
2859 | | * The user defined value in the first argument will be available to yyalloc in |
2860 | | * the yyextra field. |
2861 | | */ |
2862 | | int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) |
2863 | 0 | { |
2864 | 0 | struct yyguts_t dummy_yyguts; |
2865 | |
|
2866 | 0 | yyset_extra (yy_user_defined, &dummy_yyguts); |
2867 | |
|
2868 | 0 | if (ptr_yy_globals == NULL){ |
2869 | 0 | errno = EINVAL; |
2870 | 0 | return 1; |
2871 | 0 | } |
2872 | | |
2873 | 0 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); |
2874 | |
|
2875 | 0 | if (*ptr_yy_globals == NULL){ |
2876 | 0 | errno = ENOMEM; |
2877 | 0 | return 1; |
2878 | 0 | } |
2879 | | |
2880 | | /* By setting to 0xAA, we expose bugs in |
2881 | | yy_init_globals. Leave at 0x00 for releases. */ |
2882 | 0 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
2883 | |
|
2884 | 0 | yyset_extra (yy_user_defined, *ptr_yy_globals); |
2885 | |
|
2886 | 0 | return yy_init_globals ( *ptr_yy_globals ); |
2887 | 0 | } |
2888 | | |
2889 | | /* %endif if-c-only */ |
2890 | | |
2891 | | /* %if-c-only */ |
2892 | | static int yy_init_globals (yyscan_t yyscanner) |
2893 | 0 | { |
2894 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2895 | | /* Initialization is the same as for the non-reentrant scanner. |
2896 | | * This function is called from yylex_destroy(), so don't allocate here. |
2897 | | */ |
2898 | |
|
2899 | 0 | yyg->yy_buffer_stack = NULL; |
2900 | 0 | yyg->yy_buffer_stack_top = 0; |
2901 | 0 | yyg->yy_buffer_stack_max = 0; |
2902 | 0 | yyg->yy_c_buf_p = NULL; |
2903 | 0 | yyg->yy_init = 0; |
2904 | 0 | yyg->yy_start = 0; |
2905 | |
|
2906 | 0 | yyg->yy_start_stack_ptr = 0; |
2907 | 0 | yyg->yy_start_stack_depth = 0; |
2908 | 0 | yyg->yy_start_stack = NULL; |
2909 | | |
2910 | | /* Defined in main.c */ |
2911 | | #ifdef YY_STDINIT |
2912 | | yyin = stdin; |
2913 | | yyout = stdout; |
2914 | | #else |
2915 | 0 | yyin = NULL; |
2916 | 0 | yyout = NULL; |
2917 | 0 | #endif |
2918 | | |
2919 | | /* For future reference: Set errno on error, since we are called by |
2920 | | * yylex_init() |
2921 | | */ |
2922 | 0 | return 0; |
2923 | 0 | } |
2924 | | /* %endif */ |
2925 | | |
2926 | | /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ |
2927 | | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
2928 | | int yylex_destroy (yyscan_t yyscanner) |
2929 | 0 | { |
2930 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2931 | | |
2932 | | /* Pop the buffer stack, destroying each element. */ |
2933 | 0 | while(YY_CURRENT_BUFFER){ |
2934 | 0 | yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); |
2935 | 0 | YY_CURRENT_BUFFER_LVALUE = NULL; |
2936 | 0 | yypop_buffer_state(yyscanner); |
2937 | 0 | } |
2938 | | |
2939 | | /* Destroy the stack itself. */ |
2940 | 0 | yyfree(yyg->yy_buffer_stack , yyscanner); |
2941 | 0 | yyg->yy_buffer_stack = NULL; |
2942 | | |
2943 | | /* Destroy the start condition stack. */ |
2944 | 0 | yyfree( yyg->yy_start_stack , yyscanner ); |
2945 | 0 | yyg->yy_start_stack = NULL; |
2946 | | |
2947 | | /* Reset the globals. This is important in a non-reentrant scanner so the next time |
2948 | | * yylex() is called, initialization will occur. */ |
2949 | 0 | yy_init_globals( yyscanner); |
2950 | | |
2951 | | /* %if-reentrant */ |
2952 | | /* Destroy the main struct (reentrant only). */ |
2953 | 0 | yyfree ( yyscanner , yyscanner ); |
2954 | 0 | yyscanner = NULL; |
2955 | | /* %endif */ |
2956 | 0 | return 0; |
2957 | 0 | } |
2958 | | /* %endif */ |
2959 | | |
2960 | | /* |
2961 | | * Internal utility routines. |
2962 | | */ |
2963 | | |
2964 | | #ifndef yytext_ptr |
2965 | | static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) |
2966 | | { |
2967 | | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2968 | | (void)yyg; |
2969 | | |
2970 | | int i; |
2971 | | for ( i = 0; i < n; ++i ) |
2972 | | s1[i] = s2[i]; |
2973 | | } |
2974 | | #endif |
2975 | | |
2976 | | #ifdef YY_NEED_STRLEN |
2977 | | static int yy_flex_strlen (const char * s , yyscan_t yyscanner) |
2978 | | { |
2979 | | int n; |
2980 | | for ( n = 0; s[n]; ++n ) |
2981 | | ; |
2982 | | |
2983 | | return n; |
2984 | | } |
2985 | | #endif |
2986 | | |
2987 | | /* %if-tables-serialization definitions */ |
2988 | | /* %define-yytables The name for this specific scanner's tables. */ |
2989 | | #define YYTABLES_NAME "yytables" |
2990 | | /* %endif */ |
2991 | | |
2992 | | /* %ok-for-header */ |
2993 | | |
2994 | | #line 186 "/src/wireshark/epan/protobuf_lang_scanner.l" |
2995 | | |
2996 | | |
2997 | | static gchar* |
2998 | 0 | strdup_and_store(void* yyscanner, const char* text) { |
2999 | 0 | return pbl_store_string_token(protobuf_lang_get_extra(yyscanner), g_strdup(text)); |
3000 | 0 | } |
3001 | | |
3002 | | /* |
3003 | | * Turn diagnostics back on, so we check the code that we've written. |
3004 | | */ |
3005 | | DIAG_ON_FLEX() |
3006 | | |