Ticket #46260: _NscLib__NscParser.ypp.patch
File _NscLib__NscParser.ypp.patch, 9.3 KB (added by jmroot (Joshua Root), 10 years ago) |
---|
-
_NscLib/NscParser.ypp
old new shift_expression: 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 … … relational_expression: 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 … … equality_expression: 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 … … logical_and_expression: 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 … … logical_or_expression: 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 … … assignment_expression: 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 … … qualified_type_specifier: 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 … … labeled_statement: 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 … … expression_statement: 680 680 selection_statement: 681 681 if_start statement_blank_error 682 682 { 683 $$ = NscBuild5Block ( IF, $1, 0, NULL, NULL, NULL, $2, NULL);683 $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, $2, NULL); 684 684 } 685 685 | if_else_start statement_blank_error 686 686 { 687 $$ = NscBuild5Block ( IF, $1, 0, NULL, NULL, NULL, NULL, $2);687 $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, NULL, $2); 688 688 } 689 689 | switch_start statement 690 690 { 691 $$ = NscBuild5Block ( SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL);691 $$ = NscBuild5Block (token::SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL); 692 692 } 693 693 ; 694 694 … … if_else_start: 696 696 if_start statement_blank_error ELSE 697 697 { 698 698 NscBuildSaveLine (0); 699 $$ = NscBuild5Block ( IF, $1, 1, NULL, NULL, NULL, $2, NULL);699 $$ = NscBuild5Block (token::IF, $1, 1, NULL, NULL, NULL, $2, NULL); 700 700 } 701 701 ; 702 702 703 703 if_start: 704 704 IF '(' { NscBuildSaveLine (0); } expression ')' 705 705 { 706 $$ = NscBuild5Block ( IF, NULL, 1, NULL, $4, NULL, NULL, NULL);706 $$ = NscBuild5Block (token::IF, NULL, 1, NULL, $4, NULL, NULL, NULL); 707 707 } 708 708 ; 709 709 710 710 switch_start: 711 711 SWITCH { NscBuildSaveLine (0); } '(' expression ')' 712 712 { 713 $$ = NscBuild5Block ( SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL);713 $$ = NscBuild5Block (token::SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL); 714 714 } 715 715 ; 716 716 … … switch_start: 723 723 iteration_statement: 724 724 while_start statement 725 725 { 726 $$ = NscBuild5Block ( WHILE, $1, 0, NULL, NULL, NULL, $2, NULL);726 $$ = NscBuild5Block (token::WHILE, $1, 0, NULL, NULL, NULL, $2, NULL); 727 727 } 728 728 | do_start statement WHILE { NscBuildSaveLine (0); } '(' expression ')' ';' 729 729 { 730 $$ = NscBuild5Block ( DO, $1, 0, NULL, $6, NULL, $2, NULL);730 $$ = NscBuild5Block (token::DO, $1, 0, NULL, $6, NULL, $2, NULL); 731 731 } 732 732 | for_start statement 733 733 { 734 $$ = NscBuild5Block ( FOR, $1, 0, NULL, NULL, NULL, $2, NULL);734 $$ = NscBuild5Block (token::FOR, $1, 0, NULL, NULL, NULL, $2, NULL); 735 735 } 736 736 ; 737 737 738 738 for_start: 739 739 for_start_start ';' ';' ')' 740 740 { 741 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL);741 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL); 742 742 } 743 743 | for_start_start expression ';' ';' ')' 744 744 { 745 $$ = NscBuild5Block ( FOR, NULL, 1, $2, NULL, NULL, NULL, NULL);745 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, NULL, NULL, NULL); 746 746 } 747 747 | for_start_start ';' expression ';' ')' 748 748 { 749 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, $3, NULL, NULL, NULL);749 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, NULL, NULL, NULL); 750 750 } 751 751 | for_start_start expression ';' expression ';' ')' 752 752 { 753 $$ = NscBuild5Block ( FOR, NULL, 1, $2, $4, NULL, NULL, NULL);753 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, NULL, NULL, NULL); 754 754 } 755 755 | for_start_start ';' ';' expression ')' 756 756 { 757 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, NULL, $4, NULL, NULL);757 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, $4, NULL, NULL); 758 758 } 759 759 | for_start_start expression ';' ';' expression ')' 760 760 { 761 $$ = NscBuild5Block ( FOR, NULL, 1, $2, NULL, $5, NULL, NULL);761 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, $5, NULL, NULL); 762 762 } 763 763 | for_start_start ';' expression ';' expression ')' 764 764 { 765 $$ = NscBuild5Block ( FOR, NULL, 1, NULL, $3, $5, NULL, NULL);765 $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, $5, NULL, NULL); 766 766 } 767 767 | for_start_start expression ';' expression ';' expression ')' 768 768 { 769 $$ = NscBuild5Block ( FOR, NULL, 1, $2, $4, $6, NULL, NULL);769 $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, $6, NULL, NULL); 770 770 } 771 771 ; 772 772 … … for_start_start: 780 780 while_start: 781 781 WHILE '(' { NscBuildSaveLine (0); } expression ')' 782 782 { 783 $$ = NscBuild5Block ( WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL);783 $$ = NscBuild5Block (token::WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL); 784 784 } 785 785 ; 786 786 787 787 do_start: 788 788 DO 789 789 { 790 $$ = NscBuild5Block ( DO, NULL, 1, NULL, NULL, NULL, NULL, NULL);790 $$ = NscBuild5Block (token::DO, NULL, 1, NULL, NULL, NULL, NULL, NULL); 791 791 } 792 792 ; 793 793 … … do_start: 800 800 jump_statement: 801 801 CONTINUE { NscBuildSaveLine (0); } ';' 802 802 { 803 $$ = NscBuildBreakContinue ( CONTINUE);803 $$ = NscBuildBreakContinue (token::CONTINUE); 804 804 } 805 805 | BREAK { NscBuildSaveLine (0); } ';' 806 806 { 807 $$ = NscBuildBreakContinue ( BREAK);807 $$ = NscBuildBreakContinue (token::BREAK); 808 808 } 809 809 | return_start ';' 810 810 {