- Timestamp:
- 2014-09-19T16:21:37+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c
r4147 r4779 56 56 #define YYPUSH 0 57 57 58 /* Pull parsers. */ 59 #define YYPULL 1 60 61 58 /* Substitute the variable and function names. */ 59 #define yyparse convert_parse 60 #define yylex convert_lex 61 #define yyerror convert_error 62 #define yylval convert_lval 63 #define yychar convert_char 64 #define yydebug convert_debug 65 #define yynerrs convert_nerrs 66 67 68 /* Tokens. */ 69 #ifndef YYTOKENTYPE 70 # define YYTOKENTYPE 71 /* Put the tokens into the symbol table, so that GDB and other debuggers 72 know about them. */ 73 enum yytokentype { 74 TOK_SEP = 258, 75 TOK_KIND = 259, 76 TOK_EQUAL = 260, 77 TOK_USE = 261, 78 TOK_MODULEMAIN = 262, 79 TOK_NOTGRIDDEP = 263, 80 TOK_USEITEM = 264, 81 TOK_NAME = 265, 82 TOK_CSTINT = 266, 83 TOK_PROBTYPE = 267 84 }; 85 #endif 86 /* Tokens. */ 87 #define TOK_SEP 258 88 #define TOK_KIND 259 89 #define TOK_EQUAL 260 90 #define TOK_USE 261 91 #define TOK_MODULEMAIN 262 92 #define TOK_NOTGRIDDEP 263 93 #define TOK_USEITEM 264 94 #define TOK_NAME 265 95 #define TOK_CSTINT 266 96 #define TOK_PROBTYPE 267 62 97 63 98 … … 71 106 #include "decl.h" 72 107 73 /* Line 371 of yacc.c */ 74 #line 75 "convert.tab.c" 75 76 # ifndef YY_NULL 77 # if defined __cplusplus && 201103L <= __cplusplus 78 # define YY_NULL nullptr 79 # else 80 # define YY_NULL 0 81 # endif 82 # endif 108 int line_num=1; 109 extern FILE * convert_in; 110 111 int convert_error(const char *s) 112 { 113 printf("##\n## ERROR in conv: '%s' (line %d, file: %s)\n##\n", s, line_num, config_file); 114 exit(0); 115 } 116 117 118 119 /* Enabling traces. */ 120 #ifndef YYDEBUG 121 # define YYDEBUG 1 122 #endif 83 123 84 124 /* Enabling verbose error messages. */ … … 118 158 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 119 159 typedef union YYSTYPE 120 { 121 /* Line 387 of yacc.c */ 122 #line 42 "convert.y" 123 124 int ival; 125 char na[LONG_C]; 126 listnom * ln; 127 128 129 /* Line 387 of yacc.c */ 130 #line 131 "convert.tab.c" 131 } YYSTYPE; 132 # define YYSTYPE_IS_TRIVIAL 1 160 #line 52 "convert.y" 161 162 char na[LONG_M]; 163 } 164 /* Line 193 of yacc.c. */ 165 #line 149 "convert.tab.c" 166 YYSTYPE; 133 167 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 134 168 # define YYSTYPE_IS_DECLARED 1 … … 157 191 /* Line 390 of yacc.c */ 158 192 #line 159 "convert.tab.c" 193 194 /* Line 216 of yacc.c. */ 195 #line 162 "convert.tab.c" 159 196 160 197 #ifdef short … … 385 422 #define YYFINAL 2 386 423 /* YYLAST -- Last index in YYTABLE. */ 387 #define YYLAST 2 3424 #define YYLAST 29 388 425 389 426 /* YYNTOKENS -- Number of terminals. */ 390 #define YYNTOKENS 1 8427 #define YYNTOKENS 16 391 428 /* YYNNTS -- Number of nonterminals. */ 392 429 #define YYNNTS 3 393 430 /* YYNRULES -- Number of rules. */ 394 #define YYNRULES 1 0431 #define YYNRULES 11 395 432 /* YYNRULES -- Number of states. */ 396 #define YYNSTATES 2 4433 #define YYNSTATES 29 397 434 398 435 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 399 436 #define YYUNDEFTOK 2 400 #define YYMAXUTOK 26 4437 #define YYMAXUTOK 267 401 438 402 439 #define YYTRANSLATE(YYX) \ … … 407 444 { 408 445 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 409 1 7, 2, 2, 2, 2, 2, 2, 2, 2, 2,446 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 410 447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 411 448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 412 13, 14, 2, 2, 10, 2, 2, 2, 2, 2,413 2, 2, 2, 2, 2, 2, 2, 2, 12, 11,449 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 450 2, 2, 2, 2, 2, 2, 2, 2, 2, 14, 414 451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 415 452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 416 453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 417 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 418 455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 419 456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, … … 432 469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 433 470 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 434 5, 6, 7, 8, 9 471 5, 6, 7, 8, 9, 10, 11, 12 435 472 }; 436 473 … … 441 478 { 442 479 0, 0, 3, 4, 7, 9, 13, 19, 27, 31, 443 3 6480 37, 42 444 481 }; 445 482 … … 447 484 static const yytype_int8 yyrhs[] = 448 485 { 449 19, 0, -1, -1, 19, 20, -1, 17, -1, 9, 450 8, 11, -1, 9, 8, 10, 8, 11, -1, 9, 451 8, 10, 8, 10, 8, 11, -1, 5, 8, 11, 452 -1, 6, 3, 8, 11, -1, 4, 7, 11, -1 486 17, 0, -1, -1, 17, 18, -1, 15, -1, 12, 487 10, 14, -1, 12, 10, 13, 10, 14, -1, 12, 488 10, 13, 10, 13, 10, 14, -1, 7, 10, 14, 489 -1, 4, 10, 5, 11, 14, -1, 8, 3, 10, 490 14, -1, 6, 9, 14, -1 453 491 }; 454 492 … … 456 494 static const yytype_uint8 yyrline[] = 457 495 { 458 0, 63, 63, 64, 66, 67, 68, 69, 71, 74,459 75496 0, 71, 71, 72, 75, 76, 77, 78, 79, 84, 497 100, 104 460 498 }; 461 499 #endif … … 466 504 static const char *const yytname[] = 467 505 { 468 "$end", "error", "$undefined", "TOK_SEP", "TOK_ USE", "TOK_MODULEMAIN",469 "TOK_ NOTGRIDDEP", "TOK_USEITEM", "TOK_NAME", "TOK_PROBTYPE", "','",470 " ';'", "':'", "'('", "')'", "'['", "']'", "'\\n'", "$accept", "input",506 "$end", "error", "$undefined", "TOK_SEP", "TOK_KIND", "TOK_EQUAL", 507 "TOK_USE", "TOK_MODULEMAIN", "TOK_NOTGRIDDEP", "TOK_USEITEM", "TOK_NAME", 508 "TOK_CSTINT", "TOK_PROBTYPE", "','", "';'", "'\\n'", "$accept", "input", 471 509 "line", YY_NULL 472 510 }; … … 479 517 { 480 518 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 481 44, 59, 58, 40, 41, 91, 93, 10519 265, 266, 267, 44, 59, 10 482 520 }; 483 521 # endif … … 486 524 static const yytype_uint8 yyr1[] = 487 525 { 488 0, 1 8, 19, 19, 20, 20, 20, 20, 20, 20,489 20526 0, 16, 17, 17, 18, 18, 18, 18, 18, 18, 527 18, 18 490 528 }; 491 529 … … 493 531 static const yytype_uint8 yyr2[] = 494 532 { 495 0, 2, 0, 2, 1, 3, 5, 7, 3, 4,496 3533 0, 2, 0, 2, 1, 3, 5, 7, 3, 5, 534 4, 3 497 535 }; 498 536 … … 502 540 static const yytype_uint8 yydefact[] = 503 541 { 504 2, 0, 1, 0, 0, 0, 0, 4, 3, 0,505 0, 0, 0, 10, 8, 0, 0, 5, 9, 0,506 0, 6, 0, 7542 2, 0, 1, 0, 0, 0, 0, 0, 4, 3, 543 0, 0, 0, 0, 0, 0, 11, 8, 0, 0, 544 5, 0, 10, 0, 9, 0, 6, 0, 7 507 545 }; 508 546 … … 510 548 static const yytype_int8 yydefgoto[] = 511 549 { 512 -1, 1, 8550 -1, 1, 9 513 551 }; 514 552 515 553 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 516 554 STATE-NUM. */ 517 #define YYPACT_NINF -1 0555 #define YYPACT_NINF -13 518 556 static const yytype_int8 yypact[] = 519 557 { 520 -1 0, 0, -10, -4, 2, 8, 4, -10, -10,3,521 5, 7, -9, -10, -10, 9, 10, -10, -10, -3,522 11, -10, 12, -10558 -13, 0, -13, -7, 2, -5, 10, 4, -13, -13, 559 11, 3, 5, 8, -12, 9, -13, -13, 7, 12, 560 -13, 13, -13, -4, -13, 14, -13, 15, -13 523 561 }; 524 562 … … 526 564 static const yytype_int8 yypgoto[] = 527 565 { 528 -1 0, -10, -10566 -13, -13, -13 529 567 }; 530 568 … … 535 573 static const yytype_uint8 yytable[] = 536 574 { 537 2, 1 6, 17, 9, 3, 4, 5, 20, 21, 6,538 10, 11, 12, 0, 13, 15, 14, 7, 19, 22,539 18, 0, 0, 23575 2, 19, 20, 10, 3, 12, 4, 5, 6, 25, 576 26, 11, 7, 13, 14, 8, 15, 16, 18, 17, 577 21, 22, 23, 0, 27, 0, 0, 24, 0, 28 540 578 }; 541 579 … … 548 586 static const yytype_int8 yycheck[] = 549 587 { 550 0, 1 0, 11, 7, 4, 5, 6, 10, 11, 9,551 8, 3, 8, -1, 11, 8, 11, 17, 8, 8,552 11, -1, -1, 11588 0, 13, 14, 10, 4, 10, 6, 7, 8, 13, 589 14, 9, 12, 3, 10, 15, 5, 14, 10, 14, 590 11, 14, 10, -1, 10, -1, -1, 14, -1, 14 553 591 }; 554 592 … … 557 595 static const yytype_uint8 yystos[] = 558 596 { 559 0, 1 9, 0, 4, 5, 6, 9, 17, 20, 7,560 8, 3, 8, 11, 11, 8, 10, 11, 11, 8,561 1 0, 11, 8, 11597 0, 17, 0, 4, 6, 7, 8, 12, 15, 18, 598 10, 9, 10, 3, 10, 5, 14, 14, 10, 13, 599 14, 11, 14, 10, 14, 13, 14, 10, 14 562 600 }; 563 601 … … 1351 1389 { 1352 1390 case 5: 1353 /* Line 1787 of yacc.c */ 1354 #line 67 "convert.y" 1355 {initdimprob(1,(yyvsp[(2) - (3)].na),"0","0");} 1391 #line 76 "convert.y" 1392 { initdimprob(1,(yyvsp[(2) - (3)].na),"0","0"); ;} 1356 1393 break; 1357 1394 1358 1395 case 6: 1359 /* Line 1787 of yacc.c */ 1360 #line 68 "convert.y" 1361 {initdimprob(2,(yyvsp[(2) - (5)].na), (yyvsp[(4) - (5)].na),"0");} 1396 #line 77 "convert.y" 1397 { initdimprob(2,(yyvsp[(2) - (5)].na), (yyvsp[(4) - (5)].na),"0"); ;} 1362 1398 break; 1363 1399 1364 1400 case 7: 1365 /* Line 1787 of yacc.c */ 1366 #line 70 "convert.y" 1367 {initdimprob(3,(yyvsp[(2) - (7)].na), (yyvsp[(4) - (7)].na), (yyvsp[(6) - (7)].na));} 1401 #line 78 "convert.y" 1402 { initdimprob(3,(yyvsp[(2) - (7)].na), (yyvsp[(4) - (7)].na), (yyvsp[(6) - (7)].na)); ;} 1368 1403 break; 1369 1404 1370 1405 case 8: 1371 /* Line 1787 of yacc.c */ 1372 #line 72 "convert.y" 1373 {listofmodules = Addtolistnom((yyvsp[(2) - (3)].na),listofmodules,0); 1374 Addmoduletothelist((yyvsp[(2) - (3)].na));} 1406 #line 80 "convert.y" 1407 { 1408 listofmodules = Addtolistnom((yyvsp[(2) - (3)].na),listofmodules,0); 1409 Addmoduletothelist((yyvsp[(2) - (3)].na)); 1410 ;} 1375 1411 break; 1376 1412 1377 1413 case 9: 1378 /* Line 1787 of yacc.c */ 1379 #line 74 "convert.y" 1380 {Add_NotGridDepend_Var_1((yyvsp[(3) - (4)].na));} 1414 #line 85 "convert.y" 1415 { 1416 if (!strcasecmp((yyvsp[(4) - (5)].na),"4")) 1417 { 1418 listofkind = Addtolistnom((yyvsp[(2) - (5)].na),listofkind,4); 1419 } 1420 else if (!strcasecmp((yyvsp[(4) - (5)].na),"8")) 1421 { 1422 listofkind = Addtolistnom((yyvsp[(2) - (5)].na),listofkind,8); 1423 } 1424 else 1425 { 1426 printf("##\n## Unknown kind type : %s (must be 4 or 8)\n##",(yyvsp[(4) - (5)].na)); 1427 exit(0); 1428 } 1429 ;} 1381 1430 break; 1382 1431 1383 1432 case 10: 1384 /* Line 1787 of yacc.c */ 1385 #line 75 "convert.y" 1433 #line 101 "convert.y" 1386 1434 { 1387 if (!strcasecmp((yyvsp[(2) - (3)].na),"FIXED_GRIDS")) 1388 fixedgrids=1; 1389 if (!strcasecmp((yyvsp[(2) - (3)].na),"ONLY_FIXED_GRIDS")) 1390 onlyfixedgrids=1; 1391 } 1435 Add_NotGridDepend_Var_1((yyvsp[(3) - (4)].na)); 1436 ;} 1392 1437 break; 1393 1438 1394 1395 /* Line 1787 of yacc.c */ 1396 #line 1397 "convert.tab.c" 1439 case 11: 1440 #line 105 "convert.y" 1441 { 1442 if (!strcasecmp((yyvsp[(2) - (3)].na),"FIXED_GRIDS")) fixedgrids = 1; 1443 if (!strcasecmp((yyvsp[(2) - (3)].na),"ONLY_FIXED_GRIDS")) onlyfixedgrids = 1; 1444 ;} 1445 break; 1446 1447 1448 /* Line 1267 of yacc.c. */ 1449 #line 1420 "convert.tab.c" 1397 1450 default: break; 1398 1451 } … … 1625 1678 1626 1679 1627 /* Line 2050 of yacc.c */ 1628 #line 82 "convert.y" 1629 1680 #line 110 "convert.y" 1681 1682 1683 void print_usage() 1684 { 1685 printf("usage : conv <config_file> -convfile <FILENAME>\n"); 1686 printf(" [-workdir <directory>] [-incdir <directory>]\n"); 1687 printf(" [-comdirin <directory>] [-comdirout <directory>]\n"); 1688 printf(" [-convfile <FILENAME>] [-SubloopScalar] [-SubloopScalar1] \n"); 1689 printf(" [-free|-fixed]\n"); 1690 exit(0); 1691 } 1630 1692 1631 1693 int main(int argc,char *argv[]) 1632 1694 { 1633 extern FILE * yyin ; 1634 FILE *dependglobaloutput; 1635 int i; 1636 listnom *parcours; 1637 listvar *newvar; 1638 int stylegiven = 0; 1639 int infreegiven ; 1640 int infixedgiven ; 1641 int lengthmainfile; 1642 1643 if (argc < 2) 1644 { 1645 printf("usage : conv <file> [-rm] [-incdir <directory>] \n"); 1646 printf(" [-comdirin <directory>] [-comdirout <directory>]\n"); 1647 printf(" [-convfile <FILENAME >] -SubloopScalar -SubloopScalar1 \n"); 1648 printf(" [-free|-fixed]\n"); 1649 exit(0); 1650 } 1695 extern FILE * convert_in ; 1696 FILE *dependglobaloutput; 1697 int i; 1698 listnom *parcours; 1699 listvar *newvar; 1700 int stylegiven = 0; 1701 int infreegiven ; 1702 int infixedgiven ; 1703 int lengthmainfile; 1704 1705 char filetoparse[LONG_FNAME]; 1706 1651 1707 /******************************************************************************/ 1652 1708 /* 1- Variables initialization */ 1653 1709 /******************************************************************************/ 1654 List_Global_Var=(listvar *)NULL; 1655 List_GlobalParameter_Var=(listvar *)NULL; 1656 List_Allocate_Var=(listallocate *)NULL; 1657 List_Common_Var=(listvar *)NULL; 1658 List_SubroutineWhereAgrifUsed=(listnom *)NULL; 1659 List_Subroutine_For_Alloc=(listnom *)NULL; 1660 List_Include=(listusemodule *)NULL; 1661 List_NameOfModuleUsed=(listusemodule *)NULL; 1662 listofmoduletmp=(listusemodule *)NULL; 1663 List_SubroutineDeclaration_Var=(listvar *)NULL; 1664 List_UsedInSubroutine_Var=(listvar *)NULL; 1665 List_NotGridDepend_Var=(listvar *)NULL; 1666 Listofavailableindices=(listindice *)NULL; 1667 List_CouplePointed_Var=(listvarpointtovar *)NULL; 1668 List_ModuleUsed_Var = (listvar *)NULL; 1669 List_ModuleUsedInModuleUsed_Var = (listvar *)NULL; 1670 List_GlobParamModuleUsed_Var = (listparameter *)NULL; 1671 List_GlobParamModuleUsedInModuleUsed_Var = (listparameter *)NULL; 1672 List_SubroutineArgument_Var = (listvar *)NULL; 1673 List_FunctionType_Var = (listvar *)NULL; 1674 tmpuselocallist = (listusemodule *)NULL; 1675 List_ContainsSubroutine = (listnom *)NULL; 1676 oldfortranout = (FILE *)NULL; 1677 1678 strcpy(mainfile,argv[1]); 1679 strcpy(nomdir,"AGRIF_INC"); 1680 strcpy(commondirin,"."); 1681 strcpy(commondirout,"."); 1682 strcpy(filetoparse," "); 1683 strcpy(subofagrifinitgrids,""); 1684 strcpy(meetagrifinitgrids,""); 1685 strcpy(mpiinitvar,""); 1686 1687 length_last = 0 ; 1688 length_first = 0 ; 1689 length_v_typevar = 0 ; 1690 length_v_nomvar = 0 ; 1691 length_v_dimchar = 0 ; 1692 length_v_modulename = 0 ; 1693 length_v_commonname = 0 ; 1694 length_v_vallengspec = 0 ; 1695 length_v_nameinttypename = 0 ; 1696 length_v_commoninfile = 0 ; 1697 length_v_subroutinename = 0 ; 1698 length_v_precision = 0 ; 1699 length_v_IntentSpec = 0 ; 1700 length_v_initialvalue = 0 ; 1701 length_v_readedlistdimension = 0 ; 1702 length_u_usemodule = 0 ; 1703 length_u_charusemodule = 0 ; 1704 length_u_cursubroutine = 0 ; 1705 length_u_modulename = 0 ; 1706 length_n_name = 0 ; 1707 length_c_namevar = 0 ; 1708 length_c_namepointedvar = 0 ; 1709 length_o_nom = 0 ; 1710 length_o_module = 0 ; 1711 length_a_nomvar = 0 ; 1712 length_a_subroutine = 0 ; 1713 length_a_module = 0 ; 1714 length_t_usemodule = 0 ; 1715 length_t_cursubroutine = 0 ; 1716 length_curfilename = 0 ; 1717 length_nomfileoutput = 0 ; 1718 length_motparse = 0 ; 1719 length_mainfile = 0 ; 1720 length_nomdir = 0 ; 1721 length_commondirout = 0 ; 1722 length_commondirin = 0 ; 1723 length_filetoparse = 0 ; 1724 length_curbuf = 0 ; 1725 length_toprintglob = 0 ; 1726 length_tmpvargridname = 0 ; 1727 length_ligne_Subloop = 0 ; 1728 length_lvargridname_toamr = 0 ; 1729 length_toprint_utilagrif = 0 ; 1730 length_toprinttmp_utilchar = 0 ; 1731 length_ligne_writedecl = 0 ; 1732 length_newname_toamr = 0 ; 1733 length_newname_writedecl = 0 ; 1734 length_ligne_toamr = 0 ; 1735 length_tmpligne_writedecl = 0 ; 1736 value_char_size = 0 ; 1737 value_char_size1 = 0 ; 1738 value_char_size2 = 0 ; 1739 value_char_size3 = 0 ; 1740 inallocate = 0; 1741 infixed = 1; 1742 infree = 0; 1743 1744 checkexistcommon=1; 1745 todebug=0; 1746 onlyfixedgrids=0; 1747 fixedgrids=0; 1748 InAgrifParentDef = 0; 1749 IndicenbmaillesX=0; 1750 IndicenbmaillesY=0; 1751 IndicenbmaillesZ=0; 1752 created_dimensionlist = 1; 1753 indicemaxtabvars = 0; /* current indice in the table tabvars */ 1754 SubloopScalar = 0; 1755 todebug = 0; 1756 todebugfree = 0; 1757 retour77 = 1 ; 1758 mark = 0 ; 1759 shouldincludempif = 0 ; 1760 Read_val_max(); 1710 List_Global_Var = (listvar *) NULL; 1711 List_GlobalParameter_Var = (listvar *) NULL; 1712 List_Common_Var = (listvar *) NULL; 1713 List_Allocate_Var = (listallocate *) NULL; 1714 List_SubroutineWhereAgrifUsed = (listnom *) NULL; 1715 List_Subroutine_For_Alloc = (listnom *) NULL; 1716 List_Include = (listusemodule *) NULL; 1717 List_NameOfModuleUsed = (listusemodule *) NULL; 1718 listofmoduletmp = (listusemodule *) NULL; 1719 List_SubroutineDeclaration_Var = (listvar *) NULL; 1720 List_UsedInSubroutine_Var = (listvar *) NULL; 1721 List_NotGridDepend_Var = (listvar *) NULL; 1722 Listofavailableindices = (listindice *) NULL; 1723 Listofavailableindices_glob = (listindice **) calloc(NB_CAT_VARIABLES,sizeof(listindice *)); 1724 List_CouplePointed_Var = (listvarpointtovar *) NULL; 1725 List_ModuleUsed_Var = (listvar *) NULL; 1726 List_ModuleUsedInModuleUsed_Var = (listvar *) NULL; 1727 List_GlobParamModuleUsed_Var = (listparameter *) NULL; 1728 List_GlobParamModuleUsedInModuleUsed_Var = (listparameter *) NULL; 1729 List_SubroutineArgument_Var = (listvar *) NULL; 1730 List_FunctionType_Var = (listvar *) NULL; 1731 tmpuselocallist = (listusemodule *) NULL; 1732 List_ContainsSubroutine = (listnom *) NULL; 1733 oldfortran_out = (FILE *) NULL; 1734 1735 if (argc < 2) print_usage(); 1736 1737 strcpy(config_file, argv[1]); 1738 strcpy(work_dir, "."); 1739 strcpy(input_dir, "."); 1740 strcpy(output_dir, "AGRIF_MODELFILES"); 1741 strcpy(include_dir, "AGRIF_INC"); 1742 strcpy(filetoparse, ""); 1743 strcpy(subofagrifinitgrids, ""); 1744 strcpy(meetagrifinitgrids, ""); 1745 strcpy(mpiinitvar, ""); 1746 1747 length_last = 0 ; 1748 length_first = 0 ; 1749 length_v_vallengspec = 0 ; 1750 length_v_commoninfile = 0 ; 1751 length_v_precision = 0 ; 1752 length_v_IntentSpec = 0 ; 1753 length_v_initialvalue = 0 ; 1754 length_v_readedlistdimension = 0 ; 1755 length_a_nomvar = 0 ; 1756 length_toprintglob = 0 ; 1757 length_tmpvargridname = 0 ; 1758 length_ligne_Subloop = 0 ; 1759 length_toprint_utilagrif = 0 ; 1760 length_toprinttmp_utilchar = 0 ; 1761 length_ligne_writedecl = 0 ; 1762 length_newname_toamr = 0 ; 1763 length_newname_writedecl = 0 ; 1764 length_ligne_toamr = 0 ; 1765 length_tmpligne_writedecl = 0 ; 1766 value_char_size = 0 ; 1767 value_char_size1 = 0 ; 1768 value_char_size2 = 0 ; 1769 value_char_size3 = 0 ; 1770 inallocate = 0; 1771 infixed = 1; 1772 infree = 0; 1773 1774 onlyfixedgrids=0; 1775 fixedgrids=0; 1776 InAgrifParentDef = 0; 1777 IndicenbmaillesX=0; 1778 IndicenbmaillesY=0; 1779 IndicenbmaillesZ=0; 1780 created_dimensionlist = 1; 1781 /* current indice in the table tabvars */ 1782 for ( i=0 ; i<NB_CAT_VARIABLES ; i++) 1783 { 1784 indicemaxtabvars[i] = 0; 1785 } 1786 SubloopScalar = 0; 1787 todebug = 0; 1788 retour77 = 1 ; 1789 shouldincludempif = 0 ; 1790 1791 Read_val_max(); 1792 1761 1793 /******************************************************************************/ 1762 1794 /* 2- Program arguments */ 1763 1795 /******************************************************************************/ 1764 1796 1765 if ((yyin=fopen(argv[1],"r"))==NULL) 1766 { 1767 printf("the file %s doesn't exist \n",argv[1]); 1768 exit(0); 1769 } 1770 1771 i=2; 1772 while (i<argc) 1773 { 1774 if (!strcasecmp(argv[i],"-incdir")) 1775 { 1776 strcpy(nomdir,argv[i+1]); 1777 i++; 1778 } 1779 else if (!strcasecmp(argv[i],"-comdirin")) /* input directory */ 1780 { 1781 strcpy(commondirin,argv[i+1]); 1782 i++; 1783 } 1784 else if (!strcasecmp(argv[i],"-comdirout")) /* output directory */ 1785 { 1786 strcpy(commondirout,argv[i+1]); 1787 i++; 1788 } 1789 else if (!strcasecmp(argv[i],"-convfile")) /* file to parse */ 1790 { 1791 strcpy(filetoparse,argv[i+1]); 1792 i++; 1793 lengthmainfile = strlen(filetoparse); 1794 if (!strcasecmp(&filetoparse[lengthmainfile-4],".f90")) 1795 { 1796 infixed = 0; 1797 infree = 1; 1798 } 1799 else 1800 { 1801 infixed = 1; 1802 infree = 0; 1803 } 1804 } 1805 else if (!strcasecmp(argv[i],"-free")) /* file to parse */ 1806 { 1807 stylegiven = 1; 1808 infreegiven = 1 ; 1809 infixedgiven = 0; 1810 } 1811 else if (!strcasecmp(argv[i],"-fixed")) /* file to parse */ 1812 { 1813 stylegiven = 1; 1814 infreegiven = 0; 1815 infixedgiven = 1; 1816 } 1817 else if (!strcasecmp(argv[i],"-SubloopScalar")) /* file to parse */ 1818 { 1819 SubloopScalar = 1 ; 1820 } 1821 else if (!strcasecmp(argv[i],"-SubloopScalar1")) /* file to parse */ 1822 { 1823 SubloopScalar = 2 ; 1824 } 1825 else if (!strcasecmp(argv[i],"-todebug")) /* file to parse */ 1826 { 1827 todebug = 1 ; 1828 } 1829 else if (!strcasecmp(argv[i],"-mark")) /* file to parse */ 1830 { 1831 mark = 1 ; 1832 } 1833 else if (!strcasecmp(argv[i],"-todebugfree")) /* file to parse */ 1834 { 1835 todebugfree = 1 ; 1836 } 1837 else if (!strcasecmp(argv[i],"-rm")) 1838 { 1839 checkexistcommon=0; 1840 } 1841 else 1842 { 1843 printf("Unkwon option : %s\n",argv[i]); 1844 exit(0); 1845 } 1846 i++; 1847 } 1848 1849 if (stylegiven == 1) 1850 { 1851 infree = infreegiven; 1852 infixed = infixedgiven; 1853 } 1854 Save_Length(nomdir,34); 1855 Save_Length(commondirout,35); 1856 Save_Length(commondirin,36); 1857 Save_Length(filetoparse,37); 1797 if ( (convert_in=fopen(config_file,"r")) == NULL ) 1798 { 1799 printf("##\n## ERROR: the configuration file '%s' doesn't exist.\n##\n", config_file); 1800 print_usage(); 1801 } 1802 1803 i=2; 1804 while ( i < argc ) 1805 { 1806 if (!strcasecmp(argv[i], "-workdir")) 1807 { 1808 strcpy(work_dir,argv[i+1]); 1809 i++; 1810 } 1811 else if (!strcasecmp(argv[i], "-incdir")) 1812 { 1813 strcpy(include_dir,argv[i+1]); 1814 i++; 1815 } 1816 else if (!strcasecmp(argv[i], "-comdirin")) /* input directory */ 1817 { 1818 strcpy(input_dir,argv[i+1]); 1819 i++; 1820 } 1821 else if (!strcasecmp(argv[i], "-comdirout")) /* output directory */ 1822 { 1823 strcpy(output_dir,argv[i+1]); 1824 i++; 1825 } 1826 else if (!strcasecmp(argv[i], "-convfile")) /* file to parse */ 1827 { 1828 strcpy(filetoparse, argv[i+1]); 1829 i++; 1830 lengthmainfile = strlen(filetoparse); 1831 if (!strcasecmp(&filetoparse[lengthmainfile-4], ".f90")) 1832 { 1833 infixed = 0; 1834 infree = 1; 1835 } 1836 else 1837 { 1838 infixed = 1; 1839 infree = 0; 1840 } 1841 } 1842 else if (!strcasecmp(argv[i], "-free")) 1843 { 1844 stylegiven = 1; 1845 infreegiven = 1 ; 1846 infixedgiven = 0; 1847 } 1848 else if (!strcasecmp(argv[i], "-fixed")) 1849 { 1850 stylegiven = 1; 1851 infreegiven = 0; 1852 infixedgiven = 1; 1853 } 1854 else if (!strcasecmp(argv[i], "-SubloopScalar")) 1855 { 1856 SubloopScalar = 1 ; 1857 } 1858 else if (!strcasecmp(argv[i], "-SubloopScalar1")) 1859 { 1860 SubloopScalar = 2 ; 1861 } 1862 else if (!strcasecmp(argv[i], "-todebug")) 1863 { 1864 todebug = 1 ; 1865 } 1866 else if (!strcasecmp(argv[i],"-rm")) { } 1867 else 1868 { 1869 printf("##\n## Unkwon option : %s\n##\n", argv[i]); 1870 exit(0); 1871 } 1872 i++; 1873 } 1874 // Check input file 1875 if ( strlen(filetoparse) == 0 ) // -convfile has not been specified 1876 { 1877 printf("##\n## ERROR: please provide a file to parse with -convfile.\n##\n"); 1878 print_usage(); 1879 } 1880 // Setup input & output directories 1881 if ( strcasecmp(work_dir, ".") != 0 ) // -workdir has been changed... 1882 { 1883 if ( strcasecmp(input_dir, ".") == 0 ) // ...and -comdirin has NOT been changed 1884 { 1885 strcpy(input_dir, work_dir); 1886 } 1887 if ( strcasecmp(output_dir, "AGRIF_MODELFILES") == 0 ) // ...and -comdirout has NOT been changed 1888 { 1889 sprintf(output_dir, "%s/%s", work_dir, "AGRIF_MODELFILES"); 1890 } 1891 if ( strcasecmp(include_dir, "AGRIF_INC") == 0 ) // ...and -incdir has NOT been changed 1892 { 1893 sprintf(include_dir, "%s/%s", work_dir, "AGRIF_INC"); 1894 } 1895 } 1896 if (stylegiven == 1) 1897 { 1898 infree = infreegiven; 1899 infixed = infixedgiven; 1900 } 1858 1901 1859 1902 /******************************************************************************/ 1860 /* 3- Parsing of the conv file <name>.in*/1903 /* 3- Parsing of the conv file <name>.in */ 1861 1904 /******************************************************************************/ 1862 1905 1863 if ((yyin=fopen(argv[1],"r"))==NULL) 1864 { 1865 printf("the file %s doesn't exist \n",argv[1]); 1866 exit(0); 1867 } 1868 strcpy(mainfile,argv[1]); 1869 Save_Length(mainfile,33); 1870 1871 if ( strstr(filetoparse,".f90") || 1872 strstr(filetoparse,".F90") ) retour77 = 0; 1873 1874 yyparse(); 1906 if ( strstr(filetoparse, ".f90") || strstr(filetoparse, ".F90") ) retour77 = 0; 1907 1908 convert_parse(); 1875 1909 1876 1910 /******************************************************************************/ 1877 1911 /* 4- Preparation of the file parsing */ 1878 1912 /******************************************************************************/ 1879 if ((yyin=fopen(filetoparse,"r"))==NULL) /* Is the file to parse exist ? */ 1880 { 1881 printf("the file %s doesn't exist \n",filetoparse); 1882 exit(0); 1883 } 1884 /* mainfile : the name of the file to parse */ 1885 strcpy(mainfile,filetoparse); 1886 /* */ 1887 if ((dependglobaloutput=fopen(".dependglobal_agrif","r"))!=NULL) 1888 { 1889 fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars); 1890 fclose(dependglobaloutput); 1891 } 1892 Readthedependavailablefile(); 1893 /* Read the .dependnbxnby file which contains indices of nbmaillsX, */ 1894 /* nbmailleY and nbmailleZ */ 1895 Readthedependnbxnbyfile(); 1896 Read_Subroutine_For_Alloc(); 1913 1914 sprintf(dependfilename, "%s/.dependglobal_agrif", work_dir); 1915 /* */ 1916 if ( (dependglobaloutput=fopen(dependfilename, "r")) != NULL ) 1917 { 1918 for (i=0;i<NB_CAT_VARIABLES;i++) 1919 { 1920 fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars[i]); 1921 } 1922 fclose(dependglobaloutput); 1923 } 1924 Readthedependavailablefile(); 1925 /* Read the .dependnbxnby file which contains indices of nbmaillsX, nbmailleY and nbmailleZ */ 1926 Readthedependnbxnbyfile(); 1927 Read_Subroutine_For_Alloc(); 1928 1897 1929 /******************************************************************************/ 1898 1930 /* 5- Parsing of the input file (2 times) */ 1899 1931 /******************************************************************************/ 1900 /* Record all variable in list */ 1901 firstpass = 1; 1902 processfortran(filetoparse); 1903 /* */ 1904 CompleteThelistvarindoloop(); 1905 /* Read list of module used */ 1906 RecordUseModulesVariables(); 1907 /* Read list of module used in module used */ 1908 RecordUseModulesUseModulesVariables(); 1909 /* Save variables are considered as globals ones */ 1910 Update_List_Global_Var_From_List_Save_Var(); 1911 /* Update all lists */ 1912 ListUpdate(); 1913 /* */ 1914 Clean_List_Global_Var(); 1915 /* Indice tabvars identification */ 1916 IndiceTabvarsIdentification(); 1917 /* Update all lists */ 1918 ListUpdate(); 1919 /* The allocation subroutine is necessary ???? */ 1920 New_Allocate_Subroutine_Is_Necessary(); 1921 /* The allocation subroutine is necessary for common list */ 1922 New_Allocate_Subroutine_For_Common_Is_Necessary(); 1923 /* Sort List_SubroutineArgument_Var */ 1924 Sort_List_SubroutineArgument_Var(); 1925 /* Clean all lists */ 1926 ListClean(); 1927 /* Update Indice of List_UsedInSubroutine_Var from module used */ 1928 List_UsedInSubroutine_Var_Update_From_Module_Used(); 1929 /* Update List_SubroutineWhereAgrifUsed */ 1930 UpdateList_SubroutineWhereAgrifUsed(); 1931 /* Update List_UsedInSubroutine_Var with v_readedlistdimension */ 1932 UpdateList_UsedInSubroutine_With_dimension();; 1933 /* */ 1934 ModifyThelistvarindoloop(); 1935 /* */ 1936 UpdateListDeclarationWithDimensionList(); 1937 /* */ 1938 GiveTypeOfVariables(); 1939 Affiche(); 1940 /* Build new subroutines */ 1941 firstpass = 0; 1942 processfortran(filetoparse); 1943 1944 newvar = (listvar *)NULL; 1945 /*newvar = List_Global_Var; */ 1946 while ( newvar ) 1947 { 1948 printf("++++ %s %d %s %s %s\n", 1949 newvar->var->v_nomvar, 1950 newvar->var->v_nbdim, 1951 newvar->var->v_subroutinename, 1952 newvar->var->v_modulename, 1953 newvar->var->v_typevar 1954 ); 1955 newvar = newvar->suiv; 1956 } 1932 1933 /* Record all variables in list */ 1934 firstpass = 1; 1935 process_fortran(filetoparse); 1936 1937 CompleteThelistvarindoloop(); 1938 /* Read list of module used */ 1939 RecordUseModulesVariables(); 1940 /* Read list of module used in module used */ 1941 RecordUseModulesUseModulesVariables(); 1942 /* Save variables are considered as globals ones */ 1943 Update_List_Global_Var_From_List_Save_Var(); 1944 /* Update all lists */ 1945 ListUpdate(); 1946 1947 Clean_List_Global_Var(); 1948 /* Indice tabvars identification */ 1949 IndiceTabvarsIdentification(); 1950 /* Update all lists */ 1951 ListUpdate(); 1952 /* The allocation subroutine is necessary ???? */ 1953 New_Allocate_Subroutine_Is_Necessary(); 1954 /* The allocation subroutine is necessary for common list */ 1955 New_Allocate_Subroutine_For_Common_Is_Necessary(); 1956 /* Sort List_SubroutineArgument_Var */ 1957 Sort_List_SubroutineArgument_Var(); 1958 /* Clean all lists */ 1959 ListClean(); 1960 /* Update Indice of List_UsedInSubroutine_Var from module used */ 1961 List_UsedInSubroutine_Var_Update_From_Module_Used(); 1962 /* Update List_SubroutineWhereAgrifUsed */ 1963 UpdateList_SubroutineWhereAgrifUsed(); 1964 /* Update List_UsedInSubroutine_Var with v_readedlistdimension */ 1965 UpdateList_UsedInSubroutine_With_dimension(); 1966 1967 ModifyThelistvarindoloop(); 1968 UpdateListDeclarationWithDimensionList(); 1969 GiveTypeOfVariables(); 1970 1971 /* Build new subroutines */ 1972 firstpass = 0; 1973 process_fortran(filetoparse); 1974 1975 newvar = (listvar *) NULL; 1976 1977 while ( newvar ) 1978 { 1979 printf("++++ %s %d %s %s %s\n", 1980 newvar->var->v_nomvar, 1981 newvar->var->v_nbdim, 1982 newvar->var->v_subroutinename, 1983 newvar->var->v_modulename, 1984 newvar->var->v_typevar); 1985 newvar = newvar->suiv; 1986 } 1987 1957 1988 /******************************************************************************/ 1958 1989 /* 6- Write informations in output files */ 1959 1990 /******************************************************************************/ 1960 1991 1961 /* Write the .dependglobal_agrif file which contain the max indice */ 1962 /* of the tabvars table */ 1963 dependglobaloutput = fopen(".dependglobal_agrif","w"); 1964 fprintf(dependglobaloutput,"%d\n",indicemaxtabvars); 1965 fclose(dependglobaloutput); 1966 /* Write the list of available indice */ 1967 Writethedependavailablefile(); 1968 /* Write the .dependnbxnby file which contains indices of nbmaillsX, */ 1969 /* nbmailleY and nbmailleZ */ 1970 Writethedependnbxnbyfile(); 1971 /* Write the .depend<namefile> file which contain general informations */ 1972 /* about variable of this file */ 1973 parcours = List_NameOfModule; 1974 while( parcours ) 1975 { 1976 Writethedependlistofmoduleused(parcours->o_nom); 1977 WritedependParameterList(parcours->o_nom); 1978 Writethedependfile(parcours->o_nom,List_Global_Var); 1979 parcours=parcours->suiv; 1980 } 1981 parcours = List_NameOfCommon; 1982 while( parcours ) 1983 { 1984 Writethedependfile(parcours->o_nom,List_Common_Var); 1985 parcours=parcours->suiv; 1986 } 1987 Write_Subroutine_For_Alloc(); 1992 /* Write the .dependglobal_agrif file which contain the max indice */ 1993 /* of the tabvars table */ 1994 sprintf(dependfilename, "%s/.dependglobal_agrif", work_dir); 1995 dependglobaloutput = fopen(dependfilename, "w"); 1996 for (i=0;i<NB_CAT_VARIABLES;i++) 1997 { 1998 fprintf(dependglobaloutput,"%d\n",indicemaxtabvars[i]); 1999 } 2000 fclose(dependglobaloutput); 2001 /* Write the list of available indice */ 2002 Writethedependavailablefile(); 2003 /* Write the .dependnbxnby file which contains indices of nbmaillsX, */ 2004 /* nbmailleY and nbmailleZ */ 2005 Writethedependnbxnbyfile(); 2006 /* Write the .depend<namefile> file which contain general informations */ 2007 /* about variable of this file */ 2008 parcours = List_NameOfModule; 2009 while( parcours ) 2010 { 2011 Writethedependlistofmoduleused(parcours->o_nom); 2012 WritedependParameterList(parcours->o_nom); 2013 Writethedependfile(parcours->o_nom,List_Global_Var); 2014 parcours=parcours->suiv; 2015 } 2016 parcours = List_NameOfCommon; 2017 while( parcours ) 2018 { 2019 Writethedependfile(parcours->o_nom,List_Common_Var); 2020 parcours=parcours->suiv; 2021 } 2022 Write_Subroutine_For_Alloc(); 2023 1988 2024 /******************************************************************************/ 1989 2025 /* 7- Create files in AGRIF_INC directory */ 1990 2026 /******************************************************************************/ 1991 creefichieramr(NameTamponfile); 1992 1993 Write_val_max(); 1994 1995 if ( todebug == 1 ) printf("Out of CONV \n"); 1996 return 0; 2027 2028 creefichieramr(); 2029 2030 Write_val_max(); 2031 2032 if ( todebug == 1 ) printf("Out of CONV \n"); 2033 return 0; 1997 2034 } 1998 2035 #line 2 "convert.yy.c" … … 2003 2040 2004 2041 /* A lexical scanner generated by flex */ 2042 2043 #define yy_create_buffer convert__create_buffer 2044 #define yy_delete_buffer convert__delete_buffer 2045 #define yy_flex_debug convert__flex_debug 2046 #define yy_init_buffer convert__init_buffer 2047 #define yy_flush_buffer convert__flush_buffer 2048 #define yy_load_buffer_state convert__load_buffer_state 2049 #define yy_switch_to_buffer convert__switch_to_buffer 2050 #define yyin convert_in 2051 #define yyleng convert_leng 2052 #define yylex convert_lex 2053 #define yylineno convert_lineno 2054 #define yyout convert_out 2055 #define yyrestart convert_restart 2056 #define yytext convert_text 2057 #define yywrap convert_wrap 2058 #define yyalloc convert_alloc 2059 #define yyrealloc convert_realloc 2060 #define yyfree convert_free 2005 2061 2006 2062 #define FLEX_SCANNER … … 2045 2101 typedef int32_t flex_int32_t; 2046 2102 typedef uint32_t flex_uint32_t; 2103 typedef uint64_t flex_uint64_t; 2047 2104 #else 2048 2105 typedef signed char flex_int8_t; … … 2134 2191 2135 2192 /* Special action meaning "start processing a new file". */ 2136 #define YY_NEW_FILE yyrestart(yyin )2193 #define YY_NEW_FILE convert_restart(convert_in ) 2137 2194 2138 2195 #define YY_END_OF_BUFFER_CHAR 0 … … 2157 2214 #endif 2158 2215 2159 extern yy_size_t yyleng;2160 2161 extern FILE * yyin, *yyout;2216 extern yy_size_t convert_leng; 2217 2218 extern FILE *convert_in, *convert_out; 2162 2219 2163 2220 #define EOB_ACT_CONTINUE_SCAN 0 … … 2171 2228 do \ 2172 2229 { \ 2173 /* Undo effects of setting up yytext. */ \2230 /* Undo effects of setting up convert_text. */ \ 2174 2231 int yyless_macro_arg = (n); \ 2175 2232 YY_LESS_LINENO(yyless_macro_arg);\ … … 2177 2234 YY_RESTORE_YY_MORE_OFFSET \ 2178 2235 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 2179 YY_DO_BEFORE_ACTION; /* set up yytext again */ \2236 YY_DO_BEFORE_ACTION; /* set up convert_text again */ \ 2180 2237 } \ 2181 2238 while ( 0 ) … … 2240 2297 * 2241 2298 * When we actually see the EOF, we change the status to "new" 2242 * (via yyrestart()), so that the user can continue scanning by2243 * just pointing yyin at a new input file.2299 * (via convert_restart()), so that the user can continue scanning by 2300 * just pointing convert_in at a new input file. 2244 2301 */ 2245 2302 #define YY_BUFFER_EOF_PENDING 2 … … 2268 2325 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 2269 2326 2270 /* yy_hold_char holds the character lost when yytext is formed. */2327 /* yy_hold_char holds the character lost when convert_text is formed. */ 2271 2328 static char yy_hold_char; 2272 2329 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ 2273 yy_size_t yyleng;2330 yy_size_t convert_leng; 2274 2331 2275 2332 /* Points to current character in buffer. */ … … 2278 2335 static int yy_start = 0; /* start state number */ 2279 2336 2280 /* Flag which is used to allow yywrap()'s to do buffer switches2281 * instead of setting up a fresh yyin. A bit of a hack ...2337 /* Flag which is used to allow convert_wrap()'s to do buffer switches 2338 * instead of setting up a fresh convert_in. A bit of a hack ... 2282 2339 */ 2283 2340 static int yy_did_buffer_switch_on_eof; 2284 2341 2285 void yyrestart (FILE *input_file );2286 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );2287 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );2288 void yy_delete_buffer (YY_BUFFER_STATE b );2289 void yy_flush_buffer (YY_BUFFER_STATE b );2290 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );2291 void yypop_buffer_state (void );2292 2293 static void yyensure_buffer_stack (void );2294 static void yy_load_buffer_state (void );2295 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );2296 2297 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )2298 2299 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );2300 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );2301 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );2302 2303 void * yyalloc (yy_size_t );2304 void * yyrealloc (void *,yy_size_t );2305 void yyfree (void * );2306 2307 #define yy_new_buffer yy_create_buffer2342 void convert_restart (FILE *input_file ); 2343 void convert__switch_to_buffer (YY_BUFFER_STATE new_buffer ); 2344 YY_BUFFER_STATE convert__create_buffer (FILE *file,int size ); 2345 void convert__delete_buffer (YY_BUFFER_STATE b ); 2346 void convert__flush_buffer (YY_BUFFER_STATE b ); 2347 void convert_push_buffer_state (YY_BUFFER_STATE new_buffer ); 2348 void convert_pop_buffer_state (void ); 2349 2350 static void convert_ensure_buffer_stack (void ); 2351 static void convert__load_buffer_state (void ); 2352 static void convert__init_buffer (YY_BUFFER_STATE b,FILE *file ); 2353 2354 #define YY_FLUSH_BUFFER convert__flush_buffer(YY_CURRENT_BUFFER ) 2355 2356 YY_BUFFER_STATE convert__scan_buffer (char *base,yy_size_t size ); 2357 YY_BUFFER_STATE convert__scan_string (yyconst char *yy_str ); 2358 YY_BUFFER_STATE convert__scan_bytes (yyconst char *bytes,yy_size_t len ); 2359 2360 void *convert_alloc (yy_size_t ); 2361 void *convert_realloc (void *,yy_size_t ); 2362 void convert_free (void * ); 2363 2364 #define yy_new_buffer convert__create_buffer 2308 2365 2309 2366 #define yy_set_interactive(is_interactive) \ 2310 2367 { \ 2311 2368 if ( ! YY_CURRENT_BUFFER ){ \ 2312 yyensure_buffer_stack (); \2369 convert_ensure_buffer_stack (); \ 2313 2370 YY_CURRENT_BUFFER_LVALUE = \ 2314 yy_create_buffer(yyin,YY_BUF_SIZE ); \2371 convert__create_buffer(convert_in,YY_BUF_SIZE ); \ 2315 2372 } \ 2316 2373 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ … … 2320 2377 { \ 2321 2378 if ( ! YY_CURRENT_BUFFER ){\ 2322 yyensure_buffer_stack (); \2379 convert_ensure_buffer_stack (); \ 2323 2380 YY_CURRENT_BUFFER_LVALUE = \ 2324 yy_create_buffer(yyin,YY_BUF_SIZE ); \2381 convert__create_buffer(convert_in,YY_BUF_SIZE ); \ 2325 2382 } \ 2326 2383 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ … … 2331 2388 /* Begin user sect3 */ 2332 2389 2390 #define convert_wrap(n) 1 2391 #define YY_SKIP_YYWRAP 2392 2333 2393 typedef unsigned char YY_CHAR; 2334 2394 2335 FILE * yyin = (FILE *) 0, *yyout = (FILE *) 0;2395 FILE *convert_in = (FILE *) 0, *convert_out = (FILE *) 0; 2336 2396 2337 2397 typedef int yy_state_type; 2338 2398 2339 extern int yylineno;2340 2341 int yylineno = 1;2342 2343 extern char * yytext;2344 #define yytext_ptr yytext2399 extern int convert_lineno; 2400 2401 int convert_lineno = 1; 2402 2403 extern char *convert_text; 2404 #define yytext_ptr convert_text 2345 2405 2346 2406 static yy_state_type yy_get_previous_state (void ); … … 2350 2410 2351 2411 /* Done after the current pattern has been matched and before the 2352 * corresponding action - sets up yytext.2412 * corresponding action - sets up convert_text. 2353 2413 */ 2354 2414 #define YY_DO_BEFORE_ACTION \ 2355 2415 (yytext_ptr) = yy_bp; \ 2356 yyleng = (size_t) (yy_cp - yy_bp); \2416 convert_leng = (yy_size_t) (yy_cp - yy_bp); \ 2357 2417 (yy_hold_char) = *yy_cp; \ 2358 2418 *yy_cp = '\0'; \ 2359 2419 (yy_c_buf_p) = yy_cp; 2360 2420 2361 #define YY_NUM_RULES 1 22362 #define YY_END_OF_BUFFER 1 32421 #define YY_NUM_RULES 15 2422 #define YY_END_OF_BUFFER 16 2363 2423 /* This struct is not used in this scanner, 2364 2424 but its presence is necessary. */ … … 2368 2428 flex_int32_t yy_nxt; 2369 2429 }; 2370 static yyconst flex_int16_t yy_accept[ 77] =2430 static yyconst flex_int16_t yy_accept[84] = 2371 2431 { 0, 2372 0, 0, 0, 0, 13, 12, 11, 10, 12, 9, 2373 12, 12, 12, 9, 8, 8, 8, 8, 8, 8, 2374 11, 0, 4, 7, 7, 7, 5, 8, 8, 8, 2375 8, 8, 8, 8, 6, 8, 8, 8, 8, 3, 2376 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2377 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2378 8, 8, 8, 8, 8, 2, 8, 8, 8, 1, 2379 8, 8, 8, 8, 6, 0 2432 0, 0, 0, 0, 16, 15, 14, 13, 15, 12, 2433 11, 11, 11, 11, 12, 7, 10, 10, 10, 10, 2434 10, 10, 10, 14, 0, 4, 11, 9, 9, 9, 2435 5, 10, 10, 10, 10, 10, 10, 10, 10, 8, 2436 10, 10, 10, 10, 10, 3, 10, 6, 10, 10, 2437 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 2438 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 2439 10, 10, 2, 10, 10, 10, 1, 10, 10, 10, 2440 10, 8, 0 2380 2441 } ; 2381 2442 … … 2388 2449 6, 1, 1, 7, 1, 1, 1, 8, 9, 10, 2389 2450 11, 8, 8, 8, 12, 8, 8, 13, 14, 1, 2390 1, 1, 1, 1, 15, 16, 16, 17, 18, 19,2391 2 0, 16, 21, 16, 16, 22, 23, 24, 25, 26,2392 1 6, 27, 28, 29, 30, 16, 16, 31, 32, 16,2393 3 3, 1, 34, 1, 35, 1, 36, 16, 16, 37,2394 2395 38, 39, 40, 16, 41, 16, 16, 42, 43, 44,2396 4 5, 46, 16, 47, 48, 49, 50, 16, 16, 51,2397 5 2, 16, 1, 1, 1, 1, 1, 1, 1, 1,2451 15, 1, 1, 1, 16, 17, 17, 18, 19, 20, 2452 21, 17, 22, 17, 23, 24, 25, 26, 27, 28, 2453 17, 29, 30, 31, 32, 17, 17, 33, 34, 17, 2454 35, 1, 36, 1, 37, 1, 38, 17, 17, 39, 2455 2456 40, 41, 42, 17, 43, 17, 44, 45, 46, 47, 2457 48, 49, 17, 50, 51, 52, 53, 17, 17, 54, 2458 55, 17, 1, 1, 1, 1, 1, 1, 1, 1, 2398 2459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2399 2460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … … 2412 2473 } ; 2413 2474 2414 static yyconst flex_int32_t yy_meta[5 3] =2475 static yyconst flex_int32_t yy_meta[56] = 2415 2476 { 0, 2416 2477 1, 1, 2, 1, 1, 1, 1, 3, 3, 3, 2417 3, 3, 1, 1, 3, 3, 3, 3, 3, 3,2478 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 2418 2479 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2419 3, 3, 1, 1, 3, 3, 3, 3, 3, 3,2480 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 2420 2481 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2421 3, 3 2482 3, 3, 3, 3, 3 2422 2483 } ; 2423 2484 2424 static yyconst flex_int16_t yy_base[ 79] =2485 static yyconst flex_int16_t yy_base[86] = 2425 2486 { 0, 2426 0, 0, 0, 0, 150, 164, 147, 164, 144, 164, 2427 36, 37, 38, 134, 0, 44, 32, 34, 44, 33, 2428 144, 141, 140, 164, 164, 164, 164, 0, 131, 31, 2429 34, 42, 39, 49, 0, 50, 49, 38, 56, 0, 2430 59, 52, 107, 68, 106, 72, 75, 72, 77, 81, 2431 79, 76, 75, 86, 73, 88, 85, 89, 90, 79, 2432 93, 86, 99, 97, 103, 0, 37, 115, 114, 0, 2433 108, 116, 121, 112, 0, 164, 160, 57 2487 0, 0, 0, 0, 192, 194, 186, 194, 176, 194, 2488 48, 53, 58, 69, 164, 194, 0, 60, 51, 47, 2489 49, 67, 55, 173, 170, 169, 90, 194, 194, 194, 2490 194, 0, 160, 53, 62, 58, 66, 62, 74, 0, 2491 85, 95, 94, 82, 101, 0, 101, 0, 91, 134, 2492 96, 133, 100, 103, 99, 105, 109, 106, 102, 101, 2493 113, 99, 115, 113, 119, 127, 123, 139, 130, 142, 2494 137, 132, 0, 81, 144, 143, 0, 136, 144, 150, 2495 139, 0, 194, 190, 81 2434 2496 } ; 2435 2497 2436 static yyconst flex_int16_t yy_def[ 79] =2498 static yyconst flex_int16_t yy_def[86] = 2437 2499 { 0, 2438 76, 1, 1, 1, 76, 76, 76, 76, 77, 76, 2439 76, 76, 76, 76, 78, 78, 78, 78, 78, 78, 2440 76, 77, 77, 76, 76, 76, 76, 78, 78, 78, 2441 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 2442 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 2443 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 2444 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 2445 78, 78, 78, 78, 78, 0, 76, 76 2500 83, 1, 1, 1, 83, 83, 83, 83, 84, 83, 2501 83, 83, 83, 83, 83, 83, 85, 85, 85, 85, 2502 85, 85, 85, 83, 84, 84, 83, 83, 83, 83, 2503 83, 85, 85, 85, 85, 85, 85, 85, 85, 85, 2504 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 2505 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 2506 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 2507 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 2508 85, 85, 0, 83, 83 2446 2509 } ; 2447 2510 2448 static yyconst flex_int16_t yy_nxt[2 17] =2511 static yyconst flex_int16_t yy_nxt[250] = 2449 2512 { 0, 2450 6, 7, 8, 9, 10, 10, 10, 6, 11, 12, 2451 13, 6, 14, 10, 15, 15, 15, 15, 16, 15, 2452 15, 15, 15, 17, 18, 19, 15, 15, 15, 20, 2453 15, 15, 10, 10, 15, 15, 15, 15, 16, 15, 2454 15, 15, 15, 17, 18, 19, 15, 15, 15, 20, 2455 15, 15, 24, 25, 26, 29, 31, 32, 33, 28, 2456 34, 36, 37, 38, 30, 39, 40, 41, 42, 43, 2457 44, 69, 24, 25, 26, 45, 31, 32, 46, 33, 2458 34, 36, 37, 38, 30, 39, 40, 41, 42, 43, 2459 48, 44, 50, 51, 52, 45, 53, 54, 46, 55, 2460 2461 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 2462 48, 66, 50, 51, 52, 67, 53, 54, 68, 55, 2463 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 2464 35, 66, 70, 71, 72, 67, 73, 74, 68, 75, 2465 49, 47, 35, 23, 23, 21, 27, 23, 21, 76, 2466 35, 76, 70, 71, 72, 76, 73, 74, 76, 75, 2467 22, 76, 22, 5, 76, 76, 76, 76, 76, 76, 2468 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2469 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2470 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2471 2472 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2473 76, 76, 76, 76, 76, 76 2513 6, 7, 8, 9, 10, 10, 10, 11, 12, 13, 2514 14, 11, 15, 10, 16, 17, 17, 17, 17, 18, 2515 17, 17, 19, 17, 17, 20, 21, 22, 17, 17, 2516 17, 23, 17, 17, 10, 10, 17, 17, 17, 17, 2517 18, 17, 17, 19, 17, 17, 20, 21, 22, 17, 2518 17, 17, 23, 17, 17, 27, 27, 27, 27, 27, 2519 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 2520 28, 33, 35, 36, 37, 29, 27, 27, 27, 27, 2521 27, 34, 38, 32, 39, 41, 30, 42, 43, 44, 2522 45, 28, 46, 35, 36, 37, 29, 27, 27, 27, 2523 2524 27, 27, 34, 47, 38, 39, 41, 30, 42, 43, 2525 44, 45, 48, 46, 49, 50, 51, 76, 52, 53, 2526 55, 57, 58, 59, 47, 60, 61, 62, 63, 64, 2527 65, 66, 67, 48, 68, 49, 50, 69, 51, 52, 2528 53, 55, 57, 58, 59, 70, 60, 61, 62, 63, 2529 64, 65, 66, 67, 71, 68, 72, 73, 69, 74, 2530 75, 40, 77, 78, 79, 80, 70, 81, 82, 56, 2531 54, 40, 26, 26, 24, 71, 31, 72, 73, 26, 2532 74, 75, 40, 77, 78, 79, 80, 24, 81, 82, 2533 25, 83, 25, 5, 83, 83, 83, 83, 83, 83, 2534 2535 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2536 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2537 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2538 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2539 83, 83, 83, 83, 83, 83, 83, 83, 83 2474 2540 } ; 2475 2541 2476 static yyconst flex_int16_t yy_chk[2 17] =2542 static yyconst flex_int16_t yy_chk[250] = 2477 2543 { 0, 2478 2544 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … … 2481 2547 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2482 2548 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2483 1, 1, 11, 12, 13, 16, 17, 18, 19, 78, 2484 20, 30, 31, 32, 16, 33, 34, 36, 37, 38, 2485 39, 67, 11, 12, 13, 41, 17, 18, 42, 19, 2486 20, 30, 31, 32, 16, 33, 34, 36, 37, 38, 2487 44, 39, 46, 47, 48, 41, 49, 50, 42, 51, 2488 2489 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 2490 44, 62, 46, 47, 48, 63, 49, 50, 64, 51, 2491 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 2492 65, 62, 68, 69, 71, 63, 72, 73, 64, 74, 2493 45, 43, 29, 23, 22, 21, 14, 9, 7, 5, 2494 65, 0, 68, 69, 71, 0, 72, 73, 0, 74, 2495 77, 0, 77, 76, 76, 76, 76, 76, 76, 76, 2496 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2497 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2498 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2499 2500 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 2501 76, 76, 76, 76, 76, 76 2549 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 2550 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 2551 12, 18, 19, 20, 21, 13, 14, 14, 14, 14, 2552 14, 18, 22, 85, 23, 34, 14, 35, 36, 37, 2553 38, 12, 39, 19, 20, 21, 13, 27, 27, 27, 2554 2555 27, 27, 18, 41, 22, 23, 34, 14, 35, 36, 2556 37, 38, 42, 39, 43, 44, 45, 74, 47, 49, 2557 51, 53, 54, 55, 41, 56, 57, 58, 59, 60, 2558 61, 62, 63, 42, 64, 43, 44, 65, 45, 47, 2559 49, 51, 53, 54, 55, 66, 56, 57, 58, 59, 2560 60, 61, 62, 63, 67, 64, 68, 69, 65, 70, 2561 71, 72, 75, 76, 78, 79, 66, 80, 81, 52, 2562 50, 33, 26, 25, 24, 67, 15, 68, 69, 9, 2563 70, 71, 72, 75, 76, 78, 79, 7, 80, 81, 2564 84, 5, 84, 83, 83, 83, 83, 83, 83, 83, 2565 2566 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2567 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2568 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2569 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 2570 83, 83, 83, 83, 83, 83, 83, 83, 83 2502 2571 } ; 2503 2572 … … 2505 2574 static char *yy_last_accepting_cpos; 2506 2575 2507 extern int yy_flex_debug;2508 int yy_flex_debug = 0;2576 extern int convert__flex_debug; 2577 int convert__flex_debug = 0; 2509 2578 2510 2579 /* The intent behind this definition is that it'll catch … … 2515 2584 #define YY_MORE_ADJ 0 2516 2585 #define YY_RESTORE_YY_MORE_OFFSET 2517 char * yytext;2586 char *convert_text; 2518 2587 #line 1 "convert.lex" 2519 2588 /******************************************************************************/ … … 2552 2621 /******************************************************************************/ 2553 2622 2554 #line 37"convert.lex"2623 #line 40 "convert.lex" 2555 2624 #include <math.h> 2556 2625 #include <stdlib.h> 2557 2626 #include <string.h> 2558 int line_num=1; 2559 extern FILE * yyin; 2560 #define MAX_INCLUDE_DEPTH 30 2561 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; 2562 #line 566 "convert.yy.c" 2627 2628 #define YY_NO_INPUT 2629 #line 595 "convert.yy.c" 2563 2630 2564 2631 #define INITIAL 0 … … 2582 2649 These are made visible to non-reentrant scanners for convenience. */ 2583 2650 2584 int yylex_destroy (void );2585 2586 int yyget_debug (void );2587 2588 void yyset_debug (int debug_flag );2589 2590 YY_EXTRA_TYPE yyget_extra (void );2591 2592 void yyset_extra (YY_EXTRA_TYPE user_defined );2593 2594 FILE * yyget_in (void );2595 2596 void yyset_in (FILE * in_str );2597 2598 FILE * yyget_out (void );2599 2600 void yyset_out (FILE * out_str );2601 2602 yy_size_t yyget_leng (void );2603 2604 char * yyget_text (void );2605 2606 int yyget_lineno (void );2607 2608 void yyset_lineno (int line_number );2651 int convert_lex_destroy (void ); 2652 2653 int convert_get_debug (void ); 2654 2655 void convert_set_debug (int debug_flag ); 2656 2657 YY_EXTRA_TYPE convert_get_extra (void ); 2658 2659 void convert_set_extra (YY_EXTRA_TYPE user_defined ); 2660 2661 FILE *convert_get_in (void ); 2662 2663 void convert_set_in (FILE * in_str ); 2664 2665 FILE *convert_get_out (void ); 2666 2667 void convert_set_out (FILE * out_str ); 2668 2669 yy_size_t convert_get_leng (void ); 2670 2671 char *convert_get_text (void ); 2672 2673 int convert_get_lineno (void ); 2674 2675 void convert_set_lineno (int line_number ); 2609 2676 2610 2677 /* Macros after this point can all be overridden by user definitions in … … 2614 2681 #ifndef YY_SKIP_YYWRAP 2615 2682 #ifdef __cplusplus 2616 extern "C" int yywrap (void );2683 extern "C" int convert_wrap (void ); 2617 2684 #else 2618 extern int yywrap (void );2685 extern int convert_wrap (void ); 2619 2686 #endif 2620 2687 #endif … … 2650 2717 * we now use fwrite(). 2651 2718 */ 2652 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)2719 #define ECHO fwrite( convert_text, convert_leng, 1, convert_out ) 2653 2720 #endif 2654 2721 … … 2663 2730 size_t n; \ 2664 2731 for ( n = 0; n < max_size && \ 2665 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \2732 (c = getc( convert_in )) != EOF && c != '\n'; ++n ) \ 2666 2733 buf[n] = (char) c; \ 2667 2734 if ( c == '\n' ) \ 2668 2735 buf[n++] = (char) c; \ 2669 if ( c == EOF && ferror( yyin ) ) \2736 if ( c == EOF && ferror( convert_in ) ) \ 2670 2737 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 2671 2738 result = n; \ … … 2674 2741 { \ 2675 2742 errno=0; \ 2676 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \2743 while ( (result = fread(buf, 1, max_size, convert_in))==0 && ferror(convert_in)) \ 2677 2744 { \ 2678 2745 if( errno != EINTR) \ … … 2682 2749 } \ 2683 2750 errno=0; \ 2684 clearerr( yyin); \2751 clearerr(convert_in); \ 2685 2752 } \ 2686 2753 }\ … … 2715 2782 #define YY_DECL_IS_OURS 1 2716 2783 2717 extern int yylex (void);2718 2719 #define YY_DECL int yylex (void)2784 extern int convert_lex (void); 2785 2786 #define YY_DECL int convert_lex (void) 2720 2787 #endif /* !YY_DECL */ 2721 2788 2722 /* Code executed at the beginning of each rule, after yytext and yyleng2789 /* Code executed at the beginning of each rule, after convert_text and convert_leng 2723 2790 * have been set up. 2724 2791 */ … … 2743 2810 register int yy_act; 2744 2811 2745 #line 5 5"convert.lex"2746 2747 #line 7 51"convert.yy.c"2812 #line 54 "convert.lex" 2813 2814 #line 780 "convert.yy.c" 2748 2815 2749 2816 if ( !(yy_init) ) … … 2758 2825 (yy_start) = 1; /* first start state */ 2759 2826 2760 if ( ! yyin )2761 yyin = stdin;2762 2763 if ( ! yyout )2764 yyout = stdout;2827 if ( ! convert_in ) 2828 convert_in = stdin; 2829 2830 if ( ! convert_out ) 2831 convert_out = stdout; 2765 2832 2766 2833 if ( ! YY_CURRENT_BUFFER ) { 2767 yyensure_buffer_stack ();2834 convert_ensure_buffer_stack (); 2768 2835 YY_CURRENT_BUFFER_LVALUE = 2769 yy_create_buffer(yyin,YY_BUF_SIZE );2836 convert__create_buffer(convert_in,YY_BUF_SIZE ); 2770 2837 } 2771 2838 2772 yy_load_buffer_state( );2839 convert__load_buffer_state( ); 2773 2840 } 2774 2841 … … 2777 2844 yy_cp = (yy_c_buf_p); 2778 2845 2779 /* Support of yytext. */2846 /* Support of convert_text. */ 2780 2847 *yy_cp = (yy_hold_char); 2781 2848 … … 2798 2865 { 2799 2866 yy_current_state = (int) yy_def[yy_current_state]; 2800 if ( yy_current_state >= 77)2867 if ( yy_current_state >= 84 ) 2801 2868 yy_c = yy_meta[(unsigned int) yy_c]; 2802 2869 } … … 2804 2871 ++yy_cp; 2805 2872 } 2806 while ( yy_base[yy_current_state] != 1 64 );2873 while ( yy_base[yy_current_state] != 194 ); 2807 2874 2808 2875 yy_find_action: … … 2830 2897 case 1: 2831 2898 YY_RULE_SETUP 2832 #line 5 6"convert.lex"2833 return TOK_MODULEMAIN;/* name of the module */2899 #line 55 "convert.lex" 2900 { return TOK_MODULEMAIN; } /* name of the module */ 2834 2901 YY_BREAK 2835 2902 case 2: 2836 2903 YY_RULE_SETUP 2837 #line 5 7"convert.lex"2838 return TOK_NOTGRIDDEP;/* variable which are not grid dependent */2904 #line 56 "convert.lex" 2905 { return TOK_NOTGRIDDEP; } /* variable which are not grid dependent */ 2839 2906 YY_BREAK 2840 2907 case 3: 2841 2908 YY_RULE_SETUP 2842 #line 5 8"convert.lex"2843 return TOK_USE; 2909 #line 57 "convert.lex" 2910 { return TOK_USE; } 2844 2911 YY_BREAK 2845 2912 case 4: 2846 2913 YY_RULE_SETUP 2847 #line 5 9"convert.lex"2848 { }2914 #line 58 "convert.lex" 2915 { } 2849 2916 YY_BREAK 2850 2917 case 5: 2851 2918 YY_RULE_SETUP 2852 #line 60"convert.lex"2853 return TOK_SEP; 2919 #line 59 "convert.lex" 2920 { return TOK_SEP; } 2854 2921 YY_BREAK 2855 2922 case 6: 2856 2923 YY_RULE_SETUP 2857 #line 6 1"convert.lex"2858 { strcpy(yylval.na,yytext); return TOK_USEITEM;}2924 #line 60 "convert.lex" 2925 { return TOK_KIND; } 2859 2926 YY_BREAK 2860 2927 case 7: 2861 2928 YY_RULE_SETUP 2862 #line 6 2"convert.lex"2863 { strcpy(yylval.na,yytext); return TOK_PROBTYPE;}2929 #line 61 "convert.lex" 2930 { return TOK_EQUAL; } 2864 2931 YY_BREAK 2865 /* dimension of the problem */2866 2932 case 8: 2867 2933 YY_RULE_SETUP 2868 #line 6 4"convert.lex"2869 { strcpy(yylval.na,yytext); return TOK_NAME;}2934 #line 62 "convert.lex" 2935 { strcpy(yylval.na,convert_text); return TOK_USEITEM; } 2870 2936 YY_BREAK 2871 2937 case 9: 2872 2938 YY_RULE_SETUP 2873 #line 6 5"convert.lex"2874 { return (int) *yytext;}2939 #line 63 "convert.lex" 2940 { strcpy(yylval.na,convert_text); return TOK_PROBTYPE; } /* dimension of the problem */ 2875 2941 YY_BREAK 2876 2942 case 10: 2877 /* rule 10 can match eol */2878 2943 YY_RULE_SETUP 2879 #line 6 6"convert.lex"2880 { line_num++;return (int) *yytext;}2944 #line 64 "convert.lex" 2945 { strcpy(yylval.na,convert_text); return TOK_NAME; } 2881 2946 YY_BREAK 2882 2947 case 11: 2883 2948 YY_RULE_SETUP 2884 #line 6 7"convert.lex"2885 ; 2949 #line 65 "convert.lex" 2950 { strcpy(yylval.na,convert_text); return TOK_CSTINT; } 2886 2951 YY_BREAK 2887 2952 case 12: 2888 2953 YY_RULE_SETUP 2954 #line 66 "convert.lex" 2955 { return (int) *convert_text; } 2956 YY_BREAK 2957 case 13: 2958 /* rule 13 can match eol */ 2959 YY_RULE_SETUP 2960 #line 67 "convert.lex" 2961 { line_num++; return (int) *convert_text; } 2962 YY_BREAK 2963 case 14: 2964 YY_RULE_SETUP 2889 2965 #line 68 "convert.lex" 2966 ; 2967 YY_BREAK 2968 case 15: 2969 YY_RULE_SETUP 2970 #line 69 "convert.lex" 2890 2971 ECHO; 2891 2972 YY_BREAK 2892 #line 896"convert.yy.c"2973 #line 939 "convert.yy.c" 2893 2974 case YY_STATE_EOF(INITIAL): 2894 2975 case YY_STATE_EOF(character): … … 2908 2989 /* We're scanning a new file or input source. It's 2909 2990 * possible that this happened because the user 2910 * just pointed yyin at a new source and called2911 * yylex(). If so, then we have to assure2991 * just pointed convert_in at a new source and called 2992 * convert_lex(). If so, then we have to assure 2912 2993 * consistency between YY_CURRENT_BUFFER and our 2913 2994 * globals. Here is the right place to do so, because … … 2916 2997 */ 2917 2998 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 2918 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;2999 YY_CURRENT_BUFFER_LVALUE->yy_input_file = convert_in; 2919 3000 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 2920 3001 } … … 2969 3050 (yy_did_buffer_switch_on_eof) = 0; 2970 3051 2971 if ( yywrap( ) )3052 if ( convert_wrap( ) ) 2972 3053 { 2973 3054 /* Note: because we've taken care in 2974 3055 * yy_get_next_buffer() to have set up 2975 * yytext, we can now set up3056 * convert_text, we can now set up 2976 3057 * yy_c_buf_p so that if some total 2977 3058 * hoser (like flex itself) wants to … … 3022 3103 } /* end of action switch */ 3023 3104 } /* end of scanning one token */ 3024 } /* end of yylex */3105 } /* end of convert_lex */ 3025 3106 3026 3107 /* yy_get_next_buffer - try to read in a new buffer … … 3100 3181 b->yy_ch_buf = (char *) 3101 3182 /* Include room in for 2 EOB chars. */ 3102 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );3183 convert_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 3103 3184 } 3104 3185 else … … 3132 3213 { 3133 3214 ret_val = EOB_ACT_END_OF_FILE; 3134 yyrestart(yyin );3215 convert_restart(convert_in ); 3135 3216 } 3136 3217 … … 3149 3230 /* Extend the array by 50%, plus the number we really need. */ 3150 3231 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 3151 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );3232 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) convert_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 3152 3233 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 3153 3234 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); … … 3183 3264 { 3184 3265 yy_current_state = (int) yy_def[yy_current_state]; 3185 if ( yy_current_state >= 77)3266 if ( yy_current_state >= 84 ) 3186 3267 yy_c = yy_meta[(unsigned int) yy_c]; 3187 3268 } … … 3211 3292 { 3212 3293 yy_current_state = (int) yy_def[yy_current_state]; 3213 if ( yy_current_state >= 77)3294 if ( yy_current_state >= 84 ) 3214 3295 yy_c = yy_meta[(unsigned int) yy_c]; 3215 3296 } 3216 3297 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 3217 yy_is_jam = (yy_current_state == 76);3298 yy_is_jam = (yy_current_state == 83); 3218 3299 3219 3300 return yy_is_jam ? 0 : yy_current_state; … … 3226 3307 yy_cp = (yy_c_buf_p); 3227 3308 3228 /* undo effects of setting up yytext */3309 /* undo effects of setting up convert_text */ 3229 3310 *yy_cp = (yy_hold_char); 3230 3311 … … 3298 3379 3299 3380 /* Reset buffer status. */ 3300 yyrestart(yyin );3381 convert_restart(convert_in ); 3301 3382 3302 3383 /*FALLTHROUGH*/ … … 3304 3385 case EOB_ACT_END_OF_FILE: 3305 3386 { 3306 if ( yywrap( ) )3387 if ( convert_wrap( ) ) 3307 3388 return EOF; 3308 3389 … … 3324 3405 3325 3406 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 3326 *(yy_c_buf_p) = '\0'; /* preserve yytext */3407 *(yy_c_buf_p) = '\0'; /* preserve convert_text */ 3327 3408 (yy_hold_char) = *++(yy_c_buf_p); 3328 3409 … … 3336 3417 * @note This function does not reset the start condition to @c INITIAL . 3337 3418 */ 3338 void yyrestart (FILE * input_file )3419 void convert_restart (FILE * input_file ) 3339 3420 { 3340 3421 3341 3422 if ( ! YY_CURRENT_BUFFER ){ 3342 yyensure_buffer_stack ();3423 convert_ensure_buffer_stack (); 3343 3424 YY_CURRENT_BUFFER_LVALUE = 3344 yy_create_buffer(yyin,YY_BUF_SIZE );3425 convert__create_buffer(convert_in,YY_BUF_SIZE ); 3345 3426 } 3346 3427 3347 yy_init_buffer(YY_CURRENT_BUFFER,input_file );3348 yy_load_buffer_state( );3428 convert__init_buffer(YY_CURRENT_BUFFER,input_file ); 3429 convert__load_buffer_state( ); 3349 3430 } 3350 3431 … … 3353 3434 * 3354 3435 */ 3355 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )3436 void convert__switch_to_buffer (YY_BUFFER_STATE new_buffer ) 3356 3437 { 3357 3438 3358 3439 /* TODO. We should be able to replace this entire function body 3359 3440 * with 3360 * yypop_buffer_state();3361 * yypush_buffer_state(new_buffer);3441 * convert_pop_buffer_state(); 3442 * convert_push_buffer_state(new_buffer); 3362 3443 */ 3363 yyensure_buffer_stack ();3444 convert_ensure_buffer_stack (); 3364 3445 if ( YY_CURRENT_BUFFER == new_buffer ) 3365 3446 return; … … 3374 3455 3375 3456 YY_CURRENT_BUFFER_LVALUE = new_buffer; 3376 yy_load_buffer_state( );3457 convert__load_buffer_state( ); 3377 3458 3378 3459 /* We don't actually know whether we did this switch during 3379 * EOF ( yywrap()) processing, but the only time this flag3380 * is looked at is after yywrap() is called, so it's safe3460 * EOF (convert_wrap()) processing, but the only time this flag 3461 * is looked at is after convert_wrap() is called, so it's safe 3381 3462 * to go ahead and always set it. 3382 3463 */ … … 3384 3465 } 3385 3466 3386 static void yy_load_buffer_state (void)3467 static void convert__load_buffer_state (void) 3387 3468 { 3388 3469 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 3389 3470 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 3390 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;3471 convert_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 3391 3472 (yy_hold_char) = *(yy_c_buf_p); 3392 3473 } … … 3398 3479 * @return the allocated buffer state. 3399 3480 */ 3400 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )3481 YY_BUFFER_STATE convert__create_buffer (FILE * file, int size ) 3401 3482 { 3402 3483 YY_BUFFER_STATE b; 3403 3484 3404 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );3485 b = (YY_BUFFER_STATE) convert_alloc(sizeof( struct yy_buffer_state ) ); 3405 3486 if ( ! b ) 3406 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );3487 YY_FATAL_ERROR( "out of dynamic memory in convert__create_buffer()" ); 3407 3488 3408 3489 b->yy_buf_size = size; … … 3411 3492 * we need to put in 2 end-of-buffer characters. 3412 3493 */ 3413 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );3494 b->yy_ch_buf = (char *) convert_alloc(b->yy_buf_size + 2 ); 3414 3495 if ( ! b->yy_ch_buf ) 3415 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );3496 YY_FATAL_ERROR( "out of dynamic memory in convert__create_buffer()" ); 3416 3497 3417 3498 b->yy_is_our_buffer = 1; 3418 3499 3419 yy_init_buffer(b,file );3500 convert__init_buffer(b,file ); 3420 3501 3421 3502 return b; … … 3423 3504 3424 3505 /** Destroy the buffer. 3425 * @param b a buffer created with yy_create_buffer()3506 * @param b a buffer created with convert__create_buffer() 3426 3507 * 3427 3508 */ 3428 void yy_delete_buffer (YY_BUFFER_STATE b )3509 void convert__delete_buffer (YY_BUFFER_STATE b ) 3429 3510 { 3430 3511 … … 3436 3517 3437 3518 if ( b->yy_is_our_buffer ) 3438 yyfree((void *) b->yy_ch_buf );3439 3440 yyfree((void *) b );3519 convert_free((void *) b->yy_ch_buf ); 3520 3521 convert_free((void *) b ); 3441 3522 } 3442 3523 3443 3524 /* Initializes or reinitializes a buffer. 3444 3525 * This function is sometimes called more than once on the same buffer, 3445 * such as during a yyrestart() or at EOF.3526 * such as during a convert_restart() or at EOF. 3446 3527 */ 3447 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )3528 static void convert__init_buffer (YY_BUFFER_STATE b, FILE * file ) 3448 3529 3449 3530 { 3450 3531 int oerrno = errno; 3451 3532 3452 yy_flush_buffer(b );3533 convert__flush_buffer(b ); 3453 3534 3454 3535 b->yy_input_file = file; 3455 3536 b->yy_fill_buffer = 1; 3456 3537 3457 /* If b is the current buffer, then yy_init_buffer was _probably_3458 * called from yyrestart() or through yy_get_next_buffer.3538 /* If b is the current buffer, then convert__init_buffer was _probably_ 3539 * called from convert_restart() or through yy_get_next_buffer. 3459 3540 * In that case, we don't want to reset the lineno or column. 3460 3541 */ … … 3473 3554 * 3474 3555 */ 3475 void yy_flush_buffer (YY_BUFFER_STATE b )3556 void convert__flush_buffer (YY_BUFFER_STATE b ) 3476 3557 { 3477 3558 if ( ! b ) … … 3493 3574 3494 3575 if ( b == YY_CURRENT_BUFFER ) 3495 yy_load_buffer_state( );3576 convert__load_buffer_state( ); 3496 3577 } 3497 3578 … … 3502 3583 * 3503 3584 */ 3504 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )3585 void convert_push_buffer_state (YY_BUFFER_STATE new_buffer ) 3505 3586 { 3506 3587 if (new_buffer == NULL) 3507 3588 return; 3508 3589 3509 yyensure_buffer_stack();3510 3511 /* This block is copied from yy_switch_to_buffer. */3590 convert_ensure_buffer_stack(); 3591 3592 /* This block is copied from convert__switch_to_buffer. */ 3512 3593 if ( YY_CURRENT_BUFFER ) 3513 3594 { … … 3523 3604 YY_CURRENT_BUFFER_LVALUE = new_buffer; 3524 3605 3525 /* copied from yy_switch_to_buffer. */3526 yy_load_buffer_state( );3606 /* copied from convert__switch_to_buffer. */ 3607 convert__load_buffer_state( ); 3527 3608 (yy_did_buffer_switch_on_eof) = 1; 3528 3609 } … … 3532 3613 * 3533 3614 */ 3534 void yypop_buffer_state (void)3615 void convert_pop_buffer_state (void) 3535 3616 { 3536 3617 if (!YY_CURRENT_BUFFER) 3537 3618 return; 3538 3619 3539 yy_delete_buffer(YY_CURRENT_BUFFER );3620 convert__delete_buffer(YY_CURRENT_BUFFER ); 3540 3621 YY_CURRENT_BUFFER_LVALUE = NULL; 3541 3622 if ((yy_buffer_stack_top) > 0) … … 3543 3624 3544 3625 if (YY_CURRENT_BUFFER) { 3545 yy_load_buffer_state( );3626 convert__load_buffer_state( ); 3546 3627 (yy_did_buffer_switch_on_eof) = 1; 3547 3628 } … … 3551 3632 * Guarantees space for at least one push. 3552 3633 */ 3553 static void yyensure_buffer_stack (void)3634 static void convert_ensure_buffer_stack (void) 3554 3635 { 3555 3636 yy_size_t num_to_alloc; … … 3562 3643 */ 3563 3644 num_to_alloc = 1; 3564 (yy_buffer_stack) = (struct yy_buffer_state**) yyalloc3645 (yy_buffer_stack) = (struct yy_buffer_state**)convert_alloc 3565 3646 (num_to_alloc * sizeof(struct yy_buffer_state*) 3566 3647 ); 3567 3648 if ( ! (yy_buffer_stack) ) 3568 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );3649 YY_FATAL_ERROR( "out of dynamic memory in convert_ensure_buffer_stack()" ); 3569 3650 3570 3651 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); … … 3581 3662 3582 3663 num_to_alloc = (yy_buffer_stack_max) + grow_size; 3583 (yy_buffer_stack) = (struct yy_buffer_state**) yyrealloc3664 (yy_buffer_stack) = (struct yy_buffer_state**)convert_realloc 3584 3665 ((yy_buffer_stack), 3585 3666 num_to_alloc * sizeof(struct yy_buffer_state*) 3586 3667 ); 3587 3668 if ( ! (yy_buffer_stack) ) 3588 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );3669 YY_FATAL_ERROR( "out of dynamic memory in convert_ensure_buffer_stack()" ); 3589 3670 3590 3671 /* zero only the new slots.*/ … … 3600 3681 * @return the newly allocated buffer state object. 3601 3682 */ 3602 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )3683 YY_BUFFER_STATE convert__scan_buffer (char * base, yy_size_t size ) 3603 3684 { 3604 3685 YY_BUFFER_STATE b; … … 3610 3691 return 0; 3611 3692 3612 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );3693 b = (YY_BUFFER_STATE) convert_alloc(sizeof( struct yy_buffer_state ) ); 3613 3694 if ( ! b ) 3614 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );3695 YY_FATAL_ERROR( "out of dynamic memory in convert__scan_buffer()" ); 3615 3696 3616 3697 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ … … 3624 3705 b->yy_buffer_status = YY_BUFFER_NEW; 3625 3706 3626 yy_switch_to_buffer(b );3707 convert__switch_to_buffer(b ); 3627 3708 3628 3709 return b; 3629 3710 } 3630 3711 3631 /** Setup the input buffer state to scan a string. The next call to yylex() will3712 /** Setup the input buffer state to scan a string. The next call to convert_lex() will 3632 3713 * scan from a @e copy of @a str. 3633 3714 * @param yystr a NUL-terminated string to scan … … 3635 3716 * @return the newly allocated buffer state object. 3636 3717 * @note If you want to scan bytes that may contain NUL values, then use 3637 * yy_scan_bytes() instead.3718 * convert__scan_bytes() instead. 3638 3719 */ 3639 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )3720 YY_BUFFER_STATE convert__scan_string (yyconst char * yystr ) 3640 3721 { 3641 3722 3642 return yy_scan_bytes(yystr,strlen(yystr) );3643 } 3644 3645 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will3723 return convert__scan_bytes(yystr,strlen(yystr) ); 3724 } 3725 3726 /** Setup the input buffer state to scan the given bytes. The next call to convert_lex() will 3646 3727 * scan from a @e copy of @a bytes. 3647 3728 * @param yybytes the byte buffer to scan … … 3650 3731 * @return the newly allocated buffer state object. 3651 3732 */ 3652 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )3733 YY_BUFFER_STATE convert__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) 3653 3734 { 3654 3735 YY_BUFFER_STATE b; … … 3659 3740 /* Get memory for full buffer, including space for trailing EOB's. */ 3660 3741 n = _yybytes_len + 2; 3661 buf = (char *) yyalloc(n );3742 buf = (char *) convert_alloc(n ); 3662 3743 if ( ! buf ) 3663 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );3744 YY_FATAL_ERROR( "out of dynamic memory in convert__scan_bytes()" ); 3664 3745 3665 3746 for ( i = 0; i < _yybytes_len; ++i ) … … 3668 3749 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 3669 3750 3670 b = yy_scan_buffer(buf,n );3751 b = convert__scan_buffer(buf,n ); 3671 3752 if ( ! b ) 3672 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );3753 YY_FATAL_ERROR( "bad buffer in convert__scan_bytes()" ); 3673 3754 3674 3755 /* It's okay to grow etc. this buffer, and we should throw it … … 3696 3777 do \ 3697 3778 { \ 3698 /* Undo effects of setting up yytext. */ \3779 /* Undo effects of setting up convert_text. */ \ 3699 3780 int yyless_macro_arg = (n); \ 3700 3781 YY_LESS_LINENO(yyless_macro_arg);\ 3701 yytext[yyleng] = (yy_hold_char); \3702 (yy_c_buf_p) = yytext + yyless_macro_arg; \3782 convert_text[convert_leng] = (yy_hold_char); \ 3783 (yy_c_buf_p) = convert_text + yyless_macro_arg; \ 3703 3784 (yy_hold_char) = *(yy_c_buf_p); \ 3704 3785 *(yy_c_buf_p) = '\0'; \ 3705 yyleng = yyless_macro_arg; \3786 convert_leng = yyless_macro_arg; \ 3706 3787 } \ 3707 3788 while ( 0 ) … … 3712 3793 * 3713 3794 */ 3714 int yyget_lineno (void)3795 int convert_get_lineno (void) 3715 3796 { 3716 3797 3717 return yylineno;3798 return convert_lineno; 3718 3799 } 3719 3800 … … 3721 3802 * 3722 3803 */ 3723 FILE * yyget_in (void)3724 { 3725 return yyin;3804 FILE *convert_get_in (void) 3805 { 3806 return convert_in; 3726 3807 } 3727 3808 … … 3729 3810 * 3730 3811 */ 3731 FILE * yyget_out (void)3732 { 3733 return yyout;3812 FILE *convert_get_out (void) 3813 { 3814 return convert_out; 3734 3815 } 3735 3816 … … 3737 3818 * 3738 3819 */ 3739 yy_size_t yyget_leng (void)3740 { 3741 return yyleng;3820 yy_size_t convert_get_leng (void) 3821 { 3822 return convert_leng; 3742 3823 } 3743 3824 … … 3746 3827 */ 3747 3828 3748 char * yyget_text (void)3749 { 3750 return yytext;3829 char *convert_get_text (void) 3830 { 3831 return convert_text; 3751 3832 } 3752 3833 … … 3755 3836 * 3756 3837 */ 3757 void yyset_lineno (int line_number )3838 void convert_set_lineno (int line_number ) 3758 3839 { 3759 3840 3760 yylineno = line_number;3841 convert_lineno = line_number; 3761 3842 } 3762 3843 … … 3765 3846 * @param in_str A readable stream. 3766 3847 * 3767 * @see yy_switch_to_buffer3848 * @see convert__switch_to_buffer 3768 3849 */ 3769 void yyset_in (FILE * in_str )3770 { 3771 yyin = in_str ;3772 } 3773 3774 void yyset_out (FILE * out_str )3775 { 3776 yyout = out_str ;3777 } 3778 3779 int yyget_debug (void)3780 { 3781 return yy_flex_debug;3782 } 3783 3784 void yyset_debug (int bdebug )3785 { 3786 yy_flex_debug = bdebug ;3850 void convert_set_in (FILE * in_str ) 3851 { 3852 convert_in = in_str ; 3853 } 3854 3855 void convert_set_out (FILE * out_str ) 3856 { 3857 convert_out = out_str ; 3858 } 3859 3860 int convert_get_debug (void) 3861 { 3862 return convert__flex_debug; 3863 } 3864 3865 void convert_set_debug (int bdebug ) 3866 { 3867 convert__flex_debug = bdebug ; 3787 3868 } 3788 3869 … … 3790 3871 { 3791 3872 /* Initialization is the same as for the non-reentrant scanner. 3792 * This function is called from yylex_destroy(), so don't allocate here.3873 * This function is called from convert_lex_destroy(), so don't allocate here. 3793 3874 */ 3794 3875 … … 3802 3883 /* Defined in main.c */ 3803 3884 #ifdef YY_STDINIT 3804 yyin = stdin;3805 yyout = stdout;3885 convert_in = stdin; 3886 convert_out = stdout; 3806 3887 #else 3807 yyin = (FILE *) 0;3808 yyout = (FILE *) 0;3888 convert_in = (FILE *) 0; 3889 convert_out = (FILE *) 0; 3809 3890 #endif 3810 3891 3811 3892 /* For future reference: Set errno on error, since we are called by 3812 * yylex_init()3893 * convert_lex_init() 3813 3894 */ 3814 3895 return 0; 3815 3896 } 3816 3897 3817 /* yylex_destroy is for both reentrant and non-reentrant scanners. */3818 int yylex_destroy (void)3898 /* convert_lex_destroy is for both reentrant and non-reentrant scanners. */ 3899 int convert_lex_destroy (void) 3819 3900 { 3820 3901 3821 3902 /* Pop the buffer stack, destroying each element. */ 3822 3903 while(YY_CURRENT_BUFFER){ 3823 yy_delete_buffer(YY_CURRENT_BUFFER );3904 convert__delete_buffer(YY_CURRENT_BUFFER ); 3824 3905 YY_CURRENT_BUFFER_LVALUE = NULL; 3825 yypop_buffer_state();3906 convert_pop_buffer_state(); 3826 3907 } 3827 3908 3828 3909 /* Destroy the stack itself. */ 3829 yyfree((yy_buffer_stack) );3910 convert_free((yy_buffer_stack) ); 3830 3911 (yy_buffer_stack) = NULL; 3831 3912 3832 3913 /* Reset the globals. This is important in a non-reentrant scanner so the next time 3833 * yylex() is called, initialization will occur. */3914 * convert_lex() is called, initialization will occur. */ 3834 3915 yy_init_globals( ); 3835 3916 … … 3861 3942 #endif 3862 3943 3863 void * yyalloc (yy_size_t size )3944 void *convert_alloc (yy_size_t size ) 3864 3945 { 3865 3946 return (void *) malloc( size ); 3866 3947 } 3867 3948 3868 void * yyrealloc (void * ptr, yy_size_t size )3949 void *convert_realloc (void * ptr, yy_size_t size ) 3869 3950 { 3870 3951 /* The cast to (char *) in the following accommodates both … … 3878 3959 } 3879 3960 3880 void yyfree (void * ptr )3881 { 3882 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */3961 void convert_free (void * ptr ) 3962 { 3963 free( (char *) ptr ); /* see convert_realloc() for (char *) cast */ 3883 3964 } 3884 3965 3885 3966 #define YYTABLES_NAME "yytables" 3886 3967 3887 #line 68 "convert.lex" 3888 3889 3890 3891 3892 int yywrap() 3893 { 3894 } 3895 3896 3897 yyerror(char *s) 3898 { 3899 if (!strcasecmp(curfile,mainfile)) 3900 { 3901 printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile); 3902 } 3903 else 3904 { 3905 printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile); 3906 } 3907 exit(0); 3908 } 3909 3968 #line 69 "convert.lex" 3969 3970 3971
Note: See TracChangeset
for help on using the changeset viewer.