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" 773 #include "simclist.h" 777 static void eval_key(
char *pcToken,
list_t *list_key);
778 static void eval_value(
char *pcToken,
list_t *list_values);
779 void tperrorCheck (
char *pcToken_error);
782 static list_t *ListValues;
784 #line 785 "tokenparser.c" 785 #define YY_NO_INPUT 1 786 #line 787 "tokenparser.c" 790 #ifndef YY_NO_UNISTD_H 798 #ifndef YY_EXTRA_TYPE 799 #define YY_EXTRA_TYPE void * 802 static int yy_init_globals (
void );
807 int yylex_destroy (
void );
809 int yyget_debug (
void );
811 void yyset_debug (
int debug_flag );
813 YY_EXTRA_TYPE yyget_extra (
void );
815 void yyset_extra ( YY_EXTRA_TYPE user_defined );
817 FILE *yyget_in (
void );
819 void yyset_in ( FILE * _in_str );
821 FILE *yyget_out (
void );
823 void yyset_out ( FILE * _out_str );
825 int yyget_leng (
void );
827 char *yyget_text (
void );
829 int yyget_lineno (
void );
831 void yyset_lineno (
int _line_number );
837 #ifndef YY_SKIP_YYWRAP 839 extern "C" int yywrap (
void );
841 extern int yywrap (
void );
850 static void yy_flex_strncpy (
char *,
const char *,
int );
853 #ifdef YY_NEED_STRLEN 854 static int yy_flex_strlen (
const char * );
859 static int yyinput (
void );
861 static int input (
void );
867 #ifndef YY_READ_BUF_SIZE 870 #define YY_READ_BUF_SIZE 16384 872 #define YY_READ_BUF_SIZE 8192 881 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) 888 #define YY_INPUT(buf,result,max_size) \ 889 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 893 for ( n = 0; n < max_size && \ 894 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 897 buf[n++] = (char) c; \ 898 if ( c == EOF && ferror( yyin ) ) \ 899 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 905 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ 907 if( errno != EINTR) \ 909 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 925 #define yyterminate() return YY_NULL 929 #ifndef YY_START_STACK_INCR 930 #define YY_START_STACK_INCR 25 934 #ifndef YY_FATAL_ERROR 935 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 944 #define YY_DECL_IS_OURS 1 946 extern int yylex (
void);
948 #define YY_DECL int yylex (void) 954 #ifndef YY_USER_ACTION 955 #define YY_USER_ACTION 960 #define YY_BREAK break; 963 #define YY_RULE_SETUP \ 970 yy_state_type yy_current_state;
991 if ( ! YY_CURRENT_BUFFER ) {
992 yyensure_buffer_stack ();
993 YY_CURRENT_BUFFER_LVALUE =
994 yy_create_buffer( yyin, YY_BUF_SIZE );
997 yy_load_buffer_state( );
1001 #line 67 "tokenparser.l" 1004 #line 1005 "tokenparser.c" 1008 yy_cp = (yy_c_buf_p);
1011 *yy_cp = (yy_hold_char);
1018 yy_current_state = (yy_start);
1022 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1023 if ( yy_accept[yy_current_state] )
1025 (yy_last_accepting_state) = yy_current_state;
1026 (yy_last_accepting_cpos) = yy_cp;
1028 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1030 yy_current_state = (int) yy_def[yy_current_state];
1031 if ( yy_current_state >= 39 )
1032 yy_c = yy_meta[yy_c];
1034 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1037 while ( yy_base[yy_current_state] != 50 );
1040 yy_act = yy_accept[yy_current_state];
1043 yy_cp = (yy_last_accepting_cpos);
1044 yy_current_state = (yy_last_accepting_state);
1045 yy_act = yy_accept[yy_current_state];
1048 YY_DO_BEFORE_ACTION;
1056 *yy_cp = (yy_hold_char);
1057 yy_cp = (yy_last_accepting_cpos);
1058 yy_current_state = (yy_last_accepting_state);
1059 goto yy_find_action;
1063 #line 69 "tokenparser.l" 1069 #line 70 "tokenparser.l" 1074 #line 71 "tokenparser.l" 1075 { eval_key(yytext, ListKeys); }
1079 #line 72 "tokenparser.l" 1084 #line 73 "tokenparser.l" 1085 { eval_value(yytext, ListValues); }
1089 #line 74 "tokenparser.l" 1090 { tperrorCheck(yytext); }
1094 #line 75 "tokenparser.l" 1097 #line 1098 "tokenparser.c" 1098 case YY_STATE_EOF(INITIAL):
1101 case YY_END_OF_BUFFER:
1104 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1107 *yy_cp = (yy_hold_char);
1108 YY_RESTORE_YY_MORE_OFFSET
1110 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1121 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1122 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1123 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1133 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1135 yy_state_type yy_next_state;
1137 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1139 yy_current_state = yy_get_previous_state( );
1150 yy_next_state = yy_try_NUL_trans( yy_current_state );
1152 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1154 if ( yy_next_state )
1157 yy_cp = ++(yy_c_buf_p);
1158 yy_current_state = yy_next_state;
1164 yy_cp = (yy_c_buf_p);
1165 goto yy_find_action;
1169 else switch ( yy_get_next_buffer( ) )
1171 case EOB_ACT_END_OF_FILE:
1173 (yy_did_buffer_switch_on_eof) = 0;
1186 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1188 yy_act = YY_STATE_EOF(YY_START);
1194 if ( ! (yy_did_buffer_switch_on_eof) )
1200 case EOB_ACT_CONTINUE_SCAN:
1202 (yytext_ptr) + yy_amount_of_matched_text;
1204 yy_current_state = yy_get_previous_state( );
1206 yy_cp = (yy_c_buf_p);
1207 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1210 case EOB_ACT_LAST_MATCH:
1212 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1214 yy_current_state = yy_get_previous_state( );
1216 yy_cp = (yy_c_buf_p);
1217 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1218 goto yy_find_action;
1225 "fatal flex scanner internal error--no action found" );
1238 static int yy_get_next_buffer (
void)
1240 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1241 char *source = (yytext_ptr);
1242 int number_to_move, i;
1245 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1247 "fatal flex scanner internal error--end of buffer missed" );
1249 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1251 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1256 return EOB_ACT_END_OF_FILE;
1264 return EOB_ACT_LAST_MATCH;
1271 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1273 for ( i = 0; i < number_to_move; ++i )
1274 *(dest++) = *(source++);
1276 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1280 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1285 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1287 while ( num_to_read <= 0 )
1293 int yy_c_buf_p_offset =
1294 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1296 if ( b->yy_is_our_buffer )
1298 int new_size = b->yy_buf_size * 2;
1300 if ( new_size <= 0 )
1301 b->yy_buf_size += b->yy_buf_size / 8;
1303 b->yy_buf_size *= 2;
1305 b->yy_ch_buf = (
char *)
1307 yyrealloc( (
void *) b->yy_ch_buf,
1308 (yy_size_t) (b->yy_buf_size + 2) );
1312 b->yy_ch_buf = NULL;
1314 if ( ! b->yy_ch_buf )
1316 "fatal error - scanner input buffer overflow" );
1318 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1320 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1325 if ( num_to_read > YY_READ_BUF_SIZE )
1326 num_to_read = YY_READ_BUF_SIZE;
1329 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1330 (yy_n_chars), num_to_read );
1332 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1335 if ( (yy_n_chars) == 0 )
1337 if ( number_to_move == YY_MORE_ADJ )
1339 ret_val = EOB_ACT_END_OF_FILE;
1345 ret_val = EOB_ACT_LAST_MATCH;
1346 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1347 YY_BUFFER_EOF_PENDING;
1352 ret_val = EOB_ACT_CONTINUE_SCAN;
1354 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1356 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1357 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc(
1358 (
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1359 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1360 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1362 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1365 (yy_n_chars) += number_to_move;
1366 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1367 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1369 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1376 static yy_state_type yy_get_previous_state (
void)
1378 yy_state_type yy_current_state;
1381 yy_current_state = (yy_start);
1383 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1385 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1386 if ( yy_accept[yy_current_state] )
1388 (yy_last_accepting_state) = yy_current_state;
1389 (yy_last_accepting_cpos) = yy_cp;
1391 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1393 yy_current_state = (int) yy_def[yy_current_state];
1394 if ( yy_current_state >= 39 )
1395 yy_c = yy_meta[yy_c];
1397 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1400 return yy_current_state;
1408 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1411 char *yy_cp = (yy_c_buf_p);
1414 if ( yy_accept[yy_current_state] )
1416 (yy_last_accepting_state) = yy_current_state;
1417 (yy_last_accepting_cpos) = yy_cp;
1419 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1421 yy_current_state = (int) yy_def[yy_current_state];
1422 if ( yy_current_state >= 39 )
1423 yy_c = yy_meta[yy_c];
1425 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1426 yy_is_jam = (yy_current_state == 38);
1428 return yy_is_jam ? 0 : yy_current_state;
1437 static int yyinput (
void)
1439 static int input (
void)
1445 *(yy_c_buf_p) = (yy_hold_char);
1447 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1453 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1455 *(yy_c_buf_p) =
'\0';
1459 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1462 switch ( yy_get_next_buffer( ) )
1464 case EOB_ACT_LAST_MATCH:
1480 case EOB_ACT_END_OF_FILE:
1485 if ( ! (yy_did_buffer_switch_on_eof) )
1494 case EOB_ACT_CONTINUE_SCAN:
1495 (yy_c_buf_p) = (yytext_ptr) + offset;
1501 c = *(
unsigned char *) (yy_c_buf_p);
1502 *(yy_c_buf_p) =
'\0';
1503 (yy_hold_char) = *++(yy_c_buf_p);
1514 void yyrestart (FILE * input_file )
1517 if ( ! YY_CURRENT_BUFFER ){
1518 yyensure_buffer_stack ();
1519 YY_CURRENT_BUFFER_LVALUE =
1520 yy_create_buffer( yyin, YY_BUF_SIZE );
1523 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1524 yy_load_buffer_state( );
1539 yyensure_buffer_stack ();
1540 if ( YY_CURRENT_BUFFER == new_buffer )
1543 if ( YY_CURRENT_BUFFER )
1546 *(yy_c_buf_p) = (yy_hold_char);
1547 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1548 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1551 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1552 yy_load_buffer_state( );
1559 (yy_did_buffer_switch_on_eof) = 1;
1562 static void yy_load_buffer_state (
void)
1564 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1565 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1566 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1567 (yy_hold_char) = *(yy_c_buf_p);
1582 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1584 b->yy_buf_size = size;
1589 b->yy_ch_buf = (
char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1590 if ( ! b->yy_ch_buf )
1591 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1593 b->yy_is_our_buffer = 1;
1595 yy_init_buffer( b, file );
1610 if ( b == YY_CURRENT_BUFFER )
1613 if ( b->yy_is_our_buffer )
1614 yyfree( (
void *) b->yy_ch_buf );
1616 yyfree( (
void *) b );
1628 yy_flush_buffer( b );
1630 b->yy_input_file = file;
1631 b->yy_fill_buffer = 1;
1637 if (b != YY_CURRENT_BUFFER){
1642 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1662 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1663 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1665 b->yy_buf_pos = &b->yy_ch_buf[0];
1668 b->yy_buffer_status = YY_BUFFER_NEW;
1670 if ( b == YY_CURRENT_BUFFER )
1671 yy_load_buffer_state( );
1682 if (new_buffer == NULL)
1685 yyensure_buffer_stack();
1688 if ( YY_CURRENT_BUFFER )
1691 *(yy_c_buf_p) = (yy_hold_char);
1692 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1693 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1697 if (YY_CURRENT_BUFFER)
1699 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1702 yy_load_buffer_state( );
1703 (yy_did_buffer_switch_on_eof) = 1;
1710 void yypop_buffer_state (
void)
1712 if (!YY_CURRENT_BUFFER)
1715 yy_delete_buffer(YY_CURRENT_BUFFER );
1716 YY_CURRENT_BUFFER_LVALUE = NULL;
1720 if (YY_CURRENT_BUFFER) {
1721 yy_load_buffer_state( );
1722 (yy_did_buffer_switch_on_eof) = 1;
1729 static void yyensure_buffer_stack (
void)
1731 yy_size_t num_to_alloc;
1744 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1756 yy_size_t grow_size = 8 ;
1764 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1783 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1784 base[size-1] != YY_END_OF_BUFFER_CHAR )
1790 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1792 b->yy_buf_size = (int) (size - 2);
1793 b->yy_buf_pos = b->yy_ch_buf = base;
1794 b->yy_is_our_buffer = 0;
1795 b->yy_input_file = NULL;
1796 b->yy_n_chars = b->yy_buf_size;
1797 b->yy_is_interactive = 0;
1799 b->yy_fill_buffer = 0;
1800 b->yy_buffer_status = YY_BUFFER_NEW;
1802 yy_switch_to_buffer( b );
1818 return yy_scan_bytes( yystr, (
int) strlen(yystr) );
1828 YY_BUFFER_STATE yy_scan_bytes (
const char * yybytes,
int _yybytes_len )
1836 n = (yy_size_t) (_yybytes_len + 2);
1837 buf = (
char *) yyalloc( n );
1839 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1841 for ( i = 0; i < _yybytes_len; ++i )
1842 buf[i] = yybytes[i];
1844 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1846 b = yy_scan_buffer( buf, n );
1848 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1853 b->yy_is_our_buffer = 1;
1858 #ifndef YY_EXIT_FAILURE 1859 #define YY_EXIT_FAILURE 2 1862 static void yynoreturn yy_fatal_error (
const char* msg )
1864 fprintf( stderr,
"%s\n", msg );
1865 exit( YY_EXIT_FAILURE );
1875 int yyless_macro_arg = (n); \ 1876 YY_LESS_LINENO(yyless_macro_arg);\ 1877 yytext[yyleng] = (yy_hold_char); \ 1878 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1879 (yy_hold_char) = *(yy_c_buf_p); \ 1880 *(yy_c_buf_p) = '\0'; \ 1881 yyleng = yyless_macro_arg; \ 1890 int yyget_lineno (
void)
1899 FILE *yyget_in (
void)
1907 FILE *yyget_out (
void)
1915 int yyget_leng (
void)
1924 char *yyget_text (
void)
1933 void yyset_lineno (
int _line_number )
1936 yylineno = _line_number;
1945 void yyset_in (FILE * _in_str )
1950 void yyset_out (FILE * _out_str )
1955 int yyget_debug (
void)
1957 return yy_flex_debug;
1960 void yyset_debug (
int _bdebug )
1962 yy_flex_debug = _bdebug ;
1965 static int yy_init_globals (
void)
1974 (yy_c_buf_p) = NULL;
1994 int yylex_destroy (
void)
1998 while(YY_CURRENT_BUFFER){
1999 yy_delete_buffer( YY_CURRENT_BUFFER );
2000 YY_CURRENT_BUFFER_LVALUE = NULL;
2001 yypop_buffer_state();
2020 static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
2024 for ( i = 0; i < n; ++i )
2029 #ifdef YY_NEED_STRLEN 2030 static int yy_flex_strlen (
const char * s )
2033 for ( n = 0; s[n]; ++n )
2040 void *yyalloc (yy_size_t size )
2042 return malloc(size);
2045 void *yyrealloc (
void * ptr, yy_size_t size )
2055 return realloc(ptr, size);
2058 void yyfree (
void * ptr )
2060 free( (
char *) ptr );
2063 #define YYTABLES_NAME "yytables" 2065 #line 75 "tokenparser.l" 2069 static void eval_key(
char *pcToken,
list_t *list_key)
2076 elt = malloc(
sizeof(*elt));
2083 for (len=0; pcToken[len+5] !=
'<'; len++)
2087 elt->key = malloc(len);
2088 memcpy(elt->key, &pcToken[5], len-1);
2089 elt->key[len-1] =
'\0';
2091 r = list_init(&elt->values);
2096 list_append(list_key, elt);
2099 ListValues = &elt->values;
2102 static void eval_value(
char *pcToken,
list_t *list_values)
2113 for (len=0; pcToken[len+8] !=
'<'; len++)
2117 value = malloc(len);
2120 memcpy(value, &pcToken[8], len-1);
2121 value[len-1] =
'\0';
2125 while ((amp = strstr(amp,
"&")) != NULL)
2130 for (p = amp+1; *(p+4); p++)
2141 r = list_append(list_values, value);
2146 void tperrorCheck (
char *token_error)
2161 int LTPBundleFindValueWithKey(
list_t *l,
const char *key,
list_t **values)
2166 for (i=0; i < list_size(l); i++)
2170 elt = list_get_at(l, i);
2173 if (0 == strcmp(elt->key, key))
2175 *values = &elt->values;
2192 int bundleParse(
const char *fileName,
list_t *l)
2200 file = fopen(fileName,
"r");
2203 Log3(PCSC_LOG_CRITICAL,
"Could not open bundle file %s: %s",
2204 fileName, strerror(errno));
2218 }
while (!feof(file));
2224 printf(
"size: %d\n", list_size(l));
2225 for (i=0; i < list_size(l); i++)
2230 elt = list_get_at(l, i);
2232 printf(
"Key: %s\n", elt->key);
2234 for (j=0; j<list_size(&elt->values); j++)
2236 char *v = list_get_at(&elt->values, j);
2237 printf(
" value: %s\n", v);
2250 void bundleRelease(
list_t *l)
2254 for (i=0; i < list_size(l); i++)
2259 elt = list_get_at(l, i);
2263 for (j=0; j<list_size(&elt->values); j++)
2264 free(list_get_at(&elt->values, j));
2265 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.