Ticket #41600: nwntools.2.3.2-bison-3.patch
File nwntools.2.3.2-bison-3.patch, 34.5 KB (added by akimd (Akim Demaille), 10 years ago) |
---|
-
_NscLib/NscCompiler.cpp
diff nwntools-2.3.2/_NscLib/NscCompiler.cpp nwntools-2.3.2.new/_NscLib/NscCompiler.cpp
old new 67 67 // 68 68 //----------------------------------------------------------------------------- 69 69 70 inline void NscAddToken (c har *pszName, int nToken)70 inline void NscAddToken (const char *pszName, int nToken) 71 71 { 72 72 NscSymbol *pSymbol = g_sNscReservedWords .Add ( 73 73 pszName, NscSymType_Token); … … 106 106 // 107 107 // Add the reserved words 108 108 // 109 // "Import" token definitions. 110 typedef yy::parser::token token; 109 111 110 NscAddToken ("int", INT_TYPE);111 NscAddToken ("float", FLOAT_TYPE);112 NscAddToken ("object", OBJECT_TYPE);113 NscAddToken ("string", STRING_TYPE);114 NscAddToken ("struct", STRUCT_TYPE);115 NscAddToken ("void", VOID_TYPE);116 NscAddToken ("vector", VECTOR_TYPE);117 NscAddToken ("action", ACTION_TYPE);118 119 NscAddToken ("break", BREAK);120 NscAddToken ("case", CASE);121 NscAddToken ("continue", CONTINUE);122 NscAddToken ("default", DEFAULT);123 NscAddToken ("do", DO);124 NscAddToken ("else", ELSE);125 NscAddToken ("for", FOR);126 NscAddToken ("if", IF);127 NscAddToken ("return", RETURN);128 NscAddToken ("switch", SWITCH);129 NscAddToken ("while", WHILE);112 NscAddToken ("int", token::INT_TYPE); 113 NscAddToken ("float", token::FLOAT_TYPE); 114 NscAddToken ("object", token::OBJECT_TYPE); 115 NscAddToken ("string", token::STRING_TYPE); 116 NscAddToken ("struct", token::STRUCT_TYPE); 117 NscAddToken ("void", token::VOID_TYPE); 118 NscAddToken ("vector", token::VECTOR_TYPE); 119 NscAddToken ("action", token::ACTION_TYPE); 120 121 NscAddToken ("break", token::BREAK); 122 NscAddToken ("case", token::CASE); 123 NscAddToken ("continue", token::CONTINUE); 124 NscAddToken ("default", token::DEFAULT); 125 NscAddToken ("do", token::DO); 126 NscAddToken ("else", token::ELSE); 127 NscAddToken ("for", token::FOR); 128 NscAddToken ("if", token::IF); 129 NscAddToken ("return", token::RETURN); 130 NscAddToken ("switch", token::SWITCH); 131 NscAddToken ("while", token::WHILE); 130 132 if (fEnableExtensions || nVersion >= 999) 131 NscAddToken ("const", NWCONST); 132 133 NscAddToken ("OBJECT_SELF", OBJECT_SELF_CONST); 134 NscAddToken ("OBJECT_INVALID", OBJECT_INVALID_CONST); 133 NscAddToken ("const", token::NWCONST); 135 134 135 NscAddToken ("OBJECT_SELF", token::OBJECT_SELF_CONST); 136 NscAddToken ("OBJECT_INVALID", token::OBJECT_INVALID_CONST); 136 137 // 137 138 // Read NWSCRIPT 138 139 // … … 373 374 // 374 375 //---------------------------------------------------------------------------- 375 376 376 void yy::parser::error (const yy::parser::location_type& l, 377 const std::string& m) { 377 void yy::parser::error (const std::string& m) { 378 378 context.yyerror(m.c_str()); 379 379 } 380 380 -
_NscLib/NscContext.cpp
diff nwntools-2.3.2/_NscLib/NscContext.cpp nwntools-2.3.2.new/_NscLib/NscContext.cpp
old new 150 150 151 151 int CNscContext::yylex (YYSTYPE* yylval) 152 152 { 153 // "Import" token definitions. 154 typedef yy::parser::token token; 153 155 154 156 // 155 157 // Initialize lvalue … … 230 232 if (pSymbol != NULL) 231 233 { 232 234 assert (pSymbol ->nSymType == NscSymType_Token); 233 if (pSymbol ->nToken == ENGINE_TYPE)235 if (pSymbol ->nToken == token::ENGINE_TYPE) 234 236 { 235 237 CNscPStackEntry *pEntry = GetPStackEntry (__FILE__, __LINE__); 236 238 pEntry ->SetType ((NscType) ( … … 246 248 CNscPStackEntry *pEntry = GetPStackEntry (__FILE__, __LINE__); 247 249 pEntry ->SetIdentifier (pszStart, nCount); 248 250 *yylval = pEntry; 249 return IDENTIFIER;251 return token::IDENTIFIER; 250 252 } 251 253 } 252 254 … … 305 307 pEntry ->SetType (NscType_Integer); 306 308 pEntry ->PushConstantInteger (nValue); 307 309 *yylval = pEntry; 308 return INTEGER_CONST;310 return token::INTEGER_CONST; 309 311 } 310 312 311 313 // … … 359 361 { 360 362 pEntry ->SetType (NscType_Float); 361 363 pEntry ->PushConstantFloat ((float) atof (psz)); 362 return FLOAT_CONST;364 return token::FLOAT_CONST; 363 365 } 364 366 else 365 367 { 366 368 pEntry ->SetType (NscType_Integer); 367 369 pEntry ->PushConstantInteger (atol (psz)); 368 return INTEGER_CONST;370 return token::INTEGER_CONST; 369 371 } 370 372 } 371 373 } … … 414 416 else if (c == '=') 415 417 { 416 418 m_pStreamTop ->pszNextTokenPos++; 417 return DIVEQ;419 return token::DIVEQ; 418 420 } 419 421 else 420 422 { … … 441 443 if (c == '=') 442 444 { 443 445 m_pStreamTop ->pszNextTokenPos++; 444 return ADDEQ;446 return token::ADDEQ; 445 447 } 446 448 else if (c == '+') 447 449 { 448 450 m_pStreamTop ->pszNextTokenPos++; 449 return PLUSPLUS;451 return token::PLUSPLUS; 450 452 } 451 453 else 452 454 return '+'; … … 457 459 if (c == '=') 458 460 { 459 461 m_pStreamTop ->pszNextTokenPos++; 460 return SUBEQ;462 return token::SUBEQ; 461 463 } 462 464 else if (c == '-') 463 465 { 464 466 m_pStreamTop ->pszNextTokenPos++; 465 return MINUSMINUS;467 return token::MINUSMINUS; 466 468 } 467 469 else 468 470 return '-'; … … 473 475 if (c == '=') 474 476 { 475 477 m_pStreamTop ->pszNextTokenPos++; 476 return MULEQ;478 return token::MULEQ; 477 479 } 478 480 else 479 481 return '*'; … … 484 486 if (c == '=') 485 487 { 486 488 m_pStreamTop ->pszNextTokenPos++; 487 return MODEQ;489 return token::MODEQ; 488 490 } 489 491 else 490 492 return '%'; … … 495 497 if (c == '=') 496 498 { 497 499 m_pStreamTop ->pszNextTokenPos++; 498 return XOREQ;500 return token::XOREQ; 499 501 } 500 502 else 501 503 return '^'; … … 506 508 if (c == '=') 507 509 { 508 510 m_pStreamTop ->pszNextTokenPos++; 509 return ANDEQ;511 return token::ANDEQ; 510 512 } 511 513 else if (c == '&') 512 514 { 513 515 m_pStreamTop ->pszNextTokenPos++; 514 return ANDAND;516 return token::ANDAND; 515 517 } 516 518 else 517 519 return '&'; … … 522 524 if (c == '=') 523 525 { 524 526 m_pStreamTop ->pszNextTokenPos++; 525 return OREQ;527 return token::OREQ; 526 528 } 527 529 else if (c == '|') 528 530 { 529 531 m_pStreamTop ->pszNextTokenPos++; 530 return OROR;532 return token::OROR; 531 533 } 532 534 else 533 535 return '|'; … … 538 540 if (c == '=') 539 541 { 540 542 m_pStreamTop ->pszNextTokenPos++; 541 return NOTEQ;543 return token::NOTEQ; 542 544 } 543 545 else 544 546 return '!'; … … 549 551 if (c == '=') 550 552 { 551 553 m_pStreamTop ->pszNextTokenPos++; 552 return EQ;554 return token::EQ; 553 555 } 554 556 else 555 557 return '='; … … 560 562 if (c == '=') 561 563 { 562 564 m_pStreamTop ->pszNextTokenPos++; 563 return LTEQ;565 return token::LTEQ; 564 566 } 565 567 else if (c == '<') 566 568 { … … 569 571 if (c == '=') 570 572 { 571 573 m_pStreamTop ->pszNextTokenPos++; 572 return SLEQ;574 return token::SLEQ; 573 575 } 574 576 else 575 return SL;577 return token::SL; 576 578 } 577 579 else 578 580 return '<'; … … 583 585 if (c == '=') 584 586 { 585 587 m_pStreamTop ->pszNextTokenPos++; 586 return GTEQ;588 return token::GTEQ; 587 589 } 588 590 else if (c == '>') 589 591 { … … 592 594 if (c == '=') 593 595 { 594 596 m_pStreamTop ->pszNextTokenPos++; 595 return SREQ;597 return token::SREQ; 596 598 } 597 599 else if (c == '>') 598 600 { … … 601 603 if (c == '=') 602 604 { 603 605 m_pStreamTop ->pszNextTokenPos++; 604 return USREQ;606 return token::USREQ; 605 607 } 606 608 else 607 return USR;609 return token::USR; 608 610 } 609 611 else 610 return SR;612 return token::SR; 611 613 } 612 614 else 613 615 return '>'; … … 626 628 pEntry ->SetType (NscType_String); 627 629 pEntry ->PushConstantString (pszStart, (int) (pszOut - pszStart)); 628 630 *yylval = pEntry; 629 return STRING_CONST;631 return token::STRING_CONST; 630 632 } 631 633 else if (c == '\\') 632 634 { … … 646 648 pEntry ->PushConstantString (pszStart, (int) (pszOut - pszStart)); 647 649 *yylval = pEntry; 648 650 GenerateError ("Unterminated string"); 649 return STRING_CONST;651 return token::STRING_CONST; 650 652 } 651 653 else 652 654 *pszOut++ = c; … … 898 900 { 899 901 NscSymbol *pSymbol = g_sNscReservedWords .Add ( 900 902 pszVTmp, NscSymType_Token); 901 pSymbol ->nToken = ENGINE_TYPE; 903 typedef yy::parser::token token; 904 pSymbol ->nToken = token::ENGINE_TYPE; 902 905 pSymbol ->nEngineObject = nIndex; 903 906 } 904 907 } -
_NscLib/NscDecompiler.cpp
diff nwntools-2.3.2/_NscLib/NscDecompiler.cpp nwntools-2.3.2.new/_NscLib/NscDecompiler.cpp
old new 225 225 char szByteText [128]; 226 226 char szOpText [512]; 227 227 char szOpType [32]; 228 c har *pszOpRoot;228 const char *pszOpRoot; 229 229 230 230 // 231 231 // Switch based on the next opcode -
_NscLib/NscParser.ypp
diff nwntools-2.3.2/_NscLib/NscParser.ypp nwntools-2.3.2.new/_NscLib/NscParser.ypp
old new 273 273 } 274 274 | shift_expression SL additive_expression 275 275 { 276 $$ = NscBuildBinaryOp ( SL, $1, $3);276 $$ = NscBuildBinaryOp (token::SL, $1, $3); 277 277 } 278 278 | shift_expression SR additive_expression 279 279 { 280 $$ = NscBuildBinaryOp ( SR, $1, $3);280 $$ = NscBuildBinaryOp (token::SR, $1, $3); 281 281 } 282 282 | shift_expression USR additive_expression 283 283 { 284 $$ = NscBuildBinaryOp ( USR, $1, $3);284 $$ = NscBuildBinaryOp (token::USR, $1, $3); 285 285 } 286 286 ; 287 287 … … 300 300 } 301 301 | relational_expression LTEQ shift_expression 302 302 { 303 $$ = NscBuildBinaryOp ( LTEQ, $1, $3);303 $$ = NscBuildBinaryOp (token::LTEQ, $1, $3); 304 304 } 305 305 | relational_expression GTEQ shift_expression 306 306 { 307 $$ = NscBuildBinaryOp ( GTEQ, $1, $3);307 $$ = NscBuildBinaryOp (token::GTEQ, $1, $3); 308 308 } 309 309 ; 310 310 … … 315 315 } 316 316 | equality_expression EQ relational_expression 317 317 { 318 $$ = NscBuildBinaryOp ( EQ, $1, $3);318 $$ = NscBuildBinaryOp (token::EQ, $1, $3); 319 319 } 320 320 | equality_expression NOTEQ relational_expression 321 321 { 322 $$ = NscBuildBinaryOp ( NOTEQ, $1, $3);322 $$ = NscBuildBinaryOp (token::NOTEQ, $1, $3); 323 323 } 324 324 ; 325 325 … … 363 363 } 364 364 | logical_and_expression ANDAND inclusive_or_expression 365 365 { 366 $$ = NscBuildLogicalOp ( ANDAND, $1, $3);366 $$ = NscBuildLogicalOp (token::ANDAND, $1, $3); 367 367 } 368 368 ; 369 369 … … 374 374 } 375 375 | logical_or_expression OROR logical_and_expression 376 376 { 377 $$ = NscBuildLogicalOp ( OROR, $1, $3);377 $$ = NscBuildLogicalOp (token::OROR, $1, $3); 378 378 } 379 379 ; 380 380 … … 400 400 } 401 401 | unary_expression MULEQ assignment_expression 402 402 { 403 $$ = NscBuildBinaryOp ( MULEQ, $1, $3);403 $$ = NscBuildBinaryOp (token::MULEQ, $1, $3); 404 404 } 405 405 | unary_expression DIVEQ assignment_expression 406 406 { 407 $$ = NscBuildBinaryOp ( DIVEQ, $1, $3);407 $$ = NscBuildBinaryOp (token::DIVEQ, $1, $3); 408 408 } 409 409 | unary_expression MODEQ assignment_expression 410 410 { 411 $$ = NscBuildBinaryOp ( MODEQ, $1, $3);411 $$ = NscBuildBinaryOp (token::MODEQ, $1, $3); 412 412 } 413 413 | unary_expression ADDEQ assignment_expression 414 414 { 415 $$ = NscBuildBinaryOp ( ADDEQ, $1, $3);415 $$ = NscBuildBinaryOp (token::ADDEQ, $1, $3); 416 416 } 417 417 | unary_expression SUBEQ assignment_expression 418 418 { 419 $$ = NscBuildBinaryOp ( SUBEQ, $1, $3);419 $$ = NscBuildBinaryOp (token::SUBEQ, $1, $3); 420 420 } 421 421 | unary_expression SLEQ assignment_expression 422 422 { 423 $$ = NscBuildBinaryOp ( SLEQ, $1, $3);423 $$ = NscBuildBinaryOp (token::SLEQ, $1, $3); 424 424 } 425 425 | unary_expression SREQ assignment_expression 426 426 { 427 $$ = NscBuildBinaryOp ( SREQ, $1, $3);427 $$ = NscBuildBinaryOp (token::SREQ, $1, $3); 428 428 } 429 429 | unary_expression USREQ assignment_expression 430 430 { 431 $$ = NscBuildBinaryOp ( USREQ, $1, $3);431 $$ = NscBuildBinaryOp (token::USREQ, $1, $3); 432 432 } 433 433 | unary_expression ANDEQ assignment_expression 434 434 { 435 $$ = NscBuildBinaryOp ( ANDEQ, $1, $3);435 $$ = NscBuildBinaryOp (token::ANDEQ, $1, $3); 436 436 } 437 437 | unary_expression XOREQ assignment_expression 438 438 { 439 $$ = NscBuildBinaryOp ( XOREQ, $1, $3);439 $$ = NscBuildBinaryOp (token::XOREQ, $1, $3); 440 440 } 441 441 | unary_expression OREQ assignment_expression 442 442 { 443 $$ = NscBuildBinaryOp ( OREQ, $1, $3);443 $$ = NscBuildBinaryOp (token::OREQ, $1, $3); 444 444 } 445 445 ; 446 446 … … 480 480 type_specifier: 481 481 VOID_TYPE 482 482 { 483 $$ = NscBuildType ( VOID_TYPE, NULL);483 $$ = NscBuildType (token::VOID_TYPE, NULL); 484 484 } 485 485 | INT_TYPE 486 486 { 487 $$ = NscBuildType ( INT_TYPE, NULL);487 $$ = NscBuildType (token::INT_TYPE, NULL); 488 488 } 489 489 | FLOAT_TYPE 490 490 { 491 $$ = NscBuildType ( FLOAT_TYPE, NULL);491 $$ = NscBuildType (token::FLOAT_TYPE, NULL); 492 492 } 493 493 | OBJECT_TYPE 494 494 { 495 $$ = NscBuildType ( OBJECT_TYPE, NULL);495 $$ = NscBuildType (token::OBJECT_TYPE, NULL); 496 496 } 497 497 | STRING_TYPE 498 498 { 499 $$ = NscBuildType ( STRING_TYPE, NULL);499 $$ = NscBuildType (token::STRING_TYPE, NULL); 500 500 } 501 501 | ACTION_TYPE 502 502 { 503 $$ = NscBuildType ( ACTION_TYPE, NULL);503 $$ = NscBuildType (token::ACTION_TYPE, NULL); 504 504 } 505 505 | VECTOR_TYPE 506 506 { 507 $$ = NscBuildType ( VECTOR_TYPE, NULL);507 $$ = NscBuildType (token::VECTOR_TYPE, NULL); 508 508 } 509 509 | struct_type_start IDENTIFIER 510 510 { 511 $$ = NscBuildType ( STRUCT_TYPE, $2);511 $$ = NscBuildType (token::STRUCT_TYPE, $2); 512 512 } 513 513 | ENGINE_TYPE 514 514 { 515 $$ = NscBuildType ( ENGINE_TYPE, $1);515 $$ = NscBuildType (token::ENGINE_TYPE, $1); 516 516 } 517 517 ; 518 518 … … 600 600 case_statement: 601 601 CASE { NscBuildSaveLine (0); } constant_expression ':' 602 602 { 603 $$ = NscBuildCase ( CASE, $3);603 $$ = NscBuildCase (token::CASE, $3); 604 604 } 605 605 | DEFAULT { NscBuildSaveLine (0); } ':' 606 606 { 607 $$ = NscBuildCase ( DEFAULT, NULL);607 $$ = NscBuildCase (token::DEFAULT, NULL); 608 608 } 609 609 ; 610 610 … … 657 657 | error 658 658 { 659 659 $$ = NULL; 660 # ifdef YYCHAR_NAME 660 661 if (NscBuildSyntaxError (YYCHAR_NAME, yylval)) 661 662 YYABORT; 662 663 while (YYCHAR_NAME != EOF && YYCHAR_NAME != ';' && YYCHAR_NAME != '{' && YYCHAR_NAME != '}') … … 668 669 } 669 670 if (YYCHAR_NAME == ';') 670 671 YYCHAR_NAME = yyempty_; 672 # else // !YYCHAR_NAME 673 if (NscBuildSyntaxError (yyla.type, yyla.value)) 674 YYABORT; 675 while (yyla.type != EOF && yyla.type != ';' && yyla.type != '{' && yyla.type != '}') 676 { 677 if (yyla.value != NULL) 678 yyla.value; //FIXME 679 yyla.type = yytranslate_ (yylex (&yyla.value, context)); 680 } 681 if (yyla.type == ';') 682 yyla.clear (); 683 # endif 671 684 } 672 685 ; 673 686 … … 680 693 selection_statement: 681 694 if_start statement_blank_error 682 695 { 683 $$ = NscBuild5Block ( IF, $1, 0, NULL, NULL, NULL, $2, NULL);696 $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, $2, NULL); 684 697 } 685 698 | if_else_start statement_blank_error 686 699 { 687 $$ = NscBuild5Block ( IF, $1, 0, NULL, NULL, NULL, NULL, $2);700 $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, NULL, $2); 688 701 } 689 702 | switch_start statement 690 703 { 691 $$ = NscBuild5Block ( SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL);704 $$ = NscBuild5Block (token::SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL); 692 705 } 693 706 ; 694 707 … … 696 709 if_start statement_blank_error ELSE 697 710 { 698 711 NscBuildSaveLine (0); 699 $$ = NscBuild5Block ( IF, $1, 1, NULL, NULL, NULL, $2, NULL);712 $$ = NscBuild5Block (token::IF, $1, 1, NULL, NULL, NULL, $2, NULL); 700 713 } 701 714 ; 702 715 703 716 if_start: 704 717 IF '(' { NscBuildSaveLine (0); } expression ')' 705 718 { 706 $$ = NscBuild5Block ( IF, NULL, 1, NULL, $4, NULL, NULL, NULL);719 $$ = NscBuild5Block (token::IF, NULL, 1, NULL, $4, NULL, NULL, NULL); 707 720 } 708 721 ; 709 722 710 723 switch_start: 711 724 SWITCH { NscBuildSaveLine (0); } '(' expression ')' 712 725 { 713 $$ = NscBuild5Block ( SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL);726 $$ = NscBuild5Block (token::SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL); 714 727 } 715 728 ; 716 729 … … 723 736 iteration_statement: 724 737 while_start statement 725 738 { 726 $$ = NscBuild5Block ( WHILE, $1, 0, NULL, NULL, NULL, $2, NULL);739 $$ = NscBuild5Block (token::WHILE, $1, 0, NULL, NULL, NULL, $2, NULL); 727 740 } 728 741 | do_start statement WHILE { NscBuildSaveLine (0); } '(' expression ')' ';' 729 742 { 730 $$ = NscBuild5Block ( DO, $1, 0, NULL, $6, NULL, $2, NULL);743 $$ = NscBuild5Block (token::DO, $1, 0, NULL, $6, NULL, $2, NULL); 731 744 } 732 745 | for_start statement 733 746 { 734 $$ = NscBuild5Block ( FOR, $1, 0, NULL, NULL, NULL, $2, NULL);747 $$ = NscBuild5Block (token::FOR, $1, 0, NULL, NULL, NULL, $2, NULL); 735 748 } 736 749 ; 737 750 738 751 for_start: 739 752 for_start_start ';' ';' ')' 740 753 { 741 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL);754 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL); 742 755 } 743 756 | for_start_start expression ';' ';' ')' 744 757 { 745 $$ = NscBuild5Block ( FOR, NULL, 1, $2, NULL, NULL, NULL, NULL);758 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, NULL, NULL, NULL); 746 759 } 747 760 | for_start_start ';' expression ';' ')' 748 761 { 749 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, $3, NULL, NULL, NULL);762 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, NULL, NULL, NULL); 750 763 } 751 764 | for_start_start expression ';' expression ';' ')' 752 765 { 753 $$ = NscBuild5Block ( FOR, NULL, 1, $2, $4, NULL, NULL, NULL);766 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, NULL, NULL, NULL); 754 767 } 755 768 | for_start_start ';' ';' expression ')' 756 769 { 757 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, NULL, $4, NULL, NULL);770 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, $4, NULL, NULL); 758 771 } 759 772 | for_start_start expression ';' ';' expression ')' 760 773 { 761 $$ = NscBuild5Block ( FOR, NULL, 1, $2, NULL, $5, NULL, NULL);774 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, $5, NULL, NULL); 762 775 } 763 776 | for_start_start ';' expression ';' expression ')' 764 777 { 765 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, $3, $5, NULL, NULL);778 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, $5, NULL, NULL); 766 779 } 767 780 | for_start_start expression ';' expression ';' expression ')' 768 781 { 769 $$ = NscBuild5Block ( FOR, NULL, 1, $2, $4, $6, NULL, NULL);782 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, $6, NULL, NULL); 770 783 } 771 784 ; 772 785 … … 780 793 while_start: 781 794 WHILE '(' { NscBuildSaveLine (0); } expression ')' 782 795 { 783 $$ = NscBuild5Block ( WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL);796 $$ = NscBuild5Block (token::WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL); 784 797 } 785 798 ; 786 799 787 800 do_start: 788 801 DO 789 802 { 790 $$ = NscBuild5Block ( DO, NULL, 1, NULL, NULL, NULL, NULL, NULL);803 $$ = NscBuild5Block (token::DO, NULL, 1, NULL, NULL, NULL, NULL, NULL); 791 804 } 792 805 ; 793 806 … … 800 813 jump_statement: 801 814 CONTINUE { NscBuildSaveLine (0); } ';' 802 815 { 803 $$ = NscBuildBreakContinue ( CONTINUE);816 $$ = NscBuildBreakContinue (token::CONTINUE); 804 817 } 805 818 | BREAK { NscBuildSaveLine (0); } ';' 806 819 { 807 $$ = NscBuildBreakContinue ( BREAK);820 $$ = NscBuildBreakContinue (token::BREAK); 808 821 } 809 822 | return_start ';' 810 823 { … … 984 997 | error 985 998 { 986 999 $$ = NULL; 1000 # ifdef YYCHAR_NAME 987 1001 if (NscBuildSyntaxError (YYCHAR_NAME, yylval)) 988 1002 YYABORT; 989 1003 while (YYCHAR_NAME != EOF && YYCHAR_NAME != ';' && YYCHAR_NAME != '{' && YYCHAR_NAME != '}') … … 994 1008 YYCHAR_NAME = yylex (&yylval, context); 995 1009 } 996 1010 YYCHAR_NAME = yyempty_; 1011 # else // !YYCHAR_NAME 1012 if (NscBuildSyntaxError (yyla.type, yyla.value)) 1013 YYABORT; 1014 while (yyla.type != EOF && yyla.type != ';' && yyla.type != '{' && yyla.type != '}') 1015 { 1016 if (yyla.value != NULL) 1017 yyla.value; //FIXME 1018 yyla.type = yytranslate_ (yylex (&yyla.value, context)); 1019 } 1020 if (yyla.type == ';') 1021 yyla.clear (); 1022 # endif 997 1023 } 998 1024 ; 999 1025 -
_NscLib/NscParserRoutines.cpp
diff nwntools-2.3.2/_NscLib/NscParserRoutines.cpp nwntools-2.3.2.new/_NscLib/NscParserRoutines.cpp
old new 390 390 char szToken [2]; 391 391 const char *pszToken; 392 392 393 // "Import" token definitions. 394 typedef yy::parser::token token; 395 393 396 // 394 397 // Get the token text 395 398 // 396 399 397 400 switch (nToken) 398 401 { 399 case IDENTIFIER:402 case token::IDENTIFIER: 400 403 if (yylval) 401 404 pszToken = yylval ->GetIdentifier (); 402 405 else 403 406 pszToken = "identifier"; 404 407 break; 405 408 406 case INTEGER_CONST:409 case token::INTEGER_CONST: 407 410 pszToken = "integer constant"; 408 411 break; 409 412 410 case FLOAT_CONST:413 case token::FLOAT_CONST: 411 414 pszToken = "float constant"; 412 415 break; 413 416 414 case STRING_CONST:417 case token::STRING_CONST: 415 418 pszToken = "string constant"; 416 419 break; 417 420 418 case ADDEQ:421 case token::ADDEQ: 419 422 pszToken = "+="; 420 423 break; 421 424 422 case SUBEQ:425 case token::SUBEQ: 423 426 pszToken = "-="; 424 427 break; 425 428 426 case MULEQ:429 case token::MULEQ: 427 430 pszToken = "*="; 428 431 break; 429 432 430 case DIVEQ:433 case token::DIVEQ: 431 434 pszToken = "/="; 432 435 break; 433 436 434 case MODEQ:437 case token::MODEQ: 435 438 pszToken = "%="; 436 439 break; 437 440 438 case XOREQ:441 case token::XOREQ: 439 442 pszToken = "^="; 440 443 break; 441 444 442 case ANDEQ:445 case token::ANDEQ: 443 446 pszToken = "&="; 444 447 break; 445 448 446 case OREQ:449 case token::OREQ: 447 450 pszToken = "|="; 448 451 break; 449 452 450 case SL:453 case token::SL: 451 454 pszToken = "<<"; 452 455 break; 453 456 454 case SR:457 case token::SR: 455 458 pszToken = ">>"; 456 459 break; 457 460 458 case USR:461 case token::USR: 459 462 pszToken = ">>>"; 460 463 break; 461 464 462 case SLEQ:465 case token::SLEQ: 463 466 pszToken = "<<="; 464 467 break; 465 468 466 case SREQ:469 case token::SREQ: 467 470 pszToken = ">>="; 468 471 break; 469 472 470 case USREQ:473 case token::USREQ: 471 474 pszToken = ">>>="; 472 475 break; 473 476 474 case EQ:477 case token::EQ: 475 478 pszToken = "=="; 476 479 break; 477 480 478 case NOTEQ:481 case token::NOTEQ: 479 482 pszToken = "!="; 480 483 break; 481 484 482 case LTEQ:485 case token::LTEQ: 483 486 pszToken = "<="; 484 487 break; 485 488 486 case GTEQ:489 case token::GTEQ: 487 490 pszToken = ">="; 488 491 break; 489 492 490 case ANDAND:493 case token::ANDAND: 491 494 pszToken = "&&"; 492 495 break; 493 496 494 case OROR:497 case token::OROR: 495 498 pszToken = "||"; 496 499 break; 497 500 498 case PLUSPLUS:501 case token::PLUSPLUS: 499 502 pszToken = "++"; 500 503 break; 501 504 502 case MINUSMINUS:505 case token::MINUSMINUS: 503 506 pszToken = "--"; 504 507 break; 505 508 506 case FLOAT_TYPE:509 case token::FLOAT_TYPE: 507 510 pszToken = "float"; 508 511 break; 509 512 510 case INT_TYPE:513 case token::INT_TYPE: 511 514 pszToken = "int"; 512 515 break; 513 516 514 case OBJECT_TYPE:517 case token::OBJECT_TYPE: 515 518 pszToken = "object"; 516 519 break; 517 520 518 case STRING_TYPE:521 case token::STRING_TYPE: 519 522 pszToken = "string"; 520 523 break; 521 524 522 case VOID_TYPE:525 case token::VOID_TYPE: 523 526 pszToken = "void"; 524 527 break; 525 528 526 case STRUCT_TYPE:529 case token::STRUCT_TYPE: 527 530 pszToken = "struct"; 528 531 break; 529 532 530 case VECTOR_TYPE:533 case token::VECTOR_TYPE: 531 534 pszToken = "vector"; 532 535 break; 533 536 534 case ENGINE_TYPE:537 case token::ENGINE_TYPE: 535 538 if (yylval) 536 539 { 537 540 int nIndex = yylval ->GetType () - NscType_Engine_0; … … 541 544 pszToken = "engine-type"; 542 545 break; 543 546 544 case ACTION_TYPE:547 case token::ACTION_TYPE: 545 548 pszToken = "action"; 546 549 break; 547 550 548 case OBJECT_SELF_CONST:551 case token::OBJECT_SELF_CONST: 549 552 pszToken = "OBJECT_SELF"; 550 553 break; 551 554 552 case OBJECT_INVALID_CONST:555 case token::OBJECT_INVALID_CONST: 553 556 pszToken = "OBJECT_INVALID"; 554 557 break; 555 558 556 case BREAK:559 case token::BREAK: 557 560 pszToken = "break"; 558 561 break; 559 562 560 case CASE:563 case token::CASE: 561 564 pszToken = "case"; 562 565 break; 563 566 564 case CONTINUE:567 case token::CONTINUE: 565 568 pszToken = "continue"; 566 569 break; 567 570 568 case DEFAULT:571 case token::DEFAULT: 569 572 pszToken = "default"; 570 573 break; 571 574 572 case DO:575 case token::DO: 573 576 pszToken = "do"; 574 577 break; 575 578 576 case ELSE:579 case token::ELSE: 577 580 pszToken = "else"; 578 581 break; 579 582 580 case FOR:583 case token::FOR: 581 584 pszToken = "for"; 582 585 break; 583 586 584 case IF:587 case token::IF: 585 588 pszToken = "if"; 586 589 break; 587 590 588 case RETURN:591 case token::RETURN: 589 592 pszToken = "return"; 590 593 break; 591 594 592 case SWITCH:595 case token::SWITCH: 593 596 pszToken = "switch"; 594 597 break; 595 598 596 case WHILE:599 case token::WHILE: 597 600 pszToken = "while"; 598 601 break; 599 602 600 case NWCONST:603 case token::NWCONST: 601 604 pszToken = "const"; 602 605 break; 603 606 … … 651 654 { 652 655 CNscPStackEntry *pOut = g_pCtx ->GetPStackEntry (__FILE__, __LINE__); 653 656 657 // "Import" token definitions. 658 typedef yy::parser::token token; 659 654 660 // 655 661 // Switch based on the type 656 662 // 657 663 658 664 switch (nType) 659 665 { 660 case VOID_TYPE:666 case token::VOID_TYPE: 661 667 pOut ->SetType (NscType_Void); 662 668 break; 663 669 664 case INT_TYPE:670 case token::INT_TYPE: 665 671 pOut ->SetType (NscType_Integer); 666 672 break; 667 673 668 case FLOAT_TYPE:674 case token::FLOAT_TYPE: 669 675 pOut ->SetType (NscType_Float); 670 676 break; 671 677 672 case OBJECT_TYPE:678 case token::OBJECT_TYPE: 673 679 pOut ->SetType (NscType_Object); 674 680 break; 675 681 676 case STRING_TYPE:682 case token::STRING_TYPE: 677 683 pOut ->SetType (NscType_String); 678 684 break; 679 685 680 case VECTOR_TYPE:686 case token::VECTOR_TYPE: 681 687 pOut ->SetType (NscType_Vector); 682 688 break; 683 689 684 case ACTION_TYPE:690 case token::ACTION_TYPE: 685 691 if (!g_pCtx ->IsNWScript ()) 686 692 { 687 693 g_pCtx ->GenerateError ("\"action\" identifier only " … … 692 698 pOut ->SetType (NscType_Action); 693 699 break; 694 700 695 case STRUCT_TYPE:701 case token::STRUCT_TYPE: 696 702 assert (pId != NULL); 697 703 { 698 704 if (!g_pCtx ->IsPhase2 () && !g_pCtx ->IsNWScript ()) … … 723 729 } 724 730 break; 725 731 726 case ENGINE_TYPE:732 case token::ENGINE_TYPE: 727 733 assert (pId != NULL); 728 734 { 729 735 pOut ->SetType (pId ->GetType ()); … … 2422 2428 { 2423 2429 CNscPStackEntry *pOut = g_pCtx ->GetPStackEntry (__FILE__, __LINE__); 2424 2430 2431 // "Import" token definitions. 2432 typedef yy::parser::token token; 2433 2425 2434 // 2426 2435 // If this is phase1 and we are in a function, do nothing 2427 2436 // … … 2923 2932 } 2924 2933 break; 2925 2934 2926 case SL:2935 case token::SL: 2927 2936 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 2928 2937 { 2929 2938 if (g_pCtx ->GetOptExpression () && … … 2948 2957 } 2949 2958 break; 2950 2959 2951 case SR:2960 case token::SR: 2952 2961 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 2953 2962 { 2954 2963 #ifdef NOT_ENABLED_YET … … 2975 2984 } 2976 2985 break; 2977 2986 2978 case USR:2987 case token::USR: 2979 2988 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 2980 2989 { 2981 2990 #ifdef NOT_ENABLED_YET … … 3086 3095 } 3087 3096 break; 3088 3097 3089 case LTEQ:3098 case token::LTEQ: 3090 3099 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 3091 3100 { 3092 3101 if (g_pCtx ->GetOptExpression () && … … 3128 3137 } 3129 3138 break; 3130 3139 3131 case GTEQ:3140 case token::GTEQ: 3132 3141 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 3133 3142 { 3134 3143 if (g_pCtx ->GetOptExpression () && … … 3170 3179 } 3171 3180 break; 3172 3181 3173 case EQ:3182 case token::EQ: 3174 3183 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 3175 3184 { 3176 3185 if (g_pCtx ->GetOptExpression () && … … 3260 3269 } 3261 3270 break; 3262 3271 3263 case NOTEQ:3272 case token::NOTEQ: 3264 3273 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 3265 3274 { 3266 3275 if (g_pCtx ->GetOptExpression () && … … 3440 3449 } 3441 3450 break; 3442 3451 3443 case MULEQ:3452 case token::MULEQ: 3444 3453 if (nLhsType == NscType_Vector && nRhsType == NscType_Float) 3445 3454 { 3446 3455 NscPushAssignment (pOut, NscPCode_AsnMultiply, … … 3468 3477 } 3469 3478 break; 3470 3479 3471 case DIVEQ:3480 case token::DIVEQ: 3472 3481 if (nLhsType == NscType_Vector && nRhsType == NscType_Float) 3473 3482 { 3474 3483 NscPushAssignment (pOut, NscPCode_AsnDivide, … … 3496 3505 } 3497 3506 break; 3498 3507 3499 case MODEQ:3508 case token::MODEQ: 3500 3509 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 3501 3510 { 3502 3511 NscPushAssignment (pOut, NscPCode_AsnModulus, … … 3509 3518 } 3510 3519 break; 3511 3520 3512 case ADDEQ:3521 case token::ADDEQ: 3513 3522 if (nLhsType == NscType_Vector && nRhsType == NscType_Vector) 3514 3523 { 3515 3524 NscPushAssignment (pOut, NscPCode_AsnAdd, … … 3542 3551 } 3543 3552 break; 3544 3553 3545 case SUBEQ:3554 case token::SUBEQ: 3546 3555 if (nLhsType == NscType_Vector && nRhsType == NscType_Vector) 3547 3556 { 3548 3557 NscPushAssignment (pOut, NscPCode_AsnSubtract, … … 3570 3579 } 3571 3580 break; 3572 3581 3573 case SLEQ:3582 case token::SLEQ: 3574 3583 pszOp = "<<="; 3575 3584 nOp = NscPCode_AsnShiftLeft; 3576 3585 asn_shift_operator:; … … 3586 3595 } 3587 3596 break; 3588 3597 3589 case SREQ:3598 case token::SREQ: 3590 3599 pszOp = ">>="; 3591 3600 nOp = NscPCode_AsnShiftRight; 3592 3601 goto asn_shift_operator; 3593 3602 3594 case USREQ:3603 case token::USREQ: 3595 3604 pszOp = ">>>="; 3596 3605 nOp = NscPCode_AsnUnsignedShiftRight; 3597 3606 goto asn_shift_operator; 3598 3607 3599 case ANDEQ:3608 case token::ANDEQ: 3600 3609 pszOp = "&="; 3601 3610 nOp = NscPCode_AsnBitwiseAND; 3602 3611 asn_bitwise_expression:; … … 3612 3621 } 3613 3622 break; 3614 3623 3615 case XOREQ:3624 case token::XOREQ: 3616 3625 pszOp = "^="; 3617 3626 nOp = NscPCode_AsnBitwiseXOR; 3618 3627 goto asn_bitwise_expression; 3619 3628 3620 case OREQ:3629 case token::OREQ: 3621 3630 pszOp = "|="; 3622 3631 nOp = NscPCode_AsnBitwiseOR; 3623 3632 goto asn_bitwise_expression; … … 3690 3699 else 3691 3700 { 3692 3701 3702 // "Import" token definitions. 3703 typedef yy::parser::token token; 3704 3693 3705 // 3694 3706 // Get operator information 3695 3707 // 3696 3708 3697 3709 const char *pszOp; 3698 3710 NscPCode nOp; 3699 if (nToken == ANDAND)3711 if (nToken == token::ANDAND) 3700 3712 { 3701 3713 pszOp = "&&"; 3702 3714 nOp = NscPCode_LogicalAND; 3703 3715 } 3704 else if (nToken == OROR)3716 else if (nToken == token::OROR) 3705 3717 { 3706 3718 pszOp = "||"; 3707 3719 nOp = NscPCode_LogicalOR; … … 3750 3762 // If the operation is known to be true or false by the lhs 3751 3763 // 3752 3764 3753 else if (nToken == ANDAND && nLhsConstant == 0)3765 else if (nToken == token::ANDAND && nLhsConstant == 0) 3754 3766 { 3755 3767 pOut ->PushConstantInteger (0); 3756 3768 pOut ->SetType (NscType_Integer); 3757 3769 } 3758 else if (nToken == OROR && nLhsConstant == 1)3770 else if (nToken == token::OROR && nLhsConstant == 1) 3759 3771 { 3760 3772 pOut ->PushConstantInteger (1); 3761 3773 pOut ->SetType (NscType_Integer); … … 4673 4685 { 4674 4686 CNscPStackEntry *pOut = g_pCtx ->GetPStackEntry (__FILE__, __LINE__); 4675 4687 4688 // "Import" token definitions. 4689 typedef yy::parser::token token; 4690 4691 4676 4692 // 4677 4693 // If this is phase1 and we are in a function, do nothing 4678 4694 // … … 4706 4722 bool fCheckCond; 4707 4723 switch (nToken) 4708 4724 { 4709 case IF:4725 case token::IF: 4710 4726 nPCode = NscPCode_If; 4711 4727 nFenceType = NscFenceType_If; 4712 4728 pszToken = "if"; … … 4714 4730 fCheckCond = pPrev == NULL; 4715 4731 break; 4716 4732 4717 case WHILE:4733 case token::WHILE: 4718 4734 nPCode = NscPCode_While; 4719 4735 nFenceType = NscFenceType_While; 4720 4736 pszToken = "while"; … … 4722 4738 fCheckCond = pPrev == NULL; 4723 4739 break; 4724 4740 4725 case DO:4741 case token::DO: 4726 4742 nPCode = NscPCode_Do; 4727 4743 nFenceType = NscFenceType_Do; 4728 4744 pszToken = "do"; … … 4730 4746 fCheckCond = pPrev != NULL; 4731 4747 break; 4732 4748 4733 case FOR:4749 case token::FOR: 4734 4750 nPCode = NscPCode_For; 4735 4751 nFenceType = NscFenceType_For; 4736 4752 pszToken = "for"; … … 4738 4754 fCheckCond = pPrev == NULL; 4739 4755 break; 4740 4756 4741 case SWITCH:4757 case token::SWITCH: 4742 4758 nPCode = NscPCode_Switch; 4743 4759 nFenceType = NscFenceType_Switch; 4744 4760 pszToken = "switch"; … … 4787 4803 // for this 4788 4804 // 4789 4805 4790 if (nToken == SWITCH)4806 if (nToken == token::SWITCH) 4791 4807 { 4792 4808 NscSymbolFence *pFence = g_pCtx ->GetCurrentFence (); 4793 4809 pFence ->nPrevLocals++; … … 4806 4822 // then set return 4807 4823 // 4808 4824 4809 if (nToken == IF && pFalse)4825 if (nToken == token::IF && pFalse) 4810 4826 { 4811 4827 if (fHadReturn) 4812 4828 NscSetFenceReturn (true); … … 4976 4992 else 4977 4993 { 4978 4994 4995 // "Import" token definitions. 4996 typedef yy::parser::token token; 4997 4979 4998 // 4980 4999 // Get the conditional 4981 5000 // … … 4992 5011 // If this is a case 4993 5012 // 4994 5013 4995 if (nToken == CASE)5014 if (nToken == token::CASE) 4996 5015 { 4997 5016 4998 5017 // … … 5061 5080 // Test for only one default 5062 5081 // 5063 5082 5064 if (nToken == DEFAULT)5083 if (nToken == token::DEFAULT) 5065 5084 { 5066 5085 if (pFence ->fHasDefault) 5067 5086 { … … 5086 5105 // 5087 5106 5088 5107 NscPCode nPCode; 5089 if (nToken == CASE)5108 if (nToken == token::CASE) 5090 5109 nPCode = NscPCode_Case; 5091 else if (nToken == DEFAULT)5110 else if (nToken == token::DEFAULT) 5092 5111 nPCode = NscPCode_Default; 5093 5112 else 5094 5113 { … … 5245 5264 5246 5265 YYSTYPE NscBuildBreakContinue (int nToken) 5247 5266 { 5267 // "Import" token definitions. 5268 typedef yy::parser::token token; 5269 5248 5270 CNscPStackEntry *pOut = g_pCtx ->GetPStackEntry (__FILE__, __LINE__); 5249 5271 5250 5272 // … … 5262 5284 // 5263 5285 5264 5286 NscPCode nPCode; 5265 if (nToken == BREAK)5287 if (nToken == token::BREAK) 5266 5288 nPCode = NscPCode_Break; 5267 else if (nToken == CONTINUE)5289 else if (nToken == token::CONTINUE) 5268 5290 nPCode = NscPCode_Continue; 5269 5291 else 5270 5292 { … … 5279 5301 NscSymbolFence *pFence = g_pCtx ->GetCurrentFence (); 5280 5302 while (pFence) 5281 5303 { 5282 if ((pFence ->nFenceType == NscFenceType_Switch && nToken == BREAK) ||5304 if ((pFence ->nFenceType == NscFenceType_Switch && nToken == token::BREAK) || 5283 5305 pFence ->nFenceType == NscFenceType_Do || 5284 5306 pFence ->nFenceType == NscFenceType_While || 5285 5307 pFence ->nFenceType == NscFenceType_For) … … 5288 5310 } 5289 5311 if (pFence == NULL) 5290 5312 { 5291 if (nToken == BREAK)5313 if (nToken == token::BREAK) 5292 5314 { 5293 5315 g_pCtx ->GenerateError ("\"break\" statement only allowed in " 5294 5316 "\"switch\", \"do\", \"while\", and \"for\" statements"); 5295 5317 } 5296 else if (nToken == CONTINUE)5318 else if (nToken == token::CONTINUE) 5297 5319 { 5298 5320 g_pCtx ->GenerateError ("\"continue\" statement only allowed in " 5299 5321 "\"do\", \"while\", and \"for\" statements"); -
nwntools-2.3.2
diff nwntools-2.3.2/configure.ac nwntools-2.3.2.new/configure.ac
old new 20 20 # Check bison version, substitute name for yychar 21 21 bison_version=`bison -V | grep "^bison" | awk '{print $4}'` 22 22 bison_v=`echo $bison_version | awk 'BEGIN { FS="." } {printf "%d", $1*10+$2;}'` 23 AC_MSG_RESULT([checking bison version: $bison_version ])23 AC_MSG_RESULT([checking bison version: $bison_version ($bison_v)]) 24 24 25 if test -n "$bison_v" && test "$bison_v" -lt 20 26 then 27 AC_MSG_ERROR([need a bison version >= 2.0]) 28 fi 29 30 if test -n "$bison_v" && test "$bison_v" -eq 20 31 then 25 case $bison_v in 26 (3*) 27 AC_MSG_RESULT([setting lalr1 to use symbols]) 28 ;; 29 (20) 32 30 AC_MSG_RESULT([setting bison lalr1 yychar variable name to yylooka_]) 33 31 AC_DEFINE(YYCHAR_NAME,yylooka_,[name of yychar lookahead var in bison lalr1.cc]) 34 else 32 ;; 33 (2*) 35 34 AC_MSG_RESULT([setting bison lalr1 yychar variable name to yylooka]) 36 35 AC_DEFINE(YYCHAR_NAME,yylooka,[name of yychar lookahead var in bison lalr1.cc]) 37 fi 36 ;; 37 (*) 38 AC_MSG_ERROR([need a bison version >= 2.0]) 39 ;; 40 esac 38 41 39 42 # Check for python 40 43 AM_PATH_PYTHON(2.2,, :)