Changeset 1200 for trunk/AGRIF/LIB/main.c
- Timestamp:
- 2008-09-24T15:05:20+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/main.c
r774 r1200 195 195 listnom *parcours; 196 196 listvar *newvar; 197 int stylegiven = 0; 198 int infreegiven ; 199 int infixedgiven ; 200 int lengthmainfile; 197 201 198 202 if (argc < 2) … … 201 205 printf(" [-comdirin <directory>] [-comdirout <directory>]\n"); 202 206 printf(" [-convfile <FILENAME >] -SubloopScalar -SubloopScalar1 \n"); 207 printf(" [-free|-fixed]\n"); 203 208 exit(0); 204 209 } … … 228 233 tmpuselocallist = (listusemodule *)NULL; 229 234 List_ContainsSubroutine = (listnom *)NULL; 235 oldfortranout = (FILE *)NULL; 230 236 231 237 strcpy(mainfile,argv[1]); … … 291 297 value_char_size2 = 0 ; 292 298 value_char_size3 = 0 ; 299 inallocate = 0; 300 infixed = 1; 301 infree = 0; 293 302 294 303 checkexistcommon=1; … … 341 350 strcpy(filetoparse,argv[i+1]); 342 351 i++; 352 lengthmainfile = strlen(filetoparse); 353 if (!strcasecmp(&filetoparse[lengthmainfile-4],".f90")) 354 { 355 infixed = 0; 356 infree = 1; 357 } 358 else 359 { 360 infixed = 1; 361 infree = 0; 362 } 343 363 } 364 else if (!strcasecmp(argv[i],"-free")) /* file to parse */ 365 { 366 stylegiven = 1; 367 infreegiven = 1 ; 368 infixedgiven = 0; 369 } 370 else if (!strcasecmp(argv[i],"-fixed")) /* file to parse */ 371 { 372 stylegiven = 1; 373 infreegiven = 0; 374 infixedgiven = 1; 375 } 344 376 else if (!strcasecmp(argv[i],"-SubloopScalar")) /* file to parse */ 345 377 { … … 374 406 } 375 407 408 if (stylegiven == 1) 409 { 410 infree = infreegiven; 411 infixed = infixedgiven; 412 } 376 413 Save_Length(nomdir,34); 377 414 Save_Length(commondirout,35); … … 518 555 return 0; 519 556 } 520 #line 5 21"y.tab.c"557 #line 558 "y.tab.c" 521 558 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 522 559 static int yygrowstack(void) … … 726 763 } 727 764 break; 728 #line 7 29"y.tab.c"765 #line 766 "y.tab.c" 729 766 } 730 767 yyssp -= yym; … … 787 824 } 788 825 #line 2 "convert.yy.c" 826 827 #line 4 "convert.yy.c" 828 829 #define YY_INT_ALIGNED short int 830 789 831 /* A lexical scanner generated by flex */ 790 791 /* Scanner skeleton version:792 * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $793 */794 832 795 833 #define FLEX_SCANNER 796 834 #define YY_FLEX_MAJOR_VERSION 2 797 835 #define YY_FLEX_MINOR_VERSION 5 798 836 #define YY_FLEX_SUBMINOR_VERSION 33 837 #if YY_FLEX_SUBMINOR_VERSION > 0 838 #define FLEX_BETA 839 #endif 840 841 /* First, we deal with platform-specific or compiler-specific issues. */ 842 843 /* begin standard C headers. */ 799 844 #include <stdio.h> 800 801 802 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 803 #ifdef c_plusplus 804 #ifndef __cplusplus 805 #define __cplusplus 806 #endif 807 #endif 808 845 #include <string.h> 846 #include <errno.h> 847 #include <stdlib.h> 848 849 /* end standard C headers. */ 850 851 /* flex integer type definitions */ 852 853 #ifndef FLEXINT_H 854 #define FLEXINT_H 855 856 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 857 858 #if __STDC_VERSION__ >= 199901L 859 860 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 861 * if you want the limit (max/min) macros for int types. 862 */ 863 #ifndef __STDC_LIMIT_MACROS 864 #define __STDC_LIMIT_MACROS 1 865 #endif 866 867 #include <inttypes.h> 868 typedef int8_t flex_int8_t; 869 typedef uint8_t flex_uint8_t; 870 typedef int16_t flex_int16_t; 871 typedef uint16_t flex_uint16_t; 872 typedef int32_t flex_int32_t; 873 typedef uint32_t flex_uint32_t; 874 #else 875 typedef signed char flex_int8_t; 876 typedef short int flex_int16_t; 877 typedef int flex_int32_t; 878 typedef unsigned char flex_uint8_t; 879 typedef unsigned short int flex_uint16_t; 880 typedef unsigned int flex_uint32_t; 881 #endif /* ! C99 */ 882 883 /* Limits of integral types. */ 884 #ifndef INT8_MIN 885 #define INT8_MIN (-128) 886 #endif 887 #ifndef INT16_MIN 888 #define INT16_MIN (-32767-1) 889 #endif 890 #ifndef INT32_MIN 891 #define INT32_MIN (-2147483647-1) 892 #endif 893 #ifndef INT8_MAX 894 #define INT8_MAX (127) 895 #endif 896 #ifndef INT16_MAX 897 #define INT16_MAX (32767) 898 #endif 899 #ifndef INT32_MAX 900 #define INT32_MAX (2147483647) 901 #endif 902 #ifndef UINT8_MAX 903 #define UINT8_MAX (255U) 904 #endif 905 #ifndef UINT16_MAX 906 #define UINT16_MAX (65535U) 907 #endif 908 #ifndef UINT32_MAX 909 #define UINT32_MAX (4294967295U) 910 #endif 911 912 #endif /* ! FLEXINT_H */ 809 913 810 914 #ifdef __cplusplus 811 812 #include <stdlib.h>813 #include <unistd.h>814 815 /* Use prototypes in function declarations. */816 #define YY_USE_PROTOS817 915 818 916 /* The "const" storage-class-modifier is valid. */ … … 823 921 #if __STDC__ 824 922 825 #define YY_USE_PROTOS826 923 #define YY_USE_CONST 827 924 828 925 #endif /* __STDC__ */ 829 926 #endif /* ! __cplusplus */ 830 831 #ifdef __TURBOC__832 #pragma warn -rch833 #pragma warn -use834 #include <io.h>835 #include <stdlib.h>836 #define YY_USE_CONST837 #define YY_USE_PROTOS838 #endif839 927 840 928 #ifdef YY_USE_CONST … … 844 932 #endif 845 933 846 847 #ifdef YY_USE_PROTOS848 #define YY_PROTO(proto) proto849 #else850 #define YY_PROTO(proto) ()851 #endif852 853 934 /* Returned upon end-of-file. */ 854 935 #define YY_NULL 0 … … 865 946 * definition of BEGIN. 866 947 */ 867 #define BEGIN yy_start= 1 + 2 *948 #define BEGIN (yy_start) = 1 + 2 * 868 949 869 950 /* Translate the current start state into a value that can be later handed … … 871 952 * compatibility. 872 953 */ 873 #define YY_START (( yy_start- 1) / 2)954 #define YY_START (((yy_start) - 1) / 2) 874 955 #define YYSTATE YY_START 875 956 … … 878 959 879 960 /* Special action meaning "start processing a new file". */ 880 #define YY_NEW_FILE yyrestart( yyin)961 #define YY_NEW_FILE yyrestart(yyin ) 881 962 882 963 #define YY_END_OF_BUFFER_CHAR 0 883 964 884 965 /* Size of default input buffer. */ 966 #ifndef YY_BUF_SIZE 885 967 #define YY_BUF_SIZE 16384 886 968 #endif 969 970 /* The state buf must be large enough to hold one state per character in the main buffer. 971 */ 972 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 973 974 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 975 #define YY_TYPEDEF_YY_BUFFER_STATE 887 976 typedef struct yy_buffer_state *YY_BUFFER_STATE; 977 #endif 888 978 889 979 extern int yyleng; 980 890 981 extern FILE *yyin, *yyout; 891 982 … … 894 985 #define EOB_ACT_LAST_MATCH 2 895 986 896 /* The funky do-while in the following #define is used to turn the definition 897 * int a single C statement (which needs a semi-colon terminator). This 898 * avoids problems with code like: 899 * 900 * if ( condition_holds ) 901 * yyless( 5 ); 902 * else 903 * do_something_else(); 904 * 905 * Prior to using the do-while the compiler would get upset at the 906 * "else" because it interpreted the "if" statement as being all 907 * done when it reached the ';' after the yyless() call. 908 */ 909 910 /* Return all but the first 'n' matched characters back to the input stream. */ 911 987 #define YY_LESS_LINENO(n) 988 989 /* Return all but the first "n" matched characters back to the input stream. */ 912 990 #define yyless(n) \ 913 991 do \ 914 992 { \ 915 993 /* Undo effects of setting up yytext. */ \ 916 *yy_cp = yy_hold_char; \ 994 int yyless_macro_arg = (n); \ 995 YY_LESS_LINENO(yyless_macro_arg);\ 996 *yy_cp = (yy_hold_char); \ 917 997 YY_RESTORE_YY_MORE_OFFSET \ 918 yy_c_buf_p = yy_cp = yy_bp + n- YY_MORE_ADJ; \998 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 919 999 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 920 1000 } \ 921 1001 while ( 0 ) 922 1002 923 #define unput(c) yyunput( c, yytext_ptr)1003 #define unput(c) yyunput( c, (yytext_ptr) ) 924 1004 925 1005 /* The following is because we cannot portably get our hands on size_t … … 927 1007 * flex-generated scanners to compile on their own). 928 1008 */ 1009 1010 #ifndef YY_TYPEDEF_YY_SIZE_T 1011 #define YY_TYPEDEF_YY_SIZE_T 929 1012 typedef unsigned int yy_size_t; 930 931 1013 #endif 1014 1015 #ifndef YY_STRUCT_YY_BUFFER_STATE 1016 #define YY_STRUCT_YY_BUFFER_STATE 932 1017 struct yy_buffer_state 933 1018 { … … 966 1051 int yy_at_bol; 967 1052 1053 int yy_bs_lineno; /**< The line count. */ 1054 int yy_bs_column; /**< The column count. */ 1055 968 1056 /* Whether to try to fill the input buffer when we reach the 969 1057 * end of it. … … 972 1060 973 1061 int yy_buffer_status; 1062 974 1063 #define YY_BUFFER_NEW 0 975 1064 #define YY_BUFFER_NORMAL 1 … … 985 1074 */ 986 1075 #define YY_BUFFER_EOF_PENDING 2 1076 987 1077 }; 988 989 static YY_BUFFER_STATE yy_current_buffer = 0; 1078 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 1079 1080 /* Stack of input buffers. */ 1081 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 1082 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 1083 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 990 1084 991 1085 /* We provide macros for accessing buffer states in case in the 992 1086 * future we want to put the buffer states in a more general 993 1087 * "scanner state". 994 */ 995 #define YY_CURRENT_BUFFER yy_current_buffer 996 1088 * 1089 * Returns the top of the stack, or NULL. 1090 */ 1091 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 1092 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 1093 : NULL) 1094 1095 /* Same as previous macro, but useful when we know that the buffer stack is not 1096 * NULL or when we need an lvalue. For internal use only. 1097 */ 1098 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 997 1099 998 1100 /* yy_hold_char holds the character lost when yytext is formed. */ 999 1101 static char yy_hold_char; 1000 1001 1102 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 1002 1003 1004 1103 int yyleng; 1005 1104 1006 1105 /* Points to current character in buffer. */ 1007 1106 static char *yy_c_buf_p = (char *) 0; 1008 static int yy_init = 1; /* whether we need to initialize */1107 static int yy_init = 0; /* whether we need to initialize */ 1009 1108 static int yy_start = 0; /* start state number */ 1010 1109 … … 1014 1113 static int yy_did_buffer_switch_on_eof; 1015 1114 1016 void yyrestart YY_PROTO(( FILE *input_file )); 1017 1018 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 1019 void yy_load_buffer_state YY_PROTO(( void )); 1020 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 1021 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 1022 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 1023 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 1024 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 1025 1026 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 1027 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 1028 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 1029 1030 static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 1031 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 1032 static void yy_flex_free YY_PROTO(( void * )); 1115 void yyrestart (FILE *input_file ); 1116 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 1117 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 1118 void yy_delete_buffer (YY_BUFFER_STATE b ); 1119 void yy_flush_buffer (YY_BUFFER_STATE b ); 1120 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 1121 void yypop_buffer_state (void ); 1122 1123 static void yyensure_buffer_stack (void ); 1124 static void yy_load_buffer_state (void ); 1125 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 1126 1127 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 1128 1129 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 1130 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 1131 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); 1132 1133 void *yyalloc (yy_size_t ); 1134 void *yyrealloc (void *,yy_size_t ); 1135 void yyfree (void * ); 1033 1136 1034 1137 #define yy_new_buffer yy_create_buffer … … 1036 1139 #define yy_set_interactive(is_interactive) \ 1037 1140 { \ 1038 if ( ! yy_current_buffer ) \ 1039 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 1040 yy_current_buffer->yy_is_interactive = is_interactive; \ 1141 if ( ! YY_CURRENT_BUFFER ){ \ 1142 yyensure_buffer_stack (); \ 1143 YY_CURRENT_BUFFER_LVALUE = \ 1144 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 1145 } \ 1146 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 1041 1147 } 1042 1148 1043 1149 #define yy_set_bol(at_bol) \ 1044 1150 { \ 1045 if ( ! yy_current_buffer ) \ 1046 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 1047 yy_current_buffer->yy_at_bol = at_bol; \ 1151 if ( ! YY_CURRENT_BUFFER ){\ 1152 yyensure_buffer_stack (); \ 1153 YY_CURRENT_BUFFER_LVALUE = \ 1154 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 1155 } \ 1156 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 1048 1157 } 1049 1158 1050 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 1159 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 1160 1161 /* Begin user sect3 */ 1051 1162 1052 1163 typedef unsigned char YY_CHAR; 1164 1053 1165 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 1166 1054 1167 typedef int yy_state_type; 1168 1169 extern int yylineno; 1170 1171 int yylineno = 1; 1172 1055 1173 extern char *yytext; 1056 1174 #define yytext_ptr yytext 1057 1175 1058 static yy_state_type yy_get_previous_state YY_PROTO(( void ));1059 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));1060 static int yy_get_next_buffer YY_PROTO(( void ));1061 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));1176 static yy_state_type yy_get_previous_state (void ); 1177 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 1178 static int yy_get_next_buffer (void ); 1179 static void yy_fatal_error (yyconst char msg[] ); 1062 1180 1063 1181 /* Done after the current pattern has been matched and before the … … 1065 1183 */ 1066 1184 #define YY_DO_BEFORE_ACTION \ 1067 yytext_ptr= yy_bp; \1068 yyleng = ( int) (yy_cp - yy_bp); \1069 yy_hold_char= *yy_cp; \1185 (yytext_ptr) = yy_bp; \ 1186 yyleng = (size_t) (yy_cp - yy_bp); \ 1187 (yy_hold_char) = *yy_cp; \ 1070 1188 *yy_cp = '\0'; \ 1071 yy_c_buf_p= yy_cp;1189 (yy_c_buf_p) = yy_cp; 1072 1190 1073 1191 #define YY_NUM_RULES 12 1074 1192 #define YY_END_OF_BUFFER 13 1075 static yyconst short int yy_accept[74] = 1193 /* This struct is not used in this scanner, 1194 but its presence is necessary. */ 1195 struct yy_trans_info 1196 { 1197 flex_int32_t yy_verify; 1198 flex_int32_t yy_nxt; 1199 }; 1200 static yyconst flex_int16_t yy_accept[74] = 1076 1201 { 0, 1077 1202 0, 0, 0, 0, 13, 12, 11, 10, 12, 9, … … 1085 1210 } ; 1086 1211 1087 static yyconst int yy_ec[256] =1212 static yyconst flex_int32_t yy_ec[256] = 1088 1213 { 0, 1089 1214 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, … … 1117 1242 } ; 1118 1243 1119 static yyconst int yy_meta[36] =1244 static yyconst flex_int32_t yy_meta[36] = 1120 1245 { 0, 1121 1246 1, 1, 2, 1, 1, 1, 1, 3, 3, 3, … … 1125 1250 } ; 1126 1251 1127 static yyconst short int yy_base[76] =1252 static yyconst flex_int16_t yy_base[76] = 1128 1253 { 0, 1129 1254 0, 0, 0, 0, 96, 97, 93, 97, 90, 97, … … 1137 1262 } ; 1138 1263 1139 static yyconst short int yy_def[76] =1264 static yyconst flex_int16_t yy_def[76] = 1140 1265 { 0, 1141 1266 73, 1, 1, 1, 73, 73, 73, 73, 74, 73, … … 1149 1274 } ; 1150 1275 1151 static yyconst short int yy_nxt[133] =1276 static yyconst flex_int16_t yy_nxt[133] = 1152 1277 { 0, 1153 1278 6, 7, 8, 9, 10, 10, 10, 6, 11, 12, … … 1168 1293 } ; 1169 1294 1170 static yyconst short int yy_chk[133] =1295 static yyconst flex_int16_t yy_chk[133] = 1171 1296 { 0, 1172 1297 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … … 1190 1315 static char *yy_last_accepting_cpos; 1191 1316 1317 extern int yy_flex_debug; 1318 int yy_flex_debug = 0; 1319 1192 1320 /* The intent behind this definition is that it'll catch 1193 1321 * any uses of REJECT which flex missed. … … 1199 1327 char *yytext; 1200 1328 #line 1 "convert.lex" 1201 #define INITIAL 01202 1329 /******************************************************************************/ 1203 1330 /* */ … … 1234 1361 /* version 1.7 */ 1235 1362 /******************************************************************************/ 1236 #define character 11237 1363 1238 1364 #line 37 "convert.lex" … … 1244 1370 #define MAX_INCLUDE_DEPTH 30 1245 1371 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; 1246 #line 460 "convert.yy.c" 1372 #line 549 "convert.yy.c" 1373 1374 #define INITIAL 0 1375 #define character 1 1376 1377 #ifndef YY_NO_UNISTD_H 1378 /* Special case for "unistd.h", since it is non-ANSI. We include it way 1379 * down here because we want the user's section 1 to have been scanned first. 1380 * The user has a chance to override it with an option. 1381 */ 1382 #include <unistd.h> 1383 #endif 1384 1385 #ifndef YY_EXTRA_TYPE 1386 #define YY_EXTRA_TYPE void * 1387 #endif 1388 1389 static int yy_init_globals (void ); 1247 1390 1248 1391 /* Macros after this point can all be overridden by user definitions in … … 1252 1395 #ifndef YY_SKIP_YYWRAP 1253 1396 #ifdef __cplusplus 1254 extern "C" int yywrap YY_PROTO(( void ));1397 extern "C" int yywrap (void ); 1255 1398 #else 1256 extern int yywrap YY_PROTO(( void )); 1257 #endif 1258 #endif 1259 1260 #ifndef YY_NO_UNPUT 1261 static void yyunput YY_PROTO(( int c, char *buf_ptr )); 1262 #endif 1263 1399 extern int yywrap (void ); 1400 #endif 1401 #endif 1402 1403 static void yyunput (int c,char *buf_ptr ); 1404 1264 1405 #ifndef yytext_ptr 1265 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));1406 static void yy_flex_strncpy (char *,yyconst char *,int ); 1266 1407 #endif 1267 1408 1268 1409 #ifdef YY_NEED_STRLEN 1269 static int yy_flex_strlen YY_PROTO(( yyconst char * ));1410 static int yy_flex_strlen (yyconst char * ); 1270 1411 #endif 1271 1412 1272 1413 #ifndef YY_NO_INPUT 1414 1273 1415 #ifdef __cplusplus 1274 static int yyinput YY_PROTO(( void ));1416 static int yyinput (void ); 1275 1417 #else 1276 static int input YY_PROTO(( void )); 1277 #endif 1278 #endif 1279 1280 #if YY_STACK_USED 1281 static int yy_start_stack_ptr = 0; 1282 static int yy_start_stack_depth = 0; 1283 static int *yy_start_stack = 0; 1284 #ifndef YY_NO_PUSH_STATE 1285 static void yy_push_state YY_PROTO(( int new_state )); 1286 #endif 1287 #ifndef YY_NO_POP_STATE 1288 static void yy_pop_state YY_PROTO(( void )); 1289 #endif 1290 #ifndef YY_NO_TOP_STATE 1291 static int yy_top_state YY_PROTO(( void )); 1292 #endif 1293 1294 #else 1295 #define YY_NO_PUSH_STATE 1 1296 #define YY_NO_POP_STATE 1 1297 #define YY_NO_TOP_STATE 1 1298 #endif 1299 1300 #ifdef YY_MALLOC_DECL 1301 YY_MALLOC_DECL 1302 #else 1303 #if __STDC__ 1304 #ifndef __cplusplus 1305 #include <stdlib.h> 1306 #endif 1307 #else 1308 /* Just try to get by without declaring the routines. This will fail 1309 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 1310 * or sizeof(void*) != sizeof(int). 1311 */ 1312 #endif 1418 static int input (void ); 1419 #endif 1420 1313 1421 #endif 1314 1422 … … 1319 1427 1320 1428 /* Copy whatever the last rule matched to the standard output. */ 1321 1322 1429 #ifndef ECHO 1323 1430 /* This used to be an fputs(), but since the string might contain NUL's, … … 1332 1439 #ifndef YY_INPUT 1333 1440 #define YY_INPUT(buf,result,max_size) \ 1334 if ( yy_current_buffer->yy_is_interactive ) \1441 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 1335 1442 { \ 1336 int c = '*', n; \ 1443 int c = '*'; \ 1444 size_t n; \ 1337 1445 for ( n = 0; n < max_size && \ 1338 1446 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ … … 1344 1452 result = n; \ 1345 1453 } \ 1346 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 1347 && ferror( yyin ) ) \ 1348 YY_FATAL_ERROR( "input in flex scanner failed" ); 1454 else \ 1455 { \ 1456 errno=0; \ 1457 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 1458 { \ 1459 if( errno != EINTR) \ 1460 { \ 1461 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 1462 break; \ 1463 } \ 1464 errno=0; \ 1465 clearerr(yyin); \ 1466 } \ 1467 }\ 1468 \ 1469 1349 1470 #endif 1350 1471 … … 1367 1488 #endif 1368 1489 1490 /* end tables serialization structures and prototypes */ 1491 1369 1492 /* Default declaration of generated scanner - a define so the user can 1370 1493 * easily add parameters. 1371 1494 */ 1372 1495 #ifndef YY_DECL 1373 #define YY_DECL int yylex YY_PROTO(( void )) 1374 #endif 1496 #define YY_DECL_IS_OURS 1 1497 1498 extern int yylex (void); 1499 1500 #define YY_DECL int yylex (void) 1501 #endif /* !YY_DECL */ 1375 1502 1376 1503 /* Code executed at the beginning of each rule, after yytext and yyleng … … 1389 1516 YY_USER_ACTION 1390 1517 1518 /** The main scanner function which does all the work. 1519 */ 1391 1520 YY_DECL 1392 1521 { 1393 1522 register yy_state_type yy_current_state; 1394 1523 register char *yy_cp, *yy_bp; 1395 1524 register int yy_act; 1396 1525 1397 1526 #line 55 "convert.lex" 1398 1527 1399 #line 613"convert.yy.c"1400 1401 if ( yy_init)1528 #line 705 "convert.yy.c" 1529 1530 if ( !(yy_init) ) 1402 1531 { 1403 yy_init = 0;1532 (yy_init) = 1; 1404 1533 1405 1534 #ifdef YY_USER_INIT … … 1407 1536 #endif 1408 1537 1409 if ( ! yy_start)1410 yy_start= 1; /* first start state */1538 if ( ! (yy_start) ) 1539 (yy_start) = 1; /* first start state */ 1411 1540 1412 1541 if ( ! yyin ) … … 1416 1545 yyout = stdout; 1417 1546 1418 if ( ! yy_current_buffer ) 1419 yy_current_buffer = 1420 yy_create_buffer( yyin, YY_BUF_SIZE ); 1421 1422 yy_load_buffer_state(); 1547 if ( ! YY_CURRENT_BUFFER ) { 1548 yyensure_buffer_stack (); 1549 YY_CURRENT_BUFFER_LVALUE = 1550 yy_create_buffer(yyin,YY_BUF_SIZE ); 1551 } 1552 1553 yy_load_buffer_state( ); 1423 1554 } 1424 1555 1425 1556 while ( 1 ) /* loops until end-of-file is reached */ 1426 1557 { 1427 yy_cp = yy_c_buf_p;1558 yy_cp = (yy_c_buf_p); 1428 1559 1429 1560 /* Support of yytext. */ 1430 *yy_cp = yy_hold_char;1561 *yy_cp = (yy_hold_char); 1431 1562 1432 1563 /* yy_bp points to the position in yy_ch_buf of the start of … … 1435 1566 yy_bp = yy_cp; 1436 1567 1437 yy_current_state = yy_start;1568 yy_current_state = (yy_start); 1438 1569 yy_match: 1439 1570 do … … 1442 1573 if ( yy_accept[yy_current_state] ) 1443 1574 { 1444 yy_last_accepting_state= yy_current_state;1445 yy_last_accepting_cpos= yy_cp;1575 (yy_last_accepting_state) = yy_current_state; 1576 (yy_last_accepting_cpos) = yy_cp; 1446 1577 } 1447 1578 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) … … 1460 1591 if ( yy_act == 0 ) 1461 1592 { /* have to back up */ 1462 yy_cp = yy_last_accepting_cpos;1463 yy_current_state = yy_last_accepting_state;1593 yy_cp = (yy_last_accepting_cpos); 1594 yy_current_state = (yy_last_accepting_state); 1464 1595 yy_act = yy_accept[yy_current_state]; 1465 1596 } … … 1467 1598 YY_DO_BEFORE_ACTION; 1468 1599 1469 1470 1600 do_action: /* This label is used only to access EOF actions. */ 1471 1472 1601 1473 1602 switch ( yy_act ) … … 1475 1604 case 0: /* must back up */ 1476 1605 /* undo the effects of YY_DO_BEFORE_ACTION */ 1477 *yy_cp = yy_hold_char;1478 yy_cp = yy_last_accepting_cpos;1479 yy_current_state = yy_last_accepting_state;1606 *yy_cp = (yy_hold_char); 1607 yy_cp = (yy_last_accepting_cpos); 1608 yy_current_state = (yy_last_accepting_state); 1480 1609 goto yy_find_action; 1481 1610 … … 1527 1656 YY_BREAK 1528 1657 case 10: 1658 /* rule 10 can match eol */ 1529 1659 YY_RULE_SETUP 1530 1660 #line 66 "convert.lex" … … 1541 1671 ECHO; 1542 1672 YY_BREAK 1543 #line 757"convert.yy.c"1673 #line 850 "convert.yy.c" 1544 1674 case YY_STATE_EOF(INITIAL): 1545 1675 case YY_STATE_EOF(character): … … 1549 1679 { 1550 1680 /* Amount of text matched not including the EOB char. */ 1551 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;1681 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 1552 1682 1553 1683 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1554 *yy_cp = yy_hold_char;1684 *yy_cp = (yy_hold_char); 1555 1685 YY_RESTORE_YY_MORE_OFFSET 1556 1686 1557 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )1687 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 1558 1688 { 1559 1689 /* We're scanning a new file or input source. It's … … 1561 1691 * just pointed yyin at a new source and called 1562 1692 * yylex(). If so, then we have to assure 1563 * consistency between yy_current_bufferand our1693 * consistency between YY_CURRENT_BUFFER and our 1564 1694 * globals. Here is the right place to do so, because 1565 1695 * this is the first action (other than possibly a 1566 1696 * back-up) that will match for the new input source. 1567 1697 */ 1568 yy_n_chars = yy_current_buffer->yy_n_chars;1569 yy_current_buffer->yy_input_file = yyin;1570 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;1698 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1699 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 1700 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 1571 1701 } 1572 1702 … … 1578 1708 * in input(). 1579 1709 */ 1580 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )1710 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1581 1711 { /* This was really a NUL. */ 1582 1712 yy_state_type yy_next_state; 1583 1713 1584 yy_c_buf_p = yytext_ptr+ yy_amount_of_matched_text;1585 1586 yy_current_state = yy_get_previous_state( );1714 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 1715 1716 yy_current_state = yy_get_previous_state( ); 1587 1717 1588 1718 /* Okay, we're now positioned to make the NUL … … 1597 1727 yy_next_state = yy_try_NUL_trans( yy_current_state ); 1598 1728 1599 yy_bp = yytext_ptr+ YY_MORE_ADJ;1729 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1600 1730 1601 1731 if ( yy_next_state ) 1602 1732 { 1603 1733 /* Consume the NUL. */ 1604 yy_cp = ++ yy_c_buf_p;1734 yy_cp = ++(yy_c_buf_p); 1605 1735 yy_current_state = yy_next_state; 1606 1736 goto yy_match; … … 1609 1739 else 1610 1740 { 1611 yy_cp = yy_c_buf_p;1741 yy_cp = (yy_c_buf_p); 1612 1742 goto yy_find_action; 1613 1743 } 1614 1744 } 1615 1745 1616 else switch ( yy_get_next_buffer( ) )1746 else switch ( yy_get_next_buffer( ) ) 1617 1747 { 1618 1748 case EOB_ACT_END_OF_FILE: 1619 1749 { 1620 yy_did_buffer_switch_on_eof= 0;1621 1622 if ( yywrap( ) )1750 (yy_did_buffer_switch_on_eof) = 0; 1751 1752 if ( yywrap( ) ) 1623 1753 { 1624 1754 /* Note: because we've taken care in … … 1631 1761 * YY_NULL will get returned. 1632 1762 */ 1633 yy_c_buf_p = yytext_ptr+ YY_MORE_ADJ;1763 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 1634 1764 1635 1765 yy_act = YY_STATE_EOF(YY_START); … … 1639 1769 else 1640 1770 { 1641 if ( ! yy_did_buffer_switch_on_eof)1771 if ( ! (yy_did_buffer_switch_on_eof) ) 1642 1772 YY_NEW_FILE; 1643 1773 } … … 1646 1776 1647 1777 case EOB_ACT_CONTINUE_SCAN: 1648 yy_c_buf_p=1649 yytext_ptr+ yy_amount_of_matched_text;1650 1651 yy_current_state = yy_get_previous_state( );1652 1653 yy_cp = yy_c_buf_p;1654 yy_bp = yytext_ptr+ YY_MORE_ADJ;1778 (yy_c_buf_p) = 1779 (yytext_ptr) + yy_amount_of_matched_text; 1780 1781 yy_current_state = yy_get_previous_state( ); 1782 1783 yy_cp = (yy_c_buf_p); 1784 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1655 1785 goto yy_match; 1656 1786 1657 1787 case EOB_ACT_LAST_MATCH: 1658 yy_c_buf_p=1659 & yy_current_buffer->yy_ch_buf[yy_n_chars];1660 1661 yy_current_state = yy_get_previous_state( );1662 1663 yy_cp = yy_c_buf_p;1664 yy_bp = yytext_ptr+ YY_MORE_ADJ;1788 (yy_c_buf_p) = 1789 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 1790 1791 yy_current_state = yy_get_previous_state( ); 1792 1793 yy_cp = (yy_c_buf_p); 1794 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1665 1795 goto yy_find_action; 1666 1796 } … … 1673 1803 } /* end of action switch */ 1674 1804 } /* end of scanning one token */ 1675 } /* end of yylex */ 1676 1805 } /* end of yylex */ 1677 1806 1678 1807 /* yy_get_next_buffer - try to read in a new buffer … … 1683 1812 * EOB_ACT_END_OF_FILE - end of file 1684 1813 */ 1685 1686 static int yy_get_next_buffer() 1687 { 1688 register char *dest = yy_current_buffer->yy_ch_buf; 1689 register char *source = yytext_ptr; 1814 static int yy_get_next_buffer (void) 1815 { 1816 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1817 register char *source = (yytext_ptr); 1690 1818 register int number_to_move, i; 1691 1819 int ret_val; 1692 1820 1693 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars+ 1] )1821 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 1694 1822 YY_FATAL_ERROR( 1695 1823 "fatal flex scanner internal error--end of buffer missed" ); 1696 1824 1697 if ( yy_current_buffer->yy_fill_buffer == 0 )1825 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 1698 1826 { /* Don't try to fill the buffer, so this is an EOF. */ 1699 if ( yy_c_buf_p - yytext_ptr- YY_MORE_ADJ == 1 )1827 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 1700 1828 { 1701 1829 /* We matched a single character, the EOB, so … … 1717 1845 1718 1846 /* First move last chars to start of buffer. */ 1719 number_to_move = (int) ( yy_c_buf_p - yytext_ptr) - 1;1847 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 1720 1848 1721 1849 for ( i = 0; i < number_to_move; ++i ) 1722 1850 *(dest++) = *(source++); 1723 1851 1724 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )1852 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1725 1853 /* don't do the read, it's not guaranteed to return an EOF, 1726 1854 * just force an EOF 1727 1855 */ 1728 yy_current_buffer->yy_n_chars = yy_n_chars= 0;1856 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1729 1857 1730 1858 else 1731 1859 { 1732 int num_to_read =1733 yy_current_buffer->yy_buf_size - number_to_move - 1;1860 int num_to_read = 1861 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1734 1862 1735 1863 while ( num_to_read <= 0 ) 1736 1864 { /* Not enough room in the buffer - grow it. */ 1737 #ifdef YY_USES_REJECT1738 YY_FATAL_ERROR(1739 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );1740 #else1741 1865 1742 1866 /* just a shorter name for the current buffer */ 1743 YY_BUFFER_STATE b = yy_current_buffer;1867 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 1744 1868 1745 1869 int yy_c_buf_p_offset = 1746 (int) ( yy_c_buf_p- b->yy_ch_buf);1870 (int) ((yy_c_buf_p) - b->yy_ch_buf); 1747 1871 1748 1872 if ( b->yy_is_our_buffer ) … … 1757 1881 b->yy_ch_buf = (char *) 1758 1882 /* Include room in for 2 EOB chars. */ 1759 yy_flex_realloc( (void *) b->yy_ch_buf, 1760 b->yy_buf_size + 2 ); 1883 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1761 1884 } 1762 1885 else … … 1768 1891 "fatal error - scanner input buffer overflow" ); 1769 1892 1770 yy_c_buf_p= &b->yy_ch_buf[yy_c_buf_p_offset];1771 1772 num_to_read = yy_current_buffer->yy_buf_size -1893 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1894 1895 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1773 1896 number_to_move - 1; 1774 #endif 1897 1775 1898 } 1776 1899 … … 1779 1902 1780 1903 /* Read in more data. */ 1781 YY_INPUT( (& yy_current_buffer->yy_ch_buf[number_to_move]),1782 yy_n_chars, num_to_read );1783 1784 yy_current_buffer->yy_n_chars = yy_n_chars;1904 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1905 (yy_n_chars), num_to_read ); 1906 1907 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1785 1908 } 1786 1909 1787 if ( yy_n_chars== 0 )1910 if ( (yy_n_chars) == 0 ) 1788 1911 { 1789 1912 if ( number_to_move == YY_MORE_ADJ ) 1790 1913 { 1791 1914 ret_val = EOB_ACT_END_OF_FILE; 1792 yyrestart( yyin);1915 yyrestart(yyin ); 1793 1916 } 1794 1917 … … 1796 1919 { 1797 1920 ret_val = EOB_ACT_LAST_MATCH; 1798 yy_current_buffer->yy_buffer_status =1921 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1799 1922 YY_BUFFER_EOF_PENDING; 1800 1923 } … … 1804 1927 ret_val = EOB_ACT_CONTINUE_SCAN; 1805 1928 1806 yy_n_chars+= number_to_move;1807 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;1808 yy_current_buffer->yy_ch_buf[yy_n_chars+ 1] = YY_END_OF_BUFFER_CHAR;1809 1810 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];1929 (yy_n_chars) += number_to_move; 1930 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1931 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1932 1933 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1811 1934 1812 1935 return ret_val; 1813 } 1814 1936 } 1815 1937 1816 1938 /* yy_get_previous_state - get the state just before the EOB char was reached */ 1817 1939 1818 static yy_state_type yy_get_previous_state()1819 1940 static yy_state_type yy_get_previous_state (void) 1941 { 1820 1942 register yy_state_type yy_current_state; 1821 1943 register char *yy_cp; 1822 1823 yy_current_state = yy_start;1824 1825 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )1944 1945 yy_current_state = (yy_start); 1946 1947 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1826 1948 { 1827 1949 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1828 1950 if ( yy_accept[yy_current_state] ) 1829 1951 { 1830 yy_last_accepting_state= yy_current_state;1831 yy_last_accepting_cpos= yy_cp;1952 (yy_last_accepting_state) = yy_current_state; 1953 (yy_last_accepting_cpos) = yy_cp; 1832 1954 } 1833 1955 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) … … 1841 1963 1842 1964 return yy_current_state; 1843 } 1844 1965 } 1845 1966 1846 1967 /* yy_try_NUL_trans - try to make a transition on the NUL character … … 1849 1970 * next_state = yy_try_NUL_trans( current_state ); 1850 1971 */ 1851 1852 #ifdef YY_USE_PROTOS 1853 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 1854 #else 1855 static yy_state_type yy_try_NUL_trans( yy_current_state ) 1856 yy_state_type yy_current_state; 1857 #endif 1858 { 1972 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1973 { 1859 1974 register int yy_is_jam; 1860 register char *yy_cp = yy_c_buf_p;1975 register char *yy_cp = (yy_c_buf_p); 1861 1976 1862 1977 register YY_CHAR yy_c = 1; 1863 1978 if ( yy_accept[yy_current_state] ) 1864 1979 { 1865 yy_last_accepting_state= yy_current_state;1866 yy_last_accepting_cpos= yy_cp;1980 (yy_last_accepting_state) = yy_current_state; 1981 (yy_last_accepting_cpos) = yy_cp; 1867 1982 } 1868 1983 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) … … 1876 1991 1877 1992 return yy_is_jam ? 0 : yy_current_state; 1878 } 1879 1880 1881 #ifndef YY_NO_UNPUT 1882 #ifdef YY_USE_PROTOS 1883 static void yyunput( int c, register char *yy_bp ) 1884 #else 1885 static void yyunput( c, yy_bp ) 1886 int c; 1887 register char *yy_bp; 1888 #endif 1889 { 1890 register char *yy_cp = yy_c_buf_p; 1993 } 1994 1995 static void yyunput (int c, register char * yy_bp ) 1996 { 1997 register char *yy_cp; 1998 1999 yy_cp = (yy_c_buf_p); 1891 2000 1892 2001 /* undo effects of setting up yytext */ 1893 *yy_cp = yy_hold_char;1894 1895 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )2002 *yy_cp = (yy_hold_char); 2003 2004 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1896 2005 { /* need to shift things up to make room */ 1897 2006 /* +2 for EOB chars. */ 1898 register int number_to_move = yy_n_chars+ 2;1899 register char *dest = & yy_current_buffer->yy_ch_buf[1900 yy_current_buffer->yy_buf_size + 2];2007 register int number_to_move = (yy_n_chars) + 2; 2008 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 2009 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 1901 2010 register char *source = 1902 & yy_current_buffer->yy_ch_buf[number_to_move];1903 1904 while ( source > yy_current_buffer->yy_ch_buf )2011 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 2012 2013 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1905 2014 *--dest = *--source; 1906 2015 1907 2016 yy_cp += (int) (dest - source); 1908 2017 yy_bp += (int) (dest - source); 1909 yy_current_buffer->yy_n_chars =1910 yy_n_chars = yy_current_buffer->yy_buf_size;1911 1912 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )2018 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 2019 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 2020 2021 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1913 2022 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1914 2023 } … … 1916 2025 *--yy_cp = (char) c; 1917 2026 1918 1919 yytext_ptr = yy_bp; 1920 yy_hold_char = *yy_cp; 1921 yy_c_buf_p = yy_cp; 1922 } 1923 #endif /* ifndef YY_NO_UNPUT */ 1924 1925 2027 (yytext_ptr) = yy_bp; 2028 (yy_hold_char) = *yy_cp; 2029 (yy_c_buf_p) = yy_cp; 2030 } 2031 2032 #ifndef YY_NO_INPUT 1926 2033 #ifdef __cplusplus 1927 static int yyinput()2034 static int yyinput (void) 1928 2035 #else 1929 static int input() 1930 #endif 1931 { 2036 static int input (void) 2037 #endif 2038 2039 { 1932 2040 int c; 1933 1934 * yy_c_buf_p = yy_hold_char;1935 1936 if ( * yy_c_buf_p== YY_END_OF_BUFFER_CHAR )2041 2042 *(yy_c_buf_p) = (yy_hold_char); 2043 2044 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 1937 2045 { 1938 2046 /* yy_c_buf_p now points to the character we want to return. … … 1940 2048 * valid NUL; if not, then we've hit the end of the buffer. 1941 2049 */ 1942 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )2050 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1943 2051 /* This was really a NUL. */ 1944 * yy_c_buf_p= '\0';2052 *(yy_c_buf_p) = '\0'; 1945 2053 1946 2054 else 1947 2055 { /* need more input */ 1948 int offset = yy_c_buf_p - yytext_ptr;1949 ++ yy_c_buf_p;1950 1951 switch ( yy_get_next_buffer( ) )2056 int offset = (yy_c_buf_p) - (yytext_ptr); 2057 ++(yy_c_buf_p); 2058 2059 switch ( yy_get_next_buffer( ) ) 1952 2060 { 1953 2061 case EOB_ACT_LAST_MATCH: … … 1963 2071 1964 2072 /* Reset buffer status. */ 1965 yyrestart( 1966 1967 /* fall through*/2073 yyrestart(yyin ); 2074 2075 /*FALLTHROUGH*/ 1968 2076 1969 2077 case EOB_ACT_END_OF_FILE: 1970 2078 { 1971 if ( yywrap( ) )1972 return EOF;1973 1974 if ( ! yy_did_buffer_switch_on_eof)2079 if ( yywrap( ) ) 2080 return 0; 2081 2082 if ( ! (yy_did_buffer_switch_on_eof) ) 1975 2083 YY_NEW_FILE; 1976 2084 #ifdef __cplusplus … … 1982 2090 1983 2091 case EOB_ACT_CONTINUE_SCAN: 1984 yy_c_buf_p = yytext_ptr+ offset;2092 (yy_c_buf_p) = (yytext_ptr) + offset; 1985 2093 break; 1986 2094 } … … 1988 2096 } 1989 2097 1990 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1991 *yy_c_buf_p = '\0'; /* preserve yytext */ 1992 yy_hold_char = *++yy_c_buf_p; 1993 2098 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 2099 *(yy_c_buf_p) = '\0'; /* preserve yytext */ 2100 (yy_hold_char) = *++(yy_c_buf_p); 1994 2101 1995 2102 return c; 2103 } 2104 #endif /* ifndef YY_NO_INPUT */ 2105 2106 /** Immediately switch to a different input stream. 2107 * @param input_file A readable stream. 2108 * 2109 * @note This function does not reset the start condition to @c INITIAL . 2110 */ 2111 void yyrestart (FILE * input_file ) 2112 { 2113 2114 if ( ! YY_CURRENT_BUFFER ){ 2115 yyensure_buffer_stack (); 2116 YY_CURRENT_BUFFER_LVALUE = 2117 yy_create_buffer(yyin,YY_BUF_SIZE ); 1996 2118 } 1997 2119 1998 1999 #ifdef YY_USE_PROTOS 2000 void yyrestart( FILE *input_file ) 2001 #else 2002 void yyrestart( input_file ) 2003 FILE *input_file; 2004 #endif 2005 { 2006 if ( ! yy_current_buffer ) 2007 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 2008 2009 yy_init_buffer( yy_current_buffer, input_file ); 2010 yy_load_buffer_state(); 2011 } 2012 2013 2014 #ifdef YY_USE_PROTOS 2015 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 2016 #else 2017 void yy_switch_to_buffer( new_buffer ) 2018 YY_BUFFER_STATE new_buffer; 2019 #endif 2020 { 2021 if ( yy_current_buffer == new_buffer ) 2120 yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 2121 yy_load_buffer_state( ); 2122 } 2123 2124 /** Switch to a different input buffer. 2125 * @param new_buffer The new input buffer. 2126 * 2127 */ 2128 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 2129 { 2130 2131 /* TODO. We should be able to replace this entire function body 2132 * with 2133 * yypop_buffer_state(); 2134 * yypush_buffer_state(new_buffer); 2135 */ 2136 yyensure_buffer_stack (); 2137 if ( YY_CURRENT_BUFFER == new_buffer ) 2022 2138 return; 2023 2139 2024 if ( yy_current_buffer)2140 if ( YY_CURRENT_BUFFER ) 2025 2141 { 2026 2142 /* Flush out information for old buffer. */ 2027 * yy_c_buf_p = yy_hold_char;2028 yy_current_buffer->yy_buf_pos = yy_c_buf_p;2029 yy_current_buffer->yy_n_chars = yy_n_chars;2143 *(yy_c_buf_p) = (yy_hold_char); 2144 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 2145 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 2030 2146 } 2031 2147 2032 yy_current_buffer= new_buffer;2033 yy_load_buffer_state( );2148 YY_CURRENT_BUFFER_LVALUE = new_buffer; 2149 yy_load_buffer_state( ); 2034 2150 2035 2151 /* We don't actually know whether we did this switch during … … 2038 2154 * to go ahead and always set it. 2039 2155 */ 2040 yy_did_buffer_switch_on_eof = 1; 2041 } 2042 2043 2044 #ifdef YY_USE_PROTOS 2045 void yy_load_buffer_state( void ) 2046 #else 2047 void yy_load_buffer_state() 2048 #endif 2049 { 2050 yy_n_chars = yy_current_buffer->yy_n_chars; 2051 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 2052 yyin = yy_current_buffer->yy_input_file; 2053 yy_hold_char = *yy_c_buf_p; 2054 } 2055 2056 2057 #ifdef YY_USE_PROTOS 2058 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 2059 #else 2060 YY_BUFFER_STATE yy_create_buffer( file, size ) 2061 FILE *file; 2062 int size; 2063 #endif 2064 { 2156 (yy_did_buffer_switch_on_eof) = 1; 2157 } 2158 2159 static void yy_load_buffer_state (void) 2160 { 2161 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 2162 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 2163 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 2164 (yy_hold_char) = *(yy_c_buf_p); 2165 } 2166 2167 /** Allocate and initialize an input buffer state. 2168 * @param file A readable stream. 2169 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 2170 * 2171 * @return the allocated buffer state. 2172 */ 2173 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 2174 { 2065 2175 YY_BUFFER_STATE b; 2066 2067 b = (YY_BUFFER_STATE) yy _flex_alloc( sizeof( struct yy_buffer_state ));2176 2177 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 2068 2178 if ( ! b ) 2069 2179 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); … … 2074 2184 * we need to put in 2 end-of-buffer characters. 2075 2185 */ 2076 b->yy_ch_buf = (char *) yy _flex_alloc( b->yy_buf_size + 2);2186 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); 2077 2187 if ( ! b->yy_ch_buf ) 2078 2188 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); … … 2080 2190 b->yy_is_our_buffer = 1; 2081 2191 2082 yy_init_buffer( b,file );2192 yy_init_buffer(b,file ); 2083 2193 2084 2194 return b; 2085 } 2086 2087 2088 #ifdef YY_USE_PROTOS 2089 void yy_delete_buffer( YY_BUFFER_STATE b ) 2090 #else 2091 void yy_delete_buffer( b ) 2092 YY_BUFFER_STATE b; 2093 #endif 2094 { 2195 } 2196 2197 /** Destroy the buffer. 2198 * @param b a buffer created with yy_create_buffer() 2199 * 2200 */ 2201 void yy_delete_buffer (YY_BUFFER_STATE b ) 2202 { 2203 2095 2204 if ( ! b ) 2096 2205 return; 2097 2206 2098 if ( b == yy_current_buffer )2099 yy_current_buffer= (YY_BUFFER_STATE) 0;2207 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 2208 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 2100 2209 2101 2210 if ( b->yy_is_our_buffer ) 2102 yy_flex_free( (void *) b->yy_ch_buf ); 2103 2104 yy_flex_free( (void *) b ); 2105 } 2106 2107 2108 #ifndef YY_ALWAYS_INTERACTIVE 2109 #ifndef YY_NEVER_INTERACTIVE 2110 extern int isatty YY_PROTO(( int )); 2111 #endif 2112 #endif 2113 2114 #ifdef YY_USE_PROTOS 2115 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 2116 #else 2117 void yy_init_buffer( b, file ) 2118 YY_BUFFER_STATE b; 2119 FILE *file; 2120 #endif 2121 2122 2123 { 2124 yy_flush_buffer( b ); 2211 yyfree((void *) b->yy_ch_buf ); 2212 2213 yyfree((void *) b ); 2214 } 2215 2216 #ifndef __cplusplus 2217 extern int isatty (int ); 2218 #endif /* __cplusplus */ 2219 2220 /* Initializes or reinitializes a buffer. 2221 * This function is sometimes called more than once on the same buffer, 2222 * such as during a yyrestart() or at EOF. 2223 */ 2224 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 2225 2226 { 2227 int oerrno = errno; 2228 2229 yy_flush_buffer(b ); 2125 2230 2126 2231 b->yy_input_file = file; 2127 2232 b->yy_fill_buffer = 1; 2128 2233 2129 #if YY_ALWAYS_INTERACTIVE 2130 b->yy_is_interactive = 1; 2131 #else 2132 #if YY_NEVER_INTERACTIVE 2133 b->yy_is_interactive = 0; 2134 #else 2135 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) :0;2136 #endif 2137 #endif 2138 } 2139 2140 2141 #ifdef YY_USE_PROTOS 2142 void yy_flush_buffer( YY_BUFFER_STATE b ) 2143 #else 2144 void yy_flush_buffer( b ) 2145 YY_BUFFER_STATE b; 2146 #endif 2147 2148 2149 if ( ! b )2234 /* If b is the current buffer, then yy_init_buffer was _probably_ 2235 * called from yyrestart() or through yy_get_next_buffer. 2236 * In that case, we don't want to reset the lineno or column. 2237 */ 2238 if (b != YY_CURRENT_BUFFER){ 2239 b->yy_bs_lineno = 1; 2240 b->yy_bs_column = 0; 2241 } 2242 2243 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 2244 2245 errno = oerrno; 2246 } 2247 2248 /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 2249 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 2250 * 2251 */ 2252 void yy_flush_buffer (YY_BUFFER_STATE b ) 2253 { 2254 if ( ! b ) 2150 2255 return; 2151 2256 … … 2164 2269 b->yy_buffer_status = YY_BUFFER_NEW; 2165 2270 2166 if ( b == yy_current_buffer ) 2167 yy_load_buffer_state(); 2271 if ( b == YY_CURRENT_BUFFER ) 2272 yy_load_buffer_state( ); 2273 } 2274 2275 /** Pushes the new state onto the stack. The new state becomes 2276 * the current state. This function will allocate the stack 2277 * if necessary. 2278 * @param new_buffer The new state. 2279 * 2280 */ 2281 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 2282 { 2283 if (new_buffer == NULL) 2284 return; 2285 2286 yyensure_buffer_stack(); 2287 2288 /* This block is copied from yy_switch_to_buffer. */ 2289 if ( YY_CURRENT_BUFFER ) 2290 { 2291 /* Flush out information for old buffer. */ 2292 *(yy_c_buf_p) = (yy_hold_char); 2293 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 2294 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 2295 } 2296 2297 /* Only push if top exists. Otherwise, replace top. */ 2298 if (YY_CURRENT_BUFFER) 2299 (yy_buffer_stack_top)++; 2300 YY_CURRENT_BUFFER_LVALUE = new_buffer; 2301 2302 /* copied from yy_switch_to_buffer. */ 2303 yy_load_buffer_state( ); 2304 (yy_did_buffer_switch_on_eof) = 1; 2305 } 2306 2307 /** Removes and deletes the top of the stack, if present. 2308 * The next element becomes the new top. 2309 * 2310 */ 2311 void yypop_buffer_state (void) 2312 { 2313 if (!YY_CURRENT_BUFFER) 2314 return; 2315 2316 yy_delete_buffer(YY_CURRENT_BUFFER ); 2317 YY_CURRENT_BUFFER_LVALUE = NULL; 2318 if ((yy_buffer_stack_top) > 0) 2319 --(yy_buffer_stack_top); 2320 2321 if (YY_CURRENT_BUFFER) { 2322 yy_load_buffer_state( ); 2323 (yy_did_buffer_switch_on_eof) = 1; 2168 2324 } 2169 2170 2171 #ifndef YY_NO_SCAN_BUFFER 2172 #ifdef YY_USE_PROTOS 2173 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 2174 #else 2175 YY_BUFFER_STATE yy_scan_buffer( base, size ) 2176 char *base; 2177 yy_size_t size; 2178 #endif 2179 { 2325 } 2326 2327 /* Allocates the stack if it does not exist. 2328 * Guarantees space for at least one push. 2329 */ 2330 static void yyensure_buffer_stack (void) 2331 { 2332 int num_to_alloc; 2333 2334 if (!(yy_buffer_stack)) { 2335 2336 /* First allocation is just for 2 elements, since we don't know if this 2337 * scanner will even need a stack. We use 2 instead of 1 to avoid an 2338 * immediate realloc on the next call. 2339 */ 2340 num_to_alloc = 1; 2341 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 2342 (num_to_alloc * sizeof(struct yy_buffer_state*) 2343 ); 2344 2345 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 2346 2347 (yy_buffer_stack_max) = num_to_alloc; 2348 (yy_buffer_stack_top) = 0; 2349 return; 2350 } 2351 2352 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 2353 2354 /* Increase the buffer to prepare for a possible push. */ 2355 int grow_size = 8 /* arbitrary grow size */; 2356 2357 num_to_alloc = (yy_buffer_stack_max) + grow_size; 2358 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 2359 ((yy_buffer_stack), 2360 num_to_alloc * sizeof(struct yy_buffer_state*) 2361 ); 2362 2363 /* zero only the new slots.*/ 2364 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 2365 (yy_buffer_stack_max) = num_to_alloc; 2366 } 2367 } 2368 2369 /** Setup the input buffer state to scan directly from a user-specified character buffer. 2370 * @param base the character buffer 2371 * @param size the size in bytes of the character buffer 2372 * 2373 * @return the newly allocated buffer state object. 2374 */ 2375 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 2376 { 2180 2377 YY_BUFFER_STATE b; 2181 2378 2182 2379 if ( size < 2 || 2183 2380 base[size-2] != YY_END_OF_BUFFER_CHAR || … … 2186 2383 return 0; 2187 2384 2188 b = (YY_BUFFER_STATE) yy _flex_alloc( sizeof( struct yy_buffer_state ));2385 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 2189 2386 if ( ! b ) 2190 2387 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); … … 2200 2397 b->yy_buffer_status = YY_BUFFER_NEW; 2201 2398 2202 yy_switch_to_buffer( b);2399 yy_switch_to_buffer(b ); 2203 2400 2204 2401 return b; 2205 } 2206 #endif 2207 2208 2209 #ifndef YY_NO_SCAN_STRING 2210 #ifdef YY_USE_PROTOS 2211 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 2212 #else 2213 YY_BUFFER_STATE yy_scan_string( yy_str ) 2214 yyconst char *yy_str; 2215 #endif 2216 { 2217 int len; 2218 for ( len = 0; yy_str[len]; ++len ) 2219 ; 2220 2221 return yy_scan_bytes( yy_str, len ); 2222 } 2223 #endif 2224 2225 2226 #ifndef YY_NO_SCAN_BYTES 2227 #ifdef YY_USE_PROTOS 2228 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 2229 #else 2230 YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 2231 yyconst char *bytes; 2232 int len; 2233 #endif 2234 { 2402 } 2403 2404 /** Setup the input buffer state to scan a string. The next call to yylex() will 2405 * scan from a @e copy of @a str. 2406 * @param str a NUL-terminated string to scan 2407 * 2408 * @return the newly allocated buffer state object. 2409 * @note If you want to scan bytes that may contain NUL values, then use 2410 * yy_scan_bytes() instead. 2411 */ 2412 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 2413 { 2414 2415 return yy_scan_bytes(yystr,strlen(yystr) ); 2416 } 2417 2418 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will 2419 * scan from a @e copy of @a bytes. 2420 * @param bytes the byte buffer to scan 2421 * @param len the number of bytes in the buffer pointed to by @a bytes. 2422 * 2423 * @return the newly allocated buffer state object. 2424 */ 2425 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 2426 { 2235 2427 YY_BUFFER_STATE b; 2236 2428 char *buf; 2237 2429 yy_size_t n; 2238 2430 int i; 2239 2431 2240 2432 /* Get memory for full buffer, including space for trailing EOB's. */ 2241 n = len + 2;2242 buf = (char *) yy _flex_alloc( n);2433 n = _yybytes_len + 2; 2434 buf = (char *) yyalloc(n ); 2243 2435 if ( ! buf ) 2244 2436 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 2245 2437 2246 for ( i = 0; i < len; ++i )2247 buf[i] = bytes[i];2248 2249 buf[ len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;2250 2251 b = yy_scan_buffer( buf,n );2438 for ( i = 0; i < _yybytes_len; ++i ) 2439 buf[i] = yybytes[i]; 2440 2441 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 2442 2443 b = yy_scan_buffer(buf,n ); 2252 2444 if ( ! b ) 2253 2445 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); … … 2259 2451 2260 2452 return b; 2261 } 2262 #endif 2263 2264 2265 #ifndef YY_NO_PUSH_STATE 2266 #ifdef YY_USE_PROTOS 2267 static void yy_push_state( int new_state ) 2268 #else 2269 static void yy_push_state( new_state ) 2270 int new_state; 2271 #endif 2272 { 2273 if ( yy_start_stack_ptr >= yy_start_stack_depth ) 2274 { 2275 yy_size_t new_size; 2276 2277 yy_start_stack_depth += YY_START_STACK_INCR; 2278 new_size = yy_start_stack_depth * sizeof( int ); 2279 2280 if ( ! yy_start_stack ) 2281 yy_start_stack = (int *) yy_flex_alloc( new_size ); 2282 2283 else 2284 yy_start_stack = (int *) yy_flex_realloc( 2285 (void *) yy_start_stack, new_size ); 2286 2287 if ( ! yy_start_stack ) 2288 YY_FATAL_ERROR( 2289 "out of memory expanding start-condition stack" ); 2290 } 2291 2292 yy_start_stack[yy_start_stack_ptr++] = YY_START; 2293 2294 BEGIN(new_state); 2295 } 2296 #endif 2297 2298 2299 #ifndef YY_NO_POP_STATE 2300 static void yy_pop_state() 2301 { 2302 if ( --yy_start_stack_ptr < 0 ) 2303 YY_FATAL_ERROR( "start-condition stack underflow" ); 2304 2305 BEGIN(yy_start_stack[yy_start_stack_ptr]); 2306 } 2307 #endif 2308 2309 2310 #ifndef YY_NO_TOP_STATE 2311 static int yy_top_state() 2312 { 2313 return yy_start_stack[yy_start_stack_ptr - 1]; 2314 } 2315 #endif 2453 } 2316 2454 2317 2455 #ifndef YY_EXIT_FAILURE … … 2319 2457 #endif 2320 2458 2321 #ifdef YY_USE_PROTOS 2322 static void yy_fatal_error( yyconst char msg[] ) 2323 #else 2324 static void yy_fatal_error( msg ) 2325 char msg[]; 2326 #endif 2327 { 2328 (void) fprintf( stderr, "%s\n", msg ); 2459 static void yy_fatal_error (yyconst char* msg ) 2460 { 2461 (void) fprintf( stderr, "%s\n", msg ); 2329 2462 exit( YY_EXIT_FAILURE ); 2330 } 2331 2332 2463 } 2333 2464 2334 2465 /* Redefine yyless() so it works in section 3 code. */ … … 2339 2470 { \ 2340 2471 /* Undo effects of setting up yytext. */ \ 2341 yytext[yyleng] = yy_hold_char; \ 2342 yy_c_buf_p = yytext + n; \ 2343 yy_hold_char = *yy_c_buf_p; \ 2344 *yy_c_buf_p = '\0'; \ 2345 yyleng = n; \ 2472 int yyless_macro_arg = (n); \ 2473 YY_LESS_LINENO(yyless_macro_arg);\ 2474 yytext[yyleng] = (yy_hold_char); \ 2475 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 2476 (yy_hold_char) = *(yy_c_buf_p); \ 2477 *(yy_c_buf_p) = '\0'; \ 2478 yyleng = yyless_macro_arg; \ 2346 2479 } \ 2347 2480 while ( 0 ) 2348 2481 2349 2350 /* Internal utility routines. */ 2482 /* Accessor methods (get/set functions) to struct members. */ 2483 2484 /** Get the current line number. 2485 * 2486 */ 2487 int yyget_lineno (void) 2488 { 2489 2490 return yylineno; 2491 } 2492 2493 /** Get the input stream. 2494 * 2495 */ 2496 FILE *yyget_in (void) 2497 { 2498 return yyin; 2499 } 2500 2501 /** Get the output stream. 2502 * 2503 */ 2504 FILE *yyget_out (void) 2505 { 2506 return yyout; 2507 } 2508 2509 /** Get the length of the current token. 2510 * 2511 */ 2512 int yyget_leng (void) 2513 { 2514 return yyleng; 2515 } 2516 2517 /** Get the current token. 2518 * 2519 */ 2520 2521 char *yyget_text (void) 2522 { 2523 return yytext; 2524 } 2525 2526 /** Set the current line number. 2527 * @param line_number 2528 * 2529 */ 2530 void yyset_lineno (int line_number ) 2531 { 2532 2533 yylineno = line_number; 2534 } 2535 2536 /** Set the input stream. This does not discard the current 2537 * input buffer. 2538 * @param in_str A readable stream. 2539 * 2540 * @see yy_switch_to_buffer 2541 */ 2542 void yyset_in (FILE * in_str ) 2543 { 2544 yyin = in_str ; 2545 } 2546 2547 void yyset_out (FILE * out_str ) 2548 { 2549 yyout = out_str ; 2550 } 2551 2552 int yyget_debug (void) 2553 { 2554 return yy_flex_debug; 2555 } 2556 2557 void yyset_debug (int bdebug ) 2558 { 2559 yy_flex_debug = bdebug ; 2560 } 2561 2562 static int yy_init_globals (void) 2563 { 2564 /* Initialization is the same as for the non-reentrant scanner. 2565 * This function is called from yylex_destroy(), so don't allocate here. 2566 */ 2567 2568 (yy_buffer_stack) = 0; 2569 (yy_buffer_stack_top) = 0; 2570 (yy_buffer_stack_max) = 0; 2571 (yy_c_buf_p) = (char *) 0; 2572 (yy_init) = 0; 2573 (yy_start) = 0; 2574 2575 /* Defined in main.c */ 2576 #ifdef YY_STDINIT 2577 yyin = stdin; 2578 yyout = stdout; 2579 #else 2580 yyin = (FILE *) 0; 2581 yyout = (FILE *) 0; 2582 #endif 2583 2584 /* For future reference: Set errno on error, since we are called by 2585 * yylex_init() 2586 */ 2587 return 0; 2588 } 2589 2590 /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 2591 int yylex_destroy (void) 2592 { 2593 2594 /* Pop the buffer stack, destroying each element. */ 2595 while(YY_CURRENT_BUFFER){ 2596 yy_delete_buffer(YY_CURRENT_BUFFER ); 2597 YY_CURRENT_BUFFER_LVALUE = NULL; 2598 yypop_buffer_state(); 2599 } 2600 2601 /* Destroy the stack itself. */ 2602 yyfree((yy_buffer_stack) ); 2603 (yy_buffer_stack) = NULL; 2604 2605 /* Reset the globals. This is important in a non-reentrant scanner so the next time 2606 * yylex() is called, initialization will occur. */ 2607 yy_init_globals( ); 2608 2609 return 0; 2610 } 2611 2612 /* 2613 * Internal utility routines. 2614 */ 2351 2615 2352 2616 #ifndef yytext_ptr 2353 #ifdef YY_USE_PROTOS 2354 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 2355 #else 2356 static void yy_flex_strncpy( s1, s2, n ) 2357 char *s1; 2358 yyconst char *s2; 2359 int n; 2360 #endif 2361 { 2617 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 2618 { 2362 2619 register int i; 2363 2620 for ( i = 0; i < n; ++i ) 2364 2621 s1[i] = s2[i]; 2365 2622 } 2366 2623 #endif 2367 2624 2368 2625 #ifdef YY_NEED_STRLEN 2369 #ifdef YY_USE_PROTOS 2370 static int yy_flex_strlen( yyconst char *s ) 2371 #else 2372 static int yy_flex_strlen( s ) 2373 yyconst char *s; 2374 #endif 2375 { 2626 static int yy_flex_strlen (yyconst char * s ) 2627 { 2376 2628 register int n; 2377 2629 for ( n = 0; s[n]; ++n ) … … 2379 2631 2380 2632 return n; 2381 } 2382 #endif 2383 2384 2385 #ifdef YY_USE_PROTOS 2386 static void *yy_flex_alloc( yy_size_t size ) 2387 #else 2388 static void *yy_flex_alloc( size ) 2389 yy_size_t size; 2390 #endif 2391 { 2633 } 2634 #endif 2635 2636 void *yyalloc (yy_size_t size ) 2637 { 2392 2638 return (void *) malloc( size ); 2393 } 2394 2395 #ifdef YY_USE_PROTOS 2396 static void *yy_flex_realloc( void *ptr, yy_size_t size ) 2397 #else 2398 static void *yy_flex_realloc( ptr, size ) 2399 void *ptr; 2400 yy_size_t size; 2401 #endif 2402 { 2639 } 2640 2641 void *yyrealloc (void * ptr, yy_size_t size ) 2642 { 2403 2643 /* The cast to (char *) in the following accommodates both 2404 2644 * implementations that use char* generic pointers, and those … … 2409 2649 */ 2410 2650 return (void *) realloc( (char *) ptr, size ); 2411 } 2412 2413 #ifdef YY_USE_PROTOS 2414 static void yy_flex_free( void *ptr ) 2415 #else 2416 static void yy_flex_free( ptr ) 2417 void *ptr; 2418 #endif 2419 { 2420 free( ptr ); 2421 } 2422 2423 #if YY_MAIN 2424 int main() 2425 { 2426 yylex(); 2427 return 0; 2428 } 2429 #endif 2651 } 2652 2653 void yyfree (void * ptr ) 2654 { 2655 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2656 } 2657 2658 #define YYTABLES_NAME "yytables" 2659 2430 2660 #line 68 "convert.lex" 2431 2661 2432 2662 2433 2663 2664 2434 2665 int yywrap() 2435 2666 { … … 2449 2680 exit(0); 2450 2681 } 2682
Note: See TracChangeset
for help on using the changeset viewer.