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_scan_buffer tp_scan_buffer 11 #define yy_scan_string tp_scan_string 12 #define yy_scan_bytes tp_scan_bytes 13 #define yy_init_buffer tp_init_buffer 14 #define yy_flush_buffer tp_flush_buffer 15 #define yy_load_buffer_state tp_load_buffer_state 16 #define yy_switch_to_buffer tp_switch_to_buffer 17 #define yypush_buffer_state tppush_buffer_state 18 #define yypop_buffer_state tppop_buffer_state 19 #define yyensure_buffer_stack tpensure_buffer_stack 20 #define yy_flex_debug tp_flex_debug 24 #define yylineno tplineno 26 #define yyrestart tprestart 29 #define yyalloc tpalloc 30 #define yyrealloc tprealloc 34 #define YY_FLEX_MAJOR_VERSION 2 35 #define YY_FLEX_MINOR_VERSION 6 36 #define YY_FLEX_SUBMINOR_VERSION 4 37 #if YY_FLEX_SUBMINOR_VERSION > 0 41 #ifdef yy_create_buffer 42 #define tp_create_buffer_ALREADY_DEFINED 44 #define yy_create_buffer tp_create_buffer 47 #ifdef yy_delete_buffer 48 #define tp_delete_buffer_ALREADY_DEFINED 50 #define yy_delete_buffer tp_delete_buffer 54 #define tp_scan_buffer_ALREADY_DEFINED 56 #define yy_scan_buffer tp_scan_buffer 60 #define tp_scan_string_ALREADY_DEFINED 62 #define yy_scan_string tp_scan_string 66 #define tp_scan_bytes_ALREADY_DEFINED 68 #define yy_scan_bytes tp_scan_bytes 72 #define tp_init_buffer_ALREADY_DEFINED 74 #define yy_init_buffer tp_init_buffer 77 #ifdef yy_flush_buffer 78 #define tp_flush_buffer_ALREADY_DEFINED 80 #define yy_flush_buffer tp_flush_buffer 83 #ifdef yy_load_buffer_state 84 #define tp_load_buffer_state_ALREADY_DEFINED 86 #define yy_load_buffer_state tp_load_buffer_state 89 #ifdef yy_switch_to_buffer 90 #define tp_switch_to_buffer_ALREADY_DEFINED 92 #define yy_switch_to_buffer tp_switch_to_buffer 95 #ifdef yypush_buffer_state 96 #define tppush_buffer_state_ALREADY_DEFINED 98 #define yypush_buffer_state tppush_buffer_state 101 #ifdef yypop_buffer_state 102 #define tppop_buffer_state_ALREADY_DEFINED 104 #define yypop_buffer_state tppop_buffer_state 107 #ifdef yyensure_buffer_stack 108 #define tpensure_buffer_stack_ALREADY_DEFINED 110 #define yyensure_buffer_stack tpensure_buffer_stack 114 #define tplex_ALREADY_DEFINED 120 #define tprestart_ALREADY_DEFINED 122 #define yyrestart tprestart 126 #define tplex_init_ALREADY_DEFINED 128 #define yylex_init tplex_init 131 #ifdef yylex_init_extra 132 #define tplex_init_extra_ALREADY_DEFINED 134 #define yylex_init_extra tplex_init_extra 138 #define tplex_destroy_ALREADY_DEFINED 140 #define yylex_destroy tplex_destroy 144 #define tpget_debug_ALREADY_DEFINED 146 #define yyget_debug tpget_debug 150 #define tpset_debug_ALREADY_DEFINED 152 #define yyset_debug tpset_debug 156 #define tpget_extra_ALREADY_DEFINED 158 #define yyget_extra tpget_extra 162 #define tpset_extra_ALREADY_DEFINED 164 #define yyset_extra tpset_extra 168 #define tpget_in_ALREADY_DEFINED 170 #define yyget_in tpget_in 174 #define tpset_in_ALREADY_DEFINED 176 #define yyset_in tpset_in 180 #define tpget_out_ALREADY_DEFINED 182 #define yyget_out tpget_out 186 #define tpset_out_ALREADY_DEFINED 188 #define yyset_out tpset_out 192 #define tpget_leng_ALREADY_DEFINED 194 #define yyget_leng tpget_leng 198 #define tpget_text_ALREADY_DEFINED 200 #define yyget_text tpget_text 204 #define tpget_lineno_ALREADY_DEFINED 206 #define yyget_lineno tpget_lineno 210 #define tpset_lineno_ALREADY_DEFINED 212 #define yyset_lineno tpset_lineno 216 #define tpwrap_ALREADY_DEFINED 218 #define yywrap tpwrap 222 #define tpalloc_ALREADY_DEFINED 224 #define yyalloc tpalloc 228 #define tprealloc_ALREADY_DEFINED 230 #define yyrealloc tprealloc 234 #define tpfree_ALREADY_DEFINED 236 #define yyfree tpfree 240 #define tptext_ALREADY_DEFINED 242 #define yytext tptext 246 #define tpleng_ALREADY_DEFINED 248 #define yyleng tpleng 252 #define tpin_ALREADY_DEFINED 258 #define tpout_ALREADY_DEFINED 264 #define tp_flex_debug_ALREADY_DEFINED 266 #define yy_flex_debug tp_flex_debug 270 #define tplineno_ALREADY_DEFINED 272 #define yylineno tplineno 292 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 297 #ifndef __STDC_LIMIT_MACROS 298 #define __STDC_LIMIT_MACROS 1 301 #include <inttypes.h> 302 typedef int8_t flex_int8_t;
303 typedef uint8_t flex_uint8_t;
304 typedef int16_t flex_int16_t;
305 typedef uint16_t flex_uint16_t;
306 typedef int32_t flex_int32_t;
307 typedef uint32_t flex_uint32_t;
309 typedef signed char flex_int8_t;
310 typedef short int flex_int16_t;
311 typedef int flex_int32_t;
312 typedef unsigned char flex_uint8_t;
313 typedef unsigned short int flex_uint16_t;
314 typedef unsigned int flex_uint32_t;
318 #define INT8_MIN (-128) 321 #define INT16_MIN (-32767-1) 324 #define INT32_MIN (-2147483647-1) 327 #define INT8_MAX (127) 330 #define INT16_MAX (32767) 333 #define INT32_MAX (2147483647) 336 #define UINT8_MAX (255U) 339 #define UINT16_MAX (65535U) 342 #define UINT32_MAX (4294967295U) 346 #define SIZE_MAX (~(size_t)0) 356 #define yyconst const 358 #if defined(__GNUC__) && __GNUC__ >= 3 359 #define yynoreturn __attribute__((__noreturn__)) 370 #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) 376 #define BEGIN (yy_start) = 1 + 2 * 381 #define YY_START (((yy_start) - 1) / 2) 382 #define YYSTATE YY_START 384 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 386 #define YY_NEW_FILE yyrestart( yyin ) 387 #define YY_END_OF_BUFFER_CHAR 0 396 #define YY_BUF_SIZE 32768 398 #define YY_BUF_SIZE 16384 404 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 406 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 407 #define YY_TYPEDEF_YY_BUFFER_STATE 411 #ifndef YY_TYPEDEF_YY_SIZE_T 412 #define YY_TYPEDEF_YY_SIZE_T 413 typedef size_t yy_size_t;
418 extern FILE *yyin, *yyout;
420 #define EOB_ACT_CONTINUE_SCAN 0 421 #define EOB_ACT_END_OF_FILE 1 422 #define EOB_ACT_LAST_MATCH 2 424 #define YY_LESS_LINENO(n) 425 #define YY_LINENO_REWIND_TO(ptr) 432 int yyless_macro_arg = (n); \ 433 YY_LESS_LINENO(yyless_macro_arg);\ 434 *yy_cp = (yy_hold_char); \ 435 YY_RESTORE_YY_MORE_OFFSET \ 436 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 437 YY_DO_BEFORE_ACTION; \ 440 #define unput(c) yyunput( c, (yytext_ptr) ) 442 #ifndef YY_STRUCT_YY_BUFFER_STATE 443 #define YY_STRUCT_YY_BUFFER_STATE 465 int yy_is_our_buffer;
472 int yy_is_interactive;
488 int yy_buffer_status;
490 #define YY_BUFFER_NEW 0 491 #define YY_BUFFER_NORMAL 1 502 #define YY_BUFFER_EOF_PENDING 2 518 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 519 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 524 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 527 static char yy_hold_char;
528 static int yy_n_chars;
532 static char *yy_c_buf_p = NULL;
533 static int yy_init = 0;
534 static int yy_start = 0;
539 static int yy_did_buffer_switch_on_eof;
541 void yyrestart ( FILE *input_file );
547 void yypop_buffer_state (
void );
549 static void yyensure_buffer_stack (
void );
550 static void yy_load_buffer_state (
void );
552 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) 558 void *yyalloc ( yy_size_t );
559 void *yyrealloc (
void *, yy_size_t );
560 void yyfree (
void * );
562 #define yy_new_buffer yy_create_buffer 563 #define yy_set_interactive(is_interactive) \ 565 if ( ! YY_CURRENT_BUFFER ){ \ 566 yyensure_buffer_stack (); \ 567 YY_CURRENT_BUFFER_LVALUE = \ 568 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 570 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 572 #define yy_set_bol(at_bol) \ 574 if ( ! YY_CURRENT_BUFFER ){\ 575 yyensure_buffer_stack (); \ 576 YY_CURRENT_BUFFER_LVALUE = \ 577 yy_create_buffer( yyin, YY_BUF_SIZE ); \ 579 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 581 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 586 #define YY_SKIP_YYWRAP 587 typedef flex_uint8_t YY_CHAR;
589 FILE *yyin = NULL, *yyout = NULL;
591 typedef int yy_state_type;
600 #define yytext_ptr yytext 602 static yy_state_type yy_get_previous_state (
void );
603 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
604 static int yy_get_next_buffer (
void );
605 static void yynoreturn yy_fatal_error (
const char* msg );
610 #define YY_DO_BEFORE_ACTION \ 611 (yytext_ptr) = yy_bp; \ 612 yyleng = (int) (yy_cp - yy_bp); \ 613 (yy_hold_char) = *yy_cp; \ 615 (yy_c_buf_p) = yy_cp; 616 #define YY_NUM_RULES 7 617 #define YY_END_OF_BUFFER 8 622 flex_int32_t yy_verify;
625 static const flex_int16_t yy_accept[39] =
627 0, 0, 8, 6, 4, 2, 1, 6, 1, 0,
628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
629 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
630 0, 0, 0, 0, 0, 0, 5, 0
633 static const YY_CHAR yy_ec[256] =
635 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
636 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
637 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
638 1, 2, 4, 4, 5, 4, 4, 4, 4, 4,
639 4, 4, 4, 4, 4, 4, 6, 7, 7, 7,
640 7, 7, 7, 7, 7, 7, 7, 4, 4, 8,
641 4, 9, 4, 4, 10, 10, 10, 10, 10, 10,
642 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
643 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
644 4, 1, 4, 4, 4, 1, 11, 11, 11, 11,
646 12, 11, 13, 11, 14, 11, 15, 11, 11, 16,
647 11, 11, 11, 17, 18, 19, 11, 11, 11, 11,
648 20, 11, 1, 1, 1, 4, 1, 1, 1, 1,
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
654 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
655 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
658 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
660 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
661 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
665 static const YY_CHAR yy_meta[21] =
667 1, 2, 3, 4, 4, 4, 2, 1, 1, 2,
668 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
671 static const flex_int16_t yy_base[43] =
673 0, 7, 49, 50, 50, 50, 0, 1, 0, 36,
674 28, 26, 28, 35, 29, 0, 26, 33, 27, 33,
675 29, 22, 0, 24, 27, 14, 27, 23, 13, 50,
676 10, 9, 4, 1, 0, 2, 50, 50, 19, 23,
680 static const flex_int16_t yy_def[43] =
682 39, 39, 38, 38, 38, 38, 40, 38, 40, 38,
683 38, 38, 38, 38, 38, 41, 38, 41, 38, 38,
684 38, 38, 42, 38, 42, 38, 38, 38, 38, 38,
685 38, 38, 38, 38, 38, 38, 38, 0, 38, 38,
689 static const flex_int16_t yy_nxt[71] =
691 38, 5, 6, 18, 7, 38, 38, 8, 5, 6,
692 37, 7, 36, 38, 8, 10, 35, 34, 11, 4,
693 4, 4, 4, 9, 9, 33, 9, 25, 32, 25,
694 31, 30, 29, 28, 27, 26, 24, 23, 22, 21,
695 20, 19, 17, 16, 15, 14, 13, 12, 38, 3,
696 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
697 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
700 static const flex_int16_t yy_chk[71] =
702 0, 1, 1, 41, 1, 0, 0, 1, 2, 2,
703 36, 2, 35, 0, 2, 8, 34, 33, 8, 39,
704 39, 39, 39, 40, 40, 32, 40, 42, 31, 42,
705 29, 28, 27, 26, 25, 24, 22, 21, 20, 19,
706 18, 17, 15, 14, 13, 12, 11, 10, 3, 38,
707 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
708 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
711 static yy_state_type yy_last_accepting_state;
712 static char *yy_last_accepting_cpos;
714 extern int yy_flex_debug;
715 int yy_flex_debug = 0;
720 #define REJECT reject_used_but_not_detected 721 #define yymore() yymore_used_but_not_detected 722 #define YY_MORE_ADJ 0 723 #define YY_RESTORE_YY_MORE_OFFSET 725 #line 1 "tokenparser.l" 764 #line 42 "tokenparser.l" 775 #include "simclist.h" 779 static void eval_key(
char *pcToken,
list_t *list_key);
780 static void eval_value(
char *pcToken,
list_t *list_values);
781 void tperrorCheck (
char *pcToken_error);
784 static list_t *ListValues;
786 #line 787 "tokenparser.c" 787 #define YY_NO_INPUT 1 788 #line 789 "tokenparser.c" 792 #ifndef YY_NO_UNISTD_H 800 #ifndef YY_EXTRA_TYPE 801 #define YY_EXTRA_TYPE void * 804 static int yy_init_globals (
void );
809 int yylex_destroy (
void );
811 int yyget_debug (
void );
813 void yyset_debug (
int debug_flag );
815 YY_EXTRA_TYPE yyget_extra (
void );
817 void yyset_extra ( YY_EXTRA_TYPE user_defined );
819 FILE *yyget_in (
void );
821 void yyset_in ( FILE * _in_str );
823 FILE *yyget_out (
void );
825 void yyset_out ( FILE * _out_str );
827 int yyget_leng (
void );
829 char *yyget_text (
void );
831 int yyget_lineno (
void );
833 void yyset_lineno (
int _line_number );
839 #ifndef YY_SKIP_YYWRAP 841 extern "C" int yywrap (
void );
843 extern int yywrap (
void );
852 static void yy_flex_strncpy (
char *,
const char *,
int );
855 #ifdef YY_NEED_STRLEN 856 static int yy_flex_strlen (
const char * );
861 static int yyinput (
void );
863 static int input (
void );
869 #ifndef YY_READ_BUF_SIZE 872 #define YY_READ_BUF_SIZE 16384 874 #define YY_READ_BUF_SIZE 8192 883 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) 890 #define YY_INPUT(buf,result,max_size) \ 891 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 895 for ( n = 0; n < max_size && \ 896 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 899 buf[n++] = (char) c; \ 900 if ( c == EOF && ferror( yyin ) ) \ 901 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 907 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ 909 if( errno != EINTR) \ 911 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 927 #define yyterminate() return YY_NULL 931 #ifndef YY_START_STACK_INCR 932 #define YY_START_STACK_INCR 25 936 #ifndef YY_FATAL_ERROR 937 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 946 #define YY_DECL_IS_OURS 1 948 extern int yylex (
void);
950 #define YY_DECL int yylex (void) 956 #ifndef YY_USER_ACTION 957 #define YY_USER_ACTION 962 #define YY_BREAK break; 965 #define YY_RULE_SETUP \ 972 yy_state_type yy_current_state;
993 if ( ! YY_CURRENT_BUFFER ) {
994 yyensure_buffer_stack ();
995 YY_CURRENT_BUFFER_LVALUE =
996 yy_create_buffer( yyin, YY_BUF_SIZE );
999 yy_load_buffer_state( );
1003 #line 69 "tokenparser.l" 1006 #line 1007 "tokenparser.c" 1010 yy_cp = (yy_c_buf_p);
1013 *yy_cp = (yy_hold_char);
1020 yy_current_state = (yy_start);
1024 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1025 if ( yy_accept[yy_current_state] )
1027 (yy_last_accepting_state) = yy_current_state;
1028 (yy_last_accepting_cpos) = yy_cp;
1030 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1032 yy_current_state = (int) yy_def[yy_current_state];
1033 if ( yy_current_state >= 39 )
1034 yy_c = yy_meta[yy_c];
1036 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1039 while ( yy_base[yy_current_state] != 50 );
1042 yy_act = yy_accept[yy_current_state];
1045 yy_cp = (yy_last_accepting_cpos);
1046 yy_current_state = (yy_last_accepting_state);
1047 yy_act = yy_accept[yy_current_state];
1050 YY_DO_BEFORE_ACTION;
1058 *yy_cp = (yy_hold_char);
1059 yy_cp = (yy_last_accepting_cpos);
1060 yy_current_state = (yy_last_accepting_state);
1061 goto yy_find_action;
1065 #line 71 "tokenparser.l" 1071 #line 72 "tokenparser.l" 1076 #line 73 "tokenparser.l" 1077 { eval_key(yytext, ListKeys); }
1081 #line 74 "tokenparser.l" 1086 #line 75 "tokenparser.l" 1087 { eval_value(yytext, ListValues); }
1091 #line 76 "tokenparser.l" 1092 { tperrorCheck(yytext); }
1096 #line 77 "tokenparser.l" 1099 #line 1100 "tokenparser.c" 1100 case YY_STATE_EOF(INITIAL):
1103 case YY_END_OF_BUFFER:
1106 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1109 *yy_cp = (yy_hold_char);
1110 YY_RESTORE_YY_MORE_OFFSET
1112 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1123 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1124 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1125 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1135 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1137 yy_state_type yy_next_state;
1139 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1141 yy_current_state = yy_get_previous_state( );
1152 yy_next_state = yy_try_NUL_trans( yy_current_state );
1154 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1156 if ( yy_next_state )
1159 yy_cp = ++(yy_c_buf_p);
1160 yy_current_state = yy_next_state;
1166 yy_cp = (yy_c_buf_p);
1167 goto yy_find_action;
1171 else switch ( yy_get_next_buffer( ) )
1173 case EOB_ACT_END_OF_FILE:
1175 (yy_did_buffer_switch_on_eof) = 0;
1188 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1190 yy_act = YY_STATE_EOF(YY_START);
1196 if ( ! (yy_did_buffer_switch_on_eof) )
1202 case EOB_ACT_CONTINUE_SCAN:
1204 (yytext_ptr) + yy_amount_of_matched_text;
1206 yy_current_state = yy_get_previous_state( );
1208 yy_cp = (yy_c_buf_p);
1209 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1212 case EOB_ACT_LAST_MATCH:
1214 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1216 yy_current_state = yy_get_previous_state( );
1218 yy_cp = (yy_c_buf_p);
1219 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1220 goto yy_find_action;
1227 "fatal flex scanner internal error--no action found" );
1240 static int yy_get_next_buffer (
void)
1242 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1243 char *source = (yytext_ptr);
1244 int number_to_move, i;
1247 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1249 "fatal flex scanner internal error--end of buffer missed" );
1251 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1253 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1258 return EOB_ACT_END_OF_FILE;
1266 return EOB_ACT_LAST_MATCH;
1273 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1275 for ( i = 0; i < number_to_move; ++i )
1276 *(dest++) = *(source++);
1278 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1282 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1287 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1289 while ( num_to_read <= 0 )
1295 int yy_c_buf_p_offset =
1296 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1298 if ( b->yy_is_our_buffer )
1300 int new_size = b->yy_buf_size * 2;
1302 if ( new_size <= 0 )
1303 b->yy_buf_size += b->yy_buf_size / 8;
1305 b->yy_buf_size *= 2;
1307 b->yy_ch_buf = (
char *)
1309 yyrealloc( (
void *) b->yy_ch_buf,
1310 (yy_size_t) (b->yy_buf_size + 2) );
1314 b->yy_ch_buf = NULL;
1316 if ( ! b->yy_ch_buf )
1318 "fatal error - scanner input buffer overflow" );
1320 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1322 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1327 if ( num_to_read > YY_READ_BUF_SIZE )
1328 num_to_read = YY_READ_BUF_SIZE;
1331 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1332 (yy_n_chars), num_to_read );
1334 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1337 if ( (yy_n_chars) == 0 )
1339 if ( number_to_move == YY_MORE_ADJ )
1341 ret_val = EOB_ACT_END_OF_FILE;
1347 ret_val = EOB_ACT_LAST_MATCH;
1348 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1349 YY_BUFFER_EOF_PENDING;
1354 ret_val = EOB_ACT_CONTINUE_SCAN;
1356 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1358 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1359 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc(
1360 (
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1361 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1362 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1364 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1367 (yy_n_chars) += number_to_move;
1368 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1369 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1371 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1378 static yy_state_type yy_get_previous_state (
void)
1380 yy_state_type yy_current_state;
1383 yy_current_state = (yy_start);
1385 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1387 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1388 if ( yy_accept[yy_current_state] )
1390 (yy_last_accepting_state) = yy_current_state;
1391 (yy_last_accepting_cpos) = yy_cp;
1393 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1395 yy_current_state = (int) yy_def[yy_current_state];
1396 if ( yy_current_state >= 39 )
1397 yy_c = yy_meta[yy_c];
1399 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1402 return yy_current_state;
1410 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1413 char *yy_cp = (yy_c_buf_p);
1416 if ( yy_accept[yy_current_state] )
1418 (yy_last_accepting_state) = yy_current_state;
1419 (yy_last_accepting_cpos) = yy_cp;
1421 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1423 yy_current_state = (int) yy_def[yy_current_state];
1424 if ( yy_current_state >= 39 )
1425 yy_c = yy_meta[yy_c];
1427 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1428 yy_is_jam = (yy_current_state == 38);
1430 return yy_is_jam ? 0 : yy_current_state;
1439 static int yyinput (
void)
1441 static int input (
void)
1447 *(yy_c_buf_p) = (yy_hold_char);
1449 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1455 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1457 *(yy_c_buf_p) =
'\0';
1461 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1464 switch ( yy_get_next_buffer( ) )
1466 case EOB_ACT_LAST_MATCH:
1482 case EOB_ACT_END_OF_FILE:
1487 if ( ! (yy_did_buffer_switch_on_eof) )
1496 case EOB_ACT_CONTINUE_SCAN:
1497 (yy_c_buf_p) = (yytext_ptr) + offset;
1503 c = *(
unsigned char *) (yy_c_buf_p);
1504 *(yy_c_buf_p) =
'\0';
1505 (yy_hold_char) = *++(yy_c_buf_p);
1516 void yyrestart (FILE * input_file )
1519 if ( ! YY_CURRENT_BUFFER ){
1520 yyensure_buffer_stack ();
1521 YY_CURRENT_BUFFER_LVALUE =
1522 yy_create_buffer( yyin, YY_BUF_SIZE );
1525 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1526 yy_load_buffer_state( );
1541 yyensure_buffer_stack ();
1542 if ( YY_CURRENT_BUFFER == new_buffer )
1545 if ( YY_CURRENT_BUFFER )
1548 *(yy_c_buf_p) = (yy_hold_char);
1549 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1550 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1553 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1554 yy_load_buffer_state( );
1561 (yy_did_buffer_switch_on_eof) = 1;
1564 static void yy_load_buffer_state (
void)
1566 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1567 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1568 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1569 (yy_hold_char) = *(yy_c_buf_p);
1584 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1586 b->yy_buf_size = size;
1591 b->yy_ch_buf = (
char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1592 if ( ! b->yy_ch_buf )
1593 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1595 b->yy_is_our_buffer = 1;
1597 yy_init_buffer( b, file );
1612 if ( b == YY_CURRENT_BUFFER )
1615 if ( b->yy_is_our_buffer )
1616 yyfree( (
void *) b->yy_ch_buf );
1618 yyfree( (
void *) b );
1630 yy_flush_buffer( b );
1632 b->yy_input_file = file;
1633 b->yy_fill_buffer = 1;
1639 if (b != YY_CURRENT_BUFFER){
1644 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1664 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1665 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1667 b->yy_buf_pos = &b->yy_ch_buf[0];
1670 b->yy_buffer_status = YY_BUFFER_NEW;
1672 if ( b == YY_CURRENT_BUFFER )
1673 yy_load_buffer_state( );
1684 if (new_buffer == NULL)
1687 yyensure_buffer_stack();
1690 if ( YY_CURRENT_BUFFER )
1693 *(yy_c_buf_p) = (yy_hold_char);
1694 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1695 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1699 if (YY_CURRENT_BUFFER)
1701 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1704 yy_load_buffer_state( );
1705 (yy_did_buffer_switch_on_eof) = 1;
1712 void yypop_buffer_state (
void)
1714 if (!YY_CURRENT_BUFFER)
1717 yy_delete_buffer(YY_CURRENT_BUFFER );
1718 YY_CURRENT_BUFFER_LVALUE = NULL;
1722 if (YY_CURRENT_BUFFER) {
1723 yy_load_buffer_state( );
1724 (yy_did_buffer_switch_on_eof) = 1;
1731 static void yyensure_buffer_stack (
void)
1733 yy_size_t num_to_alloc;
1746 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1758 yy_size_t grow_size = 8 ;
1766 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1785 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1786 base[size-1] != YY_END_OF_BUFFER_CHAR )
1792 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1794 b->yy_buf_size = (int) (size - 2);
1795 b->yy_buf_pos = b->yy_ch_buf = base;
1796 b->yy_is_our_buffer = 0;
1797 b->yy_input_file = NULL;
1798 b->yy_n_chars = b->yy_buf_size;
1799 b->yy_is_interactive = 0;
1801 b->yy_fill_buffer = 0;
1802 b->yy_buffer_status = YY_BUFFER_NEW;
1804 yy_switch_to_buffer( b );
1820 return yy_scan_bytes( yystr, (
int) strlen(yystr) );
1830 YY_BUFFER_STATE yy_scan_bytes (
const char * yybytes,
int _yybytes_len )
1838 n = (yy_size_t) (_yybytes_len + 2);
1839 buf = (
char *) yyalloc( n );
1841 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1843 for ( i = 0; i < _yybytes_len; ++i )
1844 buf[i] = yybytes[i];
1846 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1848 b = yy_scan_buffer( buf, n );
1850 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1855 b->yy_is_our_buffer = 1;
1860 #ifndef YY_EXIT_FAILURE 1861 #define YY_EXIT_FAILURE 2 1864 static void yynoreturn yy_fatal_error (
const char* msg )
1866 fprintf( stderr,
"%s\n", msg );
1867 exit( YY_EXIT_FAILURE );
1877 int yyless_macro_arg = (n); \ 1878 YY_LESS_LINENO(yyless_macro_arg);\ 1879 yytext[yyleng] = (yy_hold_char); \ 1880 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1881 (yy_hold_char) = *(yy_c_buf_p); \ 1882 *(yy_c_buf_p) = '\0'; \ 1883 yyleng = yyless_macro_arg; \ 1892 int yyget_lineno (
void)
1901 FILE *yyget_in (
void)
1909 FILE *yyget_out (
void)
1917 int yyget_leng (
void)
1926 char *yyget_text (
void)
1935 void yyset_lineno (
int _line_number )
1938 yylineno = _line_number;
1947 void yyset_in (FILE * _in_str )
1952 void yyset_out (FILE * _out_str )
1957 int yyget_debug (
void)
1959 return yy_flex_debug;
1962 void yyset_debug (
int _bdebug )
1964 yy_flex_debug = _bdebug ;
1967 static int yy_init_globals (
void)
1976 (yy_c_buf_p) = NULL;
1996 int yylex_destroy (
void)
2000 while(YY_CURRENT_BUFFER){
2001 yy_delete_buffer( YY_CURRENT_BUFFER );
2002 YY_CURRENT_BUFFER_LVALUE = NULL;
2003 yypop_buffer_state();
2022 static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
2026 for ( i = 0; i < n; ++i )
2031 #ifdef YY_NEED_STRLEN 2032 static int yy_flex_strlen (
const char * s )
2035 for ( n = 0; s[n]; ++n )
2042 void *yyalloc (yy_size_t size )
2044 return malloc(size);
2047 void *yyrealloc (
void * ptr, yy_size_t size )
2057 return realloc(ptr, size);
2060 void yyfree (
void * ptr )
2062 free( (
char *) ptr );
2065 #define YYTABLES_NAME "yytables" 2067 #line 77 "tokenparser.l" 2071 static void eval_key(
char *pcToken,
list_t *list_key)
2078 elt = malloc(
sizeof(*elt));
2085 for (len=0; pcToken[len+5] !=
'<'; len++)
2089 elt->key = malloc(len);
2090 memcpy(elt->key, &pcToken[5], len-1);
2091 elt->key[len-1] =
'\0';
2093 r = list_init(&elt->values);
2098 list_append(list_key, elt);
2101 ListValues = &elt->values;
2104 static void eval_value(
char *pcToken,
list_t *list_values)
2115 for (len=0; pcToken[len+8] !=
'<'; len++)
2119 value = malloc(len);
2122 memcpy(value, &pcToken[8], len-1);
2123 value[len-1] =
'\0';
2127 while ((amp = strstr(amp,
"&")) != NULL)
2132 for (p = amp+1; *(p+4); p++)
2143 r = list_append(list_values, value);
2148 void tperrorCheck (
char *token_error)
2163 int LTPBundleFindValueWithKey(
list_t *l,
const char *key,
list_t **values)
2168 for (i=0; i < list_size(l); i++)
2172 elt = list_get_at(l, i);
2175 if (0 == strcmp(elt->key, key))
2177 *values = &elt->values;
2194 int bundleParse(
const char *fileName,
list_t *l)
2202 file = fopen(fileName,
"r");
2205 Log3(PCSC_LOG_CRITICAL,
"Could not open bundle file %s: %s",
2206 fileName, strerror(errno));
2220 }
while (!feof(file));
2226 printf(
"size: %d\n", list_size(l));
2227 for (i=0; i < list_size(l); i++)
2232 elt = list_get_at(l, i);
2234 printf(
"Key: %s\n", elt->key);
2236 for (j=0; j<list_size(&elt->values); j++)
2238 char *v = list_get_at(&elt->values, j);
2239 printf(
" value: %s\n", v);
2252 void bundleRelease(
list_t *l)
2256 for (i=0; i < list_size(l); i++)
2261 elt = list_get_at(l, i);
2265 for (j=0; j<list_size(&elt->values); j++)
2266 free(list_get_at(&elt->values, j));
2267 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.