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