2 #line 3 "tokenparser.c"
4 #define YY_INT_ALIGNED short int
8 #define yy_create_buffer tp_create_buffer
9 #define yy_delete_buffer tp_delete_buffer
10 #define yy_flex_debug tp_flex_debug
11 #define yy_init_buffer tp_init_buffer
12 #define yy_flush_buffer tp_flush_buffer
13 #define yy_load_buffer_state tp_load_buffer_state
14 #define yy_switch_to_buffer tp_switch_to_buffer
18 #define yylineno tplineno
20 #define yyrestart tprestart
23 #define yyalloc tpalloc
24 #define yyrealloc tprealloc
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 39
31 #if YY_FLEX_SUBMINOR_VERSION > 0
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t;
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
78 #define INT8_MIN (-128)
81 #define INT16_MIN (-32767-1)
84 #define INT32_MIN (-2147483647-1)
87 #define INT8_MAX (127)
90 #define INT16_MAX (32767)
93 #define INT32_MAX (2147483647)
96 #define UINT8_MAX (255U)
99 #define UINT16_MAX (65535U)
102 #define UINT32_MAX (4294967295U)
117 #if defined (__STDC__)
125 #define yyconst const
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
144 #define BEGIN (yy_start) = 1 + 2 *
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 #define YY_NEW_FILE tprestart(tpin )
159 #define YY_END_OF_BUFFER_CHAR 0
168 #define YY_BUF_SIZE 32768
170 #define YY_BUF_SIZE 16384
176 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
178 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
179 #define YY_TYPEDEF_YY_BUFFER_STATE
183 #ifndef YY_TYPEDEF_YY_SIZE_T
184 #define YY_TYPEDEF_YY_SIZE_T
185 typedef size_t yy_size_t;
188 extern yy_size_t tpleng;
190 extern FILE *tpin, *tpout;
192 #define EOB_ACT_CONTINUE_SCAN 0
193 #define EOB_ACT_END_OF_FILE 1
194 #define EOB_ACT_LAST_MATCH 2
196 #define YY_LESS_LINENO(n)
197 #define YY_LINENO_REWIND_TO(ptr)
204 int yyless_macro_arg = (n); \
205 YY_LESS_LINENO(yyless_macro_arg);\
206 *yy_cp = (yy_hold_char); \
207 YY_RESTORE_YY_MORE_OFFSET \
208 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
209 YY_DO_BEFORE_ACTION; \
213 #define unput(c) yyunput( c, (yytext_ptr) )
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
227 yy_size_t yy_buf_size;
232 yy_size_t yy_n_chars;
238 int yy_is_our_buffer;
245 int yy_is_interactive;
261 int yy_buffer_status;
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
275 #define YY_BUFFER_EOF_PENDING 2
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
301 static char yy_hold_char;
302 static yy_size_t yy_n_chars;
306 static char *yy_c_buf_p = (
char *) 0;
307 static int yy_init = 0;
308 static int yy_start = 0;
313 static int yy_did_buffer_switch_on_eof;
315 void tprestart (FILE *input_file );
316 void tp_switch_to_buffer (YY_BUFFER_STATE new_buffer );
317 YY_BUFFER_STATE tp_create_buffer (FILE *file,
int size );
318 void tp_delete_buffer (YY_BUFFER_STATE b );
319 void tp_flush_buffer (YY_BUFFER_STATE b );
320 void tppush_buffer_state (YY_BUFFER_STATE new_buffer );
321 void tppop_buffer_state (
void );
323 static void tpensure_buffer_stack (
void );
324 static void tp_load_buffer_state (
void );
325 static void tp_init_buffer (YY_BUFFER_STATE b,FILE *file );
327 #define YY_FLUSH_BUFFER tp_flush_buffer(YY_CURRENT_BUFFER )
329 YY_BUFFER_STATE tp_scan_buffer (
char *base,yy_size_t size );
330 YY_BUFFER_STATE tp_scan_string (yyconst
char *yy_str );
331 YY_BUFFER_STATE tp_scan_bytes (yyconst
char *bytes,yy_size_t len );
333 void *tpalloc (yy_size_t );
334 void *tprealloc (
void *,yy_size_t );
335 void tpfree (
void * );
337 #define yy_new_buffer tp_create_buffer
339 #define yy_set_interactive(is_interactive) \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 tpensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 tp_create_buffer(tpin,YY_BUF_SIZE ); \
346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
349 #define yy_set_bol(at_bol) \
351 if ( ! YY_CURRENT_BUFFER ){\
352 tpensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 tp_create_buffer(tpin,YY_BUF_SIZE ); \
356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
364 #define YY_SKIP_YYWRAP
366 typedef unsigned char YY_CHAR;
368 FILE *tpin = (FILE *) 0, *tpout = (FILE *) 0;
370 typedef int yy_state_type;
377 #define yytext_ptr tptext
379 static yy_state_type yy_get_previous_state (
void );
380 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
381 static int yy_get_next_buffer (
void );
382 static void yy_fatal_error (yyconst
char msg[] );
387 #define YY_DO_BEFORE_ACTION \
388 (yytext_ptr) = yy_bp; \
389 tpleng = (size_t) (yy_cp - yy_bp); \
390 (yy_hold_char) = *yy_cp; \
392 (yy_c_buf_p) = yy_cp;
394 #define YY_NUM_RULES 7
395 #define YY_END_OF_BUFFER 8
400 flex_int32_t yy_verify;
403 static yyconst flex_int16_t yy_accept[39] =
405 0, 0, 8, 6, 4, 2, 1, 6, 1, 0,
406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
407 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
408 0, 0, 0, 0, 0, 0, 5, 0
411 static yyconst flex_int32_t yy_ec[256] =
413 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 2, 4, 4, 5, 4, 4, 4, 4, 4,
417 4, 4, 4, 4, 4, 4, 6, 7, 7, 7,
418 7, 7, 7, 7, 7, 7, 7, 4, 4, 8,
419 4, 9, 4, 4, 10, 10, 10, 10, 10, 10,
420 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
421 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
422 4, 1, 4, 4, 4, 1, 11, 11, 11, 11,
424 12, 11, 13, 11, 14, 11, 15, 11, 11, 16,
425 11, 11, 11, 17, 18, 19, 11, 11, 11, 11,
426 20, 11, 1, 1, 1, 4, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
443 static yyconst flex_int32_t yy_meta[21] =
445 1, 2, 3, 4, 4, 4, 2, 1, 1, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
449 static yyconst flex_int16_t yy_base[43] =
451 0, 7, 49, 50, 50, 50, 0, 1, 0, 36,
452 28, 26, 28, 35, 29, 0, 26, 33, 27, 33,
453 29, 22, 0, 24, 27, 14, 27, 23, 13, 50,
454 10, 9, 4, 1, 0, 2, 50, 50, 19, 23,
458 static yyconst flex_int16_t yy_def[43] =
460 39, 39, 38, 38, 38, 38, 40, 38, 40, 38,
461 38, 38, 38, 38, 38, 41, 38, 41, 38, 38,
462 38, 38, 42, 38, 42, 38, 38, 38, 38, 38,
463 38, 38, 38, 38, 38, 38, 38, 0, 38, 38,
467 static yyconst flex_int16_t yy_nxt[71] =
469 38, 5, 6, 18, 7, 38, 38, 8, 5, 6,
470 37, 7, 36, 38, 8, 10, 35, 34, 11, 4,
471 4, 4, 4, 9, 9, 33, 9, 25, 32, 25,
472 31, 30, 29, 28, 27, 26, 24, 23, 22, 21,
473 20, 19, 17, 16, 15, 14, 13, 12, 38, 3,
474 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
475 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
478 static yyconst flex_int16_t yy_chk[71] =
480 0, 1, 1, 41, 1, 0, 0, 1, 2, 2,
481 36, 2, 35, 0, 2, 8, 34, 33, 8, 39,
482 39, 39, 39, 40, 40, 32, 40, 42, 31, 42,
483 29, 28, 27, 26, 25, 24, 22, 21, 20, 19,
484 18, 17, 15, 14, 13, 12, 11, 10, 3, 38,
485 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
486 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
489 static yy_state_type yy_last_accepting_state;
490 static char *yy_last_accepting_cpos;
492 extern int tp_flex_debug;
493 int tp_flex_debug = 0;
498 #define REJECT reject_used_but_not_detected
499 #define yymore() yymore_used_but_not_detected
500 #define YY_MORE_ADJ 0
501 #define YY_RESTORE_YY_MORE_OFFSET
503 #line 1 "tokenparser.l"
544 #line 44 "tokenparser.l"
553 #include "simclist.h"
557 static void eval_key(
char *pcToken,
list_t *list_key);
558 static void eval_value(
char *pcToken,
list_t *list_values);
559 void tperrorCheck (
char *pcToken_error);
562 static list_t *ListValues;
564 #define YY_NO_INPUT 1
565 #line 566 "tokenparser.c"
569 #ifndef YY_NO_UNISTD_H
577 #ifndef YY_EXTRA_TYPE
578 #define YY_EXTRA_TYPE void *
581 static int yy_init_globals (
void );
586 int tplex_destroy (
void );
588 int tpget_debug (
void );
590 void tpset_debug (
int debug_flag );
592 YY_EXTRA_TYPE tpget_extra (
void );
594 void tpset_extra (YY_EXTRA_TYPE user_defined );
596 FILE *tpget_in (
void );
598 void tpset_in (FILE * in_str );
600 FILE *tpget_out (
void );
602 void tpset_out (FILE * out_str );
604 yy_size_t tpget_leng (
void );
606 char *tpget_text (
void );
608 int tpget_lineno (
void );
610 void tpset_lineno (
int line_number );
616 #ifndef YY_SKIP_YYWRAP
618 extern "C" int tpwrap (
void );
620 extern int tpwrap (
void );
625 static void yy_flex_strncpy (
char *,yyconst
char *,
int );
628 #ifdef YY_NEED_STRLEN
629 static int yy_flex_strlen (yyconst
char * );
635 static int yyinput (
void );
637 static int input (
void );
643 #ifndef YY_READ_BUF_SIZE
646 #define YY_READ_BUF_SIZE 16384
648 #define YY_READ_BUF_SIZE 8192
657 #define ECHO do { if (fwrite( tptext, tpleng, 1, tpout )) {} } while (0)
664 #define YY_INPUT(buf,result,max_size) \
665 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
669 for ( n = 0; n < max_size && \
670 (c = getc( tpin )) != EOF && c != '\n'; ++n ) \
673 buf[n++] = (char) c; \
674 if ( c == EOF && ferror( tpin ) ) \
675 YY_FATAL_ERROR( "input in flex scanner failed" ); \
681 while ( (result = fread(buf, 1, max_size, tpin))==0 && ferror(tpin)) \
683 if( errno != EINTR) \
685 YY_FATAL_ERROR( "input in flex scanner failed" ); \
701 #define yyterminate() return YY_NULL
705 #ifndef YY_START_STACK_INCR
706 #define YY_START_STACK_INCR 25
710 #ifndef YY_FATAL_ERROR
711 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
720 #define YY_DECL_IS_OURS 1
722 extern int tplex (
void);
724 #define YY_DECL int tplex (void)
730 #ifndef YY_USER_ACTION
731 #define YY_USER_ACTION
736 #define YY_BREAK break;
739 #define YY_RULE_SETUP \
746 register yy_state_type yy_current_state;
747 register char *yy_cp, *yy_bp;
767 if ( ! YY_CURRENT_BUFFER ) {
768 tpensure_buffer_stack ();
769 YY_CURRENT_BUFFER_LVALUE =
770 tp_create_buffer(tpin,YY_BUF_SIZE );
773 tp_load_buffer_state( );
777 #line 69 "tokenparser.l"
780 #line 781 "tokenparser.c"
784 yy_cp = (yy_c_buf_p);
787 *yy_cp = (yy_hold_char);
794 yy_current_state = (yy_start);
798 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
799 if ( yy_accept[yy_current_state] )
801 (yy_last_accepting_state) = yy_current_state;
802 (yy_last_accepting_cpos) = yy_cp;
804 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
806 yy_current_state = (int) yy_def[yy_current_state];
807 if ( yy_current_state >= 39 )
808 yy_c = yy_meta[(
unsigned int) yy_c];
810 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
813 while ( yy_base[yy_current_state] != 50 );
816 yy_act = yy_accept[yy_current_state];
819 yy_cp = (yy_last_accepting_cpos);
820 yy_current_state = (yy_last_accepting_state);
821 yy_act = yy_accept[yy_current_state];
832 *yy_cp = (yy_hold_char);
833 yy_cp = (yy_last_accepting_cpos);
834 yy_current_state = (yy_last_accepting_state);
839 #line 71 "tokenparser.l"
845 #line 72 "tokenparser.l"
850 #line 73 "tokenparser.l"
851 { eval_key(tptext, ListKeys); }
855 #line 74 "tokenparser.l"
860 #line 75 "tokenparser.l"
861 { eval_value(tptext, ListValues); }
865 #line 76 "tokenparser.l"
866 { tperrorCheck(tptext); }
870 #line 77 "tokenparser.l"
873 #line 874 "tokenparser.c"
874 case YY_STATE_EOF(INITIAL):
877 case YY_END_OF_BUFFER:
880 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
883 *yy_cp = (yy_hold_char);
884 YY_RESTORE_YY_MORE_OFFSET
886 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
897 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
898 YY_CURRENT_BUFFER_LVALUE->yy_input_file = tpin;
899 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
909 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
911 yy_state_type yy_next_state;
913 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
915 yy_current_state = yy_get_previous_state( );
926 yy_next_state = yy_try_NUL_trans( yy_current_state );
928 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
933 yy_cp = ++(yy_c_buf_p);
934 yy_current_state = yy_next_state;
940 yy_cp = (yy_c_buf_p);
945 else switch ( yy_get_next_buffer( ) )
947 case EOB_ACT_END_OF_FILE:
949 (yy_did_buffer_switch_on_eof) = 0;
962 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
964 yy_act = YY_STATE_EOF(YY_START);
970 if ( ! (yy_did_buffer_switch_on_eof) )
976 case EOB_ACT_CONTINUE_SCAN:
978 (yytext_ptr) + yy_amount_of_matched_text;
980 yy_current_state = yy_get_previous_state( );
982 yy_cp = (yy_c_buf_p);
983 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
986 case EOB_ACT_LAST_MATCH:
988 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
990 yy_current_state = yy_get_previous_state( );
992 yy_cp = (yy_c_buf_p);
993 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1001 "fatal flex scanner internal error--no action found" );
1014 static int yy_get_next_buffer (
void)
1016 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1017 register char *source = (yytext_ptr);
1018 register int number_to_move, i;
1021 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1023 "fatal flex scanner internal error--end of buffer missed" );
1025 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1027 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1032 return EOB_ACT_END_OF_FILE;
1040 return EOB_ACT_LAST_MATCH;
1047 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1049 for ( i = 0; i < number_to_move; ++i )
1050 *(dest++) = *(source++);
1052 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1056 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1060 yy_size_t num_to_read =
1061 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1063 while ( num_to_read <= 0 )
1067 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1069 int yy_c_buf_p_offset =
1070 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1072 if ( b->yy_is_our_buffer )
1074 yy_size_t new_size = b->yy_buf_size * 2;
1076 if ( new_size <= 0 )
1077 b->yy_buf_size += b->yy_buf_size / 8;
1079 b->yy_buf_size *= 2;
1081 b->yy_ch_buf = (
char *)
1083 tprealloc((
void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1089 if ( ! b->yy_ch_buf )
1091 "fatal error - scanner input buffer overflow" );
1093 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1095 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1100 if ( num_to_read > YY_READ_BUF_SIZE )
1101 num_to_read = YY_READ_BUF_SIZE;
1104 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1105 (yy_n_chars), num_to_read );
1107 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1110 if ( (yy_n_chars) == 0 )
1112 if ( number_to_move == YY_MORE_ADJ )
1114 ret_val = EOB_ACT_END_OF_FILE;
1120 ret_val = EOB_ACT_LAST_MATCH;
1121 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1122 YY_BUFFER_EOF_PENDING;
1127 ret_val = EOB_ACT_CONTINUE_SCAN;
1129 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1131 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1132 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) tprealloc((
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1133 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1134 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1137 (yy_n_chars) += number_to_move;
1138 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1139 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1141 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1148 static yy_state_type yy_get_previous_state (
void)
1150 register yy_state_type yy_current_state;
1151 register char *yy_cp;
1153 yy_current_state = (yy_start);
1155 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1157 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1158 if ( yy_accept[yy_current_state] )
1160 (yy_last_accepting_state) = yy_current_state;
1161 (yy_last_accepting_cpos) = yy_cp;
1163 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1165 yy_current_state = (int) yy_def[yy_current_state];
1166 if ( yy_current_state >= 39 )
1167 yy_c = yy_meta[(
unsigned int) yy_c];
1169 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1172 return yy_current_state;
1180 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1182 register int yy_is_jam;
1183 register char *yy_cp = (yy_c_buf_p);
1185 register YY_CHAR yy_c = 1;
1186 if ( yy_accept[yy_current_state] )
1188 (yy_last_accepting_state) = yy_current_state;
1189 (yy_last_accepting_cpos) = yy_cp;
1191 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1193 yy_current_state = (int) yy_def[yy_current_state];
1194 if ( yy_current_state >= 39 )
1195 yy_c = yy_meta[(
unsigned int) yy_c];
1197 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1198 yy_is_jam = (yy_current_state == 38);
1200 return yy_is_jam ? 0 : yy_current_state;
1205 static int yyinput (
void)
1207 static int input (
void)
1213 *(yy_c_buf_p) = (yy_hold_char);
1215 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1221 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1223 *(yy_c_buf_p) =
'\0';
1227 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1230 switch ( yy_get_next_buffer( ) )
1232 case EOB_ACT_LAST_MATCH:
1248 case EOB_ACT_END_OF_FILE:
1253 if ( ! (yy_did_buffer_switch_on_eof) )
1262 case EOB_ACT_CONTINUE_SCAN:
1263 (yy_c_buf_p) = (yytext_ptr) + offset;
1269 c = *(
unsigned char *) (yy_c_buf_p);
1270 *(yy_c_buf_p) =
'\0';
1271 (yy_hold_char) = *++(yy_c_buf_p);
1282 void tprestart (FILE * input_file )
1285 if ( ! YY_CURRENT_BUFFER ){
1286 tpensure_buffer_stack ();
1287 YY_CURRENT_BUFFER_LVALUE =
1288 tp_create_buffer(tpin,YY_BUF_SIZE );
1291 tp_init_buffer(YY_CURRENT_BUFFER,input_file );
1292 tp_load_buffer_state( );
1299 void tp_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1307 tpensure_buffer_stack ();
1308 if ( YY_CURRENT_BUFFER == new_buffer )
1311 if ( YY_CURRENT_BUFFER )
1314 *(yy_c_buf_p) = (yy_hold_char);
1315 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1316 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1319 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1320 tp_load_buffer_state( );
1327 (yy_did_buffer_switch_on_eof) = 1;
1330 static void tp_load_buffer_state (
void)
1332 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1333 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1334 tpin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1335 (yy_hold_char) = *(yy_c_buf_p);
1344 YY_BUFFER_STATE tp_create_buffer (FILE * file,
int size )
1350 YY_FATAL_ERROR(
"out of dynamic memory in tp_create_buffer()" );
1352 b->yy_buf_size = size;
1357 b->yy_ch_buf = (
char *) tpalloc(b->yy_buf_size + 2 );
1358 if ( ! b->yy_ch_buf )
1359 YY_FATAL_ERROR(
"out of dynamic memory in tp_create_buffer()" );
1361 b->yy_is_our_buffer = 1;
1363 tp_init_buffer(b,file );
1372 void tp_delete_buffer (YY_BUFFER_STATE b )
1378 if ( b == YY_CURRENT_BUFFER )
1379 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1381 if ( b->yy_is_our_buffer )
1382 tpfree((
void *) b->yy_ch_buf );
1384 tpfree((
void *) b );
1391 static void tp_init_buffer (YY_BUFFER_STATE b, FILE * file )
1396 tp_flush_buffer(b );
1398 b->yy_input_file = file;
1399 b->yy_fill_buffer = 1;
1405 if (b != YY_CURRENT_BUFFER){
1410 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1419 void tp_flush_buffer (YY_BUFFER_STATE b )
1430 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1431 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1433 b->yy_buf_pos = &b->yy_ch_buf[0];
1436 b->yy_buffer_status = YY_BUFFER_NEW;
1438 if ( b == YY_CURRENT_BUFFER )
1439 tp_load_buffer_state( );
1448 void tppush_buffer_state (YY_BUFFER_STATE new_buffer )
1450 if (new_buffer == NULL)
1453 tpensure_buffer_stack();
1456 if ( YY_CURRENT_BUFFER )
1459 *(yy_c_buf_p) = (yy_hold_char);
1460 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1461 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1465 if (YY_CURRENT_BUFFER)
1467 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1470 tp_load_buffer_state( );
1471 (yy_did_buffer_switch_on_eof) = 1;
1478 void tppop_buffer_state (
void)
1480 if (!YY_CURRENT_BUFFER)
1483 tp_delete_buffer(YY_CURRENT_BUFFER );
1484 YY_CURRENT_BUFFER_LVALUE = NULL;
1488 if (YY_CURRENT_BUFFER) {
1489 tp_load_buffer_state( );
1490 (yy_did_buffer_switch_on_eof) = 1;
1497 static void tpensure_buffer_stack (
void)
1499 yy_size_t num_to_alloc;
1501 if (!(yy_buffer_stack)) {
1511 if ( ! (yy_buffer_stack) )
1512 YY_FATAL_ERROR(
"out of dynamic memory in tpensure_buffer_stack()" );
1514 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1531 if ( ! (yy_buffer_stack) )
1532 YY_FATAL_ERROR(
"out of dynamic memory in tpensure_buffer_stack()" );
1546 YY_BUFFER_STATE tp_scan_buffer (
char * base, yy_size_t size )
1551 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1552 base[size-1] != YY_END_OF_BUFFER_CHAR )
1558 YY_FATAL_ERROR(
"out of dynamic memory in tp_scan_buffer()" );
1560 b->yy_buf_size = size - 2;
1561 b->yy_buf_pos = b->yy_ch_buf = base;
1562 b->yy_is_our_buffer = 0;
1563 b->yy_input_file = 0;
1564 b->yy_n_chars = b->yy_buf_size;
1565 b->yy_is_interactive = 0;
1567 b->yy_fill_buffer = 0;
1568 b->yy_buffer_status = YY_BUFFER_NEW;
1570 tp_switch_to_buffer(b );
1583 YY_BUFFER_STATE tp_scan_string (yyconst
char * yystr )
1586 return tp_scan_bytes(yystr,strlen(yystr) );
1596 YY_BUFFER_STATE tp_scan_bytes (yyconst
char * yybytes, yy_size_t _yybytes_len )
1604 n = _yybytes_len + 2;
1605 buf = (
char *) tpalloc(n );
1607 YY_FATAL_ERROR(
"out of dynamic memory in tp_scan_bytes()" );
1609 for ( i = 0; i < _yybytes_len; ++i )
1610 buf[i] = yybytes[i];
1612 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1614 b = tp_scan_buffer(buf,n );
1616 YY_FATAL_ERROR(
"bad buffer in tp_scan_bytes()" );
1621 b->yy_is_our_buffer = 1;
1626 #ifndef YY_EXIT_FAILURE
1627 #define YY_EXIT_FAILURE 2
1630 static void yy_fatal_error (yyconst
char* msg )
1632 (void) fprintf( stderr,
"%s\n", msg );
1633 exit( YY_EXIT_FAILURE );
1643 int yyless_macro_arg = (n); \
1644 YY_LESS_LINENO(yyless_macro_arg);\
1645 tptext[tpleng] = (yy_hold_char); \
1646 (yy_c_buf_p) = tptext + yyless_macro_arg; \
1647 (yy_hold_char) = *(yy_c_buf_p); \
1648 *(yy_c_buf_p) = '\0'; \
1649 tpleng = yyless_macro_arg; \
1658 int tpget_lineno (
void)
1667 FILE *tpget_in (
void)
1675 FILE *tpget_out (
void)
1683 yy_size_t tpget_leng (
void)
1692 char *tpget_text (
void)
1701 void tpset_lineno (
int line_number )
1704 tplineno = line_number;
1713 void tpset_in (FILE * in_str )
1718 void tpset_out (FILE * out_str )
1723 int tpget_debug (
void)
1725 return tp_flex_debug;
1728 void tpset_debug (
int bdebug )
1730 tp_flex_debug = bdebug ;
1733 static int yy_init_globals (
void)
1742 (yy_c_buf_p) = (
char *) 0;
1762 int tplex_destroy (
void)
1766 while(YY_CURRENT_BUFFER){
1767 tp_delete_buffer(YY_CURRENT_BUFFER );
1768 YY_CURRENT_BUFFER_LVALUE = NULL;
1769 tppop_buffer_state();
1773 tpfree((yy_buffer_stack) );
1788 static void yy_flex_strncpy (
char* s1, yyconst
char * s2,
int n )
1791 for ( i = 0; i < n; ++i )
1796 #ifdef YY_NEED_STRLEN
1797 static int yy_flex_strlen (yyconst
char * s )
1800 for ( n = 0; s[n]; ++n )
1807 void *tpalloc (yy_size_t size )
1809 return (
void *) malloc( size );
1812 void *tprealloc (
void * ptr, yy_size_t size )
1821 return (
void *) realloc( (
char *) ptr, size );
1824 void tpfree (
void * ptr )
1826 free( (
char *) ptr );
1829 #define YYTABLES_NAME "yytables"
1831 #line 76 "tokenparser.l"
1836 static void eval_key(
char *pcToken,
list_t *list_key)
1843 elt = malloc(
sizeof(*elt));
1850 for (len=0; pcToken[len+5] !=
'<'; len++)
1854 elt->key = malloc(len);
1855 memcpy(elt->key, &pcToken[5], len-1);
1856 elt->key[len-1] =
'\0';
1858 r = list_init(&elt->values);
1863 list_append(list_key, elt);
1866 ListValues = &elt->values;
1869 static void eval_value(
char *pcToken,
list_t *list_values)
1880 for (len=0; pcToken[len+8] !=
'<'; len++)
1884 value = malloc(len);
1887 memcpy(value, &pcToken[8], len-1);
1888 value[len-1] =
'\0';
1892 while ((amp = strstr(amp,
"&")) != NULL)
1897 for (p = amp+1; *(p+4); p++)
1908 r = list_append(list_values, value);
1913 void tperrorCheck (
char *token_error)
1928 int LTPBundleFindValueWithKey(
list_t *l,
const char *key,
list_t **values)
1933 for (i=0; i < list_size(l); i++)
1937 elt = list_get_at(l, i);
1940 if (0 == strcmp(elt->key, key))
1942 *values = &elt->values;
1959 int bundleParse(
const char *fileName,
list_t *l)
1967 file = fopen(fileName,
"r");
1970 Log3(PCSC_LOG_CRITICAL,
"Could not open bundle file %s: %s",
1971 fileName, strerror(errno));
1985 }
while (!feof(file));
1991 printf(
"size: %d\n", list_size(l));
1992 for (i=0; i < list_size(l); i++)
1997 elt = list_get_at(l, i);
1999 printf(
"Key: %s\n", elt->key);
2001 for (j=0; j<list_size(&elt->values); j++)
2003 char *v = list_get_at(&elt->values, j);
2004 printf(
" value: %s\n", v);
2017 void bundleRelease(
list_t *l)
2021 for (i=0; i < list_size(l); i++)
2026 elt = list_get_at(l, i);
2030 for (j=0; j<list_size(&elt->values); j++)
2031 free(list_get_at(&elt->values, j));
2032 list_destroy(&elt->values);
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
int yy_bs_column
The column count.
Reads lexical config files and updates database.
static size_t yy_buffer_stack_max
capacity of stack.
YY_DECL
The main scanner function which does all the work.
static size_t yy_buffer_stack_top
index of top of stack.
int yy_bs_lineno
The line count.