/work/build/epan/diam_dict.c
Line | Count | Source (jump to first uncovered line) |
1 | | #line 2 "/work/build/epan/diam_dict.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/diam_dict.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 DiamDict__create_buffer_ALREADY_DEFINED |
33 | | #else |
34 | 0 | #define yy_create_buffer DiamDict__create_buffer |
35 | | #endif |
36 | | |
37 | | #ifdef yy_delete_buffer |
38 | | #define DiamDict__delete_buffer_ALREADY_DEFINED |
39 | | #else |
40 | 0 | #define yy_delete_buffer DiamDict__delete_buffer |
41 | | #endif |
42 | | |
43 | | #ifdef yy_scan_buffer |
44 | | #define DiamDict__scan_buffer_ALREADY_DEFINED |
45 | | #else |
46 | 0 | #define yy_scan_buffer DiamDict__scan_buffer |
47 | | #endif |
48 | | |
49 | | #ifdef yy_scan_string |
50 | | #define DiamDict__scan_string_ALREADY_DEFINED |
51 | | #else |
52 | | #define yy_scan_string DiamDict__scan_string |
53 | | #endif |
54 | | |
55 | | #ifdef yy_scan_bytes |
56 | | #define DiamDict__scan_bytes_ALREADY_DEFINED |
57 | | #else |
58 | 0 | #define yy_scan_bytes DiamDict__scan_bytes |
59 | | #endif |
60 | | |
61 | | #ifdef yy_init_buffer |
62 | | #define DiamDict__init_buffer_ALREADY_DEFINED |
63 | | #else |
64 | 0 | #define yy_init_buffer DiamDict__init_buffer |
65 | | #endif |
66 | | |
67 | | #ifdef yy_flush_buffer |
68 | | #define DiamDict__flush_buffer_ALREADY_DEFINED |
69 | | #else |
70 | 0 | #define yy_flush_buffer DiamDict__flush_buffer |
71 | | #endif |
72 | | |
73 | | #ifdef yy_load_buffer_state |
74 | | #define DiamDict__load_buffer_state_ALREADY_DEFINED |
75 | | #else |
76 | 0 | #define yy_load_buffer_state DiamDict__load_buffer_state |
77 | | #endif |
78 | | |
79 | | #ifdef yy_switch_to_buffer |
80 | | #define DiamDict__switch_to_buffer_ALREADY_DEFINED |
81 | | #else |
82 | 0 | #define yy_switch_to_buffer DiamDict__switch_to_buffer |
83 | | #endif |
84 | | |
85 | | #ifdef yypush_buffer_state |
86 | | #define DiamDict_push_buffer_state_ALREADY_DEFINED |
87 | | #else |
88 | | #define yypush_buffer_state DiamDict_push_buffer_state |
89 | | #endif |
90 | | |
91 | | #ifdef yypop_buffer_state |
92 | | #define DiamDict_pop_buffer_state_ALREADY_DEFINED |
93 | | #else |
94 | 0 | #define yypop_buffer_state DiamDict_pop_buffer_state |
95 | | #endif |
96 | | |
97 | | #ifdef yyensure_buffer_stack |
98 | | #define DiamDict_ensure_buffer_stack_ALREADY_DEFINED |
99 | | #else |
100 | 0 | #define yyensure_buffer_stack DiamDict_ensure_buffer_stack |
101 | | #endif |
102 | | |
103 | | #ifdef yylex |
104 | | #define DiamDict_lex_ALREADY_DEFINED |
105 | | #else |
106 | | #define yylex DiamDict_lex |
107 | | #endif |
108 | | |
109 | | #ifdef yyrestart |
110 | | #define DiamDict_restart_ALREADY_DEFINED |
111 | | #else |
112 | 0 | #define yyrestart DiamDict_restart |
113 | | #endif |
114 | | |
115 | | #ifdef yylex_init |
116 | | #define DiamDict_lex_init_ALREADY_DEFINED |
117 | | #else |
118 | | #define yylex_init DiamDict_lex_init |
119 | | #endif |
120 | | |
121 | | #ifdef yylex_init_extra |
122 | | #define DiamDict_lex_init_extra_ALREADY_DEFINED |
123 | | #else |
124 | | #define yylex_init_extra DiamDict_lex_init_extra |
125 | | #endif |
126 | | |
127 | | #ifdef yylex_destroy |
128 | | #define DiamDict_lex_destroy_ALREADY_DEFINED |
129 | | #else |
130 | | #define yylex_destroy DiamDict_lex_destroy |
131 | | #endif |
132 | | |
133 | | #ifdef yyget_debug |
134 | | #define DiamDict_get_debug_ALREADY_DEFINED |
135 | | #else |
136 | | #define yyget_debug DiamDict_get_debug |
137 | | #endif |
138 | | |
139 | | #ifdef yyset_debug |
140 | | #define DiamDict_set_debug_ALREADY_DEFINED |
141 | | #else |
142 | | #define yyset_debug DiamDict_set_debug |
143 | | #endif |
144 | | |
145 | | #ifdef yyget_extra |
146 | | #define DiamDict_get_extra_ALREADY_DEFINED |
147 | | #else |
148 | 0 | #define yyget_extra DiamDict_get_extra |
149 | | #endif |
150 | | |
151 | | #ifdef yyset_extra |
152 | | #define DiamDict_set_extra_ALREADY_DEFINED |
153 | | #else |
154 | 0 | #define yyset_extra DiamDict_set_extra |
155 | | #endif |
156 | | |
157 | | #ifdef yyget_in |
158 | | #define DiamDict_get_in_ALREADY_DEFINED |
159 | | #else |
160 | 0 | #define yyget_in DiamDict_get_in |
161 | | #endif |
162 | | |
163 | | #ifdef yyset_in |
164 | | #define DiamDict_set_in_ALREADY_DEFINED |
165 | | #else |
166 | | #define yyset_in DiamDict_set_in |
167 | | #endif |
168 | | |
169 | | #ifdef yyget_out |
170 | | #define DiamDict_get_out_ALREADY_DEFINED |
171 | | #else |
172 | | #define yyget_out DiamDict_get_out |
173 | | #endif |
174 | | |
175 | | #ifdef yyset_out |
176 | | #define DiamDict_set_out_ALREADY_DEFINED |
177 | | #else |
178 | | #define yyset_out DiamDict_set_out |
179 | | #endif |
180 | | |
181 | | #ifdef yyget_leng |
182 | | #define DiamDict_get_leng_ALREADY_DEFINED |
183 | | #else |
184 | | #define yyget_leng DiamDict_get_leng |
185 | | #endif |
186 | | |
187 | | #ifdef yyget_text |
188 | | #define DiamDict_get_text_ALREADY_DEFINED |
189 | | #else |
190 | | #define yyget_text DiamDict_get_text |
191 | | #endif |
192 | | |
193 | | #ifdef yyget_lineno |
194 | | #define DiamDict_get_lineno_ALREADY_DEFINED |
195 | | #else |
196 | | #define yyget_lineno DiamDict_get_lineno |
197 | | #endif |
198 | | |
199 | | #ifdef yyset_lineno |
200 | | #define DiamDict_set_lineno_ALREADY_DEFINED |
201 | | #else |
202 | | #define yyset_lineno DiamDict_set_lineno |
203 | | #endif |
204 | | |
205 | | #ifdef yyget_column |
206 | | #define DiamDict_get_column_ALREADY_DEFINED |
207 | | #else |
208 | | #define yyget_column DiamDict_get_column |
209 | | #endif |
210 | | |
211 | | #ifdef yyset_column |
212 | | #define DiamDict_set_column_ALREADY_DEFINED |
213 | | #else |
214 | | #define yyset_column DiamDict_set_column |
215 | | #endif |
216 | | |
217 | | #ifdef yywrap |
218 | | #define DiamDict_wrap_ALREADY_DEFINED |
219 | | #else |
220 | 0 | #define yywrap DiamDict_wrap |
221 | | #endif |
222 | | |
223 | | /* %endif */ |
224 | | |
225 | | #ifdef yyalloc |
226 | | #define DiamDict_alloc_ALREADY_DEFINED |
227 | | #else |
228 | 0 | #define yyalloc DiamDict_alloc |
229 | | #endif |
230 | | |
231 | | #ifdef yyrealloc |
232 | | #define DiamDict_realloc_ALREADY_DEFINED |
233 | | #else |
234 | 0 | #define yyrealloc DiamDict_realloc |
235 | | #endif |
236 | | |
237 | | #ifdef yyfree |
238 | | #define DiamDict_free_ALREADY_DEFINED |
239 | | #else |
240 | 0 | #define yyfree DiamDict_free |
241 | | #endif |
242 | | |
243 | | /* %if-c-only */ |
244 | | |
245 | | /* %endif */ |
246 | | |
247 | | /* First, we deal with platform-specific or compiler-specific issues. */ |
248 | | |
249 | | /* begin standard C headers. */ |
250 | | /* %if-c-only */ |
251 | | #include <stdio.h> |
252 | | #include <string.h> |
253 | | #include <errno.h> |
254 | | #include <stdlib.h> |
255 | | /* %endif */ |
256 | | |
257 | | /* %if-tables-serialization */ |
258 | | /* %endif */ |
259 | | /* end standard C headers. */ |
260 | | |
261 | | /* %if-c-or-c++ */ |
262 | | /* flex integer type definitions */ |
263 | | |
264 | | #ifndef FLEXINT_H |
265 | | #define FLEXINT_H |
266 | | |
267 | | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
268 | | |
269 | | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
270 | | |
271 | | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
272 | | * if you want the limit (max/min) macros for int types. |
273 | | */ |
274 | | #ifndef __STDC_LIMIT_MACROS |
275 | | #define __STDC_LIMIT_MACROS 1 |
276 | | #endif |
277 | | |
278 | | #include <inttypes.h> |
279 | | typedef int8_t flex_int8_t; |
280 | | typedef uint8_t flex_uint8_t; |
281 | | typedef int16_t flex_int16_t; |
282 | | typedef uint16_t flex_uint16_t; |
283 | | typedef int32_t flex_int32_t; |
284 | | typedef uint32_t flex_uint32_t; |
285 | | #else |
286 | | typedef signed char flex_int8_t; |
287 | | typedef short int flex_int16_t; |
288 | | typedef int flex_int32_t; |
289 | | typedef unsigned char flex_uint8_t; |
290 | | typedef unsigned short int flex_uint16_t; |
291 | | typedef unsigned int flex_uint32_t; |
292 | | |
293 | | /* Limits of integral types. */ |
294 | | #ifndef INT8_MIN |
295 | | #define INT8_MIN (-128) |
296 | | #endif |
297 | | #ifndef INT16_MIN |
298 | | #define INT16_MIN (-32767-1) |
299 | | #endif |
300 | | #ifndef INT32_MIN |
301 | | #define INT32_MIN (-2147483647-1) |
302 | | #endif |
303 | | #ifndef INT8_MAX |
304 | | #define INT8_MAX (127) |
305 | | #endif |
306 | | #ifndef INT16_MAX |
307 | | #define INT16_MAX (32767) |
308 | | #endif |
309 | | #ifndef INT32_MAX |
310 | | #define INT32_MAX (2147483647) |
311 | | #endif |
312 | | #ifndef UINT8_MAX |
313 | | #define UINT8_MAX (255U) |
314 | | #endif |
315 | | #ifndef UINT16_MAX |
316 | | #define UINT16_MAX (65535U) |
317 | | #endif |
318 | | #ifndef UINT32_MAX |
319 | | #define UINT32_MAX (4294967295U) |
320 | | #endif |
321 | | |
322 | | #ifndef SIZE_MAX |
323 | | #define SIZE_MAX (~(size_t)0) |
324 | | #endif |
325 | | |
326 | | #endif /* ! C99 */ |
327 | | |
328 | | #endif /* ! FLEXINT_H */ |
329 | | |
330 | | /* %endif */ |
331 | | |
332 | | /* begin standard C++ headers. */ |
333 | | /* %if-c++-only */ |
334 | | /* %endif */ |
335 | | |
336 | | /* TODO: this is always defined, so inline it */ |
337 | | #define yyconst const |
338 | | |
339 | | #if defined(__GNUC__) && __GNUC__ >= 3 |
340 | | #define yynoreturn __attribute__((__noreturn__)) |
341 | | #else |
342 | | #define yynoreturn |
343 | | #endif |
344 | | |
345 | | /* %not-for-header */ |
346 | | /* Returned upon end-of-file. */ |
347 | 0 | #define YY_NULL 0 |
348 | | /* %ok-for-header */ |
349 | | |
350 | | /* %not-for-header */ |
351 | | /* Promotes a possibly negative, possibly signed char to an |
352 | | * integer in range [0..255] for use as an array index. |
353 | | */ |
354 | 0 | #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) |
355 | | /* %ok-for-header */ |
356 | | |
357 | | /* %if-reentrant */ |
358 | | |
359 | | /* An opaque pointer. */ |
360 | | #ifndef YY_TYPEDEF_YY_SCANNER_T |
361 | | #define YY_TYPEDEF_YY_SCANNER_T |
362 | | typedef void* yyscan_t; |
363 | | #endif |
364 | | |
365 | | /* For convenience, these vars (plus the bison vars far below) |
366 | | are macros in the reentrant scanner. */ |
367 | 0 | #define yyin yyg->yyin_r |
368 | 0 | #define yyout yyg->yyout_r |
369 | 0 | #define yyextra yyg->yyextra_r |
370 | 0 | #define yyleng yyg->yyleng_r |
371 | 0 | #define yytext yyg->yytext_r |
372 | 0 | #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
373 | 0 | #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
374 | 0 | #define yy_flex_debug yyg->yy_flex_debug_r |
375 | | |
376 | | /* %endif */ |
377 | | |
378 | | /* %if-not-reentrant */ |
379 | | /* %endif */ |
380 | | |
381 | | /* Enter a start condition. This macro really ought to take a parameter, |
382 | | * but we do it the disgusting crufty way forced on us by the ()-less |
383 | | * definition of BEGIN. |
384 | | */ |
385 | 0 | #define BEGIN yyg->yy_start = 1 + 2 * |
386 | | /* Translate the current start state into a value that can be later handed |
387 | | * to BEGIN to return to the state. The YYSTATE alias is for lex |
388 | | * compatibility. |
389 | | */ |
390 | 0 | #define YY_START ((yyg->yy_start - 1) / 2) |
391 | | #define YYSTATE YY_START |
392 | | /* Action number for EOF rule of a given start state. */ |
393 | 0 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
394 | | /* Special action meaning "start processing a new file". */ |
395 | 0 | #define YY_NEW_FILE yyrestart( yyin , yyscanner ) |
396 | 0 | #define YY_END_OF_BUFFER_CHAR 0 |
397 | | |
398 | | /* Size of default input buffer. */ |
399 | | #ifndef YY_BUF_SIZE |
400 | | #ifdef __ia64__ |
401 | | /* On IA-64, the buffer size is 16k, not 8k. |
402 | | * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. |
403 | | * Ditto for the __ia64__ case accordingly. |
404 | | */ |
405 | | #define YY_BUF_SIZE 32768 |
406 | | #else |
407 | 0 | #define YY_BUF_SIZE 16384 |
408 | | #endif /* __ia64__ */ |
409 | | #endif |
410 | | |
411 | | /* The state buf must be large enough to hold one state per character in the main buffer. |
412 | | */ |
413 | | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
414 | | |
415 | | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
416 | | #define YY_TYPEDEF_YY_BUFFER_STATE |
417 | | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
418 | | #endif |
419 | | |
420 | | #ifndef YY_TYPEDEF_YY_SIZE_T |
421 | | #define YY_TYPEDEF_YY_SIZE_T |
422 | | typedef size_t yy_size_t; |
423 | | #endif |
424 | | |
425 | | /* %if-not-reentrant */ |
426 | | /* %endif */ |
427 | | |
428 | | /* %if-c-only */ |
429 | | /* %if-not-reentrant */ |
430 | | /* %endif */ |
431 | | /* %endif */ |
432 | | |
433 | 0 | #define EOB_ACT_CONTINUE_SCAN 0 |
434 | 0 | #define EOB_ACT_END_OF_FILE 1 |
435 | 0 | #define EOB_ACT_LAST_MATCH 2 |
436 | | |
437 | | #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 DiamDict_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 85 |
636 | 0 | #define YY_END_OF_BUFFER 86 |
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[482] = |
645 | | { 0, |
646 | | 0, 0, 24, 24, 0, 0, 7, 7, 0, 0, |
647 | | 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, |
648 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
649 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
650 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
651 | | 0, 0, 0, 0, 0, 0, 86, 85, 27, 24, |
652 | | 24, 27, 27, 27, 20, 26, 21, 27, 4, 4, |
653 | | 85, 4, 7, 8, 16, 85, 85, 18, 85, 29, |
654 | | 30, 30, 31, 84, 84, 85, 85, 85, 85, 85, |
655 | | 85, 39, 85, 85, 32, 32, 85, 75, 85, 85, |
656 | | |
657 | | 85, 85, 85, 64, 85, 85, 85, 85, 85, 52, |
658 | | 85, 85, 85, 85, 46, 85, 85, 85, 85, 57, |
659 | | 85, 13, 13, 85, 13, 13, 13, 10, 12, 24, |
660 | | 0, 20, 26, 21, 0, 0, 25, 0, 22, 20, |
661 | | 0, 23, 6, 26, 21, 0, 2, 0, 0, 0, |
662 | | 7, 8, 16, 0, 0, 0, 18, 0, 19, 29, |
663 | | 30, 0, 0, 0, 0, 0, 79, 0, 0, 0, |
664 | | 0, 0, 0, 0, 0, 0, 83, 40, 0, 0, |
665 | | 0, 33, 76, 0, 0, 0, 0, 65, 0, 0, |
666 | | 0, 0, 53, 0, 0, 0, 47, 0, 0, 0, |
667 | | |
668 | | 58, 0, 0, 0, 0, 0, 14, 0, 0, 10, |
669 | | 12, 28, 22, 0, 0, 0, 23, 6, 2, 5, |
670 | | 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, |
671 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
672 | | 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
673 | | 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, |
674 | | 3, 0, 0, 5, 0, 0, 0, 0, 0, 0, |
675 | | 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, |
676 | | 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, |
677 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
678 | | |
679 | | 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, |
680 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
681 | | 72, 70, 0, 68, 83, 0, 83, 83, 83, 83, |
682 | | 0, 83, 0, 83, 83, 0, 83, 83, 0, 0, |
683 | | 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, |
684 | | 35, 0, 0, 0, 0, 0, 0, 0, 77, 0, |
685 | | 0, 37, 0, 71, 74, 73, 63, 0, 60, 0, |
686 | | 51, 49, 0, 45, 43, 0, 0, 0, 0, 0, |
687 | | 0, 0, 0, 17, 0, 0, 0, 48, 0, 81, |
688 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
689 | | |
690 | | 0, 0, 0, 0, 11, 0, 15, 0, 0, 0, |
691 | | 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, |
692 | | 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, |
693 | | 0, 80, 54, 0, 66, 0, 0, 0, 0, 0, |
694 | | 0, 0, 0, 1, 0, 0, 0, 0, 41, 67, |
695 | | 83, 0, 83, 83, 83, 83, 0, 1, 0, 0, |
696 | | 0, 0, 69, 0, 62, 50, 44, 55, 0, 34, |
697 | | 0, 36, 0, 83, 83, 82, 0, 61, 56, 78, |
698 | | 0 |
699 | | } ; |
700 | | |
701 | | static const YY_CHAR yy_ec[256] = |
702 | | { 0, |
703 | | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
704 | | 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, |
705 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
706 | | 1, 2, 4, 5, 1, 1, 1, 6, 1, 1, |
707 | | 1, 7, 1, 1, 8, 1, 9, 10, 10, 10, |
708 | | 10, 10, 10, 10, 10, 10, 10, 1, 11, 12, |
709 | | 13, 14, 15, 1, 16, 17, 18, 19, 20, 21, |
710 | | 22, 23, 24, 23, 25, 26, 27, 28, 29, 30, |
711 | | 23, 31, 32, 33, 34, 35, 23, 23, 36, 23, |
712 | | 37, 1, 38, 1, 1, 1, 39, 40, 41, 42, |
713 | | |
714 | | 43, 44, 45, 23, 46, 23, 47, 48, 49, 50, |
715 | | 51, 52, 23, 53, 54, 55, 56, 57, 23, 23, |
716 | | 58, 23, 1, 1, 1, 1, 1, 1, 1, 1, |
717 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
718 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
719 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
720 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
721 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
722 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
723 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
724 | | |
725 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
726 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
727 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
728 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
729 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
730 | | 1, 1, 1, 1, 1 |
731 | | } ; |
732 | | |
733 | | static const YY_CHAR yy_meta[59] = |
734 | | { 0, |
735 | | 1, 1, 1, 1, 2, 1, 3, 4, 1, 4, |
736 | | 1, 1, 5, 1, 1, 4, 4, 4, 4, 4, |
737 | | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, |
738 | | 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, |
739 | | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, |
740 | | 4, 4, 4, 4, 4, 4, 4, 4 |
741 | | } ; |
742 | | |
743 | | static const flex_int16_t yy_base[507] = |
744 | | { 0, |
745 | | 0, 0, 0, 37, 8, 15, 75, 113, 151, 189, |
746 | | 5, 29, 1179, 1178, 1177, 1176, 1175, 1174, 11, 12, |
747 | | 1173, 1172, 12, 22, 1164, 1163, 17, 18, 1162, 1161, |
748 | | 227, 277, 30, 42, 284, 285, 46, 121, 319, 327, |
749 | | 369, 0, 418, 467, 516, 565, 339, 362, 210, 272, |
750 | | 1160, 1154, 1149, 1137, 0, 0, 1137, 1185, 1185, 55, |
751 | | 95, 1058, 0, 1048, 166, 50, 60, 92, 1185, 63, |
752 | | 97, 1053, 70, 0, 0, 129, 65, 0, 134, 0, |
753 | | 1050, 1049, 1185, 1185, 92, 383, 1043, 341, 164, 1040, |
754 | | 1037, 1185, 163, 198, 1185, 1045, 1035, 1185, 186, 204, |
755 | | |
756 | | 195, 237, 1034, 1185, 234, 167, 256, 283, 1032, 1185, |
757 | | 287, 336, 341, 1031, 1185, 291, 385, 396, 1030, 1185, |
758 | | 308, 1185, 426, 432, 1005, 101, 232, 0, 0, 485, |
759 | | 992, 440, 100, 136, 256, 969, 1185, 953, 138, 140, |
760 | | 450, 144, 175, 213, 258, 308, 322, 463, 929, 881, |
761 | | 400, 0, 0, 418, 355, 398, 0, 460, 403, 0, |
762 | | 820, 432, 337, 452, 342, 405, 1185, 497, 449, 461, |
763 | | 460, 494, 472, 489, 471, 815, 1185, 1185, 750, 513, |
764 | | 750, 1185, 1185, 518, 514, 530, 532, 1185, 533, 537, |
765 | | 540, 548, 1185, 552, 555, 564, 1185, 567, 572, 574, |
766 | | |
767 | | 1185, 565, 608, 732, 411, 464, 553, 554, 570, 0, |
768 | | 0, 1185, 617, 705, 574, 577, 626, 628, 632, 634, |
769 | | 583, 637, 608, 608, 611, 610, 616, 615, 630, 619, |
770 | | 630, 622, 626, 626, 622, 627, 625, 625, 632, 632, |
771 | | 698, 672, 673, 674, 675, 676, 677, 658, 678, 687, |
772 | | 688, 689, 691, 692, 694, 709, 710, 722, 736, 692, |
773 | | 738, 693, 703, 740, 707, 711, 727, 721, 732, 735, |
774 | | 726, 725, 732, 732, 1185, 734, 742, 734, 736, 740, |
775 | | 740, 737, 752, 1185, 664, 28, 659, 655, 638, 634, |
776 | | 760, 600, 761, 595, 588, 767, 584, 575, 771, 166, |
777 | | |
778 | | 795, 799, 756, 803, 755, 770, 776, 783, 776, 787, |
779 | | 550, 785, 789, 797, 792, 801, 805, 804, 546, 792, |
780 | | 1185, 1185, 797, 1185, 542, 811, 516, 514, 506, 496, |
781 | | 821, 486, 819, 472, 459, 822, 440, 409, 825, 829, |
782 | | 849, 1185, 860, 811, 822, 863, 829, 836, 846, 393, |
783 | | 1185, 839, 847, 356, 858, 847, 855, 864, 1185, 856, |
784 | | 868, 1185, 878, 1185, 1185, 1185, 1185, 872, 1185, 210, |
785 | | 1185, 1185, 241, 1185, 1185, 425, 883, 887, 907, 910, |
786 | | 871, 870, 916, 1185, 886, 887, 888, 1185, 907, 1185, |
787 | | 901, 899, 912, 911, 913, 915, 922, 926, 929, 934, |
788 | | |
789 | | 937, 933, 931, 938, 1185, 925, 887, 947, 937, 933, |
790 | | 951, 950, 350, 1185, 944, 951, 348, 965, 976, 960, |
791 | | 978, 982, 983, 985, 309, 974, 968, 988, 983, 976, |
792 | | 318, 1185, 1185, 292, 1185, 289, 1001, 255, 253, 249, |
793 | | 243, 997, 215, 1009, 977, 984, 987, 993, 1185, 1185, |
794 | | 216, 1005, 201, 180, 167, 154, 1010, 1038, 115, 996, |
795 | | 1006, 1007, 1185, 97, 1185, 1185, 1185, 1185, 78, 1185, |
796 | | 71, 1185, 1014, 51, 49, 1185, 34, 1185, 1185, 1185, |
797 | | 1185, 1065, 1070, 1075, 1080, 1085, 1090, 1095, 1100, 1105, |
798 | | 1110, 1115, 1120, 1125, 1130, 40, 24, 0, 1135, 1140, |
799 | | |
800 | | 1142, 1147, 1152, 1157, 1162, 1167 |
801 | | } ; |
802 | | |
803 | | static const flex_int16_t yy_def[507] = |
804 | | { 0, |
805 | | 482, 482, 483, 483, 484, 484, 485, 485, 486, 486, |
806 | | 482, 482, 487, 487, 482, 482, 488, 488, 482, 482, |
807 | | 482, 482, 489, 489, 482, 482, 482, 482, 482, 482, |
808 | | 490, 490, 491, 491, 32, 32, 32, 32, 32, 32, |
809 | | 32, 41, 41, 41, 41, 41, 32, 32, 492, 492, |
810 | | 493, 493, 494, 494, 482, 482, 481, 481, 481, 481, |
811 | | 481, 495, 496, 481, 481, 481, 481, 481, 481, 481, |
812 | | 481, 481, 481, 497, 498, 481, 481, 499, 481, 500, |
813 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 501, |
814 | | 481, 481, 501, 501, 481, 502, 481, 481, 501, 501, |
815 | | |
816 | | 501, 501, 481, 481, 501, 501, 501, 501, 481, 481, |
817 | | 501, 501, 501, 481, 481, 501, 501, 501, 481, 481, |
818 | | 501, 481, 481, 481, 481, 481, 481, 503, 504, 481, |
819 | | 481, 481, 481, 481, 481, 495, 481, 496, 481, 481, |
820 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
821 | | 481, 497, 498, 481, 481, 481, 499, 481, 481, 500, |
822 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
823 | | 481, 481, 481, 481, 481, 501, 481, 481, 501, 501, |
824 | | 502, 481, 481, 501, 501, 501, 501, 481, 501, 501, |
825 | | 501, 501, 481, 501, 501, 501, 481, 501, 501, 501, |
826 | | |
827 | | 481, 501, 481, 481, 481, 481, 481, 481, 481, 503, |
828 | | 504, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
829 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
830 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
831 | | 481, 501, 501, 501, 501, 501, 501, 501, 501, 501, |
832 | | 501, 501, 501, 501, 501, 501, 501, 481, 481, 481, |
833 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
834 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
835 | | 481, 481, 481, 481, 501, 501, 501, 501, 501, 501, |
836 | | 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, |
837 | | |
838 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
839 | | 505, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
840 | | 481, 481, 481, 481, 481, 501, 481, 481, 481, 481, |
841 | | 501, 481, 501, 481, 481, 501, 481, 481, 501, 501, |
842 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 505, |
843 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
844 | | 481, 481, 501, 481, 481, 481, 481, 501, 481, 501, |
845 | | 481, 481, 501, 481, 481, 501, 501, 501, 481, 481, |
846 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
847 | | 481, 481, 481, 481, 481, 481, 501, 501, 501, 501, |
848 | | |
849 | | 501, 501, 501, 481, 481, 481, 481, 481, 481, 481, |
850 | | 481, 481, 481, 481, 481, 481, 481, 501, 501, 501, |
851 | | 501, 501, 501, 501, 506, 481, 481, 481, 481, 481, |
852 | | 481, 481, 481, 481, 481, 501, 501, 501, 501, 501, |
853 | | 501, 501, 506, 481, 481, 481, 481, 481, 481, 481, |
854 | | 481, 501, 481, 481, 481, 481, 501, 481, 481, 481, |
855 | | 481, 481, 481, 501, 481, 481, 481, 481, 501, 481, |
856 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
857 | | 0, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
858 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
859 | | |
860 | | 481, 481, 481, 481, 481, 481 |
861 | | } ; |
862 | | |
863 | | static const flex_int16_t yy_nxt[1244] = |
864 | | { 0, |
865 | | 481, 60, 61, 153, 62, 63, 76, 76, 64, 70, |
866 | | 71, 65, 66, 67, 58, 72, 70, 71, 81, 81, |
867 | | 82, 82, 72, 85, 58, 87, 87, 152, 88, 88, |
868 | | 76, 76, 58, 85, 96, 326, 77, 68, 60, 61, |
869 | | 177, 62, 63, 138, 58, 64, 96, 480, 65, 66, |
870 | | 67, 144, 144, 479, 97, 478, 130, 130, 77, 98, |
871 | | 77, 145, 145, 131, 148, 148, 132, 133, 134, 90, |
872 | | 149, 151, 151, 100, 68, 58, 73, 73, 58, 58, |
873 | | 58, 58, 77, 58, 476, 58, 58, 58, 58, 58, |
874 | | 475, 90, 135, 146, 146, 100, 130, 130, 148, 148, |
875 | | |
876 | | 156, 144, 144, 131, 149, 147, 132, 133, 134, 474, |
877 | | 162, 58, 58, 58, 73, 73, 58, 58, 58, 58, |
878 | | 208, 58, 156, 58, 58, 58, 58, 58, 470, 97, |
879 | | 154, 154, 135, 162, 98, 158, 158, 145, 145, 213, |
880 | | 213, 140, 140, 208, 90, 217, 217, 159, 100, 58, |
881 | | 58, 58, 58, 58, 58, 58, 58, 58, 468, 58, |
882 | | 155, 58, 58, 58, 58, 58, 90, 140, 140, 141, |
883 | | 100, 467, 172, 340, 142, 177, 218, 218, 177, 177, |
884 | | 143, 179, 155, 173, 466, 174, 190, 58, 58, 58, |
885 | | 58, 58, 58, 58, 58, 58, 175, 58, 177, 58, |
886 | | |
887 | | 58, 58, 58, 58, 179, 465, 173, 177, 174, 190, |
888 | | 177, 123, 124, 180, 144, 144, 177, 399, 175, 185, |
889 | | 463, 184, 177, 186, 125, 58, 58, 58, 58, 58, |
890 | | 58, 58, 58, 58, 126, 91, 180, 58, 58, 58, |
891 | | 92, 58, 185, 184, 127, 186, 177, 209, 400, 177, |
892 | | 93, 444, 187, 177, 94, 456, 126, 146, 146, 145, |
893 | | 145, 455, 189, 58, 58, 454, 127, 453, 177, 147, |
894 | | 209, 191, 93, 123, 124, 187, 94, 58, 58, 58, |
895 | | 58, 58, 58, 58, 189, 91, 125, 58, 58, 58, |
896 | | 92, 58, 97, 97, 191, 177, 126, 98, 98, 177, |
897 | | |
898 | | 93, 451, 192, 177, 94, 450, 127, 90, 90, 146, |
899 | | 146, 90, 90, 58, 58, 194, 99, 99, 126, 198, |
900 | | 177, 147, 93, 219, 219, 192, 94, 97, 127, 90, |
901 | | 90, 449, 98, 90, 90, 97, 101, 194, 99, 99, |
902 | | 98, 198, 90, 202, 101, 444, 102, 119, 177, 168, |
903 | | 90, 195, 120, 177, 102, 224, 169, 226, 170, 101, |
904 | | 196, 435, 90, 432, 90, 202, 90, 101, 102, 390, |
905 | | 119, 121, 90, 171, 195, 120, 102, 103, 224, 169, |
906 | | 226, 170, 104, 196, 90, 90, 105, 106, 90, 90, |
907 | | 156, 163, 90, 121, 121, 171, 107, 177, 164, 165, |
908 | | |
909 | | 199, 151, 151, 108, 222, 222, 351, 90, 177, 105, |
910 | | 106, 90, 156, 375, 90, 200, 121, 166, 107, 154, |
911 | | 154, 164, 165, 199, 227, 108, 109, 203, 203, 221, |
912 | | 208, 110, 401, 203, 203, 111, 90, 177, 200, 166, |
913 | | 204, 140, 140, 141, 374, 112, 204, 227, 142, 155, |
914 | | 205, 221, 113, 208, 143, 223, 205, 214, 111, 90, |
915 | | 206, 158, 158, 372, 148, 148, 206, 112, 215, 216, |
916 | | 149, 155, 205, 159, 113, 109, 371, 223, 205, 209, |
917 | | 110, 225, 206, 232, 111, 90, 130, 130, 206, 233, |
918 | | 369, 215, 216, 131, 112, 234, 132, 133, 134, 237, |
919 | | |
920 | | 367, 113, 209, 225, 238, 232, 240, 111, 90, 235, |
921 | | 366, 233, 228, 229, 230, 236, 112, 234, 365, 239, |
922 | | 364, 237, 135, 113, 114, 177, 177, 238, 240, 115, |
923 | | 177, 231, 235, 116, 90, 228, 229, 230, 236, 242, |
924 | | 244, 239, 177, 117, 177, 177, 362, 243, 245, 177, |
925 | | 118, 247, 177, 231, 258, 258, 116, 90, 246, 359, |
926 | | 177, 242, 244, 351, 177, 117, 249, 177, 248, 243, |
927 | | 251, 245, 118, 114, 247, 250, 177, 177, 115, 177, |
928 | | 246, 252, 116, 90, 177, 254, 177, 338, 249, 259, |
929 | | 248, 253, 117, 251, 257, 260, 337, 250, 255, 118, |
930 | | |
931 | | 335, 256, 262, 252, 263, 116, 90, 334, 254, 203, |
932 | | 203, 259, 332, 253, 117, 265, 257, 260, 213, 213, |
933 | | 255, 118, 204, 256, 262, 266, 263, 217, 217, 218, |
934 | | 218, 267, 205, 219, 219, 264, 264, 265, 222, 222, |
935 | | 268, 269, 206, 270, 271, 272, 330, 273, 266, 274, |
936 | | 329, 275, 276, 267, 205, 277, 278, 279, 280, 281, |
937 | | 282, 283, 268, 269, 206, 270, 271, 328, 272, 273, |
938 | | 177, 327, 274, 275, 276, 291, 325, 277, 278, 279, |
939 | | 280, 281, 282, 283, 177, 177, 177, 177, 177, 177, |
940 | | 177, 285, 286, 287, 288, 289, 290, 292, 291, 177, |
941 | | |
942 | | 177, 177, 284, 177, 177, 293, 177, 294, 295, 296, |
943 | | 305, 297, 261, 298, 285, 286, 287, 288, 289, 290, |
944 | | 292, 177, 177, 258, 258, 303, 307, 299, 293, 300, |
945 | | 294, 295, 296, 305, 297, 306, 298, 301, 301, 304, |
946 | | 304, 264, 264, 308, 309, 207, 310, 303, 302, 307, |
947 | | 299, 311, 300, 312, 182, 313, 314, 306, 315, 316, |
948 | | 317, 318, 241, 319, 320, 308, 321, 309, 310, 322, |
949 | | 323, 324, 177, 177, 311, 343, 312, 313, 314, 177, |
950 | | 315, 316, 317, 177, 318, 319, 320, 344, 321, 333, |
951 | | 331, 322, 323, 345, 324, 336, 301, 301, 343, 339, |
952 | | |
953 | | 341, 341, 346, 342, 304, 304, 347, 302, 348, 344, |
954 | | 349, 333, 331, 352, 353, 345, 354, 336, 355, 356, |
955 | | 357, 339, 358, 177, 346, 360, 361, 177, 347, 161, |
956 | | 348, 177, 349, 177, 177, 352, 353, 177, 363, 354, |
957 | | 355, 177, 356, 357, 368, 358, 381, 360, 361, 370, |
958 | | 341, 341, 373, 342, 382, 376, 377, 385, 378, 386, |
959 | | 363, 379, 379, 387, 383, 383, 368, 384, 381, 388, |
960 | | 389, 370, 380, 391, 373, 392, 382, 376, 377, 385, |
961 | | 378, 386, 393, 394, 177, 395, 387, 396, 426, 426, |
962 | | 177, 388, 389, 397, 220, 177, 391, 392, 402, 177, |
963 | | |
964 | | 406, 398, 403, 410, 393, 407, 394, 395, 379, 379, |
965 | | 396, 404, 404, 408, 405, 409, 397, 383, 383, 380, |
966 | | 384, 402, 406, 398, 411, 403, 410, 407, 412, 413, |
967 | | 414, 415, 416, 417, 177, 408, 150, 409, 177, 404, |
968 | | 404, 177, 405, 177, 425, 177, 177, 411, 418, 177, |
969 | | 412, 413, 420, 414, 415, 416, 417, 421, 419, 423, |
970 | | 422, 424, 427, 212, 428, 429, 430, 425, 431, 434, |
971 | | 418, 433, 177, 137, 420, 426, 426, 177, 438, 421, |
972 | | 419, 423, 422, 424, 436, 427, 428, 429, 177, 430, |
973 | | 177, 431, 434, 433, 177, 177, 439, 177, 445, 437, |
974 | | |
975 | | 440, 438, 441, 446, 442, 139, 447, 436, 448, 177, |
976 | | 458, 458, 459, 177, 460, 461, 462, 177, 207, 439, |
977 | | 445, 437, 177, 440, 457, 441, 446, 442, 447, 452, |
978 | | 448, 471, 464, 472, 459, 473, 460, 461, 462, 458, |
979 | | 458, 477, 469, 201, 197, 193, 457, 188, 183, 182, |
980 | | 178, 452, 177, 471, 464, 472, 167, 473, 161, 161, |
981 | | 150, 139, 137, 477, 469, 58, 58, 58, 58, 58, |
982 | | 59, 59, 59, 59, 59, 69, 69, 69, 69, 69, |
983 | | 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, |
984 | | 78, 78, 78, 78, 78, 80, 80, 80, 80, 80, |
985 | | |
986 | | 84, 84, 84, 84, 84, 90, 90, 90, 90, 90, |
987 | | 95, 95, 95, 95, 95, 122, 122, 122, 122, 122, |
988 | | 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, |
989 | | 136, 136, 136, 136, 136, 157, 481, 157, 157, 157, |
990 | | 160, 58, 160, 160, 160, 176, 176, 181, 181, 181, |
991 | | 181, 181, 210, 58, 210, 210, 210, 211, 58, 211, |
992 | | 211, 211, 350, 350, 58, 350, 350, 443, 443, 443, |
993 | | 443, 443, 89, 89, 86, 86, 83, 83, 58, 58, |
994 | | 79, 79, 58, 58, 57, 481, 481, 481, 481, 481, |
995 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
996 | | |
997 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
998 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
999 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1000 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1001 | | 481, 481, 481 |
1002 | | } ; |
1003 | | |
1004 | | static const flex_int16_t yy_chk[1244] = |
1005 | | { 0, |
1006 | | 0, 3, 3, 498, 3, 3, 11, 11, 3, 5, |
1007 | | 5, 3, 3, 3, 23, 5, 6, 6, 19, 20, |
1008 | | 19, 20, 6, 23, 24, 27, 28, 497, 27, 28, |
1009 | | 12, 12, 33, 24, 33, 286, 11, 3, 4, 4, |
1010 | | 286, 4, 4, 496, 34, 4, 34, 477, 4, 4, |
1011 | | 4, 66, 66, 475, 37, 474, 60, 60, 11, 37, |
1012 | | 12, 67, 67, 60, 70, 70, 60, 60, 60, 37, |
1013 | | 70, 73, 73, 37, 4, 7, 7, 7, 7, 7, |
1014 | | 7, 7, 12, 7, 471, 7, 7, 7, 7, 7, |
1015 | | 469, 37, 60, 68, 68, 37, 61, 61, 71, 71, |
1016 | | |
1017 | | 77, 133, 133, 61, 71, 68, 61, 61, 61, 464, |
1018 | | 85, 7, 7, 8, 8, 8, 8, 8, 8, 8, |
1019 | | 126, 8, 77, 8, 8, 8, 8, 8, 459, 38, |
1020 | | 76, 76, 61, 85, 38, 79, 79, 134, 134, 139, |
1021 | | 139, 140, 140, 126, 38, 142, 142, 79, 38, 8, |
1022 | | 8, 9, 9, 9, 9, 9, 9, 9, 456, 9, |
1023 | | 76, 9, 9, 9, 9, 9, 38, 65, 65, 65, |
1024 | | 38, 455, 89, 300, 65, 93, 143, 143, 300, 106, |
1025 | | 65, 93, 76, 89, 454, 89, 106, 9, 9, 10, |
1026 | | 10, 10, 10, 10, 10, 10, 89, 10, 99, 10, |
1027 | | |
1028 | | 10, 10, 10, 10, 93, 453, 89, 101, 89, 106, |
1029 | | 94, 49, 49, 94, 144, 144, 100, 370, 89, 100, |
1030 | | 451, 99, 370, 101, 49, 10, 10, 31, 31, 31, |
1031 | | 31, 31, 31, 31, 49, 31, 94, 31, 31, 31, |
1032 | | 31, 31, 100, 99, 49, 101, 105, 127, 373, 102, |
1033 | | 31, 443, 102, 373, 31, 441, 49, 135, 135, 145, |
1034 | | 145, 440, 105, 31, 31, 439, 49, 438, 107, 135, |
1035 | | 127, 107, 31, 50, 50, 102, 31, 32, 32, 32, |
1036 | | 32, 32, 32, 32, 105, 32, 50, 32, 32, 32, |
1037 | | 32, 32, 35, 36, 107, 108, 50, 35, 36, 111, |
1038 | | |
1039 | | 32, 436, 108, 116, 32, 434, 50, 35, 36, 146, |
1040 | | 146, 35, 36, 32, 32, 111, 35, 36, 50, 116, |
1041 | | 121, 146, 32, 147, 147, 108, 32, 39, 50, 35, |
1042 | | 36, 431, 39, 35, 36, 40, 39, 111, 35, 36, |
1043 | | 40, 116, 39, 121, 40, 425, 39, 47, 112, 88, |
1044 | | 40, 112, 47, 113, 40, 163, 88, 165, 88, 39, |
1045 | | 113, 417, 47, 413, 39, 121, 47, 40, 39, 354, |
1046 | | 48, 47, 40, 88, 112, 48, 40, 41, 163, 88, |
1047 | | 165, 88, 41, 113, 47, 48, 41, 41, 47, 48, |
1048 | | 155, 86, 41, 47, 48, 88, 41, 117, 86, 86, |
1049 | | |
1050 | | 117, 151, 151, 41, 159, 159, 350, 48, 118, 41, |
1051 | | 41, 48, 155, 338, 41, 118, 48, 86, 41, 154, |
1052 | | 154, 86, 86, 117, 166, 41, 43, 123, 123, 156, |
1053 | | 205, 43, 376, 124, 124, 43, 43, 376, 118, 86, |
1054 | | 123, 132, 132, 132, 337, 43, 124, 166, 132, 154, |
1055 | | 123, 156, 43, 205, 132, 162, 124, 141, 43, 43, |
1056 | | 123, 158, 158, 335, 148, 148, 124, 43, 141, 141, |
1057 | | 148, 154, 123, 158, 43, 44, 334, 162, 124, 206, |
1058 | | 44, 164, 123, 169, 44, 44, 130, 130, 124, 170, |
1059 | | 332, 141, 141, 130, 44, 171, 130, 130, 130, 173, |
1060 | | |
1061 | | 330, 44, 206, 164, 174, 169, 175, 44, 44, 172, |
1062 | | 329, 170, 168, 168, 168, 172, 44, 171, 328, 174, |
1063 | | 327, 173, 130, 44, 45, 180, 185, 174, 175, 45, |
1064 | | 184, 168, 172, 45, 45, 168, 168, 168, 172, 180, |
1065 | | 185, 174, 186, 45, 187, 189, 325, 184, 186, 190, |
1066 | | 45, 189, 191, 168, 207, 207, 45, 45, 187, 319, |
1067 | | 192, 180, 185, 311, 194, 45, 191, 195, 190, 184, |
1068 | | 194, 186, 45, 46, 189, 192, 196, 202, 46, 198, |
1069 | | 187, 195, 46, 46, 199, 198, 200, 298, 191, 208, |
1070 | | 190, 196, 46, 194, 202, 209, 297, 192, 199, 46, |
1071 | | |
1072 | | 295, 200, 215, 195, 216, 46, 46, 294, 198, 203, |
1073 | | 203, 208, 292, 196, 46, 221, 202, 209, 213, 213, |
1074 | | 199, 46, 203, 200, 215, 223, 216, 217, 217, 218, |
1075 | | 218, 224, 203, 219, 219, 220, 220, 221, 222, 222, |
1076 | | 225, 226, 203, 227, 228, 229, 290, 230, 223, 231, |
1077 | | 289, 232, 233, 224, 203, 234, 235, 236, 237, 238, |
1078 | | 239, 240, 225, 226, 203, 227, 228, 288, 229, 230, |
1079 | | 248, 287, 231, 232, 233, 248, 285, 234, 235, 236, |
1080 | | 237, 238, 239, 240, 242, 243, 244, 245, 246, 247, |
1081 | | 249, 242, 243, 244, 245, 246, 247, 249, 248, 250, |
1082 | | |
1083 | | 251, 252, 241, 253, 254, 250, 255, 251, 252, 253, |
1084 | | 262, 254, 214, 255, 242, 243, 244, 245, 246, 247, |
1085 | | 249, 256, 257, 258, 258, 260, 265, 256, 250, 257, |
1086 | | 251, 252, 253, 262, 254, 263, 255, 259, 259, 261, |
1087 | | 261, 264, 264, 266, 267, 204, 268, 260, 259, 265, |
1088 | | 256, 269, 257, 270, 181, 271, 272, 263, 273, 274, |
1089 | | 276, 277, 179, 278, 279, 266, 280, 267, 268, 281, |
1090 | | 282, 283, 291, 293, 269, 303, 270, 271, 272, 296, |
1091 | | 273, 274, 276, 299, 277, 278, 279, 305, 280, 293, |
1092 | | 291, 281, 282, 306, 283, 296, 301, 301, 303, 299, |
1093 | | |
1094 | | 302, 302, 307, 302, 304, 304, 308, 301, 309, 305, |
1095 | | 310, 293, 291, 312, 313, 306, 314, 296, 315, 316, |
1096 | | 317, 299, 318, 326, 307, 320, 323, 176, 308, 161, |
1097 | | 309, 333, 310, 331, 336, 312, 313, 339, 326, 314, |
1098 | | 315, 340, 316, 317, 331, 318, 344, 320, 323, 333, |
1099 | | 341, 341, 336, 341, 345, 339, 340, 347, 340, 348, |
1100 | | 326, 343, 343, 349, 346, 346, 331, 346, 344, 352, |
1101 | | 353, 333, 343, 355, 336, 356, 345, 339, 340, 347, |
1102 | | 340, 348, 357, 358, 368, 360, 349, 361, 407, 407, |
1103 | | 363, 352, 353, 363, 150, 377, 355, 356, 377, 378, |
1104 | | |
1105 | | 381, 368, 378, 387, 357, 382, 358, 360, 379, 379, |
1106 | | 361, 380, 380, 385, 380, 386, 363, 383, 383, 379, |
1107 | | 383, 377, 381, 368, 389, 378, 387, 382, 391, 392, |
1108 | | 393, 394, 395, 396, 397, 385, 149, 386, 398, 404, |
1109 | | 404, 399, 404, 403, 406, 402, 400, 389, 397, 401, |
1110 | | 391, 392, 399, 393, 394, 395, 396, 400, 398, 402, |
1111 | | 401, 403, 408, 138, 409, 410, 411, 406, 412, 416, |
1112 | | 397, 415, 420, 136, 399, 426, 426, 418, 420, 400, |
1113 | | 398, 402, 401, 403, 418, 408, 409, 410, 419, 411, |
1114 | | 421, 412, 416, 415, 422, 423, 421, 424, 427, 419, |
1115 | | |
1116 | | 422, 420, 423, 428, 424, 131, 429, 418, 430, 442, |
1117 | | 444, 444, 445, 437, 446, 447, 448, 452, 125, 421, |
1118 | | 427, 419, 457, 422, 442, 423, 428, 424, 429, 437, |
1119 | | 430, 460, 452, 461, 445, 462, 446, 447, 448, 458, |
1120 | | 458, 473, 457, 119, 114, 109, 442, 103, 97, 96, |
1121 | | 91, 437, 90, 460, 452, 461, 87, 462, 82, 81, |
1122 | | 72, 64, 62, 473, 457, 482, 482, 482, 482, 482, |
1123 | | 483, 483, 483, 483, 483, 484, 484, 484, 484, 484, |
1124 | | 485, 485, 485, 485, 485, 486, 486, 486, 486, 486, |
1125 | | 487, 487, 487, 487, 487, 488, 488, 488, 488, 488, |
1126 | | |
1127 | | 489, 489, 489, 489, 489, 490, 490, 490, 490, 490, |
1128 | | 491, 491, 491, 491, 491, 492, 492, 492, 492, 492, |
1129 | | 493, 493, 493, 493, 493, 494, 494, 494, 494, 494, |
1130 | | 495, 495, 495, 495, 495, 499, 57, 499, 499, 499, |
1131 | | 500, 54, 500, 500, 500, 501, 501, 502, 502, 502, |
1132 | | 502, 502, 503, 53, 503, 503, 503, 504, 52, 504, |
1133 | | 504, 504, 505, 505, 51, 505, 505, 506, 506, 506, |
1134 | | 506, 506, 30, 29, 26, 25, 22, 21, 18, 17, |
1135 | | 16, 15, 14, 13, 481, 481, 481, 481, 481, 481, |
1136 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1137 | | |
1138 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1139 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1140 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1141 | | 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, |
1142 | | 481, 481, 481 |
1143 | | } ; |
1144 | | |
1145 | | static const flex_int16_t yy_rule_linenum[85] = |
1146 | | { 0, |
1147 | | 260, 261, 263, 264, 265, 267, 268, 269, 284, 285, |
1148 | | 287, 288, 290, 291, 294, 295, 302, 303, 307, 309, |
1149 | | 311, 313, 315, 317, 319, 321, 323, 325, 384, 391, |
1150 | | 398, 400, 405, 410, 416, 421, 437, 438, 440, 441, |
1151 | | 443, 445, 462, 463, 464, 465, 466, 468, 484, 485, |
1152 | | 486, 487, 488, 490, 506, 507, 508, 509, 512, 533, |
1153 | | 534, 535, 536, 537, 538, 541, 542, 544, 545, 547, |
1154 | | 564, 567, 584, 585, 587, 588, 590, 592, 595, 598, |
1155 | | 601, 605, 609, 611 |
1156 | | } ; |
1157 | | |
1158 | | /* The intent behind this definition is that it'll catch |
1159 | | * any uses of REJECT which flex missed. |
1160 | | */ |
1161 | | #define REJECT reject_used_but_not_detected |
1162 | | #define yymore() yymore_used_but_not_detected |
1163 | 0 | #define YY_MORE_ADJ 0 |
1164 | | #define YY_RESTORE_YY_MORE_OFFSET |
1165 | | #line 1 "/src/wireshark/epan/diam_dict.l" |
1166 | | |
1167 | | /* |
1168 | | * We want a reentrant scanner. |
1169 | | */ |
1170 | | /* |
1171 | | * We don't use input, so don't generate code for it. |
1172 | | */ |
1173 | | #define YY_NO_INPUT 1 |
1174 | | /* |
1175 | | * We don't use unput, so don't generate code for it. |
1176 | | */ |
1177 | | /* |
1178 | | * We don't read interactively from the terminal. |
1179 | | */ |
1180 | | /* |
1181 | | * The language we're scanning is case-insensitive. |
1182 | | */ |
1183 | | /* |
1184 | | * We use start condition stacks. |
1185 | | */ |
1186 | | /* |
1187 | | * We want to stop processing when we get to the end of the input. |
1188 | | */ |
1189 | | /* |
1190 | | * The type for the state we keep for a scanner. |
1191 | | */ |
1192 | | /* |
1193 | | * Prefix scanner routines with "DiamDict_" rather than "yy", so this scanner |
1194 | | * can coexist with other scanners. |
1195 | | */ |
1196 | | /* |
1197 | | * We have to override the memory allocators so that we don't get |
1198 | | * "unused argument" warnings from the yyscanner argument (which |
1199 | | * we don't use, as we have a global memory allocator). |
1200 | | * |
1201 | | * We provide, as macros, our own versions of the routines generated by Flex, |
1202 | | * which just call malloc()/realloc()/free() (as the Flex versions do), |
1203 | | * discarding the extra argument. |
1204 | | */ |
1205 | | #line 67 "/src/wireshark/epan/diam_dict.l" |
1206 | | /* |
1207 | | ** diam_dict.h |
1208 | | ** Diameter Dictionary Import Routines |
1209 | | ** |
1210 | | ** (c) 2007, Luis E. Garcia Ontanon <luis@ontanon.org> |
1211 | | ** |
1212 | | ** SPDX-License-Identifier: LGPL-2.0-or-later |
1213 | | ** |
1214 | | ** See draft-frascone-xml-dictionary for the syntax of the |
1215 | | ** dictionary. |
1216 | | */ |
1217 | | |
1218 | | #include <glib.h> |
1219 | | #include <stdio.h> |
1220 | | #include <string.h> |
1221 | | #include <errno.h> |
1222 | | #include <stdlib.h> |
1223 | | #include <stdarg.h> |
1224 | | #include "diam_dict.h" |
1225 | | #include <epan/to_str.h> |
1226 | | #include <wsutil/file_util.h> |
1227 | | |
1228 | | /* |
1229 | | * Disable diagnostics in the code generated by Flex. |
1230 | | */ |
1231 | | DIAG_OFF_FLEX() |
1232 | | |
1233 | | typedef struct entity_t { |
1234 | | char* name; |
1235 | | char* file; |
1236 | | struct entity_t* next; |
1237 | | } entity_t; |
1238 | | |
1239 | 0 | #define ATTR_UINT(cont) do { D(("attr_uint " #cont "\t" )); yyextra->attr_uint = &(cont); yy_push_state(GET_UINT_ATTR, yyscanner); } while(0) |
1240 | 0 | #define ATTR_STR(cont) do { D(("attr_str " #cont "\t" )); yyextra->attr_str = &(cont); yy_push_state(GET_ATTR, yyscanner); } while(0) |
1241 | 0 | #define IGNORE() do { D(("ignore: %s\t",yytext)); yy_push_state(IGNORE_ATTR, yyscanner); } while(0) |
1242 | | |
1243 | 4 | #define D(args) ddict_debug args |
1244 | | |
1245 | 0 | #define MAX_INCLUDE_DEPTH 10 |
1246 | 0 | #define YY_INPUT(buf,result,max_size) { result = yyextra->current_yyinput(buf,max_size,yyscanner); } |
1247 | 0 | #define YY_USER_INIT { \ |
1248 | 0 | DiamDict_scanner_state_t *scanner_state = DiamDict_get_extra(yyscanner); \ |
1249 | 0 | BEGIN(scanner_state->start_state); \ |
1250 | 0 | } |
1251 | | #define ECHO |
1252 | 0 | #define APPEND(txt,len) append_to_buffer(txt,len,yyextra) |
1253 | | |
1254 | | typedef struct { |
1255 | | const char* sys_dir; |
1256 | | |
1257 | | char* write_ptr; |
1258 | | char* read_ptr; |
1259 | | |
1260 | | char* strbuf; |
1261 | | unsigned size_strbuf; |
1262 | | unsigned len_strbuf; |
1263 | | |
1264 | | ddict_t* dict; |
1265 | | |
1266 | | ddict_application_t* appl; |
1267 | | ddict_avp_t* avp; |
1268 | | ddict_enum_t* enumitem; |
1269 | | ddict_gavp_t* gavp; |
1270 | | ddict_typedefn_t* typedefn; |
1271 | | ddict_cmd_t* cmd; |
1272 | | ddict_vendor_t* vnd; |
1273 | | ddict_xmlpi_t* xmlpi; |
1274 | | |
1275 | | ddict_application_t* last_appl; |
1276 | | ddict_avp_t* last_avp; |
1277 | | ddict_enum_t* last_enumitem; |
1278 | | ddict_gavp_t* last_gavp; |
1279 | | ddict_typedefn_t* last_typedefn; |
1280 | | ddict_cmd_t* last_cmd; |
1281 | | ddict_vendor_t* last_vnd; |
1282 | | ddict_xmlpi_t* last_xmlpi; |
1283 | | |
1284 | | entity_t *ents; |
1285 | | |
1286 | | char** attr_str; |
1287 | | unsigned* attr_uint; |
1288 | | |
1289 | | size_t (*current_yyinput)(char*,size_t,yyscan_t); |
1290 | | int (*current_close)(FILE *fh); |
1291 | | |
1292 | | YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; |
1293 | | int include_stack_ptr; |
1294 | | |
1295 | | int start_state; |
1296 | | } DiamDict_scanner_state_t; |
1297 | | |
1298 | | static void ddict_debug(const char* fmt, ...) G_GNUC_PRINTF(1, 2); |
1299 | | static void append_to_buffer(const char* txt, unsigned len, DiamDict_scanner_state_t *statep); |
1300 | | static FILE* ddict_open(const char*, const char*); |
1301 | | |
1302 | | /* |
1303 | | * Sleazy hack to suppress compiler warnings in yy_fatal_error(). |
1304 | | */ |
1305 | 0 | #define YY_EXIT_FAILURE ((void)yyscanner, 2) |
1306 | | |
1307 | | /* |
1308 | | * Macros for the allocators, to discard the extra argument. |
1309 | | */ |
1310 | 0 | #define DiamDict_alloc(size, yyscanner) (void *)malloc(size) |
1311 | 0 | #define DiamDict_realloc(ptr, size, yyscanner) (void *)realloc((char *)(ptr), (size)) |
1312 | 0 | #define DiamDict_free(ptr, yyscanner) free((char *)ptr) |
1313 | | |
1314 | | #line 1315 "/work/build/epan/diam_dict.c" |
1315 | | |
1316 | | #line 1317 "/work/build/epan/diam_dict.c" |
1317 | | |
1318 | | #define INITIAL 0 |
1319 | 0 | #define LOADING 1 |
1320 | 0 | #define LOADING_COMMENT 2 |
1321 | 0 | #define LOADING_XMLPI 3 |
1322 | 0 | #define ENTITY 4 |
1323 | 0 | #define GET_SYSTEM 5 |
1324 | 0 | #define GET_FILE 6 |
1325 | 0 | #define END_ENTITY 7 |
1326 | 0 | #define GET_ATTR 8 |
1327 | 0 | #define GET_UINT_ATTR 9 |
1328 | 0 | #define END_ATTR 10 |
1329 | 0 | #define OUTSIDE 11 |
1330 | 0 | #define IN_DICT 12 |
1331 | 0 | #define IN_APPL 13 |
1332 | 0 | #define IN_AVP 14 |
1333 | 0 | #define APPL_ATTRS 15 |
1334 | 0 | #define IGNORE_ATTR 16 |
1335 | 0 | #define TYPE_ATTRS 17 |
1336 | 0 | #define GAVP_ATTRS 18 |
1337 | 0 | #define ENUM_ATTRS 19 |
1338 | 0 | #define AVP_ATTRS 20 |
1339 | 0 | #define VENDOR_ATTRS 21 |
1340 | 0 | #define COMMAND_ATTRS 22 |
1341 | 0 | #define TYPEDEFN_ATTRS 23 |
1342 | 0 | #define XMLPI_ATTRS 24 |
1343 | 0 | #define XMLPI_GETKEY 25 |
1344 | 0 | #define XMLPI_GETVAL 26 |
1345 | | #define XMLPI_ENDATTR 27 |
1346 | | |
1347 | | #ifndef YY_NO_UNISTD_H |
1348 | | /* Special case for "unistd.h", since it is non-ANSI. We include it way |
1349 | | * down here because we want the user's section 1 to have been scanned first. |
1350 | | * The user has a chance to override it with an option. |
1351 | | */ |
1352 | | /* %if-c-only */ |
1353 | | #include <unistd.h> |
1354 | | /* %endif */ |
1355 | | /* %if-c++-only */ |
1356 | | /* %endif */ |
1357 | | #endif |
1358 | | |
1359 | | #define YY_EXTRA_TYPE DiamDict_scanner_state_t * |
1360 | | |
1361 | | /* %if-c-only Reentrant structure and macros (non-C++). */ |
1362 | | /* %if-reentrant */ |
1363 | | |
1364 | | /* Holds the entire state of the reentrant scanner. */ |
1365 | | struct yyguts_t |
1366 | | { |
1367 | | |
1368 | | /* User-defined. Not touched by flex. */ |
1369 | | YY_EXTRA_TYPE yyextra_r; |
1370 | | |
1371 | | /* The rest are the same as the globals declared in the non-reentrant scanner. */ |
1372 | | FILE *yyin_r, *yyout_r; |
1373 | | size_t yy_buffer_stack_top; /**< index of top of stack. */ |
1374 | | size_t yy_buffer_stack_max; /**< capacity of stack. */ |
1375 | | YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ |
1376 | | char yy_hold_char; |
1377 | | int yy_n_chars; |
1378 | | int yyleng_r; |
1379 | | char *yy_c_buf_p; |
1380 | | int yy_init; |
1381 | | int yy_start; |
1382 | | int yy_did_buffer_switch_on_eof; |
1383 | | int yy_start_stack_ptr; |
1384 | | int yy_start_stack_depth; |
1385 | | int *yy_start_stack; |
1386 | | yy_state_type yy_last_accepting_state; |
1387 | | char* yy_last_accepting_cpos; |
1388 | | |
1389 | | int yylineno_r; |
1390 | | int yy_flex_debug_r; |
1391 | | |
1392 | | char *yytext_r; |
1393 | | int yy_more_flag; |
1394 | | int yy_more_len; |
1395 | | |
1396 | | }; /* end struct yyguts_t */ |
1397 | | |
1398 | | /* %if-c-only */ |
1399 | | |
1400 | | static int yy_init_globals ( yyscan_t yyscanner ); |
1401 | | |
1402 | | /* %endif */ |
1403 | | |
1404 | | /* %if-reentrant */ |
1405 | | |
1406 | | int yylex_init (yyscan_t* scanner); |
1407 | | |
1408 | | int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); |
1409 | | |
1410 | | /* %endif */ |
1411 | | |
1412 | | /* %endif End reentrant structures and macros. */ |
1413 | | |
1414 | | /* Accessor methods to globals. |
1415 | | These are made visible to non-reentrant scanners for convenience. */ |
1416 | | |
1417 | | int yylex_destroy ( yyscan_t yyscanner ); |
1418 | | |
1419 | | int yyget_debug ( yyscan_t yyscanner ); |
1420 | | |
1421 | | void yyset_debug ( int debug_flag , yyscan_t yyscanner ); |
1422 | | |
1423 | | YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); |
1424 | | |
1425 | | void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); |
1426 | | |
1427 | | FILE *yyget_in ( yyscan_t yyscanner ); |
1428 | | |
1429 | | void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); |
1430 | | |
1431 | | FILE *yyget_out ( yyscan_t yyscanner ); |
1432 | | |
1433 | | void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); |
1434 | | |
1435 | | int yyget_leng ( yyscan_t yyscanner ); |
1436 | | |
1437 | | char *yyget_text ( yyscan_t yyscanner ); |
1438 | | |
1439 | | int yyget_lineno ( yyscan_t yyscanner ); |
1440 | | |
1441 | | void yyset_lineno ( int _line_number , yyscan_t yyscanner ); |
1442 | | |
1443 | | int yyget_column ( yyscan_t yyscanner ); |
1444 | | |
1445 | | void yyset_column ( int _column_no , yyscan_t yyscanner ); |
1446 | | |
1447 | | /* %if-bison-bridge */ |
1448 | | /* %endif */ |
1449 | | |
1450 | | /* Macros after this point can all be overridden by user definitions in |
1451 | | * section 1. |
1452 | | */ |
1453 | | |
1454 | | #ifndef YY_SKIP_YYWRAP |
1455 | | #ifdef __cplusplus |
1456 | | extern "C" int yywrap ( yyscan_t yyscanner ); |
1457 | | #else |
1458 | | extern int yywrap ( yyscan_t yyscanner ); |
1459 | | #endif |
1460 | | #endif |
1461 | | |
1462 | | /* %not-for-header */ |
1463 | | #ifndef YY_NO_UNPUT |
1464 | | |
1465 | | #endif |
1466 | | /* %ok-for-header */ |
1467 | | |
1468 | | /* %endif */ |
1469 | | |
1470 | | #ifndef yytext_ptr |
1471 | | static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); |
1472 | | #endif |
1473 | | |
1474 | | #ifdef YY_NEED_STRLEN |
1475 | | static int yy_flex_strlen ( const char * , yyscan_t yyscanner); |
1476 | | #endif |
1477 | | |
1478 | | #ifndef YY_NO_INPUT |
1479 | | /* %if-c-only Standard (non-C++) definition */ |
1480 | | /* %not-for-header */ |
1481 | | #ifdef __cplusplus |
1482 | | static int yyinput ( yyscan_t yyscanner ); |
1483 | | #else |
1484 | | static int input ( yyscan_t yyscanner ); |
1485 | | #endif |
1486 | | /* %ok-for-header */ |
1487 | | |
1488 | | /* %endif */ |
1489 | | #endif |
1490 | | |
1491 | | /* %if-c-only */ |
1492 | | |
1493 | | static void yy_push_state ( int _new_state , yyscan_t yyscanner); |
1494 | | |
1495 | | static void yy_pop_state ( yyscan_t yyscanner ); |
1496 | | |
1497 | | static int yy_top_state ( yyscan_t yyscanner ); |
1498 | | |
1499 | | /* %endif */ |
1500 | | |
1501 | | /* Amount of stuff to slurp up with each read. */ |
1502 | | #ifndef YY_READ_BUF_SIZE |
1503 | | #ifdef __ia64__ |
1504 | | /* On IA-64, the buffer size is 16k, not 8k */ |
1505 | | #define YY_READ_BUF_SIZE 16384 |
1506 | | #else |
1507 | 0 | #define YY_READ_BUF_SIZE 8192 |
1508 | | #endif /* __ia64__ */ |
1509 | | #endif |
1510 | | |
1511 | | /* Copy whatever the last rule matched to the standard output. */ |
1512 | | #ifndef ECHO |
1513 | | /* %if-c-only Standard (non-C++) definition */ |
1514 | | /* This used to be an fputs(), but since the string might contain NUL's, |
1515 | | * we now use fwrite(). |
1516 | | */ |
1517 | | #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) |
1518 | | /* %endif */ |
1519 | | /* %if-c++-only C++ definition */ |
1520 | | /* %endif */ |
1521 | | #endif |
1522 | | |
1523 | | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
1524 | | * is returned in "result". |
1525 | | */ |
1526 | | #ifndef YY_INPUT |
1527 | | #define YY_INPUT(buf,result,max_size) \ |
1528 | | /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ |
1529 | | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
1530 | | { \ |
1531 | | int c = '*'; \ |
1532 | | int n; \ |
1533 | | for ( n = 0; n < max_size && \ |
1534 | | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
1535 | | buf[n] = (char) c; \ |
1536 | | if ( c == '\n' ) \ |
1537 | | buf[n++] = (char) c; \ |
1538 | | if ( c == EOF && ferror( yyin ) ) \ |
1539 | | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
1540 | | result = n; \ |
1541 | | } \ |
1542 | | else \ |
1543 | | { \ |
1544 | | errno=0; \ |
1545 | | while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ |
1546 | | { \ |
1547 | | if( errno != EINTR) \ |
1548 | | { \ |
1549 | | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
1550 | | break; \ |
1551 | | } \ |
1552 | | errno=0; \ |
1553 | | clearerr(yyin); \ |
1554 | | } \ |
1555 | | }\ |
1556 | | \ |
1557 | | /* %if-c++-only C++ definition \ */\ |
1558 | | /* %endif */ |
1559 | | |
1560 | | #endif |
1561 | | |
1562 | | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
1563 | | * we don't want an extra ';' after the "return" because that will cause |
1564 | | * some compilers to complain about unreachable statements. |
1565 | | */ |
1566 | | #ifndef yyterminate |
1567 | 0 | #define yyterminate() return YY_NULL |
1568 | | #endif |
1569 | | |
1570 | | /* Number of entries by which start-condition stack grows. */ |
1571 | | #ifndef YY_START_STACK_INCR |
1572 | 0 | #define YY_START_STACK_INCR 25 |
1573 | | #endif |
1574 | | |
1575 | | /* Report a fatal error. */ |
1576 | | #ifndef YY_FATAL_ERROR |
1577 | | /* %if-c-only */ |
1578 | 0 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) |
1579 | | /* %endif */ |
1580 | | /* %if-c++-only */ |
1581 | | /* %endif */ |
1582 | | #endif |
1583 | | |
1584 | | /* %if-tables-serialization structures and prototypes */ |
1585 | | /* %not-for-header */ |
1586 | | /* %ok-for-header */ |
1587 | | |
1588 | | /* %not-for-header */ |
1589 | | /* %tables-yydmap generated elements */ |
1590 | | /* %endif */ |
1591 | | /* end tables serialization structures and prototypes */ |
1592 | | |
1593 | | /* %ok-for-header */ |
1594 | | |
1595 | | /* Default declaration of generated scanner - a define so the user can |
1596 | | * easily add parameters. |
1597 | | */ |
1598 | | #ifndef YY_DECL |
1599 | | #define YY_DECL_IS_OURS 1 |
1600 | | /* %if-c-only Standard (non-C++) definition */ |
1601 | | |
1602 | | extern int yylex (yyscan_t yyscanner); |
1603 | | |
1604 | | #define YY_DECL int yylex (yyscan_t yyscanner) |
1605 | | /* %endif */ |
1606 | | /* %if-c++-only C++ definition */ |
1607 | | /* %endif */ |
1608 | | #endif /* !YY_DECL */ |
1609 | | |
1610 | | /* Code executed at the beginning of each rule, after yytext and yyleng |
1611 | | * have been set up. |
1612 | | */ |
1613 | | #ifndef YY_USER_ACTION |
1614 | | #define YY_USER_ACTION |
1615 | | #endif |
1616 | | |
1617 | | /* Code executed at the end of each rule. */ |
1618 | | #ifndef YY_BREAK |
1619 | 0 | #define YY_BREAK /*LINTED*/break; |
1620 | | #endif |
1621 | | |
1622 | | /* %% [6.0] YY_RULE_SETUP definition goes here */ |
1623 | | #define YY_RULE_SETUP \ |
1624 | | YY_USER_ACTION |
1625 | | |
1626 | | /* %not-for-header */ |
1627 | | /** The main scanner function which does all the work. |
1628 | | */ |
1629 | | YY_DECL |
1630 | 0 | { |
1631 | 0 | yy_state_type yy_current_state; |
1632 | 0 | char *yy_cp, *yy_bp; |
1633 | 0 | int yy_act; |
1634 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
1635 | |
|
1636 | 0 | if ( !yyg->yy_init ) |
1637 | 0 | { |
1638 | 0 | yyg->yy_init = 1; |
1639 | |
|
1640 | 0 | #ifdef YY_USER_INIT |
1641 | 0 | YY_USER_INIT; |
1642 | 0 | #endif |
1643 | |
|
1644 | 0 | if ( ! yyg->yy_start ) |
1645 | 0 | yyg->yy_start = 1; /* first start state */ |
1646 | |
|
1647 | 0 | if ( ! yyin ) |
1648 | | /* %if-c-only */ |
1649 | 0 | yyin = stdin; |
1650 | | /* %endif */ |
1651 | | /* %if-c++-only */ |
1652 | | /* %endif */ |
1653 | |
|
1654 | 0 | if ( ! yyout ) |
1655 | | /* %if-c-only */ |
1656 | 0 | yyout = stdout; |
1657 | | /* %endif */ |
1658 | | /* %if-c++-only */ |
1659 | | /* %endif */ |
1660 | |
|
1661 | 0 | if ( ! YY_CURRENT_BUFFER ) { |
1662 | 0 | yyensure_buffer_stack (yyscanner); |
1663 | 0 | YY_CURRENT_BUFFER_LVALUE = |
1664 | 0 | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
1665 | 0 | } |
1666 | |
|
1667 | 0 | yy_load_buffer_state( yyscanner ); |
1668 | 0 | } |
1669 | |
|
1670 | 0 | { |
1671 | | /* %% [7.0] user's declarations go here */ |
1672 | 0 | #line 259 "/src/wireshark/epan/diam_dict.l" |
1673 | |
|
1674 | 0 | #line 1675 "/work/build/epan/diam_dict.c" |
1675 | |
|
1676 | 0 | while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ |
1677 | 0 | { |
1678 | | /* %% [8.0] yymore()-related code goes here */ |
1679 | 0 | yy_cp = yyg->yy_c_buf_p; |
1680 | | |
1681 | | /* Support of yytext. */ |
1682 | 0 | *yy_cp = yyg->yy_hold_char; |
1683 | | |
1684 | | /* yy_bp points to the position in yy_ch_buf of the start of |
1685 | | * the current run. |
1686 | | */ |
1687 | 0 | yy_bp = yy_cp; |
1688 | | |
1689 | | /* %% [9.0] code to set up and find next match goes here */ |
1690 | 0 | yy_current_state = yyg->yy_start; |
1691 | 0 | yy_match: |
1692 | 0 | do |
1693 | 0 | { |
1694 | 0 | YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; |
1695 | 0 | if ( yy_accept[yy_current_state] ) |
1696 | 0 | { |
1697 | 0 | yyg->yy_last_accepting_state = yy_current_state; |
1698 | 0 | yyg->yy_last_accepting_cpos = yy_cp; |
1699 | 0 | } |
1700 | 0 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
1701 | 0 | { |
1702 | 0 | yy_current_state = (int) yy_def[yy_current_state]; |
1703 | 0 | if ( yy_current_state >= 482 ) |
1704 | 0 | yy_c = yy_meta[yy_c]; |
1705 | 0 | } |
1706 | 0 | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
1707 | 0 | ++yy_cp; |
1708 | 0 | } |
1709 | 0 | while ( yy_current_state != 481 ); |
1710 | 0 | yy_cp = yyg->yy_last_accepting_cpos; |
1711 | 0 | yy_current_state = yyg->yy_last_accepting_state; |
1712 | |
|
1713 | 0 | yy_find_action: |
1714 | | /* %% [10.0] code to find the action number goes here */ |
1715 | 0 | yy_act = yy_accept[yy_current_state]; |
1716 | |
|
1717 | 0 | YY_DO_BEFORE_ACTION; |
1718 | | |
1719 | | /* %% [11.0] code for yylineno update goes here */ |
1720 | |
|
1721 | 0 | do_action: /* This label is used only to access EOF actions. */ |
1722 | | |
1723 | | /* %% [12.0] debug code goes here */ |
1724 | 0 | if ( yy_flex_debug ) |
1725 | 0 | { |
1726 | 0 | if ( yy_act == 0 ) |
1727 | 0 | fprintf( stderr, "--scanner backing up\n" ); |
1728 | 0 | else if ( yy_act < 85 ) |
1729 | 0 | fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", |
1730 | 0 | (long)yy_rule_linenum[yy_act], yytext ); |
1731 | 0 | else if ( yy_act == 85 ) |
1732 | 0 | fprintf( stderr, "--accepting default rule (\"%s\")\n", |
1733 | 0 | yytext ); |
1734 | 0 | else if ( yy_act == 86 ) |
1735 | 0 | fprintf( stderr, "--(end of buffer or a NUL)\n" ); |
1736 | 0 | else |
1737 | 0 | fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); |
1738 | 0 | } |
1739 | |
|
1740 | 0 | switch ( yy_act ) |
1741 | 0 | { /* beginning of action switch */ |
1742 | | /* %% [13.0] actions go here */ |
1743 | 0 | case 0: /* must back up */ |
1744 | | /* undo the effects of YY_DO_BEFORE_ACTION */ |
1745 | 0 | *yy_cp = yyg->yy_hold_char; |
1746 | 0 | yy_cp = yyg->yy_last_accepting_cpos; |
1747 | 0 | yy_current_state = yyg->yy_last_accepting_state; |
1748 | 0 | goto yy_find_action; |
1749 | | |
1750 | 0 | case 1: |
1751 | | /* rule 1 can match eol */ |
1752 | 0 | YY_RULE_SETUP |
1753 | 0 | #line 260 "/src/wireshark/epan/diam_dict.l" |
1754 | 0 | ; |
1755 | 0 | YY_BREAK |
1756 | 0 | case 2: |
1757 | | /* rule 2 can match eol */ |
1758 | 0 | YY_RULE_SETUP |
1759 | 0 | #line 261 "/src/wireshark/epan/diam_dict.l" |
1760 | 0 | ; |
1761 | 0 | YY_BREAK |
1762 | 0 | case 3: |
1763 | | /* rule 3 can match eol */ |
1764 | 0 | YY_RULE_SETUP |
1765 | 0 | #line 263 "/src/wireshark/epan/diam_dict.l" |
1766 | 0 | BEGIN LOADING_COMMENT; |
1767 | 0 | YY_BREAK |
1768 | 0 | case 4: |
1769 | 0 | YY_RULE_SETUP |
1770 | 0 | #line 264 "/src/wireshark/epan/diam_dict.l" |
1771 | 0 | ; |
1772 | 0 | YY_BREAK |
1773 | 0 | case 5: |
1774 | | /* rule 5 can match eol */ |
1775 | 0 | YY_RULE_SETUP |
1776 | 0 | #line 265 "/src/wireshark/epan/diam_dict.l" |
1777 | 0 | BEGIN LOADING; |
1778 | 0 | YY_BREAK |
1779 | 0 | case 6: |
1780 | | /* rule 6 can match eol */ |
1781 | 0 | YY_RULE_SETUP |
1782 | 0 | #line 267 "/src/wireshark/epan/diam_dict.l" |
1783 | 0 | BEGIN LOADING_XMLPI; |
1784 | 0 | YY_BREAK |
1785 | 0 | case 7: |
1786 | | /* rule 7 can match eol */ |
1787 | 0 | YY_RULE_SETUP |
1788 | 0 | #line 268 "/src/wireshark/epan/diam_dict.l" |
1789 | 0 | ; |
1790 | 0 | YY_BREAK |
1791 | 0 | case 8: |
1792 | 0 | YY_RULE_SETUP |
1793 | 0 | #line 269 "/src/wireshark/epan/diam_dict.l" |
1794 | 0 | { |
1795 | 0 | yyextra->xmlpi = g_new(ddict_xmlpi_t,1); |
1796 | 0 | yyextra->xmlpi->name = g_strdup(yytext); |
1797 | 0 | yyextra->xmlpi->key = NULL; |
1798 | 0 | yyextra->xmlpi->value = NULL; |
1799 | 0 | yyextra->xmlpi->next = NULL; |
1800 | |
|
1801 | 0 | if (!yyextra->dict->xmlpis) |
1802 | 0 | yyextra->last_xmlpi = yyextra->dict->xmlpis = yyextra->xmlpi; |
1803 | 0 | else |
1804 | 0 | yyextra->last_xmlpi = yyextra->last_xmlpi->next = yyextra->xmlpi; |
1805 | |
|
1806 | 0 | BEGIN XMLPI_ATTRS; |
1807 | 0 | } |
1808 | 0 | YY_BREAK |
1809 | 0 | case 9: |
1810 | | /* rule 9 can match eol */ |
1811 | 0 | YY_RULE_SETUP |
1812 | 0 | #line 284 "/src/wireshark/epan/diam_dict.l" |
1813 | 0 | BEGIN XMLPI_GETKEY; |
1814 | 0 | YY_BREAK |
1815 | 0 | case 10: |
1816 | | /* rule 10 can match eol */ |
1817 | 0 | YY_RULE_SETUP |
1818 | 0 | #line 285 "/src/wireshark/epan/diam_dict.l" |
1819 | 0 | { yyextra->xmlpi->key = g_strdup(yytext); BEGIN XMLPI_ATTRS; } |
1820 | 0 | YY_BREAK |
1821 | 0 | case 11: |
1822 | | /* rule 11 can match eol */ |
1823 | 0 | YY_RULE_SETUP |
1824 | 0 | #line 287 "/src/wireshark/epan/diam_dict.l" |
1825 | 0 | BEGIN XMLPI_GETVAL; |
1826 | 0 | YY_BREAK |
1827 | 0 | case 12: |
1828 | | /* rule 12 can match eol */ |
1829 | 0 | YY_RULE_SETUP |
1830 | 0 | #line 288 "/src/wireshark/epan/diam_dict.l" |
1831 | 0 | { yyextra->xmlpi->value = g_strdup(yytext); BEGIN XMLPI_ATTRS; } |
1832 | 0 | YY_BREAK |
1833 | 0 | case 13: |
1834 | 0 | YY_RULE_SETUP |
1835 | 0 | #line 290 "/src/wireshark/epan/diam_dict.l" |
1836 | |
|
1837 | 0 | YY_BREAK |
1838 | 0 | case 14: |
1839 | | /* rule 14 can match eol */ |
1840 | 0 | YY_RULE_SETUP |
1841 | 0 | #line 291 "/src/wireshark/epan/diam_dict.l" |
1842 | 0 | BEGIN LOADING; |
1843 | 0 | YY_BREAK |
1844 | 0 | case 15: |
1845 | | /* rule 15 can match eol */ |
1846 | 0 | YY_RULE_SETUP |
1847 | 0 | #line 294 "/src/wireshark/epan/diam_dict.l" |
1848 | 0 | BEGIN ENTITY; |
1849 | 0 | YY_BREAK |
1850 | 0 | case 16: |
1851 | 0 | YY_RULE_SETUP |
1852 | 0 | #line 295 "/src/wireshark/epan/diam_dict.l" |
1853 | 0 | { |
1854 | 0 | entity_t* e = g_new(entity_t,1); |
1855 | 0 | e->name = g_strdup(yytext); |
1856 | 0 | e->next = yyextra->ents; |
1857 | 0 | yyextra->ents = e; |
1858 | 0 | BEGIN GET_SYSTEM; |
1859 | 0 | }; |
1860 | 0 | YY_BREAK |
1861 | 0 | case 17: |
1862 | | /* rule 17 can match eol */ |
1863 | 0 | YY_RULE_SETUP |
1864 | 0 | #line 302 "/src/wireshark/epan/diam_dict.l" |
1865 | 0 | BEGIN GET_FILE; |
1866 | 0 | YY_BREAK |
1867 | 0 | case 18: |
1868 | | /* rule 18 can match eol */ |
1869 | 0 | YY_RULE_SETUP |
1870 | 0 | #line 303 "/src/wireshark/epan/diam_dict.l" |
1871 | 0 | { |
1872 | 0 | yyextra->ents->file = g_strdup(yytext); |
1873 | 0 | BEGIN END_ENTITY; |
1874 | 0 | } |
1875 | 0 | YY_BREAK |
1876 | 0 | case 19: |
1877 | | /* rule 19 can match eol */ |
1878 | 0 | YY_RULE_SETUP |
1879 | 0 | #line 307 "/src/wireshark/epan/diam_dict.l" |
1880 | 0 | BEGIN LOADING; |
1881 | 0 | YY_BREAK |
1882 | 0 | case 20: |
1883 | | /* rule 20 can match eol */ |
1884 | 0 | YY_RULE_SETUP |
1885 | 0 | #line 309 "/src/wireshark/epan/diam_dict.l" |
1886 | 0 | APPEND("<",1); |
1887 | 0 | YY_BREAK |
1888 | 0 | case 21: |
1889 | | /* rule 21 can match eol */ |
1890 | 0 | YY_RULE_SETUP |
1891 | 0 | #line 311 "/src/wireshark/epan/diam_dict.l" |
1892 | 0 | APPEND(">",1); |
1893 | 0 | YY_BREAK |
1894 | 0 | case 22: |
1895 | | /* rule 22 can match eol */ |
1896 | 0 | YY_RULE_SETUP |
1897 | 0 | #line 313 "/src/wireshark/epan/diam_dict.l" |
1898 | 0 | APPEND("/>",2); |
1899 | 0 | YY_BREAK |
1900 | 0 | case 23: |
1901 | | /* rule 23 can match eol */ |
1902 | 0 | YY_RULE_SETUP |
1903 | 0 | #line 315 "/src/wireshark/epan/diam_dict.l" |
1904 | 0 | APPEND("</",2); |
1905 | 0 | YY_BREAK |
1906 | 0 | case 24: |
1907 | | /* rule 24 can match eol */ |
1908 | 0 | YY_RULE_SETUP |
1909 | 0 | #line 317 "/src/wireshark/epan/diam_dict.l" |
1910 | 0 | APPEND(" ",1); |
1911 | 0 | YY_BREAK |
1912 | 0 | case 25: |
1913 | | /* rule 25 can match eol */ |
1914 | 0 | YY_RULE_SETUP |
1915 | 0 | #line 319 "/src/wireshark/epan/diam_dict.l" |
1916 | 0 | APPEND(yytext, (unsigned) yyleng); |
1917 | 0 | YY_BREAK |
1918 | 0 | case 26: |
1919 | | /* rule 26 can match eol */ |
1920 | 0 | YY_RULE_SETUP |
1921 | 0 | #line 321 "/src/wireshark/epan/diam_dict.l" |
1922 | 0 | APPEND("=",1); |
1923 | 0 | YY_BREAK |
1924 | 0 | case 27: |
1925 | 0 | YY_RULE_SETUP |
1926 | 0 | #line 323 "/src/wireshark/epan/diam_dict.l" |
1927 | 0 | APPEND(yytext, (unsigned) yyleng); |
1928 | 0 | YY_BREAK |
1929 | 0 | case 28: |
1930 | 0 | YY_RULE_SETUP |
1931 | 0 | #line 325 "/src/wireshark/epan/diam_dict.l" |
1932 | 0 | { |
1933 | 0 | char* p = ++yytext; |
1934 | 0 | entity_t* e; |
1935 | |
|
1936 | 0 | while(*p != ';') p++; |
1937 | |
|
1938 | 0 | *p = '\0'; |
1939 | |
|
1940 | 0 | D(("looking for entity: %s\n",yytext)); |
1941 | |
|
1942 | 0 | if ( yyextra->include_stack_ptr >= MAX_INCLUDE_DEPTH ) { |
1943 | 0 | fprintf(stderr, "included files nested to deeply\n"); |
1944 | 0 | yyterminate(); |
1945 | 0 | } |
1946 | | |
1947 | 0 | for (e = yyextra->ents; e; e = e->next) { |
1948 | 0 | if (strcmp(e->name,yytext) == 0) { |
1949 | 0 | yyin = ddict_open(yyextra->sys_dir,e->file); |
1950 | 0 | D(("entity: %s filename: %s yyin: %p\n",e->name,e->file,(void*)yyin)); |
1951 | 0 | if (!yyin) { |
1952 | 0 | if (errno) |
1953 | 0 | fprintf(stderr, "Could not open file: '%s', error: %s\n", e->file, g_strerror(errno) ); |
1954 | 0 | else |
1955 | 0 | fprintf(stderr, "Could not open file: '%s', error unknown (errno == 0)\n", e->file ); |
1956 | 0 | yyterminate(); |
1957 | 0 | } else { |
1958 | 0 | yyextra->include_stack[yyextra->include_stack_ptr++] = YY_CURRENT_BUFFER; |
1959 | 0 | yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), yyscanner); |
1960 | 0 | BEGIN LOADING; |
1961 | 0 | } |
1962 | 0 | break; |
1963 | 0 | } |
1964 | 0 | } |
1965 | | |
1966 | 0 | if (!e) { |
1967 | 0 | fprintf(stderr, "Could not find entity: '%s'\n", yytext ); |
1968 | 0 | yyterminate(); |
1969 | 0 | } |
1970 | |
|
1971 | 0 | } |
1972 | 0 | YY_BREAK |
1973 | 0 | case YY_STATE_EOF(INITIAL): |
1974 | 0 | case YY_STATE_EOF(LOADING): |
1975 | 0 | case YY_STATE_EOF(LOADING_COMMENT): |
1976 | 0 | case YY_STATE_EOF(LOADING_XMLPI): |
1977 | 0 | case YY_STATE_EOF(ENTITY): |
1978 | 0 | case YY_STATE_EOF(GET_SYSTEM): |
1979 | 0 | case YY_STATE_EOF(GET_FILE): |
1980 | 0 | case YY_STATE_EOF(END_ENTITY): |
1981 | 0 | case YY_STATE_EOF(GET_ATTR): |
1982 | 0 | case YY_STATE_EOF(GET_UINT_ATTR): |
1983 | 0 | case YY_STATE_EOF(END_ATTR): |
1984 | 0 | case YY_STATE_EOF(OUTSIDE): |
1985 | 0 | case YY_STATE_EOF(IN_DICT): |
1986 | 0 | case YY_STATE_EOF(IN_APPL): |
1987 | 0 | case YY_STATE_EOF(IN_AVP): |
1988 | 0 | case YY_STATE_EOF(APPL_ATTRS): |
1989 | 0 | case YY_STATE_EOF(IGNORE_ATTR): |
1990 | 0 | case YY_STATE_EOF(TYPE_ATTRS): |
1991 | 0 | case YY_STATE_EOF(GAVP_ATTRS): |
1992 | 0 | case YY_STATE_EOF(ENUM_ATTRS): |
1993 | 0 | case YY_STATE_EOF(AVP_ATTRS): |
1994 | 0 | case YY_STATE_EOF(VENDOR_ATTRS): |
1995 | 0 | case YY_STATE_EOF(COMMAND_ATTRS): |
1996 | 0 | case YY_STATE_EOF(TYPEDEFN_ATTRS): |
1997 | 0 | case YY_STATE_EOF(XMLPI_ATTRS): |
1998 | 0 | case YY_STATE_EOF(XMLPI_GETKEY): |
1999 | 0 | case YY_STATE_EOF(XMLPI_GETVAL): |
2000 | 0 | case YY_STATE_EOF(XMLPI_ENDATTR): |
2001 | 0 | #line 366 "/src/wireshark/epan/diam_dict.l" |
2002 | 0 | { |
2003 | 0 | if (!yyin) yyterminate(); |
2004 | | |
2005 | 0 | yyextra->current_close(yyin); |
2006 | 0 | D(("closing: %p %i\n",(void*)yyin,yyextra->include_stack_ptr)); |
2007 | |
|
2008 | 0 | if ( --yyextra->include_stack_ptr < 0 ) { |
2009 | 0 | D(("DONE READING\n")); |
2010 | 0 | yyin = NULL; |
2011 | 0 | yyterminate(); |
2012 | 0 | } else { |
2013 | 0 | yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner); |
2014 | 0 | yy_switch_to_buffer(yyextra->include_stack[yyextra->include_stack_ptr], yyscanner); |
2015 | 0 | BEGIN LOADING; |
2016 | 0 | } |
2017 | 0 | } |
2018 | 0 | YY_BREAK |
2019 | 0 | case 29: |
2020 | | /* rule 29 can match eol */ |
2021 | 0 | YY_RULE_SETUP |
2022 | 0 | #line 384 "/src/wireshark/epan/diam_dict.l" |
2023 | 0 | { |
2024 | 0 | *(yyextra->attr_str) = g_strdup(yytext); |
2025 | 0 | D(("%s\n",yytext)); |
2026 | 0 | yyextra->attr_str = NULL; |
2027 | 0 | BEGIN END_ATTR; |
2028 | 0 | } |
2029 | 0 | YY_BREAK |
2030 | 0 | case 30: |
2031 | 0 | YY_RULE_SETUP |
2032 | 0 | #line 391 "/src/wireshark/epan/diam_dict.l" |
2033 | 0 | { |
2034 | 0 | *(yyextra->attr_uint) = (unsigned) strtoul(yytext,NULL,10); |
2035 | 0 | D(("%s\n",yytext);); |
2036 | 0 | yyextra->attr_uint = NULL; |
2037 | 0 | BEGIN END_ATTR; |
2038 | 0 | } |
2039 | 0 | YY_BREAK |
2040 | 0 | case 31: |
2041 | 0 | YY_RULE_SETUP |
2042 | 0 | #line 398 "/src/wireshark/epan/diam_dict.l" |
2043 | 0 | { yy_pop_state(yyscanner); } |
2044 | 0 | YY_BREAK |
2045 | 0 | case 32: |
2046 | 0 | YY_RULE_SETUP |
2047 | 0 | #line 400 "/src/wireshark/epan/diam_dict.l" |
2048 | 0 | { |
2049 | | /* XXX: should go?*/ |
2050 | 0 | D(("{%s}",yytext)); |
2051 | 0 | } |
2052 | 0 | YY_BREAK |
2053 | 0 | case 33: |
2054 | | /* rule 33 can match eol */ |
2055 | 0 | YY_RULE_SETUP |
2056 | 0 | #line 405 "/src/wireshark/epan/diam_dict.l" |
2057 | 0 | { |
2058 | 0 | D(("=>%s<=\n",yytext)); |
2059 | 0 | yy_pop_state(yyscanner); |
2060 | 0 | } |
2061 | 0 | YY_BREAK |
2062 | 0 | case 34: |
2063 | 0 | YY_RULE_SETUP |
2064 | 0 | #line 410 "/src/wireshark/epan/diam_dict.l" |
2065 | 0 | { |
2066 | 0 | D(("dictionary_start\n")); |
2067 | |
|
2068 | 0 | BEGIN IN_DICT; |
2069 | 0 | } |
2070 | 0 | YY_BREAK |
2071 | 0 | case 35: |
2072 | | /* rule 35 can match eol */ |
2073 | 0 | YY_RULE_SETUP |
2074 | 0 | #line 416 "/src/wireshark/epan/diam_dict.l" |
2075 | 0 | { |
2076 | 0 | D(("base_start\n")); |
2077 | 0 | BEGIN IN_APPL; |
2078 | 0 | } |
2079 | 0 | YY_BREAK |
2080 | 0 | case 36: |
2081 | 0 | YY_RULE_SETUP |
2082 | 0 | #line 421 "/src/wireshark/epan/diam_dict.l" |
2083 | 0 | { |
2084 | 0 | D(("application_start\n")); |
2085 | |
|
2086 | 0 | yyextra->appl = g_new(ddict_application_t,1); |
2087 | 0 | yyextra->appl->name = NULL; |
2088 | 0 | yyextra->appl->code = 0; |
2089 | 0 | yyextra->appl->next = NULL; |
2090 | |
|
2091 | 0 | if (!yyextra->dict->applications) |
2092 | 0 | yyextra->last_appl = yyextra->dict->applications = yyextra->appl; |
2093 | 0 | else |
2094 | 0 | yyextra->last_appl = yyextra->last_appl->next = yyextra->appl; |
2095 | |
|
2096 | 0 | BEGIN APPL_ATTRS; |
2097 | 0 | } |
2098 | 0 | YY_BREAK |
2099 | 0 | case 37: |
2100 | 0 | YY_RULE_SETUP |
2101 | 0 | #line 437 "/src/wireshark/epan/diam_dict.l" |
2102 | 0 | { ATTR_STR(yyextra->appl->name); } |
2103 | 0 | YY_BREAK |
2104 | 0 | case 38: |
2105 | 0 | YY_RULE_SETUP |
2106 | 0 | #line 438 "/src/wireshark/epan/diam_dict.l" |
2107 | 0 | { ATTR_UINT(yyextra->appl->code); } |
2108 | 0 | YY_BREAK |
2109 | 0 | case 39: |
2110 | 0 | YY_RULE_SETUP |
2111 | 0 | #line 440 "/src/wireshark/epan/diam_dict.l" |
2112 | 0 | BEGIN IN_APPL; |
2113 | 0 | YY_BREAK |
2114 | 0 | case 40: |
2115 | 0 | YY_RULE_SETUP |
2116 | 0 | #line 441 "/src/wireshark/epan/diam_dict.l" |
2117 | 0 | BEGIN IN_DICT; |
2118 | 0 | YY_BREAK |
2119 | 0 | case 41: |
2120 | 0 | YY_RULE_SETUP |
2121 | 0 | #line 443 "/src/wireshark/epan/diam_dict.l" |
2122 | 0 | ; |
2123 | 0 | YY_BREAK |
2124 | 0 | case 42: |
2125 | 0 | YY_RULE_SETUP |
2126 | 0 | #line 445 "/src/wireshark/epan/diam_dict.l" |
2127 | 0 | { |
2128 | 0 | D(("command_start\n")); |
2129 | |
|
2130 | 0 | yyextra->cmd = g_new(ddict_cmd_t,1); |
2131 | 0 | yyextra->cmd->name = NULL; |
2132 | 0 | yyextra->cmd->vendor = NULL; |
2133 | 0 | yyextra->cmd->code = 0; |
2134 | 0 | yyextra->cmd->next = NULL; |
2135 | |
|
2136 | 0 | if (!yyextra->dict->cmds) |
2137 | 0 | yyextra->last_cmd = yyextra->dict->cmds = yyextra->cmd; |
2138 | 0 | else |
2139 | 0 | yyextra->last_cmd = yyextra->last_cmd->next = yyextra->cmd; |
2140 | |
|
2141 | 0 | BEGIN COMMAND_ATTRS; |
2142 | 0 | } |
2143 | 0 | YY_BREAK |
2144 | 0 | case 43: |
2145 | 0 | YY_RULE_SETUP |
2146 | 0 | #line 462 "/src/wireshark/epan/diam_dict.l" |
2147 | 0 | { ATTR_STR(yyextra->cmd->name); } |
2148 | 0 | YY_BREAK |
2149 | 0 | case 44: |
2150 | 0 | YY_RULE_SETUP |
2151 | 0 | #line 463 "/src/wireshark/epan/diam_dict.l" |
2152 | 0 | { ATTR_STR(yyextra->cmd->vendor); } |
2153 | 0 | YY_BREAK |
2154 | 0 | case 45: |
2155 | 0 | YY_RULE_SETUP |
2156 | 0 | #line 464 "/src/wireshark/epan/diam_dict.l" |
2157 | 0 | { ATTR_UINT(yyextra->cmd->code); } |
2158 | 0 | YY_BREAK |
2159 | 0 | case 46: |
2160 | 0 | #line 466 "/src/wireshark/epan/diam_dict.l" |
2161 | 0 | case 47: |
2162 | 0 | YY_RULE_SETUP |
2163 | 0 | #line 466 "/src/wireshark/epan/diam_dict.l" |
2164 | 0 | { BEGIN IN_APPL; } |
2165 | 0 | YY_BREAK |
2166 | 0 | case 48: |
2167 | 0 | YY_RULE_SETUP |
2168 | 0 | #line 468 "/src/wireshark/epan/diam_dict.l" |
2169 | 0 | { |
2170 | 0 | D(("vendor_start\n")); |
2171 | |
|
2172 | 0 | yyextra->vnd = g_new(ddict_vendor_t,1); |
2173 | 0 | yyextra->vnd->name = NULL; |
2174 | 0 | yyextra->vnd->code = 0; |
2175 | 0 | yyextra->vnd->next = NULL; |
2176 | |
|
2177 | 0 | if (!yyextra->dict->vendors) |
2178 | 0 | yyextra->last_vnd = yyextra->dict->vendors = yyextra->vnd; |
2179 | 0 | else |
2180 | 0 | yyextra->last_vnd = yyextra->last_vnd->next = yyextra->vnd; |
2181 | |
|
2182 | 0 | BEGIN VENDOR_ATTRS; |
2183 | 0 | } |
2184 | 0 | YY_BREAK |
2185 | 0 | case 49: |
2186 | 0 | YY_RULE_SETUP |
2187 | 0 | #line 484 "/src/wireshark/epan/diam_dict.l" |
2188 | 0 | { ATTR_STR(yyextra->vnd->desc); } |
2189 | 0 | YY_BREAK |
2190 | 0 | case 50: |
2191 | 0 | YY_RULE_SETUP |
2192 | 0 | #line 485 "/src/wireshark/epan/diam_dict.l" |
2193 | 0 | { ATTR_STR(yyextra->vnd->name); } |
2194 | 0 | YY_BREAK |
2195 | 0 | case 51: |
2196 | 0 | YY_RULE_SETUP |
2197 | 0 | #line 486 "/src/wireshark/epan/diam_dict.l" |
2198 | 0 | { ATTR_UINT(yyextra->vnd->code); } |
2199 | 0 | YY_BREAK |
2200 | 0 | case 52: |
2201 | 0 | YY_RULE_SETUP |
2202 | 0 | #line 487 "/src/wireshark/epan/diam_dict.l" |
2203 | 0 | { BEGIN IN_APPL; } |
2204 | 0 | YY_BREAK |
2205 | 0 | case 53: |
2206 | 0 | YY_RULE_SETUP |
2207 | 0 | #line 488 "/src/wireshark/epan/diam_dict.l" |
2208 | 0 | { BEGIN IN_DICT; } |
2209 | 0 | YY_BREAK |
2210 | 0 | case 54: |
2211 | 0 | YY_RULE_SETUP |
2212 | 0 | #line 490 "/src/wireshark/epan/diam_dict.l" |
2213 | 0 | { |
2214 | 0 | D(("typedefn_start\n")); |
2215 | |
|
2216 | 0 | yyextra->typedefn = g_new(ddict_typedefn_t,1); |
2217 | 0 | yyextra->typedefn->name = NULL; |
2218 | 0 | yyextra->typedefn->parent = NULL; |
2219 | 0 | yyextra->typedefn->next = NULL; |
2220 | |
|
2221 | 0 | if (!yyextra->dict->typedefns) |
2222 | 0 | yyextra->last_typedefn = yyextra->dict->typedefns = yyextra->typedefn; |
2223 | 0 | else |
2224 | 0 | yyextra->last_typedefn = yyextra->last_typedefn->next = yyextra->typedefn; |
2225 | |
|
2226 | 0 | BEGIN TYPEDEFN_ATTRS; |
2227 | 0 | } |
2228 | 0 | YY_BREAK |
2229 | 0 | case 55: |
2230 | 0 | YY_RULE_SETUP |
2231 | 0 | #line 506 "/src/wireshark/epan/diam_dict.l" |
2232 | 0 | { ATTR_STR(yyextra->typedefn->name); } |
2233 | 0 | YY_BREAK |
2234 | 0 | case 56: |
2235 | 0 | YY_RULE_SETUP |
2236 | 0 | #line 507 "/src/wireshark/epan/diam_dict.l" |
2237 | 0 | { ATTR_STR(yyextra->typedefn->parent); } |
2238 | 0 | YY_BREAK |
2239 | 0 | case 57: |
2240 | 0 | #line 509 "/src/wireshark/epan/diam_dict.l" |
2241 | 0 | case 58: |
2242 | 0 | YY_RULE_SETUP |
2243 | 0 | #line 509 "/src/wireshark/epan/diam_dict.l" |
2244 | 0 | { BEGIN IN_APPL; } |
2245 | 0 | YY_BREAK |
2246 | 0 | case 59: |
2247 | 0 | YY_RULE_SETUP |
2248 | 0 | #line 512 "/src/wireshark/epan/diam_dict.l" |
2249 | 0 | { |
2250 | 0 | D(("avp_start\n")); |
2251 | |
|
2252 | 0 | yyextra->avp = g_new(ddict_avp_t,1); |
2253 | 0 | yyextra->avp->name = NULL; |
2254 | 0 | yyextra->avp->description = NULL; |
2255 | 0 | yyextra->avp->vendor = NULL; |
2256 | 0 | yyextra->avp->code = 0; |
2257 | 0 | yyextra->avp->type = NULL; |
2258 | 0 | yyextra->avp->enums = NULL; |
2259 | 0 | yyextra->avp->gavps = NULL; |
2260 | 0 | yyextra->avp->next = NULL; |
2261 | |
|
2262 | 0 | if (! yyextra->dict->avps ) |
2263 | 0 | yyextra->last_avp = yyextra->dict->avps = yyextra->avp; |
2264 | 0 | else |
2265 | 0 | yyextra->last_avp = yyextra->last_avp->next = yyextra->avp; |
2266 | |
|
2267 | 0 | BEGIN AVP_ATTRS; |
2268 | 0 | } |
2269 | 0 | YY_BREAK |
2270 | 0 | case 60: |
2271 | 0 | YY_RULE_SETUP |
2272 | 0 | #line 533 "/src/wireshark/epan/diam_dict.l" |
2273 | 0 | { ATTR_STR(yyextra->avp->name); } |
2274 | 0 | YY_BREAK |
2275 | 0 | case 61: |
2276 | 0 | YY_RULE_SETUP |
2277 | 0 | #line 534 "/src/wireshark/epan/diam_dict.l" |
2278 | 0 | { ATTR_STR(yyextra->avp->description); } |
2279 | 0 | YY_BREAK |
2280 | 0 | case 62: |
2281 | 0 | YY_RULE_SETUP |
2282 | 0 | #line 535 "/src/wireshark/epan/diam_dict.l" |
2283 | 0 | { ATTR_STR(yyextra->avp->vendor); } |
2284 | 0 | YY_BREAK |
2285 | 0 | case 63: |
2286 | 0 | YY_RULE_SETUP |
2287 | 0 | #line 536 "/src/wireshark/epan/diam_dict.l" |
2288 | 0 | { ATTR_UINT(yyextra->avp->code); } |
2289 | 0 | YY_BREAK |
2290 | 0 | case 64: |
2291 | 0 | YY_RULE_SETUP |
2292 | 0 | #line 537 "/src/wireshark/epan/diam_dict.l" |
2293 | 0 | { BEGIN IN_AVP; } |
2294 | 0 | YY_BREAK |
2295 | 0 | case 65: |
2296 | 0 | YY_RULE_SETUP |
2297 | 0 | #line 538 "/src/wireshark/epan/diam_dict.l" |
2298 | 0 | { BEGIN IN_APPL; } |
2299 | 0 | YY_BREAK |
2300 | 0 | case 66: |
2301 | 0 | YY_RULE_SETUP |
2302 | 0 | #line 541 "/src/wireshark/epan/diam_dict.l" |
2303 | 0 | { yyextra->avp->type = g_strdup("Grouped"); }; |
2304 | 0 | YY_BREAK |
2305 | 0 | case 67: |
2306 | 0 | YY_RULE_SETUP |
2307 | 0 | #line 542 "/src/wireshark/epan/diam_dict.l" |
2308 | 0 | ; |
2309 | 0 | YY_BREAK |
2310 | 0 | case 68: |
2311 | 0 | YY_RULE_SETUP |
2312 | 0 | #line 544 "/src/wireshark/epan/diam_dict.l" |
2313 | 0 | { BEGIN TYPE_ATTRS; } |
2314 | 0 | YY_BREAK |
2315 | 0 | case 69: |
2316 | 0 | YY_RULE_SETUP |
2317 | 0 | #line 545 "/src/wireshark/epan/diam_dict.l" |
2318 | 0 | { ATTR_STR(yyextra->avp->type); } |
2319 | 0 | YY_BREAK |
2320 | 0 | case 70: |
2321 | 0 | YY_RULE_SETUP |
2322 | 0 | #line 547 "/src/wireshark/epan/diam_dict.l" |
2323 | 0 | { |
2324 | 0 | D(("gavp_start\n")); |
2325 | |
|
2326 | 0 | yyextra->gavp = g_new(ddict_gavp_t,1); |
2327 | 0 | yyextra->gavp->name = NULL; |
2328 | 0 | yyextra->gavp->code = 0; |
2329 | 0 | yyextra->gavp->next = NULL; |
2330 | |
|
2331 | 0 | if (!yyextra->avp->gavps) |
2332 | 0 | yyextra->last_gavp = yyextra->avp->gavps = yyextra->gavp; |
2333 | 0 | else |
2334 | 0 | yyextra->last_gavp = yyextra->last_gavp->next = yyextra->gavp; |
2335 | |
|
2336 | 0 | BEGIN GAVP_ATTRS; |
2337 | 0 | } |
2338 | 0 | YY_BREAK |
2339 | 0 | case 71: |
2340 | 0 | YY_RULE_SETUP |
2341 | 0 | #line 564 "/src/wireshark/epan/diam_dict.l" |
2342 | 0 | { ATTR_STR(yyextra->gavp->name); } |
2343 | 0 | YY_BREAK |
2344 | 0 | case 72: |
2345 | 0 | YY_RULE_SETUP |
2346 | 0 | #line 567 "/src/wireshark/epan/diam_dict.l" |
2347 | 0 | { |
2348 | 0 | D(("enum_start\n")); |
2349 | |
|
2350 | 0 | yyextra->enumitem = g_new(ddict_enum_t,1); |
2351 | 0 | yyextra->enumitem->name = NULL; |
2352 | 0 | yyextra->enumitem->code = 0; |
2353 | 0 | yyextra->enumitem->next = NULL; |
2354 | |
|
2355 | 0 | if (!yyextra->avp->enums) |
2356 | 0 | yyextra->last_enumitem = yyextra->avp->enums = yyextra->enumitem; |
2357 | 0 | else |
2358 | 0 | yyextra->last_enumitem = yyextra->last_enumitem->next = yyextra->enumitem; |
2359 | |
|
2360 | 0 | BEGIN ENUM_ATTRS; |
2361 | 0 | } |
2362 | 0 | YY_BREAK |
2363 | 0 | case 73: |
2364 | 0 | YY_RULE_SETUP |
2365 | 0 | #line 584 "/src/wireshark/epan/diam_dict.l" |
2366 | 0 | { ATTR_STR(yyextra->enumitem->name); } |
2367 | 0 | YY_BREAK |
2368 | 0 | case 74: |
2369 | 0 | YY_RULE_SETUP |
2370 | 0 | #line 585 "/src/wireshark/epan/diam_dict.l" |
2371 | 0 | { ATTR_UINT(yyextra->enumitem->code); } |
2372 | 0 | YY_BREAK |
2373 | 0 | case 75: |
2374 | 0 | YY_RULE_SETUP |
2375 | 0 | #line 587 "/src/wireshark/epan/diam_dict.l" |
2376 | 0 | { BEGIN IN_AVP; } |
2377 | 0 | YY_BREAK |
2378 | 0 | case 76: |
2379 | 0 | YY_RULE_SETUP |
2380 | 0 | #line 588 "/src/wireshark/epan/diam_dict.l" |
2381 | 0 | { BEGIN IN_AVP; } |
2382 | 0 | YY_BREAK |
2383 | 0 | case 77: |
2384 | 0 | YY_RULE_SETUP |
2385 | 0 | #line 590 "/src/wireshark/epan/diam_dict.l" |
2386 | 0 | { D(("avp_end\n")); BEGIN IN_APPL; } |
2387 | 0 | YY_BREAK |
2388 | 0 | case 78: |
2389 | 0 | YY_RULE_SETUP |
2390 | 0 | #line 592 "/src/wireshark/epan/diam_dict.l" |
2391 | 0 | { |
2392 | 0 | D(("application_end\n")); BEGIN IN_DICT; |
2393 | 0 | } |
2394 | 0 | YY_BREAK |
2395 | 0 | case 79: |
2396 | 0 | YY_RULE_SETUP |
2397 | 0 | #line 595 "/src/wireshark/epan/diam_dict.l" |
2398 | 0 | { |
2399 | 0 | D(("application_stop_end\n")); BEGIN IN_DICT; |
2400 | 0 | } |
2401 | 0 | YY_BREAK |
2402 | 0 | case 80: |
2403 | 0 | YY_RULE_SETUP |
2404 | 0 | #line 598 "/src/wireshark/epan/diam_dict.l" |
2405 | 0 | { |
2406 | 0 | D(("vendor_end\n")); BEGIN IN_DICT; |
2407 | 0 | } |
2408 | 0 | YY_BREAK |
2409 | 0 | case 81: |
2410 | 0 | YY_RULE_SETUP |
2411 | 0 | #line 601 "/src/wireshark/epan/diam_dict.l" |
2412 | 0 | { |
2413 | 0 | D(("base_end\n")); BEGIN IN_DICT; |
2414 | 0 | } |
2415 | 0 | YY_BREAK |
2416 | 0 | case 82: |
2417 | 0 | YY_RULE_SETUP |
2418 | 0 | #line 605 "/src/wireshark/epan/diam_dict.l" |
2419 | 0 | { |
2420 | 0 | yyterminate(); |
2421 | 0 | } |
2422 | 0 | YY_BREAK |
2423 | 0 | case 83: |
2424 | 0 | YY_RULE_SETUP |
2425 | 0 | #line 609 "/src/wireshark/epan/diam_dict.l" |
2426 | 0 | IGNORE(); |
2427 | 0 | YY_BREAK |
2428 | 0 | case 84: |
2429 | 0 | YY_RULE_SETUP |
2430 | 0 | #line 611 "/src/wireshark/epan/diam_dict.l" |
2431 | 0 | ; |
2432 | 0 | YY_BREAK |
2433 | 0 | case 85: |
2434 | 0 | YY_RULE_SETUP |
2435 | 0 | #line 613 "/src/wireshark/epan/diam_dict.l" |
2436 | 0 | ECHO; |
2437 | 0 | YY_BREAK |
2438 | 0 | #line 2439 "/work/build/epan/diam_dict.c" |
2439 | | |
2440 | 0 | case YY_END_OF_BUFFER: |
2441 | 0 | { |
2442 | | /* Amount of text matched not including the EOB char. */ |
2443 | 0 | int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; |
2444 | | |
2445 | | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
2446 | 0 | *yy_cp = yyg->yy_hold_char; |
2447 | 0 | YY_RESTORE_YY_MORE_OFFSET |
2448 | |
|
2449 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) |
2450 | 0 | { |
2451 | | /* We're scanning a new file or input source. It's |
2452 | | * possible that this happened because the user |
2453 | | * just pointed yyin at a new source and called |
2454 | | * yylex(). If so, then we have to assure |
2455 | | * consistency between YY_CURRENT_BUFFER and our |
2456 | | * globals. Here is the right place to do so, because |
2457 | | * this is the first action (other than possibly a |
2458 | | * back-up) that will match for the new input source. |
2459 | | */ |
2460 | 0 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
2461 | | /* %if-c-only */ |
2462 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; |
2463 | | /* %endif */ |
2464 | | /* %if-c++-only */ |
2465 | | /* %endif */ |
2466 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; |
2467 | 0 | } |
2468 | | |
2469 | | /* Note that here we test for yy_c_buf_p "<=" to the position |
2470 | | * of the first EOB in the buffer, since yy_c_buf_p will |
2471 | | * already have been incremented past the NUL character |
2472 | | * (since all states make transitions on EOB to the |
2473 | | * end-of-buffer state). Contrast this with the test |
2474 | | * in input(). |
2475 | | */ |
2476 | 0 | if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) |
2477 | 0 | { /* This was really a NUL. */ |
2478 | 0 | yy_state_type yy_next_state; |
2479 | |
|
2480 | 0 | yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; |
2481 | |
|
2482 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
2483 | | |
2484 | | /* Okay, we're now positioned to make the NUL |
2485 | | * transition. We couldn't have |
2486 | | * yy_get_previous_state() go ahead and do it |
2487 | | * for us because it doesn't know how to deal |
2488 | | * with the possibility of jamming (and we don't |
2489 | | * want to build jamming into it because then it |
2490 | | * will run more slowly). |
2491 | | */ |
2492 | |
|
2493 | 0 | yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); |
2494 | |
|
2495 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
2496 | |
|
2497 | 0 | if ( yy_next_state ) |
2498 | 0 | { |
2499 | | /* Consume the NUL. */ |
2500 | 0 | yy_cp = ++yyg->yy_c_buf_p; |
2501 | 0 | yy_current_state = yy_next_state; |
2502 | 0 | goto yy_match; |
2503 | 0 | } |
2504 | | |
2505 | 0 | else |
2506 | 0 | { |
2507 | | /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ |
2508 | 0 | yy_cp = yyg->yy_last_accepting_cpos; |
2509 | 0 | yy_current_state = yyg->yy_last_accepting_state; |
2510 | 0 | goto yy_find_action; |
2511 | 0 | } |
2512 | 0 | } |
2513 | | |
2514 | 0 | else switch ( yy_get_next_buffer( yyscanner ) ) |
2515 | 0 | { |
2516 | 0 | case EOB_ACT_END_OF_FILE: |
2517 | 0 | { |
2518 | 0 | yyg->yy_did_buffer_switch_on_eof = 0; |
2519 | |
|
2520 | 0 | if ( yywrap( yyscanner ) ) |
2521 | 0 | { |
2522 | | /* Note: because we've taken care in |
2523 | | * yy_get_next_buffer() to have set up |
2524 | | * yytext, we can now set up |
2525 | | * yy_c_buf_p so that if some total |
2526 | | * hoser (like flex itself) wants to |
2527 | | * call the scanner after we return the |
2528 | | * YY_NULL, it'll still work - another |
2529 | | * YY_NULL will get returned. |
2530 | | */ |
2531 | 0 | yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; |
2532 | |
|
2533 | 0 | yy_act = YY_STATE_EOF(YY_START); |
2534 | 0 | goto do_action; |
2535 | 0 | } |
2536 | | |
2537 | 0 | else |
2538 | 0 | { |
2539 | 0 | if ( ! yyg->yy_did_buffer_switch_on_eof ) |
2540 | 0 | YY_NEW_FILE; |
2541 | 0 | } |
2542 | 0 | break; |
2543 | 0 | } |
2544 | | |
2545 | 0 | case EOB_ACT_CONTINUE_SCAN: |
2546 | 0 | yyg->yy_c_buf_p = |
2547 | 0 | yyg->yytext_ptr + yy_amount_of_matched_text; |
2548 | |
|
2549 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
2550 | |
|
2551 | 0 | yy_cp = yyg->yy_c_buf_p; |
2552 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
2553 | 0 | goto yy_match; |
2554 | | |
2555 | 0 | case EOB_ACT_LAST_MATCH: |
2556 | 0 | yyg->yy_c_buf_p = |
2557 | 0 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; |
2558 | |
|
2559 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
2560 | |
|
2561 | 0 | yy_cp = yyg->yy_c_buf_p; |
2562 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
2563 | 0 | goto yy_find_action; |
2564 | 0 | } |
2565 | 0 | break; |
2566 | 0 | } |
2567 | | |
2568 | 0 | default: |
2569 | 0 | YY_FATAL_ERROR( |
2570 | 0 | "fatal flex scanner internal error--no action found" ); |
2571 | 0 | } /* end of action switch */ |
2572 | 0 | } /* end of scanning one token */ |
2573 | 0 | } /* end of user's declarations */ |
2574 | 0 | } /* end of yylex */ |
2575 | | /* %ok-for-header */ |
2576 | | |
2577 | | /* %if-c++-only */ |
2578 | | /* %not-for-header */ |
2579 | | /* %ok-for-header */ |
2580 | | |
2581 | | /* %endif */ |
2582 | | |
2583 | | /* yy_get_next_buffer - try to read in a new buffer |
2584 | | * |
2585 | | * Returns a code representing an action: |
2586 | | * EOB_ACT_LAST_MATCH - |
2587 | | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
2588 | | * EOB_ACT_END_OF_FILE - end of file |
2589 | | */ |
2590 | | /* %if-c-only */ |
2591 | | static int yy_get_next_buffer (yyscan_t yyscanner) |
2592 | | /* %endif */ |
2593 | | /* %if-c++-only */ |
2594 | | /* %endif */ |
2595 | 0 | { |
2596 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2597 | 0 | char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
2598 | 0 | char *source = yyg->yytext_ptr; |
2599 | 0 | int number_to_move, i; |
2600 | 0 | int ret_val; |
2601 | |
|
2602 | 0 | if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) |
2603 | 0 | YY_FATAL_ERROR( |
2604 | 0 | "fatal flex scanner internal error--end of buffer missed" ); |
2605 | | |
2606 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) |
2607 | 0 | { /* Don't try to fill the buffer, so this is an EOF. */ |
2608 | 0 | if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) |
2609 | 0 | { |
2610 | | /* We matched a single character, the EOB, so |
2611 | | * treat this as a final EOF. |
2612 | | */ |
2613 | 0 | return EOB_ACT_END_OF_FILE; |
2614 | 0 | } |
2615 | | |
2616 | 0 | else |
2617 | 0 | { |
2618 | | /* We matched some text prior to the EOB, first |
2619 | | * process it. |
2620 | | */ |
2621 | 0 | return EOB_ACT_LAST_MATCH; |
2622 | 0 | } |
2623 | 0 | } |
2624 | | |
2625 | | /* Try to read more data. */ |
2626 | | |
2627 | | /* First move last chars to start of buffer. */ |
2628 | 0 | number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); |
2629 | |
|
2630 | 0 | for ( i = 0; i < number_to_move; ++i ) |
2631 | 0 | *(dest++) = *(source++); |
2632 | |
|
2633 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
2634 | | /* don't do the read, it's not guaranteed to return an EOF, |
2635 | | * just force an EOF |
2636 | | */ |
2637 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; |
2638 | | |
2639 | 0 | else |
2640 | 0 | { |
2641 | 0 | int num_to_read = |
2642 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
2643 | |
|
2644 | 0 | while ( num_to_read <= 0 ) |
2645 | 0 | { /* Not enough room in the buffer - grow it. */ |
2646 | | |
2647 | | /* just a shorter name for the current buffer */ |
2648 | 0 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
2649 | |
|
2650 | 0 | int yy_c_buf_p_offset = |
2651 | 0 | (int) (yyg->yy_c_buf_p - b->yy_ch_buf); |
2652 | |
|
2653 | 0 | if ( b->yy_is_our_buffer ) |
2654 | 0 | { |
2655 | 0 | int new_size = b->yy_buf_size * 2; |
2656 | |
|
2657 | 0 | if ( new_size <= 0 ) |
2658 | 0 | b->yy_buf_size += b->yy_buf_size / 8; |
2659 | 0 | else |
2660 | 0 | b->yy_buf_size *= 2; |
2661 | |
|
2662 | 0 | b->yy_ch_buf = (char *) |
2663 | | /* Include room in for 2 EOB chars. */ |
2664 | 0 | yyrealloc( (void *) b->yy_ch_buf, |
2665 | 0 | (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
2666 | 0 | } |
2667 | 0 | else |
2668 | | /* Can't grow it, we don't own it. */ |
2669 | 0 | b->yy_ch_buf = NULL; |
2670 | |
|
2671 | 0 | if ( ! b->yy_ch_buf ) |
2672 | 0 | YY_FATAL_ERROR( |
2673 | 0 | "fatal error - scanner input buffer overflow" ); |
2674 | | |
2675 | 0 | yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
2676 | |
|
2677 | 0 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - |
2678 | 0 | number_to_move - 1; |
2679 | |
|
2680 | 0 | } |
2681 | | |
2682 | 0 | if ( num_to_read > YY_READ_BUF_SIZE ) |
2683 | 0 | num_to_read = YY_READ_BUF_SIZE; |
2684 | | |
2685 | | /* Read in more data. */ |
2686 | 0 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), |
2687 | 0 | yyg->yy_n_chars, num_to_read ); |
2688 | |
|
2689 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
2690 | 0 | } |
2691 | | |
2692 | 0 | if ( yyg->yy_n_chars == 0 ) |
2693 | 0 | { |
2694 | 0 | if ( number_to_move == YY_MORE_ADJ ) |
2695 | 0 | { |
2696 | 0 | ret_val = EOB_ACT_END_OF_FILE; |
2697 | 0 | yyrestart( yyin , yyscanner); |
2698 | 0 | } |
2699 | | |
2700 | 0 | else |
2701 | 0 | { |
2702 | 0 | ret_val = EOB_ACT_LAST_MATCH; |
2703 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = |
2704 | 0 | YY_BUFFER_EOF_PENDING; |
2705 | 0 | } |
2706 | 0 | } |
2707 | | |
2708 | 0 | else |
2709 | 0 | ret_val = EOB_ACT_CONTINUE_SCAN; |
2710 | |
|
2711 | 0 | if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
2712 | | /* Extend the array by 50%, plus the number we really need. */ |
2713 | 0 | int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); |
2714 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( |
2715 | 0 | (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); |
2716 | 0 | if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
2717 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); |
2718 | | /* "- 2" to take care of EOB's */ |
2719 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); |
2720 | 0 | } |
2721 | | |
2722 | 0 | yyg->yy_n_chars += number_to_move; |
2723 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
2724 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
2725 | |
|
2726 | 0 | yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
2727 | |
|
2728 | 0 | return ret_val; |
2729 | 0 | } |
2730 | | |
2731 | | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
2732 | | |
2733 | | /* %if-c-only */ |
2734 | | /* %not-for-header */ |
2735 | | static yy_state_type yy_get_previous_state (yyscan_t yyscanner) |
2736 | | /* %endif */ |
2737 | | /* %if-c++-only */ |
2738 | | /* %endif */ |
2739 | 0 | { |
2740 | 0 | yy_state_type yy_current_state; |
2741 | 0 | char *yy_cp; |
2742 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2743 | | |
2744 | | /* %% [15.0] code to get the start state into yy_current_state goes here */ |
2745 | 0 | yy_current_state = yyg->yy_start; |
2746 | |
|
2747 | 0 | for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) |
2748 | 0 | { |
2749 | | /* %% [16.0] code to find the next state goes here */ |
2750 | 0 | YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
2751 | 0 | if ( yy_accept[yy_current_state] ) |
2752 | 0 | { |
2753 | 0 | yyg->yy_last_accepting_state = yy_current_state; |
2754 | 0 | yyg->yy_last_accepting_cpos = yy_cp; |
2755 | 0 | } |
2756 | 0 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
2757 | 0 | { |
2758 | 0 | yy_current_state = (int) yy_def[yy_current_state]; |
2759 | 0 | if ( yy_current_state >= 482 ) |
2760 | 0 | yy_c = yy_meta[yy_c]; |
2761 | 0 | } |
2762 | 0 | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
2763 | 0 | } |
2764 | |
|
2765 | 0 | return yy_current_state; |
2766 | 0 | } |
2767 | | |
2768 | | /* yy_try_NUL_trans - try to make a transition on the NUL character |
2769 | | * |
2770 | | * synopsis |
2771 | | * next_state = yy_try_NUL_trans( current_state ); |
2772 | | */ |
2773 | | /* %if-c-only */ |
2774 | | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) |
2775 | | /* %endif */ |
2776 | | /* %if-c++-only */ |
2777 | | /* %endif */ |
2778 | 0 | { |
2779 | 0 | int yy_is_jam; |
2780 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ |
2781 | | /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ |
2782 | 0 | char *yy_cp = yyg->yy_c_buf_p; |
2783 | |
|
2784 | 0 | YY_CHAR yy_c = 1; |
2785 | 0 | if ( yy_accept[yy_current_state] ) |
2786 | 0 | { |
2787 | 0 | yyg->yy_last_accepting_state = yy_current_state; |
2788 | 0 | yyg->yy_last_accepting_cpos = yy_cp; |
2789 | 0 | } |
2790 | 0 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
2791 | 0 | { |
2792 | 0 | yy_current_state = (int) yy_def[yy_current_state]; |
2793 | 0 | if ( yy_current_state >= 482 ) |
2794 | 0 | yy_c = yy_meta[yy_c]; |
2795 | 0 | } |
2796 | 0 | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
2797 | 0 | yy_is_jam = (yy_current_state == 481); |
2798 | |
|
2799 | 0 | (void)yyg; |
2800 | 0 | return yy_is_jam ? 0 : yy_current_state; |
2801 | 0 | } |
2802 | | |
2803 | | #ifndef YY_NO_UNPUT |
2804 | | /* %if-c-only */ |
2805 | | |
2806 | | /* %endif */ |
2807 | | #endif |
2808 | | |
2809 | | /* %if-c-only */ |
2810 | | #ifndef YY_NO_INPUT |
2811 | | #ifdef __cplusplus |
2812 | | static int yyinput (yyscan_t yyscanner) |
2813 | | #else |
2814 | | static int input (yyscan_t yyscanner) |
2815 | | #endif |
2816 | | |
2817 | | /* %endif */ |
2818 | | /* %if-c++-only */ |
2819 | | /* %endif */ |
2820 | | { |
2821 | | int c; |
2822 | | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2823 | | |
2824 | | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2825 | | |
2826 | | if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
2827 | | { |
2828 | | /* yy_c_buf_p now points to the character we want to return. |
2829 | | * If this occurs *before* the EOB characters, then it's a |
2830 | | * valid NUL; if not, then we've hit the end of the buffer. |
2831 | | */ |
2832 | | if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) |
2833 | | /* This was really a NUL. */ |
2834 | | *yyg->yy_c_buf_p = '\0'; |
2835 | | |
2836 | | else |
2837 | | { /* need more input */ |
2838 | | int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); |
2839 | | ++yyg->yy_c_buf_p; |
2840 | | |
2841 | | switch ( yy_get_next_buffer( yyscanner ) ) |
2842 | | { |
2843 | | case EOB_ACT_LAST_MATCH: |
2844 | | /* This happens because yy_g_n_b() |
2845 | | * sees that we've accumulated a |
2846 | | * token and flags that we need to |
2847 | | * try matching the token before |
2848 | | * proceeding. But for input(), |
2849 | | * there's no matching to consider. |
2850 | | * So convert the EOB_ACT_LAST_MATCH |
2851 | | * to EOB_ACT_END_OF_FILE. |
2852 | | */ |
2853 | | |
2854 | | /* Reset buffer status. */ |
2855 | | yyrestart( yyin , yyscanner); |
2856 | | |
2857 | | /*FALLTHROUGH*/ |
2858 | | |
2859 | | case EOB_ACT_END_OF_FILE: |
2860 | | { |
2861 | | if ( yywrap( yyscanner ) ) |
2862 | | return 0; |
2863 | | |
2864 | | if ( ! yyg->yy_did_buffer_switch_on_eof ) |
2865 | | YY_NEW_FILE; |
2866 | | #ifdef __cplusplus |
2867 | | return yyinput(yyscanner); |
2868 | | #else |
2869 | | return input(yyscanner); |
2870 | | #endif |
2871 | | } |
2872 | | |
2873 | | case EOB_ACT_CONTINUE_SCAN: |
2874 | | yyg->yy_c_buf_p = yyg->yytext_ptr + offset; |
2875 | | break; |
2876 | | } |
2877 | | } |
2878 | | } |
2879 | | |
2880 | | c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ |
2881 | | *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ |
2882 | | yyg->yy_hold_char = *++yyg->yy_c_buf_p; |
2883 | | |
2884 | | /* %% [19.0] update BOL and yylineno */ |
2885 | | |
2886 | | return c; |
2887 | | } |
2888 | | /* %if-c-only */ |
2889 | | #endif /* ifndef YY_NO_INPUT */ |
2890 | | /* %endif */ |
2891 | | |
2892 | | /** Immediately switch to a different input stream. |
2893 | | * @param input_file A readable stream. |
2894 | | * @param yyscanner The scanner object. |
2895 | | * @note This function does not reset the start condition to @c INITIAL . |
2896 | | */ |
2897 | | /* %if-c-only */ |
2898 | | void yyrestart (FILE * input_file , yyscan_t yyscanner) |
2899 | | /* %endif */ |
2900 | | /* %if-c++-only */ |
2901 | | /* %endif */ |
2902 | 0 | { |
2903 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2904 | |
|
2905 | 0 | if ( ! YY_CURRENT_BUFFER ){ |
2906 | 0 | yyensure_buffer_stack (yyscanner); |
2907 | 0 | YY_CURRENT_BUFFER_LVALUE = |
2908 | 0 | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
2909 | 0 | } |
2910 | |
|
2911 | 0 | yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); |
2912 | 0 | yy_load_buffer_state( yyscanner ); |
2913 | 0 | } |
2914 | | |
2915 | | /* %if-c++-only */ |
2916 | | /* %endif */ |
2917 | | |
2918 | | /** Switch to a different input buffer. |
2919 | | * @param new_buffer The new input buffer. |
2920 | | * @param yyscanner The scanner object. |
2921 | | */ |
2922 | | /* %if-c-only */ |
2923 | | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
2924 | | /* %endif */ |
2925 | | /* %if-c++-only */ |
2926 | | /* %endif */ |
2927 | 0 | { |
2928 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2929 | | |
2930 | | /* TODO. We should be able to replace this entire function body |
2931 | | * with |
2932 | | * yypop_buffer_state(); |
2933 | | * yypush_buffer_state(new_buffer); |
2934 | | */ |
2935 | 0 | yyensure_buffer_stack (yyscanner); |
2936 | 0 | if ( YY_CURRENT_BUFFER == new_buffer ) |
2937 | 0 | return; |
2938 | | |
2939 | 0 | if ( YY_CURRENT_BUFFER ) |
2940 | 0 | { |
2941 | | /* Flush out information for old buffer. */ |
2942 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2943 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
2944 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
2945 | 0 | } |
2946 | |
|
2947 | 0 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
2948 | 0 | yy_load_buffer_state( yyscanner ); |
2949 | | |
2950 | | /* We don't actually know whether we did this switch during |
2951 | | * EOF (yywrap()) processing, but the only time this flag |
2952 | | * is looked at is after yywrap() is called, so it's safe |
2953 | | * to go ahead and always set it. |
2954 | | */ |
2955 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
2956 | 0 | } |
2957 | | |
2958 | | /* %if-c-only */ |
2959 | | static void yy_load_buffer_state (yyscan_t yyscanner) |
2960 | | /* %endif */ |
2961 | | /* %if-c++-only */ |
2962 | | /* %endif */ |
2963 | 0 | { |
2964 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2965 | 0 | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
2966 | 0 | yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
2967 | | /* %if-c-only */ |
2968 | 0 | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
2969 | | /* %endif */ |
2970 | | /* %if-c++-only */ |
2971 | | /* %endif */ |
2972 | 0 | yyg->yy_hold_char = *yyg->yy_c_buf_p; |
2973 | 0 | } |
2974 | | |
2975 | | /** Allocate and initialize an input buffer state. |
2976 | | * @param file A readable stream. |
2977 | | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. |
2978 | | * @param yyscanner The scanner object. |
2979 | | * @return the allocated buffer state. |
2980 | | */ |
2981 | | /* %if-c-only */ |
2982 | | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) |
2983 | | /* %endif */ |
2984 | | /* %if-c++-only */ |
2985 | | /* %endif */ |
2986 | 0 | { |
2987 | 0 | YY_BUFFER_STATE b; |
2988 | | |
2989 | 0 | b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
2990 | 0 | if ( ! b ) |
2991 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
2992 | | |
2993 | 0 | b->yy_buf_size = size; |
2994 | | |
2995 | | /* yy_ch_buf has to be 2 characters longer than the size given because |
2996 | | * we need to put in 2 end-of-buffer characters. |
2997 | | */ |
2998 | 0 | b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
2999 | 0 | if ( ! b->yy_ch_buf ) |
3000 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
3001 | | |
3002 | 0 | b->yy_is_our_buffer = 1; |
3003 | |
|
3004 | 0 | yy_init_buffer( b, file , yyscanner); |
3005 | |
|
3006 | 0 | return b; |
3007 | 0 | } |
3008 | | |
3009 | | /* %if-c++-only */ |
3010 | | /* %endif */ |
3011 | | |
3012 | | /** Destroy the buffer. |
3013 | | * @param b a buffer created with yy_create_buffer() |
3014 | | * @param yyscanner The scanner object. |
3015 | | */ |
3016 | | /* %if-c-only */ |
3017 | | void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
3018 | | /* %endif */ |
3019 | | /* %if-c++-only */ |
3020 | | /* %endif */ |
3021 | 0 | { |
3022 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3023 | |
|
3024 | 0 | if ( ! b ) |
3025 | 0 | return; |
3026 | | |
3027 | 0 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ |
3028 | 0 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
3029 | |
|
3030 | 0 | if ( b->yy_is_our_buffer ) |
3031 | 0 | yyfree( (void *) b->yy_ch_buf , yyscanner ); |
3032 | |
|
3033 | 0 | yyfree( (void *) b , yyscanner ); |
3034 | 0 | } |
3035 | | |
3036 | | /* Initializes or reinitializes a buffer. |
3037 | | * This function is sometimes called more than once on the same buffer, |
3038 | | * such as during a yyrestart() or at EOF. |
3039 | | */ |
3040 | | /* %if-c-only */ |
3041 | | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) |
3042 | | /* %endif */ |
3043 | | /* %if-c++-only */ |
3044 | | /* %endif */ |
3045 | | |
3046 | 0 | { |
3047 | 0 | int oerrno = errno; |
3048 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3049 | |
|
3050 | 0 | yy_flush_buffer( b , yyscanner); |
3051 | | |
3052 | | /* %if-c-only */ |
3053 | 0 | b->yy_input_file = file; |
3054 | | /* %endif */ |
3055 | | /* %if-c++-only */ |
3056 | | /* %endif */ |
3057 | 0 | b->yy_fill_buffer = 1; |
3058 | | |
3059 | | /* If b is the current buffer, then yy_init_buffer was _probably_ |
3060 | | * called from yyrestart() or through yy_get_next_buffer. |
3061 | | * In that case, we don't want to reset the lineno or column. |
3062 | | */ |
3063 | 0 | if (b != YY_CURRENT_BUFFER){ |
3064 | 0 | b->yy_bs_lineno = 1; |
3065 | 0 | b->yy_bs_column = 0; |
3066 | 0 | } |
3067 | | |
3068 | | /* %if-c-only */ |
3069 | |
|
3070 | 0 | b->yy_is_interactive = 0; |
3071 | | |
3072 | | /* %endif */ |
3073 | | /* %if-c++-only */ |
3074 | | /* %endif */ |
3075 | 0 | errno = oerrno; |
3076 | 0 | } |
3077 | | |
3078 | | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
3079 | | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
3080 | | * @param yyscanner The scanner object. |
3081 | | */ |
3082 | | /* %if-c-only */ |
3083 | | void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
3084 | | /* %endif */ |
3085 | | /* %if-c++-only */ |
3086 | | /* %endif */ |
3087 | 0 | { |
3088 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3089 | 0 | if ( ! b ) |
3090 | 0 | return; |
3091 | | |
3092 | 0 | b->yy_n_chars = 0; |
3093 | | |
3094 | | /* We always need two end-of-buffer characters. The first causes |
3095 | | * a transition to the end-of-buffer state. The second causes |
3096 | | * a jam in that state. |
3097 | | */ |
3098 | 0 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
3099 | 0 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
3100 | |
|
3101 | 0 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
3102 | |
|
3103 | 0 | b->yy_at_bol = 1; |
3104 | 0 | b->yy_buffer_status = YY_BUFFER_NEW; |
3105 | |
|
3106 | 0 | if ( b == YY_CURRENT_BUFFER ) |
3107 | 0 | yy_load_buffer_state( yyscanner ); |
3108 | 0 | } |
3109 | | |
3110 | | /* %if-c-or-c++ */ |
3111 | | /** Pushes the new state onto the stack. The new state becomes |
3112 | | * the current state. This function will allocate the stack |
3113 | | * if necessary. |
3114 | | * @param new_buffer The new state. |
3115 | | * @param yyscanner The scanner object. |
3116 | | */ |
3117 | | /* %if-c-only */ |
3118 | | void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
3119 | | /* %endif */ |
3120 | | /* %if-c++-only */ |
3121 | | /* %endif */ |
3122 | 0 | { |
3123 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3124 | 0 | if (new_buffer == NULL) |
3125 | 0 | return; |
3126 | | |
3127 | 0 | yyensure_buffer_stack(yyscanner); |
3128 | | |
3129 | | /* This block is copied from yy_switch_to_buffer. */ |
3130 | 0 | if ( YY_CURRENT_BUFFER ) |
3131 | 0 | { |
3132 | | /* Flush out information for old buffer. */ |
3133 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
3134 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
3135 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
3136 | 0 | } |
3137 | | |
3138 | | /* Only push if top exists. Otherwise, replace top. */ |
3139 | 0 | if (YY_CURRENT_BUFFER) |
3140 | 0 | yyg->yy_buffer_stack_top++; |
3141 | 0 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
3142 | | |
3143 | | /* copied from yy_switch_to_buffer. */ |
3144 | 0 | yy_load_buffer_state( yyscanner ); |
3145 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
3146 | 0 | } |
3147 | | /* %endif */ |
3148 | | |
3149 | | /* %if-c-or-c++ */ |
3150 | | /** Removes and deletes the top of the stack, if present. |
3151 | | * The next element becomes the new top. |
3152 | | * @param yyscanner The scanner object. |
3153 | | */ |
3154 | | /* %if-c-only */ |
3155 | | void yypop_buffer_state (yyscan_t yyscanner) |
3156 | | /* %endif */ |
3157 | | /* %if-c++-only */ |
3158 | | /* %endif */ |
3159 | 0 | { |
3160 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3161 | 0 | if (!YY_CURRENT_BUFFER) |
3162 | 0 | return; |
3163 | | |
3164 | 0 | yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); |
3165 | 0 | YY_CURRENT_BUFFER_LVALUE = NULL; |
3166 | 0 | if (yyg->yy_buffer_stack_top > 0) |
3167 | 0 | --yyg->yy_buffer_stack_top; |
3168 | |
|
3169 | 0 | if (YY_CURRENT_BUFFER) { |
3170 | 0 | yy_load_buffer_state( yyscanner ); |
3171 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
3172 | 0 | } |
3173 | 0 | } |
3174 | | /* %endif */ |
3175 | | |
3176 | | /* %if-c-or-c++ */ |
3177 | | /* Allocates the stack if it does not exist. |
3178 | | * Guarantees space for at least one push. |
3179 | | */ |
3180 | | /* %if-c-only */ |
3181 | | static void yyensure_buffer_stack (yyscan_t yyscanner) |
3182 | | /* %endif */ |
3183 | | /* %if-c++-only */ |
3184 | | /* %endif */ |
3185 | 0 | { |
3186 | 0 | yy_size_t num_to_alloc; |
3187 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3188 | |
|
3189 | 0 | if (!yyg->yy_buffer_stack) { |
3190 | | |
3191 | | /* First allocation is just for 2 elements, since we don't know if this |
3192 | | * scanner will even need a stack. We use 2 instead of 1 to avoid an |
3193 | | * immediate realloc on the next call. |
3194 | | */ |
3195 | 0 | num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ |
3196 | 0 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc |
3197 | 0 | (num_to_alloc * sizeof(struct yy_buffer_state*) |
3198 | 0 | , yyscanner); |
3199 | 0 | if ( ! yyg->yy_buffer_stack ) |
3200 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
3201 | | |
3202 | 0 | memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
3203 | |
|
3204 | 0 | yyg->yy_buffer_stack_max = num_to_alloc; |
3205 | 0 | yyg->yy_buffer_stack_top = 0; |
3206 | 0 | return; |
3207 | 0 | } |
3208 | | |
3209 | 0 | if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ |
3210 | | |
3211 | | /* Increase the buffer to prepare for a possible push. */ |
3212 | 0 | yy_size_t grow_size = 8 /* arbitrary grow size */; |
3213 | |
|
3214 | 0 | num_to_alloc = yyg->yy_buffer_stack_max + grow_size; |
3215 | 0 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc |
3216 | 0 | (yyg->yy_buffer_stack, |
3217 | 0 | num_to_alloc * sizeof(struct yy_buffer_state*) |
3218 | 0 | , yyscanner); |
3219 | 0 | if ( ! yyg->yy_buffer_stack ) |
3220 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
3221 | | |
3222 | | /* zero only the new slots.*/ |
3223 | 0 | memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); |
3224 | 0 | yyg->yy_buffer_stack_max = num_to_alloc; |
3225 | 0 | } |
3226 | 0 | } |
3227 | | /* %endif */ |
3228 | | |
3229 | | /* %if-c-only */ |
3230 | | /** Setup the input buffer state to scan directly from a user-specified character buffer. |
3231 | | * @param base the character buffer |
3232 | | * @param size the size in bytes of the character buffer |
3233 | | * @param yyscanner The scanner object. |
3234 | | * @return the newly allocated buffer state object. |
3235 | | */ |
3236 | | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) |
3237 | 0 | { |
3238 | 0 | YY_BUFFER_STATE b; |
3239 | | |
3240 | 0 | if ( size < 2 || |
3241 | 0 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
3242 | 0 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
3243 | | /* They forgot to leave room for the EOB's. */ |
3244 | 0 | return NULL; |
3245 | | |
3246 | 0 | b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
3247 | 0 | if ( ! b ) |
3248 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
3249 | | |
3250 | 0 | b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ |
3251 | 0 | b->yy_buf_pos = b->yy_ch_buf = base; |
3252 | 0 | b->yy_is_our_buffer = 0; |
3253 | 0 | b->yy_input_file = NULL; |
3254 | 0 | b->yy_n_chars = b->yy_buf_size; |
3255 | 0 | b->yy_is_interactive = 0; |
3256 | 0 | b->yy_at_bol = 1; |
3257 | 0 | b->yy_fill_buffer = 0; |
3258 | 0 | b->yy_buffer_status = YY_BUFFER_NEW; |
3259 | |
|
3260 | 0 | yy_switch_to_buffer( b , yyscanner ); |
3261 | |
|
3262 | 0 | return b; |
3263 | 0 | } |
3264 | | /* %endif */ |
3265 | | |
3266 | | /* %if-c-only */ |
3267 | | /** Setup the input buffer state to scan a string. The next call to yylex() will |
3268 | | * scan from a @e copy of @a str. |
3269 | | * @param yystr a NUL-terminated string to scan |
3270 | | * @param yyscanner The scanner object. |
3271 | | * @return the newly allocated buffer state object. |
3272 | | * @note If you want to scan bytes that may contain NUL values, then use |
3273 | | * yy_scan_bytes() instead. |
3274 | | */ |
3275 | | YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) |
3276 | 0 | { |
3277 | | |
3278 | 0 | return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); |
3279 | 0 | } |
3280 | | /* %endif */ |
3281 | | |
3282 | | /* %if-c-only */ |
3283 | | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
3284 | | * scan from a @e copy of @a bytes. |
3285 | | * @param yybytes the byte buffer to scan |
3286 | | * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
3287 | | * @param yyscanner The scanner object. |
3288 | | * @return the newly allocated buffer state object. |
3289 | | */ |
3290 | | YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) |
3291 | 0 | { |
3292 | 0 | YY_BUFFER_STATE b; |
3293 | 0 | char *buf; |
3294 | 0 | yy_size_t n; |
3295 | 0 | int i; |
3296 | | |
3297 | | /* Get memory for full buffer, including space for trailing EOB's. */ |
3298 | 0 | n = (yy_size_t) (_yybytes_len + 2); |
3299 | 0 | buf = (char *) yyalloc( n , yyscanner ); |
3300 | 0 | if ( ! buf ) |
3301 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
3302 | | |
3303 | 0 | for ( i = 0; i < _yybytes_len; ++i ) |
3304 | 0 | buf[i] = yybytes[i]; |
3305 | |
|
3306 | 0 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
3307 | |
|
3308 | 0 | b = yy_scan_buffer( buf, n , yyscanner); |
3309 | 0 | if ( ! b ) |
3310 | 0 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
3311 | | |
3312 | | /* It's okay to grow etc. this buffer, and we should throw it |
3313 | | * away when we're done. |
3314 | | */ |
3315 | 0 | b->yy_is_our_buffer = 1; |
3316 | |
|
3317 | 0 | return b; |
3318 | 0 | } |
3319 | | /* %endif */ |
3320 | | |
3321 | | /* %if-c-only */ |
3322 | | static void yy_push_state (int _new_state , yyscan_t yyscanner) |
3323 | | /* %endif */ |
3324 | | /* %if-c++-only */ |
3325 | | /* %endif */ |
3326 | 0 | { |
3327 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3328 | 0 | if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) |
3329 | 0 | { |
3330 | 0 | yy_size_t new_size; |
3331 | |
|
3332 | 0 | yyg->yy_start_stack_depth += YY_START_STACK_INCR; |
3333 | 0 | new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int ); |
3334 | |
|
3335 | 0 | if ( ! yyg->yy_start_stack ) |
3336 | 0 | yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner ); |
3337 | | |
3338 | 0 | else |
3339 | 0 | yyg->yy_start_stack = (int *) yyrealloc( |
3340 | 0 | (void *) yyg->yy_start_stack, new_size , yyscanner ); |
3341 | |
|
3342 | 0 | if ( ! yyg->yy_start_stack ) |
3343 | 0 | YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); |
3344 | 0 | } |
3345 | | |
3346 | 0 | yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; |
3347 | |
|
3348 | 0 | BEGIN(_new_state); |
3349 | 0 | } |
3350 | | |
3351 | | /* %if-c-only */ |
3352 | | static void yy_pop_state (yyscan_t yyscanner) |
3353 | | /* %endif */ |
3354 | | /* %if-c++-only */ |
3355 | | /* %endif */ |
3356 | 0 | { |
3357 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3358 | 0 | if ( --yyg->yy_start_stack_ptr < 0 ) |
3359 | 0 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
3360 | | |
3361 | 0 | BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]); |
3362 | 0 | } |
3363 | | |
3364 | | /* %if-c-only */ |
3365 | | static int yy_top_state (yyscan_t yyscanner) |
3366 | | /* %endif */ |
3367 | | /* %if-c++-only */ |
3368 | | /* %endif */ |
3369 | 0 | { |
3370 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3371 | 0 | return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1]; |
3372 | 0 | } |
3373 | | |
3374 | | #ifndef YY_EXIT_FAILURE |
3375 | | #define YY_EXIT_FAILURE 2 |
3376 | | #endif |
3377 | | |
3378 | | /* %if-c-only */ |
3379 | | static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) |
3380 | 0 | { |
3381 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3382 | 0 | (void)yyg; |
3383 | 0 | fprintf( stderr, "%s\n", msg ); |
3384 | 0 | exit( YY_EXIT_FAILURE ); |
3385 | 0 | } |
3386 | | /* %endif */ |
3387 | | /* %if-c++-only */ |
3388 | | /* %endif */ |
3389 | | |
3390 | | /* Redefine yyless() so it works in section 3 code. */ |
3391 | | |
3392 | | #undef yyless |
3393 | | #define yyless(n) \ |
3394 | | do \ |
3395 | | { \ |
3396 | | /* Undo effects of setting up yytext. */ \ |
3397 | | int yyless_macro_arg = (n); \ |
3398 | | YY_LESS_LINENO(yyless_macro_arg);\ |
3399 | | yytext[yyleng] = yyg->yy_hold_char; \ |
3400 | | yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ |
3401 | | yyg->yy_hold_char = *yyg->yy_c_buf_p; \ |
3402 | | *yyg->yy_c_buf_p = '\0'; \ |
3403 | | yyleng = yyless_macro_arg; \ |
3404 | | } \ |
3405 | | while ( 0 ) |
3406 | | |
3407 | | /* Accessor methods (get/set functions) to struct members. */ |
3408 | | |
3409 | | /* %if-c-only */ |
3410 | | /* %if-reentrant */ |
3411 | | |
3412 | | /** Get the user-defined data for this scanner. |
3413 | | * @param yyscanner The scanner object. |
3414 | | */ |
3415 | | YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) |
3416 | 0 | { |
3417 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3418 | 0 | return yyextra; |
3419 | 0 | } |
3420 | | |
3421 | | /* %endif */ |
3422 | | |
3423 | | /** Get the current line number. |
3424 | | * @param yyscanner The scanner object. |
3425 | | */ |
3426 | | int yyget_lineno (yyscan_t yyscanner) |
3427 | 0 | { |
3428 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3429 | |
|
3430 | 0 | if (! YY_CURRENT_BUFFER) |
3431 | 0 | return 0; |
3432 | | |
3433 | 0 | return yylineno; |
3434 | 0 | } |
3435 | | |
3436 | | /** Get the current column number. |
3437 | | * @param yyscanner The scanner object. |
3438 | | */ |
3439 | | int yyget_column (yyscan_t yyscanner) |
3440 | 0 | { |
3441 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3442 | |
|
3443 | 0 | if (! YY_CURRENT_BUFFER) |
3444 | 0 | return 0; |
3445 | | |
3446 | 0 | return yycolumn; |
3447 | 0 | } |
3448 | | |
3449 | | /** Get the input stream. |
3450 | | * @param yyscanner The scanner object. |
3451 | | */ |
3452 | | FILE *yyget_in (yyscan_t yyscanner) |
3453 | 0 | { |
3454 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3455 | 0 | return yyin; |
3456 | 0 | } |
3457 | | |
3458 | | /** Get the output stream. |
3459 | | * @param yyscanner The scanner object. |
3460 | | */ |
3461 | | FILE *yyget_out (yyscan_t yyscanner) |
3462 | 0 | { |
3463 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3464 | 0 | return yyout; |
3465 | 0 | } |
3466 | | |
3467 | | /** Get the length of the current token. |
3468 | | * @param yyscanner The scanner object. |
3469 | | */ |
3470 | | int yyget_leng (yyscan_t yyscanner) |
3471 | 0 | { |
3472 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3473 | 0 | return yyleng; |
3474 | 0 | } |
3475 | | |
3476 | | /** Get the current token. |
3477 | | * @param yyscanner The scanner object. |
3478 | | */ |
3479 | | |
3480 | | char *yyget_text (yyscan_t yyscanner) |
3481 | 0 | { |
3482 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3483 | 0 | return yytext; |
3484 | 0 | } |
3485 | | |
3486 | | /* %if-reentrant */ |
3487 | | |
3488 | | /** Set the user-defined data. This data is never touched by the scanner. |
3489 | | * @param user_defined The data to be associated with this scanner. |
3490 | | * @param yyscanner The scanner object. |
3491 | | */ |
3492 | | void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) |
3493 | 0 | { |
3494 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3495 | 0 | yyextra = user_defined ; |
3496 | 0 | } |
3497 | | |
3498 | | /* %endif */ |
3499 | | |
3500 | | /** Set the current line number. |
3501 | | * @param _line_number line number |
3502 | | * @param yyscanner The scanner object. |
3503 | | */ |
3504 | | void yyset_lineno (int _line_number , yyscan_t yyscanner) |
3505 | 0 | { |
3506 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3507 | | |
3508 | | /* lineno is only valid if an input buffer exists. */ |
3509 | 0 | if (! YY_CURRENT_BUFFER ) |
3510 | 0 | YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); |
3511 | | |
3512 | 0 | yylineno = _line_number; |
3513 | 0 | } |
3514 | | |
3515 | | /** Set the current column. |
3516 | | * @param _column_no column number |
3517 | | * @param yyscanner The scanner object. |
3518 | | */ |
3519 | | void yyset_column (int _column_no , yyscan_t yyscanner) |
3520 | 0 | { |
3521 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3522 | | |
3523 | | /* column is only valid if an input buffer exists. */ |
3524 | 0 | if (! YY_CURRENT_BUFFER ) |
3525 | 0 | YY_FATAL_ERROR( "yyset_column called with no buffer" ); |
3526 | | |
3527 | 0 | yycolumn = _column_no; |
3528 | 0 | } |
3529 | | |
3530 | | /** Set the input stream. This does not discard the current |
3531 | | * input buffer. |
3532 | | * @param _in_str A readable stream. |
3533 | | * @param yyscanner The scanner object. |
3534 | | * @see yy_switch_to_buffer |
3535 | | */ |
3536 | | void yyset_in (FILE * _in_str , yyscan_t yyscanner) |
3537 | 0 | { |
3538 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3539 | 0 | yyin = _in_str ; |
3540 | 0 | } |
3541 | | |
3542 | | void yyset_out (FILE * _out_str , yyscan_t yyscanner) |
3543 | 0 | { |
3544 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3545 | 0 | yyout = _out_str ; |
3546 | 0 | } |
3547 | | |
3548 | | int yyget_debug (yyscan_t yyscanner) |
3549 | 0 | { |
3550 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3551 | 0 | return yy_flex_debug; |
3552 | 0 | } |
3553 | | |
3554 | | void yyset_debug (int _bdebug , yyscan_t yyscanner) |
3555 | 0 | { |
3556 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3557 | 0 | yy_flex_debug = _bdebug ; |
3558 | 0 | } |
3559 | | |
3560 | | /* %endif */ |
3561 | | |
3562 | | /* %if-reentrant */ |
3563 | | /* Accessor methods for yylval and yylloc */ |
3564 | | |
3565 | | /* %if-bison-bridge */ |
3566 | | /* %endif */ |
3567 | | |
3568 | | /* User-visible API */ |
3569 | | |
3570 | | /* yylex_init is special because it creates the scanner itself, so it is |
3571 | | * the ONLY reentrant function that doesn't take the scanner as the last argument. |
3572 | | * That's why we explicitly handle the declaration, instead of using our macros. |
3573 | | */ |
3574 | | int yylex_init(yyscan_t* ptr_yy_globals) |
3575 | 0 | { |
3576 | 0 | if (ptr_yy_globals == NULL){ |
3577 | 0 | errno = EINVAL; |
3578 | 0 | return 1; |
3579 | 0 | } |
3580 | | |
3581 | 0 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); |
3582 | |
|
3583 | 0 | if (*ptr_yy_globals == NULL){ |
3584 | 0 | errno = ENOMEM; |
3585 | 0 | return 1; |
3586 | 0 | } |
3587 | | |
3588 | | /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ |
3589 | 0 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
3590 | |
|
3591 | 0 | return yy_init_globals ( *ptr_yy_globals ); |
3592 | 0 | } |
3593 | | |
3594 | | /* yylex_init_extra has the same functionality as yylex_init, but follows the |
3595 | | * convention of taking the scanner as the last argument. Note however, that |
3596 | | * this is a *pointer* to a scanner, as it will be allocated by this call (and |
3597 | | * is the reason, too, why this function also must handle its own declaration). |
3598 | | * The user defined value in the first argument will be available to yyalloc in |
3599 | | * the yyextra field. |
3600 | | */ |
3601 | | int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) |
3602 | 0 | { |
3603 | 0 | struct yyguts_t dummy_yyguts; |
3604 | |
|
3605 | 0 | yyset_extra (yy_user_defined, &dummy_yyguts); |
3606 | |
|
3607 | 0 | if (ptr_yy_globals == NULL){ |
3608 | 0 | errno = EINVAL; |
3609 | 0 | return 1; |
3610 | 0 | } |
3611 | | |
3612 | 0 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); |
3613 | |
|
3614 | 0 | if (*ptr_yy_globals == NULL){ |
3615 | 0 | errno = ENOMEM; |
3616 | 0 | return 1; |
3617 | 0 | } |
3618 | | |
3619 | | /* By setting to 0xAA, we expose bugs in |
3620 | | yy_init_globals. Leave at 0x00 for releases. */ |
3621 | 0 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
3622 | |
|
3623 | 0 | yyset_extra (yy_user_defined, *ptr_yy_globals); |
3624 | |
|
3625 | 0 | return yy_init_globals ( *ptr_yy_globals ); |
3626 | 0 | } |
3627 | | |
3628 | | /* %endif if-c-only */ |
3629 | | |
3630 | | /* %if-c-only */ |
3631 | | static int yy_init_globals (yyscan_t yyscanner) |
3632 | 0 | { |
3633 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3634 | | /* Initialization is the same as for the non-reentrant scanner. |
3635 | | * This function is called from yylex_destroy(), so don't allocate here. |
3636 | | */ |
3637 | |
|
3638 | 0 | yyg->yy_buffer_stack = NULL; |
3639 | 0 | yyg->yy_buffer_stack_top = 0; |
3640 | 0 | yyg->yy_buffer_stack_max = 0; |
3641 | 0 | yyg->yy_c_buf_p = NULL; |
3642 | 0 | yyg->yy_init = 0; |
3643 | 0 | yyg->yy_start = 0; |
3644 | |
|
3645 | 0 | yyg->yy_start_stack_ptr = 0; |
3646 | 0 | yyg->yy_start_stack_depth = 0; |
3647 | 0 | yyg->yy_start_stack = NULL; |
3648 | | |
3649 | | /* Defined in main.c */ |
3650 | | #ifdef YY_STDINIT |
3651 | | yyin = stdin; |
3652 | | yyout = stdout; |
3653 | | #else |
3654 | 0 | yyin = NULL; |
3655 | 0 | yyout = NULL; |
3656 | 0 | #endif |
3657 | | |
3658 | | /* For future reference: Set errno on error, since we are called by |
3659 | | * yylex_init() |
3660 | | */ |
3661 | 0 | return 0; |
3662 | 0 | } |
3663 | | /* %endif */ |
3664 | | |
3665 | | /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ |
3666 | | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
3667 | | int yylex_destroy (yyscan_t yyscanner) |
3668 | 0 | { |
3669 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3670 | | |
3671 | | /* Pop the buffer stack, destroying each element. */ |
3672 | 0 | while(YY_CURRENT_BUFFER){ |
3673 | 0 | yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); |
3674 | 0 | YY_CURRENT_BUFFER_LVALUE = NULL; |
3675 | 0 | yypop_buffer_state(yyscanner); |
3676 | 0 | } |
3677 | | |
3678 | | /* Destroy the stack itself. */ |
3679 | 0 | yyfree(yyg->yy_buffer_stack , yyscanner); |
3680 | 0 | yyg->yy_buffer_stack = NULL; |
3681 | | |
3682 | | /* Destroy the start condition stack. */ |
3683 | 0 | yyfree( yyg->yy_start_stack , yyscanner ); |
3684 | 0 | yyg->yy_start_stack = NULL; |
3685 | | |
3686 | | /* Reset the globals. This is important in a non-reentrant scanner so the next time |
3687 | | * yylex() is called, initialization will occur. */ |
3688 | 0 | yy_init_globals( yyscanner); |
3689 | | |
3690 | | /* %if-reentrant */ |
3691 | | /* Destroy the main struct (reentrant only). */ |
3692 | 0 | yyfree ( yyscanner , yyscanner ); |
3693 | 0 | yyscanner = NULL; |
3694 | | /* %endif */ |
3695 | 0 | return 0; |
3696 | 0 | } |
3697 | | /* %endif */ |
3698 | | |
3699 | | /* |
3700 | | * Internal utility routines. |
3701 | | */ |
3702 | | |
3703 | | #ifndef yytext_ptr |
3704 | | static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) |
3705 | | { |
3706 | | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
3707 | | (void)yyg; |
3708 | | |
3709 | | int i; |
3710 | | for ( i = 0; i < n; ++i ) |
3711 | | s1[i] = s2[i]; |
3712 | | } |
3713 | | #endif |
3714 | | |
3715 | | #ifdef YY_NEED_STRLEN |
3716 | | static int yy_flex_strlen (const char * s , yyscan_t yyscanner) |
3717 | | { |
3718 | | int n; |
3719 | | for ( n = 0; s[n]; ++n ) |
3720 | | ; |
3721 | | |
3722 | | return n; |
3723 | | } |
3724 | | #endif |
3725 | | |
3726 | | /* %if-tables-serialization definitions */ |
3727 | | /* %define-yytables The name for this specific scanner's tables. */ |
3728 | | #define YYTABLES_NAME "yytables" |
3729 | | /* %endif */ |
3730 | | |
3731 | | /* %ok-for-header */ |
3732 | | |
3733 | | #line 613 "/src/wireshark/epan/diam_dict.l" |
3734 | | |
3735 | | |
3736 | | /* |
3737 | | * Turn diagnostics back on, so we check the code that we've written. |
3738 | | */ |
3739 | | DIAG_ON_FLEX() |
3740 | | |
3741 | | static int debugging = 0; |
3742 | | |
3743 | 4 | static void ddict_debug(const char* fmt, ...) { |
3744 | 4 | va_list ap; |
3745 | | |
3746 | 4 | va_start(ap, fmt); |
3747 | 4 | if (debugging) vfprintf(stderr, fmt, ap); |
3748 | 4 | va_end(ap); |
3749 | | |
3750 | 4 | fflush(stderr); |
3751 | 4 | } |
3752 | | |
3753 | | /* |
3754 | | * Sleazy hack to avoid unused function warnings for yy_top_state. |
3755 | | */ |
3756 | | extern void ddict_unused(yyscan_t yyscanner); |
3757 | | |
3758 | | void |
3759 | | ddict_unused(yyscan_t yyscanner) |
3760 | 0 | { |
3761 | 0 | yy_top_state(yyscanner); |
3762 | 0 | } |
3763 | | |
3764 | | static void |
3765 | | append_to_buffer(const char* txt, unsigned len, DiamDict_scanner_state_t *statep) |
3766 | 0 | { |
3767 | |
|
3768 | 0 | if (statep->strbuf == NULL) { |
3769 | 0 | statep->strbuf = (char*)g_malloc(statep->size_strbuf); |
3770 | 0 | statep->read_ptr = statep->strbuf; |
3771 | 0 | statep->write_ptr = statep->strbuf; |
3772 | 0 | } |
3773 | |
|
3774 | 0 | if (statep->len_strbuf + len >= statep->size_strbuf) { |
3775 | 0 | statep->strbuf = (char*)g_realloc(statep->strbuf,statep->size_strbuf *= 2); |
3776 | 0 | statep->read_ptr = statep->strbuf; |
3777 | 0 | } |
3778 | |
|
3779 | 0 | statep->write_ptr = statep->strbuf + statep->len_strbuf; |
3780 | 0 | memcpy(statep->write_ptr, txt, len + 1); |
3781 | 0 | statep->len_strbuf += len; |
3782 | 0 | } |
3783 | | |
3784 | | static size_t |
3785 | | file_input(char* buf, size_t max, yyscan_t scanner) |
3786 | 0 | { |
3787 | 0 | FILE *in = yyget_in(scanner); |
3788 | 0 | size_t read_cnt; |
3789 | |
|
3790 | 0 | read_cnt = fread(buf,1,max,in); |
3791 | |
|
3792 | 0 | if ( read_cnt == max ) { |
3793 | 0 | return max; |
3794 | 0 | } else if (read_cnt > 0) { |
3795 | 0 | return read_cnt; |
3796 | 0 | } else { |
3797 | 0 | return YY_NULL; |
3798 | 0 | } |
3799 | 0 | } |
3800 | | |
3801 | | |
3802 | | static size_t |
3803 | | string_input(char* buf, size_t max, yyscan_t scanner) |
3804 | 0 | { |
3805 | 0 | DiamDict_scanner_state_t *statep = yyget_extra(scanner); |
3806 | |
|
3807 | 0 | if (statep->read_ptr >= statep->write_ptr ) { |
3808 | 0 | return YY_NULL; |
3809 | 0 | } else if ( statep->read_ptr + max > statep->write_ptr ) { |
3810 | 0 | max = statep->write_ptr - statep->read_ptr; |
3811 | 0 | } |
3812 | | |
3813 | 0 | memcpy(buf,statep->read_ptr,max); |
3814 | 0 | statep->read_ptr += max; |
3815 | |
|
3816 | 0 | return max; |
3817 | 0 | } |
3818 | | |
3819 | | /* |
3820 | | * If we're reading from a string, yyin is set to stdin, and we don't |
3821 | | * want to close that. |
3822 | | */ |
3823 | | static int |
3824 | | string_close(FILE *fh _U_) |
3825 | 0 | { |
3826 | 0 | return 0; |
3827 | 0 | } |
3828 | | |
3829 | | static FILE * |
3830 | | ddict_open(const char* system_directory, const char* filename) |
3831 | 2 | { |
3832 | 2 | FILE* fh; |
3833 | 2 | char* fname; |
3834 | 2 | if (system_directory) { |
3835 | 2 | fname = ws_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", |
3836 | 2 | system_directory,filename); |
3837 | 2 | } else { |
3838 | 0 | fname = g_strdup(filename); |
3839 | 0 | } |
3840 | | |
3841 | 2 | fh = ws_fopen(fname,"r"); |
3842 | | |
3843 | 2 | D(("fname: %s fh: %p\n",fname,(void*)fh)); |
3844 | | |
3845 | 2 | g_free(fname); |
3846 | | |
3847 | | |
3848 | 2 | return fh; |
3849 | 2 | } |
3850 | | |
3851 | | ddict_t * |
3852 | | ddict_scan(const char* system_directory, const char* filename, int dbg) |
3853 | 2 | { |
3854 | 2 | DiamDict_scanner_state_t state; |
3855 | 2 | FILE *in; |
3856 | 2 | yyscan_t scanner; |
3857 | | |
3858 | 2 | debugging = dbg; |
3859 | | |
3860 | 2 | state.sys_dir = system_directory; |
3861 | | |
3862 | 2 | state.write_ptr = NULL; |
3863 | 2 | state.read_ptr = NULL; |
3864 | | |
3865 | 2 | state.strbuf = NULL; |
3866 | 2 | state.size_strbuf = 8192; |
3867 | 2 | state.len_strbuf = 0; |
3868 | | |
3869 | 2 | state.dict = g_new(ddict_t,1); |
3870 | 2 | state.dict->applications = NULL; |
3871 | 2 | state.dict->vendors = NULL; |
3872 | 2 | state.dict->cmds = NULL; |
3873 | 2 | state.dict->typedefns = NULL; |
3874 | 2 | state.dict->avps = NULL; |
3875 | 2 | state.dict->xmlpis = NULL; |
3876 | | |
3877 | 2 | state.appl = NULL; |
3878 | 2 | state.avp = NULL; |
3879 | 2 | state.enumitem = NULL; |
3880 | 2 | state.gavp = NULL; |
3881 | 2 | state.typedefn = NULL; |
3882 | 2 | state.cmd = NULL; |
3883 | 2 | state.vnd = NULL; |
3884 | 2 | state.xmlpi = NULL; |
3885 | | |
3886 | 2 | state.last_appl = NULL; |
3887 | 2 | state.last_avp = NULL; |
3888 | 2 | state.last_enumitem = NULL; |
3889 | 2 | state.last_gavp = NULL; |
3890 | 2 | state.last_typedefn = NULL; |
3891 | 2 | state.last_cmd = NULL; |
3892 | 2 | state.last_vnd = NULL; |
3893 | 2 | state.last_xmlpi = NULL; |
3894 | | |
3895 | 2 | state.ents = NULL; |
3896 | | |
3897 | 2 | state.attr_str = NULL; |
3898 | 2 | state.attr_uint = NULL; |
3899 | | |
3900 | | /* |
3901 | | * Pass 1. |
3902 | | * |
3903 | | * Reads the file, does some work, and stores a modified version |
3904 | | * of the file contents in memory. |
3905 | | */ |
3906 | 2 | state.current_yyinput = file_input; |
3907 | 2 | state.current_close = fclose; |
3908 | 2 | state.include_stack_ptr = 0; |
3909 | | |
3910 | 2 | in = ddict_open(system_directory,filename); |
3911 | | |
3912 | 2 | if (in == NULL) { |
3913 | 2 | D(("unable to open %s: %s\n", filename, g_strerror(errno))); |
3914 | 2 | g_free(state.dict); |
3915 | 2 | return NULL; |
3916 | 2 | } |
3917 | | |
3918 | 0 | if (DiamDict_lex_init(&scanner) != 0) { |
3919 | | /* Note: cannot be reached since memory allocation failure terminates early */ |
3920 | 0 | D(("Can't initialize scanner: %s\n", g_strerror(errno))); |
3921 | 0 | fclose(in); |
3922 | 0 | g_free(state.dict); |
3923 | 0 | return NULL; |
3924 | 0 | } |
3925 | | |
3926 | 0 | DiamDict_set_in(in, scanner); |
3927 | | |
3928 | | /* Associate the state with the scanner */ |
3929 | 0 | DiamDict_set_extra(&state, scanner); |
3930 | |
|
3931 | 0 | state.start_state = LOADING; |
3932 | 0 | DiamDict_lex(scanner); |
3933 | |
|
3934 | 0 | DiamDict_lex_destroy(scanner); |
3935 | | /* |
3936 | | * XXX - can the lexical analyzer terminate without closing |
3937 | | * all open input files? |
3938 | | */ |
3939 | |
|
3940 | 0 | D(("\n---------------\n%s\n------- %u -------\n",state.strbuf,state.len_strbuf)); |
3941 | | |
3942 | | /* |
3943 | | * Pass 2. |
3944 | | * |
3945 | | * Reads the modified version of the file contents and does the |
3946 | | * rest of the work. |
3947 | | */ |
3948 | 0 | state.current_yyinput = string_input; |
3949 | 0 | state.current_close = string_close; |
3950 | |
|
3951 | 0 | if (DiamDict_lex_init(&scanner) != 0) { |
3952 | | /* Note: cannot be reached since memory allocation failure terminates early */ |
3953 | 0 | D(("Can't initialize scanner: %s\n", g_strerror(errno))); |
3954 | 0 | g_free(state.dict); |
3955 | 0 | g_free(state.strbuf); |
3956 | 0 | return NULL; |
3957 | 0 | } |
3958 | | |
3959 | | /* Associate the state with the scanner */ |
3960 | 0 | DiamDict_set_extra(&state, scanner); |
3961 | |
|
3962 | 0 | state.start_state = OUTSIDE; |
3963 | 0 | DiamDict_lex(scanner); |
3964 | |
|
3965 | 0 | DiamDict_lex_destroy(scanner); |
3966 | 0 | { |
3967 | 0 | entity_t *e, *en; |
3968 | |
|
3969 | 0 | for (e = state.ents; e; e = en) { |
3970 | 0 | en = e->next; |
3971 | 0 | g_free(e->name); |
3972 | 0 | g_free(e->file); |
3973 | 0 | g_free(e); |
3974 | 0 | } |
3975 | 0 | } |
3976 | 0 | g_free(state.strbuf); |
3977 | |
|
3978 | 0 | return state.dict; |
3979 | 0 | } |
3980 | | |
3981 | | void |
3982 | | ddict_free(ddict_t* d) |
3983 | 0 | { |
3984 | 0 | ddict_application_t *p, *pn; |
3985 | 0 | ddict_vendor_t *v, *vn; |
3986 | 0 | ddict_cmd_t *c, *cn; |
3987 | 0 | ddict_typedefn_t *t, *tn; |
3988 | 0 | ddict_avp_t *a, *an; |
3989 | 0 | ddict_xmlpi_t *x, *xn; |
3990 | |
|
3991 | 0 | #define FREE_NAMEANDOBJ(n) do { g_free(n->name); g_free(n); } while(0) |
3992 | |
|
3993 | 0 | for (p = d->applications; p; p = pn ) { |
3994 | 0 | pn = p->next; |
3995 | 0 | FREE_NAMEANDOBJ(p); |
3996 | 0 | } |
3997 | |
|
3998 | 0 | for (v = d->vendors; v; v = vn) { |
3999 | 0 | vn = v->next; |
4000 | 0 | g_free(v->desc); |
4001 | 0 | FREE_NAMEANDOBJ(v); |
4002 | 0 | } |
4003 | |
|
4004 | 0 | for (c = d->cmds; c; c = cn ) { |
4005 | 0 | cn = c->next; |
4006 | 0 | g_free(c->vendor); |
4007 | 0 | FREE_NAMEANDOBJ(c); |
4008 | 0 | } |
4009 | |
|
4010 | 0 | for (t = d->typedefns; t; t = tn) { |
4011 | 0 | tn = t->next; |
4012 | 0 | g_free(t->parent); |
4013 | 0 | FREE_NAMEANDOBJ(t); |
4014 | 0 | } |
4015 | |
|
4016 | 0 | for (a = d->avps; a; a = an) { |
4017 | 0 | ddict_gavp_t* g, *gn; |
4018 | 0 | ddict_enum_t* e, *en; |
4019 | 0 | an = a->next; |
4020 | |
|
4021 | 0 | for (g = a->gavps; g; g = gn) { |
4022 | 0 | gn = g->next; |
4023 | 0 | FREE_NAMEANDOBJ(g); |
4024 | 0 | } |
4025 | |
|
4026 | 0 | for (e = a->enums; e; e = en) { |
4027 | 0 | en = e->next; |
4028 | 0 | FREE_NAMEANDOBJ(e); |
4029 | 0 | } |
4030 | |
|
4031 | 0 | g_free(a->vendor); |
4032 | 0 | g_free(a->type); |
4033 | 0 | g_free(a->description); |
4034 | 0 | FREE_NAMEANDOBJ(a); |
4035 | 0 | } |
4036 | |
|
4037 | 0 | for (x = d->xmlpis; x; x = xn) { |
4038 | 0 | xn = x->next; |
4039 | 0 | g_free(x->key); |
4040 | 0 | g_free(x->value); |
4041 | 0 | FREE_NAMEANDOBJ(x); |
4042 | 0 | } |
4043 | |
|
4044 | 0 | g_free(d); |
4045 | 0 | } |
4046 | | |
4047 | | void |
4048 | | ddict_print(FILE* fh, ddict_t* d) |
4049 | 0 | { |
4050 | 0 | ddict_application_t* p; |
4051 | 0 | ddict_vendor_t* v; |
4052 | 0 | ddict_cmd_t* c; |
4053 | 0 | ddict_typedefn_t* t; |
4054 | 0 | ddict_avp_t* a; |
4055 | | |
4056 | |
|
4057 | 0 | for (p = d->applications; p; p = p->next) { |
4058 | 0 | fprintf(fh,"Application: %s[%u]:\n", |
4059 | 0 | p->name ? p->name : "-", |
4060 | 0 | p->code); |
4061 | 0 | } |
4062 | |
|
4063 | 0 | for (v = d->vendors; v; v = v->next) { |
4064 | 0 | fprintf(fh,"Vendor: %s[%u]:\n", |
4065 | 0 | v->name ? v->name : "-", |
4066 | 0 | v->code); |
4067 | 0 | } |
4068 | |
|
4069 | 0 | for (c = d->cmds; c; c = c->next) { |
4070 | 0 | fprintf(fh,"Command: %s[%u] \n", |
4071 | 0 | c->name ? c->name : "-", |
4072 | 0 | c->code); |
4073 | 0 | } |
4074 | |
|
4075 | 0 | for (t = d->typedefns; t; t = t->next) { |
4076 | 0 | fprintf(fh,"Type: %s -> %s \n", |
4077 | 0 | t->name ? t->name : "-", |
4078 | 0 | t->parent ? t->parent : "" ); |
4079 | 0 | } |
4080 | |
|
4081 | 0 | for (a = d->avps; a; a = a->next) { |
4082 | 0 | ddict_gavp_t* g; |
4083 | 0 | ddict_enum_t* e; |
4084 | 0 | fprintf(fh,"AVP: %s[%u:%s] %s %s\n", |
4085 | 0 | a->name ? a->name : "-", |
4086 | 0 | a->code, |
4087 | 0 | a->vendor ? a->vendor : "None", |
4088 | 0 | a->type ? a->type : "-", |
4089 | 0 | a->description ? a->description : ""); |
4090 | |
|
4091 | 0 | for (g = a->gavps; g; g = g->next) { |
4092 | 0 | fprintf(fh,"\tGAVP: %s\n", |
4093 | 0 | g->name ? g->name : "-" ); |
4094 | 0 | } |
4095 | |
|
4096 | 0 | for (e = a->enums; e; e = e->next) { |
4097 | 0 | fprintf(fh,"\tEnum: %s[%u]\n", |
4098 | 0 | e->name ? e->name : "-", |
4099 | 0 | e->code); |
4100 | 0 | } |
4101 | 0 | } |
4102 | 0 | } |
4103 | | |
4104 | | #ifdef TEST_DIAM_DICT_STANDALONE |
4105 | | int |
4106 | | main(int argc, char** argv) |
4107 | | { |
4108 | | ddict_t* d; |
4109 | | char* dname = NULL; |
4110 | | char* fname; |
4111 | | int i = 1; |
4112 | | |
4113 | | switch (argc) { |
4114 | | case 3: |
4115 | | dname = argv[i++]; |
4116 | | case 2: |
4117 | | fname = argv[i]; |
4118 | | break; |
4119 | | default: |
4120 | | fprintf(stderr,"%s: usage [dictionary_dir] dictionary_filename\n",argv[0]); |
4121 | | return 1; |
4122 | | } |
4123 | | |
4124 | | d = ddict_scan(dname,fname,1); |
4125 | | if (d == NULL) { |
4126 | | fprintf(stderr, "Can't open dictionary\n"); |
4127 | | return 2; |
4128 | | } |
4129 | | |
4130 | | ddict_print(stdout, d); |
4131 | | |
4132 | | return 0; |
4133 | | } |
4134 | | #endif |
4135 | | |