Changeset 1442
- Timestamp:
- Jun 7, 2012, 1:38:10 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/orbital/generated/gun-parser.cpp
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 36 36 /* First part of user declarations. */ 37 37 38 /* Line 293of lalr1.cc */38 /* Line 310 of lalr1.cc */ 39 39 #line 1 "gun-parser.y" 40 40 … … 61 61 62 62 63 /* Line 293of lalr1.cc */63 /* Line 310 of lalr1.cc */ 64 64 #line 65 "generated/gun-parser.cpp" 65 65 … … 69 69 /* User implementation prologue. */ 70 70 71 /* Line 299of lalr1.cc */71 /* Line 316 of lalr1.cc */ 72 72 #line 66 "gun-parser.y" 73 73 … … 78 78 79 79 80 /* Line 299of lalr1.cc */80 /* Line 316 of lalr1.cc */ 81 81 #line 82 "generated/gun-parser.cpp" 82 82 … … 93 93 #endif 94 94 95 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].96 If N is 0, then set CURRENT to the empty location which ends97 the previous symbol: RHS[0] (always defined). */98 99 #define YYRHSLOC(Rhs, K) ((Rhs)[K])100 #ifndef YYLLOC_DEFAULT101 # define YYLLOC_DEFAULT(Current, Rhs, N) \102 do \103 if (N) \104 { \105 (Current).begin = YYRHSLOC (Rhs, 1).begin; \106 (Current).end = YYRHSLOC (Rhs, N).end; \107 } \108 else \109 { \110 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \111 } \112 while (false)113 #endif114 115 95 /* Suppress unused-variable warnings by "using" E. */ 116 96 #define YYUSE(e) ((void) (e)) … … 164 144 namespace orbital { 165 145 166 /* Line 382 of lalr1.cc */ 167 #line 168 "generated/gun-parser.cpp" 146 /* Line 379 of lalr1.cc */ 147 #line 148 "generated/gun-parser.cpp" 148 #if YYERROR_VERBOSE 168 149 169 150 /* Return YYSTR after stripping away unnecessary quotes and … … 204 185 } 205 186 187 #endif 206 188 207 189 /// Build a parser object. … … 304 286 #endif 305 287 306 inline bool307 GunParser::yy_pact_value_is_default_ (int yyvalue)308 {309 return yyvalue == yypact_ninf_;310 }311 312 inline bool313 GunParser::yy_table_value_is_error_ (int yyvalue)314 {315 return yyvalue == yytable_ninf_;316 }317 318 288 int 319 289 GunParser::parse () … … 337 307 location_type yylloc; 338 308 /// The locations where the error started and ended. 339 location_type yyerror_range[ 3];309 location_type yyerror_range[2]; 340 310 341 311 /// $$. … … 375 345 /* Try to take a decision without lookahead. */ 376 346 yyn = yypact_[yystate]; 377 if (yy _pact_value_is_default_ (yyn))347 if (yyn == yypact_ninf_) 378 348 goto yydefault; 379 349 … … 408 378 if (yyn <= 0) 409 379 { 410 if (yy _table_value_is_error_ (yyn))411 380 if (yyn == 0 || yyn == yytable_ninf_) 381 goto yyerrlab; 412 382 yyn = -yyn; 413 383 goto yyreduce; … … 465 435 case 5: 466 436 467 /* Line 6 90of lalr1.cc */437 /* Line 677 of lalr1.cc */ 468 438 #line 85 "gun-parser.y" 469 439 { gc.m_gun.m_angle = gc.m_gun.AimActor(); } … … 472 442 case 6: 473 443 474 /* Line 6 90of lalr1.cc */444 /* Line 677 of lalr1.cc */ 475 445 #line 86 "gun-parser.y" 476 446 { gc.m_gun.PreAimActor((yysemantic_stack_[(2) - (2)].args).f0); } … … 479 449 case 7: 480 450 481 /* Line 6 90of lalr1.cc */451 /* Line 677 of lalr1.cc */ 482 452 #line 87 "gun-parser.y" 483 453 { gc.m_gun.m_pre_aim = (yysemantic_stack_[(2) - (2)].args).f0; } … … 486 456 case 8: 487 457 488 /* Line 6 90of lalr1.cc */458 /* Line 677 of lalr1.cc */ 489 459 #line 88 "gun-parser.y" 490 460 { gc.m_gun.m_angle = (yysemantic_stack_[(2) - (2)].args).f0; } … … 493 463 case 9: 494 464 495 /* Line 6 90of lalr1.cc */465 /* Line 677 of lalr1.cc */ 496 466 #line 89 "gun-parser.y" 497 467 { gc.m_gun.m_round_duration = (yysemantic_stack_[(2) - (2)].args).f0; } … … 500 470 case 10: 501 471 502 /* Line 6 90of lalr1.cc */472 /* Line 677 of lalr1.cc */ 503 473 #line 90 "gun-parser.y" 504 474 { gc.m_gun.m_angle_offset = (yysemantic_stack_[(2) - (2)].args).f0; } … … 507 477 case 11: 508 478 509 /* Line 6 90of lalr1.cc */479 /* Line 677 of lalr1.cc */ 510 480 #line 91 "gun-parser.y" 511 481 { gc.m_gun.m_radius = (yysemantic_stack_[(2) - (2)].args).f0; } … … 514 484 case 12: 515 485 516 /* Line 6 90of lalr1.cc */486 /* Line 677 of lalr1.cc */ 517 487 #line 92 "gun-parser.y" 518 488 { gc.m_gun.m_shoot_speed = (yysemantic_stack_[(2) - (2)].args).f0; } … … 521 491 case 13: 522 492 523 /* Line 6 90of lalr1.cc */493 /* Line 677 of lalr1.cc */ 524 494 #line 93 "gun-parser.y" 525 495 { /* FIXME: 1st modifier */ } … … 528 498 case 14: 529 499 530 /* Line 6 90of lalr1.cc */500 /* Line 677 of lalr1.cc */ 531 501 #line 94 "gun-parser.y" 532 502 { /* FIXME: 2nd modifier */ } … … 535 505 case 15: 536 506 537 /* Line 6 90of lalr1.cc */507 /* Line 677 of lalr1.cc */ 538 508 #line 95 "gun-parser.y" 539 509 { for (int i = 0; i < (int)(yysemantic_stack_[(2) - (2)].args).f0; i++) gc.m_gun.Shoot(1); … … 544 514 case 16: 545 515 546 /* Line 6 90of lalr1.cc */516 /* Line 677 of lalr1.cc */ 547 517 #line 98 "gun-parser.y" 548 518 { for (int i = 0; i < (int)(yysemantic_stack_[(2) - (2)].args).f0; i++) gc.m_gun.Shoot(0); … … 553 523 case 17: 554 524 555 /* Line 6 90of lalr1.cc */525 /* Line 677 of lalr1.cc */ 556 526 #line 101 "gun-parser.y" 557 527 { gc.m_gun.Shoot(1); gc.m_gun.m_nbshoots = (int)(yysemantic_stack_[(2) - (2)].args).f0 - 1; … … 562 532 case 18: 563 533 564 /* Line 6 90of lalr1.cc */534 /* Line 677 of lalr1.cc */ 565 535 #line 104 "gun-parser.y" 566 536 { gc.m_gun.Shoot(0); gc.m_gun.m_nbshoots = (int)(yysemantic_stack_[(2) - (2)].args).f0 - 1; … … 571 541 case 19: 572 542 573 /* Line 6 90of lalr1.cc */543 /* Line 677 of lalr1.cc */ 574 544 #line 107 "gun-parser.y" 575 545 { gc.m_gun.m_round_timer = gc.m_gun.m_round_duration * (yysemantic_stack_[(2) - (2)].args).f0; … … 579 549 case 20: 580 550 581 /* Line 6 90of lalr1.cc */551 /* Line 677 of lalr1.cc */ 582 552 #line 109 "gun-parser.y" 583 553 { /* FIXME: loops */ } … … 586 556 case 21: 587 557 588 /* Line 6 90of lalr1.cc */558 /* Line 677 of lalr1.cc */ 589 559 #line 112 "gun-parser.y" 590 560 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } … … 593 563 case 22: 594 564 595 /* Line 6 90of lalr1.cc */565 /* Line 677 of lalr1.cc */ 596 566 #line 113 "gun-parser.y" 597 567 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(3) - (3)].fval); } … … 600 570 case 23: 601 571 602 /* Line 6 90of lalr1.cc */572 /* Line 677 of lalr1.cc */ 603 573 #line 114 "gun-parser.y" 604 574 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(3) - (3)].fval); } … … 607 577 case 24: 608 578 609 /* Line 6 90of lalr1.cc */579 /* Line 677 of lalr1.cc */ 610 580 #line 117 "gun-parser.y" 611 581 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } … … 614 584 case 25: 615 585 616 /* Line 6 90of lalr1.cc */586 /* Line 677 of lalr1.cc */ 617 587 #line 118 "gun-parser.y" 618 588 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } … … 621 591 622 592 623 /* Line 6 90of lalr1.cc */624 #line 625 "generated/gun-parser.cpp"593 /* Line 677 of lalr1.cc */ 594 #line 595 "generated/gun-parser.cpp" 625 595 default: 626 596 break; 627 597 } 628 /* User semantic actions sometimes alter yychar, and that requires629 that yytoken be updated with the new translation. We take the630 approach of translating immediately before every use of yytoken.631 One alternative is translating here after every semantic action,632 but that translation would be missed if the semantic action633 invokes YYABORT, YYACCEPT, or YYERROR immediately after altering634 yychar. In the case of YYABORT or YYACCEPT, an incorrect635 destructor might then be invoked immediately. In the case of636 YYERROR, subsequent parser actions might lead to an incorrect637 destructor call or verbose syntax error message before the638 lookahead is translated. */639 598 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 640 599 … … 660 619 `------------------------------------*/ 661 620 yyerrlab: 662 /* Make sure we have latest lookahead translation. See comments at663 user semantic actions for why this is necessary. */664 yytoken = yytranslate_ (yychar);665 666 621 /* If not already recovering from an error, report this error. */ 667 622 if (!yyerrstatus_) 668 623 { 669 624 ++yynerrs_; 670 if (yychar == yyempty_)671 yytoken = yyempty_;672 625 error (yylloc, yysyntax_error_ (yystate, yytoken)); 673 626 } 674 627 675 yyerror_range[ 1] = yylloc;628 yyerror_range[0] = yylloc; 676 629 if (yyerrstatus_ == 3) 677 630 { … … 708 661 goto yyerrorlab; 709 662 710 yyerror_range[ 1] = yylocation_stack_[yylen - 1];663 yyerror_range[0] = yylocation_stack_[yylen - 1]; 711 664 /* Do not reclaim the symbols of the rule which action triggered 712 665 this YYERROR. */ … … 725 678 { 726 679 yyn = yypact_[yystate]; 727 if ( !yy_pact_value_is_default_ (yyn))680 if (yyn != yypact_ninf_) 728 681 { 729 682 yyn += yyterror_; … … 740 693 YYABORT; 741 694 742 yyerror_range[ 1] = yylocation_stack_[0];695 yyerror_range[0] = yylocation_stack_[0]; 743 696 yydestruct_ ("Error: popping", 744 697 yystos_[yystate], … … 749 702 } 750 703 751 yyerror_range[ 2] = yylloc;704 yyerror_range[1] = yylloc; 752 705 // Using YYLLOC is tempting, but would change the location of 753 706 // the lookahead. YYLOC is available though. 754 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);707 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); 755 708 yysemantic_stack_.push (yylval); 756 709 yylocation_stack_.push (yyloc); … … 775 728 yyreturn: 776 729 if (yychar != yyempty_) 777 { 778 /* Make sure we have latest lookahead translation. See comments 779 at user semantic actions for why this is necessary. */ 780 yytoken = yytranslate_ (yychar); 781 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, 782 &yylloc); 783 } 730 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 784 731 785 732 /* Do not reclaim the symbols of the rule which action triggered … … 800 747 // Generate an error message. 801 748 std::string 802 GunParser::yysyntax_error_ (int yystate, int yytoken) 803 { 804 std::string yyres; 805 // Number of reported tokens (one for the "unexpected", one per 806 // "expected"). 807 size_t yycount = 0; 808 // Its maximum. 809 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 810 // Arguments of yyformat. 811 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 812 813 /* There are many possibilities here to consider: 814 - If this state is a consistent state with a default action, then 815 the only way this function was invoked is if the default action 816 is an error action. In that case, don't check for expected 817 tokens because there are none. 818 - The only way there can be no lookahead present (in yytoken) is 819 if this state is a consistent state with a default action. 820 Thus, detecting the absence of a lookahead is sufficient to 821 determine that there is no unexpected or expected token to 822 report. In that case, just report a simple "syntax error". 823 - Don't assume there isn't a lookahead just because this state is 824 a consistent state with a default action. There might have 825 been a previous inconsistent state, consistent state with a 826 non-default action, or user semantic action that manipulated 827 yychar. 828 - Of course, the expected token list depends on states to have 829 correct lookahead information, and it depends on the parser not 830 to perform extra reductions after fetching a lookahead from the 831 scanner and before detecting a syntax error. Thus, state 832 merging (from LALR or IELR) and default reductions corrupt the 833 expected token list. However, the list is correct for 834 canonical LR with one exception: it will still contain any 835 token that will not be accepted due to an error action in a 836 later state. 837 */ 838 if (yytoken != yyempty_) 839 { 840 yyarg[yycount++] = yytname_[yytoken]; 841 int yyn = yypact_[yystate]; 842 if (!yy_pact_value_is_default_ (yyn)) 843 { 844 /* Start YYX at -YYN if negative to avoid negative indexes in 845 YYCHECK. In other words, skip the first -YYN actions for 846 this state because they are default actions. */ 847 int yyxbegin = yyn < 0 ? -yyn : 0; 848 /* Stay within bounds of both yycheck and yytname. */ 849 int yychecklim = yylast_ - yyn + 1; 850 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 851 for (int yyx = yyxbegin; yyx < yyxend; ++yyx) 852 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ 853 && !yy_table_value_is_error_ (yytable_[yyx + yyn])) 854 { 855 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 856 { 857 yycount = 1; 858 break; 859 } 860 else 861 yyarg[yycount++] = yytname_[yyx]; 862 } 863 } 864 } 865 866 char const* yyformat = 0; 867 switch (yycount) 868 { 869 #define YYCASE_(N, S) \ 870 case N: \ 871 yyformat = S; \ 872 break 873 YYCASE_(0, YY_("syntax error")); 874 YYCASE_(1, YY_("syntax error, unexpected %s")); 875 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 876 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 877 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 878 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 879 #undef YYCASE_ 880 } 881 882 // Argument number. 883 size_t yyi = 0; 884 for (char const* yyp = yyformat; *yyp; ++yyp) 885 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) 886 { 887 yyres += yytnamerr_ (yyarg[yyi++]); 888 ++yyp; 889 } 890 else 891 yyres += *yyp; 892 return yyres; 749 GunParser::yysyntax_error_ (int yystate, int tok) 750 { 751 std::string res; 752 YYUSE (yystate); 753 #if YYERROR_VERBOSE 754 int yyn = yypact_[yystate]; 755 if (yypact_ninf_ < yyn && yyn <= yylast_) 756 { 757 /* Start YYX at -YYN if negative to avoid negative indexes in 758 YYCHECK. */ 759 int yyxbegin = yyn < 0 ? -yyn : 0; 760 761 /* Stay within bounds of both yycheck and yytname. */ 762 int yychecklim = yylast_ - yyn + 1; 763 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 764 int count = 0; 765 for (int x = yyxbegin; x < yyxend; ++x) 766 if (yycheck_[x + yyn] == x && x != yyterror_) 767 ++count; 768 769 // FIXME: This method of building the message is not compatible 770 // with internationalization. It should work like yacc.c does it. 771 // That is, first build a string that looks like this: 772 // "syntax error, unexpected %s or %s or %s" 773 // Then, invoke YY_ on this string. 774 // Finally, use the string as a format to output 775 // yytname_[tok], etc. 776 // Until this gets fixed, this message appears in English only. 777 res = "syntax error, unexpected "; 778 res += yytnamerr_ (yytname_[tok]); 779 if (count < 5) 780 { 781 count = 0; 782 for (int x = yyxbegin; x < yyxend; ++x) 783 if (yycheck_[x + yyn] == x && x != yyterror_) 784 { 785 res += (!count++) ? ", expecting " : " or "; 786 res += yytnamerr_ (yytname_[x]); 787 } 788 } 789 } 790 else 791 #endif 792 res = YY_("syntax error"); 793 return res; 893 794 } 894 795 … … 907 808 }; 908 809 909 /* YYDEFACT[S] -- default r eduction number in state S. Performed when910 YYTABLE doesn't specify something else to do. Zero means the911 default is anerror. */810 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE 811 doesn't specify something else to do. Zero means the default is an 812 error. */ 912 813 const unsigned char 913 814 GunParser::yydefact_[] = … … 936 837 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 937 838 positive, shift that token. If negative, reduce the rule which 938 number is the opposite. If YYTABLE_NINF_, syntax error. */839 number is the opposite. If zero, do what YYDEFACT says. */ 939 840 const signed char GunParser::yytable_ninf_ = -1; 940 841 const unsigned char … … 1136 1037 } // orbital 1137 1038 1138 /* Line 1 136of lalr1.cc */1139 #line 1 140"generated/gun-parser.cpp"1140 1141 1142 /* Line 1 138of lalr1.cc */1039 /* Line 1053 of lalr1.cc */ 1040 #line 1041 "generated/gun-parser.cpp" 1041 1042 1043 /* Line 1055 of lalr1.cc */ 1143 1044 #line 121 "gun-parser.y" 1144 1045 -
trunk/orbital/generated/gun-parser.h
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 41 41 #include <iostream> 42 42 #include "stack.hh" 43 44 45 namespace orbital { 46 47 /* Line 34 of lalr1.cc */ 48 #line 49 "generated/gun-parser.h" 49 class position; 50 class location; 51 52 } // orbital 53 54 /* Line 34 of lalr1.cc */ 55 #line 56 "generated/gun-parser.h" 56 43 57 #include "location.hh" 44 58 … … 61 75 #endif 62 76 77 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 78 If N is 0, then set CURRENT to the empty location which ends 79 the previous symbol: RHS[0] (always defined). */ 80 81 #ifndef YYLLOC_DEFAULT 82 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 83 do { \ 84 if (N) \ 85 { \ 86 (Current).begin = (Rhs)[1].begin; \ 87 (Current).end = (Rhs)[N].end; \ 88 } \ 89 else \ 90 { \ 91 (Current).begin = (Current).end = (Rhs)[0].end; \ 92 } \ 93 } while (false) 94 #endif 95 63 96 64 97 namespace orbital { 65 98 66 /* Line 3 5of lalr1.cc */67 #line 68"generated/gun-parser.h"99 /* Line 34 of lalr1.cc */ 100 #line 101 "generated/gun-parser.h" 68 101 69 102 /// A Bison parser. … … 76 109 { 77 110 78 /* Line 3 5of lalr1.cc */111 /* Line 34 of lalr1.cc */ 79 112 #line 35 "gun-parser.y" 80 113 … … 84 117 85 118 86 /* Line 3 5of lalr1.cc */87 #line 88"generated/gun-parser.h"119 /* Line 34 of lalr1.cc */ 120 #line 121 "generated/gun-parser.h" 88 121 }; 89 122 #else … … 188 221 location_stack_type yylocation_stack_; 189 222 190 /// Whether the given \c yypact_ value indicates a defaulted state.191 /// \param yyvalue the value to check192 static bool yy_pact_value_is_default_ (int yyvalue);193 194 /// Whether the given \c yytable_ value indicates a syntax error.195 /// \param yyvalue the value to check196 static bool yy_table_value_is_error_ (int yyvalue);197 198 223 /// Internal symbol numbers. 199 224 typedef unsigned char token_number_type; … … 203 228 static const signed char yypact_ninf_; 204 229 205 /// For a state, default r eduction number.230 /// For a state, default rule to reduce. 206 231 /// Unless\a yytable_ specifies something else to do. 207 232 /// Zero means the default is an error. … … 234 259 #endif 235 260 261 #if YYERROR_VERBOSE 236 262 /// Convert the symbol name \a n to a form suitable for a diagnostic. 237 static std::string yytnamerr_ (const char *n); 263 virtual std::string yytnamerr_ (const char *n); 264 #endif 238 265 239 266 #if YYDEBUG … … 293 320 } // orbital 294 321 295 /* Line 3 5of lalr1.cc */296 #line 297"generated/gun-parser.h"322 /* Line 34 of lalr1.cc */ 323 #line 324 "generated/gun-parser.h" 297 324 298 325 -
trunk/orbital/generated/location.hh
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Locations for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify -
trunk/orbital/generated/mesh-parser.cpp
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 36 36 /* First part of user declarations. */ 37 37 38 /* Line 293of lalr1.cc */38 /* Line 310 of lalr1.cc */ 39 39 #line 1 "mesh-parser.y" 40 40 … … 61 61 62 62 63 /* Line 293of lalr1.cc */63 /* Line 310 of lalr1.cc */ 64 64 #line 65 "generated/mesh-parser.cpp" 65 65 … … 69 69 /* User implementation prologue. */ 70 70 71 /* Line 299of lalr1.cc */72 #line 6 4"mesh-parser.y"71 /* Line 316 of lalr1.cc */ 72 #line 63 "mesh-parser.y" 73 73 74 74 #include "../mesh-compiler.h" … … 78 78 79 79 80 /* Line 299of lalr1.cc */80 /* Line 316 of lalr1.cc */ 81 81 #line 82 "generated/mesh-parser.cpp" 82 82 … … 93 93 #endif 94 94 95 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].96 If N is 0, then set CURRENT to the empty location which ends97 the previous symbol: RHS[0] (always defined). */98 99 #define YYRHSLOC(Rhs, K) ((Rhs)[K])100 #ifndef YYLLOC_DEFAULT101 # define YYLLOC_DEFAULT(Current, Rhs, N) \102 do \103 if (N) \104 { \105 (Current).begin = YYRHSLOC (Rhs, 1).begin; \106 (Current).end = YYRHSLOC (Rhs, N).end; \107 } \108 else \109 { \110 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \111 } \112 while (false)113 #endif114 115 95 /* Suppress unused-variable warnings by "using" E. */ 116 96 #define YYUSE(e) ((void) (e)) … … 164 144 namespace orbital { 165 145 166 /* Line 382 of lalr1.cc */ 167 #line 168 "generated/mesh-parser.cpp" 146 /* Line 379 of lalr1.cc */ 147 #line 148 "generated/mesh-parser.cpp" 148 #if YYERROR_VERBOSE 168 149 169 150 /* Return YYSTR after stripping away unnecessary quotes and … … 204 185 } 205 186 187 #endif 206 188 207 189 /// Build a parser object. … … 304 286 #endif 305 287 306 inline bool307 MeshParser::yy_pact_value_is_default_ (int yyvalue)308 {309 return yyvalue == yypact_ninf_;310 }311 312 inline bool313 MeshParser::yy_table_value_is_error_ (int yyvalue)314 {315 return yyvalue == yytable_ninf_;316 }317 318 288 int 319 289 MeshParser::parse () … … 337 307 location_type yylloc; 338 308 /// The locations where the error started and ended. 339 location_type yyerror_range[ 3];309 location_type yyerror_range[2]; 340 310 341 311 /// $$. … … 375 345 /* Try to take a decision without lookahead. */ 376 346 yyn = yypact_[yystate]; 377 if (yy _pact_value_is_default_ (yyn))347 if (yyn == yypact_ninf_) 378 348 goto yydefault; 379 349 … … 408 378 if (yyn <= 0) 409 379 { 410 if (yy _table_value_is_error_ (yyn))411 380 if (yyn == 0 || yyn == yytable_ninf_) 381 goto yyerrlab; 412 382 yyn = -yyn; 413 383 goto yyreduce; … … 465 435 case 7: 466 436 467 /* Line 6 90of lalr1.cc */468 #line 8 8"mesh-parser.y"437 /* Line 677 of lalr1.cc */ 438 #line 87 "mesh-parser.y" 469 439 { mc.m_mesh.OpenBrace(); } 470 440 break; … … 472 442 case 8: 473 443 474 /* Line 6 90of lalr1.cc */475 #line 9 2"mesh-parser.y"444 /* Line 677 of lalr1.cc */ 445 #line 91 "mesh-parser.y" 476 446 { mc.m_mesh.CloseBrace(); } 477 447 break; 478 448 449 case 14: 450 451 /* Line 677 of lalr1.cc */ 452 #line 106 "mesh-parser.y" 453 { mc.m_mesh.SetCurColor(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } 454 break; 455 479 456 case 15: 480 457 481 /* Line 690 of lalr1.cc */ 482 #line 108 "mesh-parser.y" 483 { mc.m_mesh.MeshConvert(); } 484 break; 485 486 case 16: 487 488 /* Line 690 of lalr1.cc */ 489 #line 109 "mesh-parser.y" 490 { /* TODO */ } 491 break; 492 493 case 17: 494 495 /* Line 690 of lalr1.cc */ 496 #line 113 "mesh-parser.y" 497 { mc.m_mesh.SetCurColor(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } 498 break; 499 500 case 18: 501 502 /* Line 690 of lalr1.cc */ 503 #line 114 "mesh-parser.y" 458 /* Line 677 of lalr1.cc */ 459 #line 107 "mesh-parser.y" 504 460 { uint16_t x = (uint16_t)(yysemantic_stack_[(2) - (2)].u32val); 505 461 vec4 v(x >> 12, (x >> 8) & 0xf, (x >> 4) & 0xf, x & 0xf); … … 507 463 break; 508 464 509 case 1 9:510 511 /* Line 6 90of lalr1.cc */512 #line 11 7"mesh-parser.y"465 case 16: 466 467 /* Line 677 of lalr1.cc */ 468 #line 110 "mesh-parser.y" 513 469 { mc.m_mesh.SetCurColor2(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } 514 470 break; 515 471 516 case 20:517 518 /* Line 6 90of lalr1.cc */519 #line 11 8"mesh-parser.y"472 case 17: 473 474 /* Line 677 of lalr1.cc */ 475 #line 111 "mesh-parser.y" 520 476 { uint16_t x = (uint16_t)(yysemantic_stack_[(2) - (2)].u32val); 521 477 vec4 v(x >> 12, (x >> 8) & 0xf, (x >> 4) & 0xf, x & 0xf); … … 523 479 break; 524 480 481 case 18: 482 483 /* Line 677 of lalr1.cc */ 484 #line 117 "mesh-parser.y" 485 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } 486 break; 487 488 case 19: 489 490 /* Line 677 of lalr1.cc */ 491 #line 118 "mesh-parser.y" 492 { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } 493 break; 494 495 case 20: 496 497 /* Line 677 of lalr1.cc */ 498 #line 119 "mesh-parser.y" 499 { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } 500 break; 501 525 502 case 21: 526 503 527 /* Line 690 of lalr1.cc */ 504 /* Line 677 of lalr1.cc */ 505 #line 120 "mesh-parser.y" 506 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 507 break; 508 509 case 22: 510 511 /* Line 677 of lalr1.cc */ 512 #line 121 "mesh-parser.y" 513 { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); } 514 break; 515 516 case 23: 517 518 /* Line 677 of lalr1.cc */ 519 #line 122 "mesh-parser.y" 520 { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); } 521 break; 522 523 case 24: 524 525 /* Line 677 of lalr1.cc */ 526 #line 123 "mesh-parser.y" 527 { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); } 528 break; 529 530 case 25: 531 532 /* Line 677 of lalr1.cc */ 528 533 #line 124 "mesh-parser.y" 529 { mc.m_mesh.T ranslate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }530 break; 531 532 case 2 2:533 534 /* Line 6 90of lalr1.cc */534 { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 535 break; 536 537 case 26: 538 539 /* Line 677 of lalr1.cc */ 535 540 #line 125 "mesh-parser.y" 536 { mc.m_mesh.T ranslate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }537 break; 538 539 case 2 3:540 541 /* Line 6 90of lalr1.cc */541 { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 542 break; 543 544 case 27: 545 546 /* Line 677 of lalr1.cc */ 542 547 #line 126 "mesh-parser.y" 543 { mc.m_mesh.T ranslate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }544 break; 545 546 case 2 4:547 548 /* Line 6 90of lalr1.cc */548 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 549 break; 550 551 case 28: 552 553 /* Line 677 of lalr1.cc */ 549 554 #line 127 "mesh-parser.y" 550 { mc.m_mesh. Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }551 break; 552 553 case 2 5:554 555 /* Line 6 90of lalr1.cc */555 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } 556 break; 557 558 case 29: 559 560 /* Line 677 of lalr1.cc */ 556 561 #line 128 "mesh-parser.y" 557 { mc.m_mesh. RotateX((yysemantic_stack_[(2) - (2)].args).f0); }558 break; 559 560 case 26:561 562 /* Line 6 90of lalr1.cc */562 { mc.m_mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } 563 break; 564 565 case 30: 566 567 /* Line 677 of lalr1.cc */ 563 568 #line 129 "mesh-parser.y" 564 { mc.m_mesh. RotateY((yysemantic_stack_[(2) - (2)].args).f0); }565 break; 566 567 case 27:568 569 /* Line 6 90of lalr1.cc */569 { mc.m_mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } 570 break; 571 572 case 31: 573 574 /* Line 677 of lalr1.cc */ 570 575 #line 130 "mesh-parser.y" 571 { mc.m_mesh. RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }572 break; 573 574 case 28:575 576 /* Line 6 90of lalr1.cc */576 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 577 break; 578 579 case 32: 580 581 /* Line 677 of lalr1.cc */ 577 582 #line 131 "mesh-parser.y" 578 { mc.m_mesh. TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }579 break; 580 581 case 29:582 583 /* Line 6 90of lalr1.cc */583 { mc.m_mesh.MirrorX(); } 584 break; 585 586 case 33: 587 588 /* Line 677 of lalr1.cc */ 584 589 #line 132 "mesh-parser.y" 585 { mc.m_mesh. TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }586 break; 587 588 case 3 0:589 590 /* Line 6 90of lalr1.cc */590 { mc.m_mesh.MirrorY(); } 591 break; 592 593 case 34: 594 595 /* Line 677 of lalr1.cc */ 591 596 #line 133 "mesh-parser.y" 592 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 593 break; 594 595 case 31: 596 597 /* Line 690 of lalr1.cc */ 598 #line 134 "mesh-parser.y" 599 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } 600 break; 601 602 case 32: 603 604 /* Line 690 of lalr1.cc */ 605 #line 135 "mesh-parser.y" 606 { mc.m_mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } 607 break; 608 609 case 33: 610 611 /* Line 690 of lalr1.cc */ 612 #line 136 "mesh-parser.y" 613 { mc.m_mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } 614 break; 615 616 case 34: 617 618 /* Line 690 of lalr1.cc */ 597 { mc.m_mesh.MirrorZ(); } 598 break; 599 600 case 35: 601 602 /* Line 677 of lalr1.cc */ 619 603 #line 137 "mesh-parser.y" 620 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }621 break;622 623 case 35:624 625 /* Line 690 of lalr1.cc */626 #line 138 "mesh-parser.y"627 { mc.m_mesh.MirrorX(); }628 break;629 630 case 36:631 632 /* Line 690 of lalr1.cc */633 #line 139 "mesh-parser.y"634 { mc.m_mesh.MirrorY(); }635 break;636 637 case 37:638 639 /* Line 690 of lalr1.cc */640 #line 140 "mesh-parser.y"641 { mc.m_mesh.MirrorZ(); }642 break;643 644 case 38:645 646 /* Line 690 of lalr1.cc */647 #line 144 "mesh-parser.y"648 604 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 649 605 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 651 607 break; 652 608 653 case 3 9:654 655 /* Line 6 90of lalr1.cc */656 #line 14 7"mesh-parser.y"609 case 36: 610 611 /* Line 677 of lalr1.cc */ 612 #line 140 "mesh-parser.y" 657 613 { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 658 614 break; 659 615 660 case 40:661 662 /* Line 6 90of lalr1.cc */663 #line 14 8"mesh-parser.y"616 case 37: 617 618 /* Line 677 of lalr1.cc */ 619 #line 141 "mesh-parser.y" 664 620 { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 665 621 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 666 622 break; 667 623 668 case 41:669 670 /* Line 6 90of lalr1.cc */671 #line 1 50"mesh-parser.y"624 case 38: 625 626 /* Line 677 of lalr1.cc */ 627 #line 143 "mesh-parser.y" 672 628 { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 673 629 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 674 630 break; 675 631 676 case 42:677 678 /* Line 6 90of lalr1.cc */679 #line 1 52"mesh-parser.y"632 case 39: 633 634 /* Line 677 of lalr1.cc */ 635 #line 145 "mesh-parser.y" 680 636 { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, 681 637 vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } 682 638 break; 683 639 684 case 4 3:685 686 /* Line 6 90of lalr1.cc */687 #line 1 54"mesh-parser.y"640 case 40: 641 642 /* Line 677 of lalr1.cc */ 643 #line 147 "mesh-parser.y" 688 644 { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, 689 645 (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } 690 646 break; 691 647 692 case 4 4:693 694 /* Line 6 90of lalr1.cc */695 #line 1 56"mesh-parser.y"648 case 41: 649 650 /* Line 677 of lalr1.cc */ 651 #line 149 "mesh-parser.y" 696 652 { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 697 653 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 698 654 break; 699 655 656 case 42: 657 658 /* Line 677 of lalr1.cc */ 659 #line 151 "mesh-parser.y" 660 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } 661 break; 662 663 case 43: 664 665 /* Line 677 of lalr1.cc */ 666 #line 152 "mesh-parser.y" 667 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 668 break; 669 670 case 44: 671 672 /* Line 677 of lalr1.cc */ 673 #line 153 "mesh-parser.y" 674 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 675 break; 676 700 677 case 45: 701 678 702 /* Line 690 of lalr1.cc */ 703 #line 158 "mesh-parser.y" 704 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } 705 break; 706 707 case 46: 708 709 /* Line 690 of lalr1.cc */ 710 #line 159 "mesh-parser.y" 711 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 712 break; 713 714 case 47: 715 716 /* Line 690 of lalr1.cc */ 717 #line 160 "mesh-parser.y" 718 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 719 break; 720 721 case 48: 722 723 /* Line 690 of lalr1.cc */ 724 #line 161 "mesh-parser.y" 679 /* Line 677 of lalr1.cc */ 680 #line 154 "mesh-parser.y" 725 681 { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, 726 682 (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6, (int)(yysemantic_stack_[(2) - (2)].args).f7); } 727 683 break; 728 684 685 case 46: 686 687 /* Line 677 of lalr1.cc */ 688 #line 158 "mesh-parser.y" 689 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } 690 break; 691 692 case 47: 693 694 /* Line 677 of lalr1.cc */ 695 #line 159 "mesh-parser.y" 696 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } 697 break; 698 699 case 48: 700 701 /* Line 677 of lalr1.cc */ 702 #line 160 "mesh-parser.y" 703 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } 704 break; 705 729 706 case 49: 730 707 731 /* Line 690 of lalr1.cc */ 708 /* Line 677 of lalr1.cc */ 709 #line 161 "mesh-parser.y" 710 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } 711 break; 712 713 case 50: 714 715 /* Line 677 of lalr1.cc */ 716 #line 162 "mesh-parser.y" 717 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } 718 break; 719 720 case 51: 721 722 /* Line 677 of lalr1.cc */ 723 #line 163 "mesh-parser.y" 724 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } 725 break; 726 727 case 52: 728 729 /* Line 677 of lalr1.cc */ 730 #line 164 "mesh-parser.y" 731 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } 732 break; 733 734 case 53: 735 736 /* Line 677 of lalr1.cc */ 732 737 #line 165 "mesh-parser.y" 733 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } 734 break; 735 736 case 50: 737 738 /* Line 690 of lalr1.cc */ 739 #line 166 "mesh-parser.y" 740 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } 741 break; 742 743 case 51: 744 745 /* Line 690 of lalr1.cc */ 746 #line 167 "mesh-parser.y" 747 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } 748 break; 749 750 case 52: 751 752 /* Line 690 of lalr1.cc */ 738 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } 739 break; 740 741 case 54: 742 743 /* Line 677 of lalr1.cc */ 753 744 #line 168 "mesh-parser.y" 754 { (yyval. args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); }755 break; 756 757 case 5 3:758 759 /* Line 6 90of lalr1.cc */745 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } 746 break; 747 748 case 55: 749 750 /* Line 677 of lalr1.cc */ 760 751 #line 169 "mesh-parser.y" 761 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); }762 break;763 764 case 54:765 766 /* Line 690 of lalr1.cc */767 #line 170 "mesh-parser.y"768 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); }769 break;770 771 case 55:772 773 /* Line 690 of lalr1.cc */774 #line 171 "mesh-parser.y"775 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); }776 break;777 778 case 56:779 780 /* Line 690 of lalr1.cc */781 #line 172 "mesh-parser.y"782 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); }783 break;784 785 case 57:786 787 /* Line 690 of lalr1.cc */788 #line 175 "mesh-parser.y"789 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }790 break;791 792 case 58:793 794 /* Line 690 of lalr1.cc */795 #line 176 "mesh-parser.y"796 752 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } 797 753 break; … … 799 755 800 756 801 /* Line 6 90of lalr1.cc */802 #line 803"generated/mesh-parser.cpp"757 /* Line 677 of lalr1.cc */ 758 #line 759 "generated/mesh-parser.cpp" 803 759 default: 804 760 break; 805 761 } 806 /* User semantic actions sometimes alter yychar, and that requires807 that yytoken be updated with the new translation. We take the808 approach of translating immediately before every use of yytoken.809 One alternative is translating here after every semantic action,810 but that translation would be missed if the semantic action811 invokes YYABORT, YYACCEPT, or YYERROR immediately after altering812 yychar. In the case of YYABORT or YYACCEPT, an incorrect813 destructor might then be invoked immediately. In the case of814 YYERROR, subsequent parser actions might lead to an incorrect815 destructor call or verbose syntax error message before the816 lookahead is translated. */817 762 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 818 763 … … 838 783 `------------------------------------*/ 839 784 yyerrlab: 840 /* Make sure we have latest lookahead translation. See comments at841 user semantic actions for why this is necessary. */842 yytoken = yytranslate_ (yychar);843 844 785 /* If not already recovering from an error, report this error. */ 845 786 if (!yyerrstatus_) 846 787 { 847 788 ++yynerrs_; 848 if (yychar == yyempty_)849 yytoken = yyempty_;850 789 error (yylloc, yysyntax_error_ (yystate, yytoken)); 851 790 } 852 791 853 yyerror_range[ 1] = yylloc;792 yyerror_range[0] = yylloc; 854 793 if (yyerrstatus_ == 3) 855 794 { … … 886 825 goto yyerrorlab; 887 826 888 yyerror_range[ 1] = yylocation_stack_[yylen - 1];827 yyerror_range[0] = yylocation_stack_[yylen - 1]; 889 828 /* Do not reclaim the symbols of the rule which action triggered 890 829 this YYERROR. */ … … 903 842 { 904 843 yyn = yypact_[yystate]; 905 if ( !yy_pact_value_is_default_ (yyn))844 if (yyn != yypact_ninf_) 906 845 { 907 846 yyn += yyterror_; … … 918 857 YYABORT; 919 858 920 yyerror_range[ 1] = yylocation_stack_[0];859 yyerror_range[0] = yylocation_stack_[0]; 921 860 yydestruct_ ("Error: popping", 922 861 yystos_[yystate], … … 927 866 } 928 867 929 yyerror_range[ 2] = yylloc;868 yyerror_range[1] = yylloc; 930 869 // Using YYLLOC is tempting, but would change the location of 931 870 // the lookahead. YYLOC is available though. 932 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);871 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); 933 872 yysemantic_stack_.push (yylval); 934 873 yylocation_stack_.push (yyloc); … … 953 892 yyreturn: 954 893 if (yychar != yyempty_) 955 { 956 /* Make sure we have latest lookahead translation. See comments 957 at user semantic actions for why this is necessary. */ 958 yytoken = yytranslate_ (yychar); 959 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, 960 &yylloc); 961 } 894 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 962 895 963 896 /* Do not reclaim the symbols of the rule which action triggered … … 978 911 // Generate an error message. 979 912 std::string 980 MeshParser::yysyntax_error_ (int yystate, int yytoken) 981 { 982 std::string yyres; 983 // Number of reported tokens (one for the "unexpected", one per 984 // "expected"). 985 size_t yycount = 0; 986 // Its maximum. 987 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 988 // Arguments of yyformat. 989 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 990 991 /* There are many possibilities here to consider: 992 - If this state is a consistent state with a default action, then 993 the only way this function was invoked is if the default action 994 is an error action. In that case, don't check for expected 995 tokens because there are none. 996 - The only way there can be no lookahead present (in yytoken) is 997 if this state is a consistent state with a default action. 998 Thus, detecting the absence of a lookahead is sufficient to 999 determine that there is no unexpected or expected token to 1000 report. In that case, just report a simple "syntax error". 1001 - Don't assume there isn't a lookahead just because this state is 1002 a consistent state with a default action. There might have 1003 been a previous inconsistent state, consistent state with a 1004 non-default action, or user semantic action that manipulated 1005 yychar. 1006 - Of course, the expected token list depends on states to have 1007 correct lookahead information, and it depends on the parser not 1008 to perform extra reductions after fetching a lookahead from the 1009 scanner and before detecting a syntax error. Thus, state 1010 merging (from LALR or IELR) and default reductions corrupt the 1011 expected token list. However, the list is correct for 1012 canonical LR with one exception: it will still contain any 1013 token that will not be accepted due to an error action in a 1014 later state. 1015 */ 1016 if (yytoken != yyempty_) 913 MeshParser::yysyntax_error_ (int yystate, int tok) 914 { 915 std::string res; 916 YYUSE (yystate); 917 #if YYERROR_VERBOSE 918 int yyn = yypact_[yystate]; 919 if (yypact_ninf_ < yyn && yyn <= yylast_) 1017 920 { 1018 yyarg[yycount++] = yytname_[yytoken]; 1019 int yyn = yypact_[yystate]; 1020 if (!yy_pact_value_is_default_ (yyn)) 1021 { 1022 /* Start YYX at -YYN if negative to avoid negative indexes in 1023 YYCHECK. In other words, skip the first -YYN actions for 1024 this state because they are default actions. */ 1025 int yyxbegin = yyn < 0 ? -yyn : 0; 1026 /* Stay within bounds of both yycheck and yytname. */ 1027 int yychecklim = yylast_ - yyn + 1; 1028 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 1029 for (int yyx = yyxbegin; yyx < yyxend; ++yyx) 1030 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ 1031 && !yy_table_value_is_error_ (yytable_[yyx + yyn])) 1032 { 1033 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1034 { 1035 yycount = 1; 1036 break; 1037 } 1038 else 1039 yyarg[yycount++] = yytname_[yyx]; 1040 } 1041 } 921 /* Start YYX at -YYN if negative to avoid negative indexes in 922 YYCHECK. */ 923 int yyxbegin = yyn < 0 ? -yyn : 0; 924 925 /* Stay within bounds of both yycheck and yytname. */ 926 int yychecklim = yylast_ - yyn + 1; 927 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 928 int count = 0; 929 for (int x = yyxbegin; x < yyxend; ++x) 930 if (yycheck_[x + yyn] == x && x != yyterror_) 931 ++count; 932 933 // FIXME: This method of building the message is not compatible 934 // with internationalization. It should work like yacc.c does it. 935 // That is, first build a string that looks like this: 936 // "syntax error, unexpected %s or %s or %s" 937 // Then, invoke YY_ on this string. 938 // Finally, use the string as a format to output 939 // yytname_[tok], etc. 940 // Until this gets fixed, this message appears in English only. 941 res = "syntax error, unexpected "; 942 res += yytnamerr_ (yytname_[tok]); 943 if (count < 5) 944 { 945 count = 0; 946 for (int x = yyxbegin; x < yyxend; ++x) 947 if (yycheck_[x + yyn] == x && x != yyterror_) 948 { 949 res += (!count++) ? ", expecting " : " or "; 950 res += yytnamerr_ (yytname_[x]); 951 } 952 } 1042 953 } 1043 1044 char const* yyformat = 0; 1045 switch (yycount) 1046 { 1047 #define YYCASE_(N, S) \ 1048 case N: \ 1049 yyformat = S; \ 1050 break 1051 YYCASE_(0, YY_("syntax error")); 1052 YYCASE_(1, YY_("syntax error, unexpected %s")); 1053 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1054 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1055 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1056 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1057 #undef YYCASE_ 1058 } 1059 1060 // Argument number. 1061 size_t yyi = 0; 1062 for (char const* yyp = yyformat; *yyp; ++yyp) 1063 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) 1064 { 1065 yyres += yytnamerr_ (yyarg[yyi++]); 1066 ++yyp; 1067 } 1068 else 1069 yyres += *yyp; 1070 return yyres; 954 else 955 #endif 956 res = YY_("syntax error"); 957 return res; 1071 958 } 1072 959 … … 1074 961 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 1075 962 STATE-NUM. */ 1076 const signed char MeshParser::yypact_ninf_ = -4 7;963 const signed char MeshParser::yypact_ninf_ = -44; 1077 964 const signed char 1078 965 MeshParser::yypact_[] = 1079 966 { 1080 33, -47, -47, 70, 75, -11, -11, -11, -11, -47,1081 -1 1, -11, -11, -11, -47, -11, -11, -11, -11, -47,1082 -1 1, -11, -11, -11, -11, -11, -11, -11, -11, -11,1083 -1 1, -11, -11, -47, 6, 9, 33, 33, 68, -47,1084 -4 7, -47, -47, -47, -47, -47, -11, -11, -11, -11,1085 -4 7, -47, -47, -47, -47, -47, -47, -47, -47, -47,1086 -4 7, -47, -47, -47, -47, -47, -47, -47, -11, -11,1087 -4 7, -47, -47, -47, -47, -47, -47, -47, -47, -47,1088 - 11, -11, -47, -47, -47, -47, -27, -47, -47, -47,1089 -4 7, -47, -47, -47, -47, -47, -47, -471090 }; 1091 1092 /* YYDEFACT[S] -- default r eduction number in state S. Performed when1093 YYTABLE doesn't specify something else to do. Zero means the1094 default is anerror. */967 33, 68, 73, -10, -10, -10, -10, -44, -10, -10, 968 -10, -10, -44, -10, -10, -10, -10, -44, -10, -10, 969 -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, 970 -10, -44, 6, 9, 33, 33, 67, -44, -44, -44, 971 -44, -44, -44, -10, -10, -10, -10, -44, -44, -44, 972 -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, 973 -44, -44, -44, -44, -44, -10, -10, -44, -44, -44, 974 -44, -44, -44, -44, -44, -44, -44, -10, -10, -44, 975 -44, -44, -44, -26, -44, -44, -44, -44, -44, -44, 976 -44, -44, -44, -44, -44 977 }; 978 979 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE 980 doesn't specify something else to do. Zero means the default is an 981 error. */ 1095 982 const unsigned char 1096 983 MeshParser::yydefact_[] = 1097 984 { 1098 0, 15, 16, 0, 0, 0, 0, 0, 0, 35,1099 0, 0, 0, 0, 36, 0, 0, 0, 0, 37,985 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 986 0, 0, 33, 0, 0, 0, 0, 34, 0, 0, 1100 987 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101 0, 0, 0, 7, 0, 0, 3, 0, 5, 9,1102 1 1, 12, 13, 14, 57, 18, 0, 0, 0, 0,1103 1 7, 49, 20, 19, 21, 25, 28, 31, 22, 26,1104 2 9, 32, 23, 27, 30, 33, 24, 34, 0, 0,1105 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,1106 0, 0, 48, 1, 2, 4, 0, 10, 58, 50,1107 51, 52, 53, 54, 55, 56,8, 6988 0, 7, 0, 0, 3, 0, 5, 9, 11, 12, 989 13, 54, 15, 0, 0, 0, 0, 14, 46, 17, 990 16, 18, 22, 25, 28, 19, 23, 26, 29, 20, 991 24, 27, 30, 21, 31, 0, 0, 35, 36, 37, 992 38, 39, 40, 41, 42, 43, 44, 0, 0, 45, 993 1, 2, 4, 0, 10, 55, 47, 48, 49, 50, 994 51, 52, 53, 8, 6 1108 995 }; 1109 996 … … 1112 999 MeshParser::yypgoto_[] = 1113 1000 { 1114 -47, -47, -6, -47, -47, -47, -47, -24, -47, -47, 1115 -47, -47, 2, 38, 96, 1, -8, -16, -47, -47, 1116 -46 1001 -44, -44, -4, -44, -44, -44, -44, -22, -44, -44, 1002 -44, 4, 38, 95, 3, -9, -11, -44, -44, -43 1117 1003 }; 1118 1004 … … 1121 1007 MeshParser::yydefgoto_[] = 1122 1008 { 1123 -1, 34, 35, 36, 37, 97, 38, 39, 40, 41, 1124 42, 43, 47, 48, 49, 68, 69, 70, 81, 82, 1125 51 1009 -1, 32, 33, 34, 35, 94, 36, 37, 38, 39, 1010 40, 44, 45, 46, 65, 66, 67, 78, 79, 48 1126 1011 }; 1127 1012 1128 1013 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 1129 1014 positive, shift that token. If negative, reduce the rule which 1130 number is the opposite. If YYTABLE_NINF_, syntax error. */1015 number is the opposite. If zero, do what YYDEFACT says. */ 1131 1016 const signed char MeshParser::yytable_ninf_ = -1; 1132 1017 const unsigned char 1133 1018 MeshParser::yytable_[] = 1134 1019 { 1135 8 8, 89, 90, 91, 50, 53, 83, 54, 55, 84,1136 5 7, 96, 58, 59, 87, 61, 80, 62, 63, 75,1137 6 5, 0, 92, 93, 44, 72, 73, 74, 46, 76,1138 8 5, 86, 0, 0, 94, 95, 1, 2, 3, 4,1020 85, 86, 87, 88, 47, 50, 80, 51, 52, 81, 1021 54, 93, 55, 56, 84, 58, 72, 59, 60, 77, 1022 62, 0, 89, 90, 41, 69, 70, 71, 43, 73, 1023 82, 83, 0, 0, 91, 92, 1, 2, 3, 4, 1139 1024 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1140 1025 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1141 25, 26, 27, 28, 29, 30, 31, 32, 78, 79,1142 33, 1, 2, 3, 4, 5, 6, 7, 8, 9,1143 1 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,1144 2 0, 21, 22, 23, 24, 25, 26, 27, 28, 29,1145 30, 31, 32, 56, 0, 44, 45, 0, 60, 46,1146 44, 52, 0, 64, 46, 0, 66, 67, 0, 71,1147 0, 0, 0, 0, 0, 771026 25, 26, 27, 28, 29, 30, 75, 76, 0, 31, 1027 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1028 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1029 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1030 53, 0, 41, 42, 0, 57, 43, 41, 49, 0, 1031 61, 43, 0, 63, 64, 0, 68, 0, 0, 0, 1032 0, 0, 74 1148 1033 }; 1149 1034 … … 1152 1037 MeshParser::yycheck_[] = 1153 1038 { 1154 4 6, 47, 48, 49, 3, 4, 0, 5, 6, 0,1155 8, 38, 10, 11, 38, 13, 32, 15, 16, 27,1156 1 8, -1, 68, 69, 35, 24, 25, 26, 39, 28,1157 3 6, 37, -1, -1, 80, 81, 3, 4, 5, 6,1039 43, 44, 45, 46, 1, 2, 0, 3, 4, 0, 1040 6, 37, 8, 9, 36, 11, 25, 13, 14, 30, 1041 16, -1, 65, 66, 34, 22, 23, 24, 38, 26, 1042 34, 35, -1, -1, 77, 78, 3, 4, 5, 6, 1158 1043 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1159 1044 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1160 27, 28, 29, 30, 31, 32, 33, 34, 30, 31,1161 37, 3, 4, 5, 6, 7, 8, 9, 10, 11,1162 1 2, 13, 14, 15, 16, 17, 18, 19, 20, 21,1163 2 2, 23, 24, 25, 26, 27, 28, 29, 30, 31,1164 32, 33, 34, 7, -1, 35, 36, -1, 12, 39,1165 35, 36, -1, 17, 39, -1, 20, 21, -1, 23,1166 -1, -1, -1, -1, -1, 291045 27, 28, 29, 30, 31, 32, 28, 29, -1, 36, 1046 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1047 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1048 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1049 5, -1, 34, 35, -1, 10, 38, 34, 35, -1, 1050 15, 38, -1, 18, 19, -1, 21, -1, -1, -1, 1051 -1, -1, 27 1167 1052 }; 1168 1053 … … 1175 1060 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1176 1061 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1177 32, 3 3, 34, 37, 41, 42, 43, 44, 46, 47,1178 4 8, 49, 50, 51, 35, 36, 39, 52, 53, 54,1179 5 5, 60, 36, 55, 52, 52, 54, 52, 52, 52,1180 5 4, 52, 52, 52, 54, 52, 54, 54, 55, 56,1181 5 7, 54, 55, 55, 55, 56, 55, 54, 53, 53,1182 57, 58, 59, 0, 0, 42, 42, 47, 60, 60,1183 60, 60, 60, 60, 60, 60, 38, 451062 32, 36, 40, 41, 42, 43, 45, 46, 47, 48, 1063 49, 34, 35, 38, 50, 51, 52, 53, 58, 35, 1064 53, 50, 50, 52, 50, 50, 50, 52, 50, 50, 1065 50, 52, 50, 52, 52, 53, 54, 55, 52, 53, 1066 53, 53, 54, 53, 52, 51, 51, 55, 56, 57, 1067 0, 0, 41, 41, 46, 58, 58, 58, 58, 58, 1068 58, 58, 58, 37, 44 1184 1069 }; 1185 1070 … … 1193 1078 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 1194 1079 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 1195 285, 286, 287, 288, 289, 290, 291,91, 93, 451080 285, 286, 287, 288, 289, 290, 91, 93, 45 1196 1081 }; 1197 1082 #endif … … 1201 1086 MeshParser::yyr1_[] = 1202 1087 { 1203 0, 40, 41, 42, 42, 43, 43, 44, 45, 46,1204 4 6, 47, 47, 47, 47, 48, 48, 49, 49, 49,1205 4 9, 50, 50, 50, 50, 50, 50, 50, 50, 50,1206 50, 50, 50, 50, 50, 50, 50, 50, 51, 51,1207 51, 51, 51, 51, 51, 51, 51, 51, 51, 52,1208 5 3, 54, 55, 56, 57, 58, 59, 60, 601088 0, 39, 40, 41, 41, 42, 42, 43, 44, 45, 1089 45, 46, 46, 46, 47, 47, 47, 47, 48, 48, 1090 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 1091 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 1092 49, 49, 49, 49, 49, 49, 50, 51, 52, 53, 1093 54, 55, 56, 57, 58, 58 1209 1094 }; 1210 1095 … … 1214 1099 { 1215 1100 0, 2, 2, 1, 2, 1, 3, 1, 1, 1, 1216 2, 1, 1, 1, 1, 1, 1, 2, 2, 2,1217 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1218 2, 2, 2, 2, 2, 1, 1, 1, 2, 2,1219 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,1220 2, 2, 2, 2, 2, 2, 2,1, 21101 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1103 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 1104 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1105 2, 2, 2, 2, 1, 2 1221 1106 }; 1222 1107 … … 1227 1112 const MeshParser::yytname_[] = 1228 1113 { 1229 "T_END", "error", "$undefined", "T_INITRB", "T_FREERB", "T_COLOR", 1230 "T_BGCOLOR", "T_TRANSLATEX", "T_ROTATEX", "T_TAPERX", "T_SCALEX", 1231 "T_MIRRORX", "T_TRANSLATEY", "T_ROTATEY", "T_TAPERY", "T_SCALEY", 1232 "T_MIRRORY", "T_TRANSLATEZ", "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", 1233 "T_MIRRORZ", "T_TRANSLATE", "T_SCALE", "T_CYLINDER", "T_BOX", 1234 "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_STAR", 1235 "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "NUMBER", 1236 "COLOR", "'['", "']'", "'-'", "$accept", "mesh_description", 1237 "mesh_expression_list", "mesh_expression", "mesh_open", "mesh_close", 1238 "mesh_command_list", "mesh_command", "rb_command", "color_command", 1239 "transform_command", "primitive_command", "args1", "args2", "args3", 1240 "args4", "args5", "args6", "args7", "args8", "number", 0 1114 "T_END", "error", "$undefined", "T_COLOR", "T_BGCOLOR", "T_TRANSLATEX", 1115 "T_ROTATEX", "T_TAPERX", "T_SCALEX", "T_MIRRORX", "T_TRANSLATEY", 1116 "T_ROTATEY", "T_TAPERY", "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ", 1117 "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE", 1118 "T_SCALE", "T_CYLINDER", "T_BOX", "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", 1119 "T_SPHERE", "T_STAR", "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", 1120 "T_COG", "T_ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", 1121 "mesh_description", "mesh_expression_list", "mesh_expression", 1122 "mesh_open", "mesh_close", "mesh_command_list", "mesh_command", 1123 "color_command", "transform_command", "primitive_command", "args1", 1124 "args2", "args3", "args4", "args5", "args6", "args7", "args8", "number", 0 1241 1125 }; 1242 1126 #endif … … 1247 1131 MeshParser::yyrhs_[] = 1248 1132 { 1249 4 1, 0, -1, 42, 0, -1, 43, -1, 43, 42,1250 -1, 4 6, -1, 44, 42, 45, -1, 37, -1, 38,1251 -1, 4 7, -1, 46, 47, -1, 48, -1, 49, -1,1252 50, -1, 51, -1, 3, -1, 4, -1, 5, 55,1253 -1, 5, 36, -1, 6, 55, -1, 6, 36, -1,1254 7, 52, -1, 12, 52, -1, 17, 52, -1, 22,1255 5 4, -1, 8, 52, -1, 13, 52, -1, 18, 52,1256 -1, 9, 54, -1, 14, 54, -1, 19, 54, -1,1257 1 0, 52, -1, 15, 52, -1, 20, 52, -1, 23,1258 54, -1, 11, -1, 16, -1, 21, -1, 24, 57,1259 -1, 25, 5 4, -1, 26, 55, -1, 27, 55, -1,1260 28, 5 5, -1, 29, 56, -1, 30, 55, -1, 31,1261 5 4, -1, 32, 53, -1, 33, 53, -1, 34, 59,1262 -1, 60, -1, 52, 60, -1, 53, 60, -1, 54,1263 60, -1, 55, 60, -1, 56, 60, -1, 57, 60,1264 -1, 58, 60, -1, 35, -1, 39, 60, -11133 40, 0, -1, 41, 0, -1, 42, -1, 42, 41, 1134 -1, 45, -1, 43, 41, 44, -1, 36, -1, 37, 1135 -1, 46, -1, 45, 46, -1, 47, -1, 48, -1, 1136 49, -1, 3, 53, -1, 3, 35, -1, 4, 53, 1137 -1, 4, 35, -1, 5, 50, -1, 10, 50, -1, 1138 15, 50, -1, 20, 52, -1, 6, 50, -1, 11, 1139 50, -1, 16, 50, -1, 7, 52, -1, 12, 52, 1140 -1, 17, 52, -1, 8, 50, -1, 13, 50, -1, 1141 18, 50, -1, 21, 52, -1, 9, -1, 14, -1, 1142 19, -1, 22, 55, -1, 23, 52, -1, 24, 53, 1143 -1, 25, 53, -1, 26, 53, -1, 27, 54, -1, 1144 28, 53, -1, 29, 52, -1, 30, 51, -1, 31, 1145 51, -1, 32, 57, -1, 58, -1, 50, 58, -1, 1146 51, 58, -1, 52, 58, -1, 53, 58, -1, 54, 1147 58, -1, 55, 58, -1, 56, 58, -1, 34, -1, 1148 38, 58, -1 1265 1149 }; 1266 1150 … … 1271 1155 { 1272 1156 0, 0, 3, 6, 8, 11, 13, 17, 19, 21, 1273 23, 26, 28, 30, 32, 3 4, 36, 38, 41, 44,1274 47, 50, 53, 56, 59, 62, 65, 68, 71, 74,1275 77, 80, 83, 86, 89, 92, 94, 96, 98, 101,1276 10 4, 107, 110, 113, 116, 119, 122, 125, 128, 131,1277 13 3, 136, 139, 142, 145, 148, 151, 154, 1561157 23, 26, 28, 30, 32, 35, 38, 41, 44, 47, 1158 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 1159 80, 83, 86, 88, 90, 92, 95, 98, 101, 104, 1160 107, 110, 113, 116, 119, 122, 125, 127, 130, 133, 1161 136, 139, 142, 145, 148, 150 1278 1162 }; 1279 1163 … … 1282 1166 MeshParser::yyrline_[] = 1283 1167 { 1284 0, 7 4, 74, 78, 79, 83, 84, 88, 92, 96,1285 9 7, 101, 102, 103, 104, 108, 109, 113, 114, 117,1286 11 8, 124, 125, 126, 127, 128, 129, 130, 131, 132,1287 1 33, 134, 135, 136, 137, 138, 139, 140, 144, 147,1288 14 8, 150, 152, 154, 156, 158, 159, 160, 161, 165,1289 16 6, 167, 168, 169, 170, 171, 172, 175, 1761168 0, 73, 73, 77, 78, 82, 83, 87, 91, 95, 1169 96, 100, 101, 102, 106, 107, 110, 111, 117, 118, 1170 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 1171 129, 130, 131, 132, 133, 137, 140, 141, 143, 145, 1172 147, 149, 151, 152, 153, 154, 158, 159, 160, 161, 1173 162, 163, 164, 165, 168, 169 1290 1174 }; 1291 1175 … … 1331 1215 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1332 1216 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1333 2, 2, 2, 2, 2, 3 9, 2, 2, 2, 2,1334 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1335 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1336 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1337 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1338 2, 3 7, 2, 38, 2, 2, 2, 2, 2, 2,1217 2, 2, 2, 2, 2, 38, 2, 2, 2, 2, 1218 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1219 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1220 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1221 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1222 2, 36, 2, 37, 2, 2, 2, 2, 2, 2, 1339 1223 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1340 1224 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, … … 1356 1240 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1357 1241 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 1358 35 , 361242 35 1359 1243 }; 1360 1244 if ((unsigned int) t <= yyuser_token_number_max_) … … 1365 1249 1366 1250 const int MeshParser::yyeof_ = 0; 1367 const int MeshParser::yylast_ = 12 5;1368 const int MeshParser::yynnts_ = 2 1;1251 const int MeshParser::yylast_ = 122; 1252 const int MeshParser::yynnts_ = 20; 1369 1253 const int MeshParser::yyempty_ = -2; 1370 const int MeshParser::yyfinal_ = 8 3;1254 const int MeshParser::yyfinal_ = 80; 1371 1255 const int MeshParser::yyterror_ = 1; 1372 1256 const int MeshParser::yyerrcode_ = 256; 1373 const int MeshParser::yyntokens_ = 40;1374 1375 const unsigned int MeshParser::yyuser_token_number_max_ = 29 1;1257 const int MeshParser::yyntokens_ = 39; 1258 1259 const unsigned int MeshParser::yyuser_token_number_max_ = 290; 1376 1260 const MeshParser::token_number_type MeshParser::yyundef_token_ = 2; 1377 1261 … … 1379 1263 } // orbital 1380 1264 1381 /* Line 1 136of lalr1.cc */1382 #line 1 383"generated/mesh-parser.cpp"1383 1384 1385 /* Line 1 138of lalr1.cc */1386 #line 17 9"mesh-parser.y"1265 /* Line 1053 of lalr1.cc */ 1266 #line 1267 "generated/mesh-parser.cpp" 1267 1268 1269 /* Line 1055 of lalr1.cc */ 1270 #line 172 "mesh-parser.y" 1387 1271 1388 1272 -
trunk/orbital/generated/mesh-parser.h
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 41 41 #include <iostream> 42 42 #include "stack.hh" 43 44 45 namespace orbital { 46 47 /* Line 34 of lalr1.cc */ 48 #line 49 "generated/mesh-parser.h" 49 class position; 50 class location; 51 52 } // orbital 53 54 /* Line 34 of lalr1.cc */ 55 #line 56 "generated/mesh-parser.h" 56 43 57 #include "location.hh" 44 58 … … 61 75 #endif 62 76 77 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 78 If N is 0, then set CURRENT to the empty location which ends 79 the previous symbol: RHS[0] (always defined). */ 80 81 #ifndef YYLLOC_DEFAULT 82 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 83 do { \ 84 if (N) \ 85 { \ 86 (Current).begin = (Rhs)[1].begin; \ 87 (Current).end = (Rhs)[N].end; \ 88 } \ 89 else \ 90 { \ 91 (Current).begin = (Current).end = (Rhs)[0].end; \ 92 } \ 93 } while (false) 94 #endif 95 63 96 64 97 namespace orbital { 65 98 66 /* Line 3 5of lalr1.cc */67 #line 68"generated/mesh-parser.h"99 /* Line 34 of lalr1.cc */ 100 #line 101 "generated/mesh-parser.h" 68 101 69 102 /// A Bison parser. … … 76 109 { 77 110 78 /* Line 3 5of lalr1.cc */111 /* Line 34 of lalr1.cc */ 79 112 #line 35 "mesh-parser.y" 80 113 … … 86 119 87 120 88 /* Line 3 5of lalr1.cc */89 #line 90"generated/mesh-parser.h"121 /* Line 34 of lalr1.cc */ 122 #line 123 "generated/mesh-parser.h" 90 123 }; 91 124 #else … … 100 133 enum yytokentype { 101 134 T_END = 0, 102 T_INITRB = 258, 103 T_FREERB = 259, 104 T_COLOR = 260, 105 T_BGCOLOR = 261, 106 T_TRANSLATEX = 262, 107 T_ROTATEX = 263, 108 T_TAPERX = 264, 109 T_SCALEX = 265, 110 T_MIRRORX = 266, 111 T_TRANSLATEY = 267, 112 T_ROTATEY = 268, 113 T_TAPERY = 269, 114 T_SCALEY = 270, 115 T_MIRRORY = 271, 116 T_TRANSLATEZ = 272, 117 T_ROTATEZ = 273, 118 T_TAPERZ = 274, 119 T_SCALEZ = 275, 120 T_MIRRORZ = 276, 121 T_TRANSLATE = 277, 122 T_SCALE = 278, 123 T_CYLINDER = 279, 124 T_BOX = 280, 125 T_SMOOTHCHAMFBOX = 281, 126 T_FLATCHAMFBOX = 282, 127 T_SPHERE = 283, 128 T_STAR = 284, 129 T_EXPANDEDSTAR = 285, 130 T_DISC = 286, 131 T_TRIANGLE = 287, 132 T_QUAD = 288, 133 T_COG = 289, 134 NUMBER = 290, 135 COLOR = 291 135 T_COLOR = 258, 136 T_BGCOLOR = 259, 137 T_TRANSLATEX = 260, 138 T_ROTATEX = 261, 139 T_TAPERX = 262, 140 T_SCALEX = 263, 141 T_MIRRORX = 264, 142 T_TRANSLATEY = 265, 143 T_ROTATEY = 266, 144 T_TAPERY = 267, 145 T_SCALEY = 268, 146 T_MIRRORY = 269, 147 T_TRANSLATEZ = 270, 148 T_ROTATEZ = 271, 149 T_TAPERZ = 272, 150 T_SCALEZ = 273, 151 T_MIRRORZ = 274, 152 T_TRANSLATE = 275, 153 T_SCALE = 276, 154 T_CYLINDER = 277, 155 T_BOX = 278, 156 T_SMOOTHCHAMFBOX = 279, 157 T_FLATCHAMFBOX = 280, 158 T_SPHERE = 281, 159 T_STAR = 282, 160 T_EXPANDEDSTAR = 283, 161 T_DISC = 284, 162 T_TRIANGLE = 285, 163 T_QUAD = 286, 164 T_COG = 287, 165 T_ERROR = 288, 166 NUMBER = 289, 167 COLOR = 290 136 168 }; 137 169 … … 207 239 location_stack_type yylocation_stack_; 208 240 209 /// Whether the given \c yypact_ value indicates a defaulted state.210 /// \param yyvalue the value to check211 static bool yy_pact_value_is_default_ (int yyvalue);212 213 /// Whether the given \c yytable_ value indicates a syntax error.214 /// \param yyvalue the value to check215 static bool yy_table_value_is_error_ (int yyvalue);216 217 241 /// Internal symbol numbers. 218 242 typedef unsigned char token_number_type; … … 222 246 static const signed char yypact_ninf_; 223 247 224 /// For a state, default r eduction number.248 /// For a state, default rule to reduce. 225 249 /// Unless\a yytable_ specifies something else to do. 226 250 /// Zero means the default is an error. … … 253 277 #endif 254 278 279 #if YYERROR_VERBOSE 255 280 /// Convert the symbol name \a n to a form suitable for a diagnostic. 256 static std::string yytnamerr_ (const char *n); 281 virtual std::string yytnamerr_ (const char *n); 282 #endif 257 283 258 284 #if YYDEBUG … … 312 338 } // orbital 313 339 314 /* Line 3 5of lalr1.cc */315 #line 3 16"generated/mesh-parser.h"340 /* Line 34 of lalr1.cc */ 341 #line 342 "generated/mesh-parser.h" 316 342 317 343 -
trunk/orbital/generated/mesh-scanner.cpp
r1434 r1442 331 331 (yy_c_buf_p) = yy_cp; 332 332 333 #define YY_NUM_RULES 4 1334 #define YY_END_OF_BUFFER 4 2333 #define YY_NUM_RULES 40 334 #define YY_END_OF_BUFFER 41 335 335 /* This struct is not used in this scanner, 336 336 but its presence is necessary. */ … … 340 340 flex_int32_t yy_nxt; 341 341 }; 342 static yyconst flex_int16_t yy_accept[6 9] =342 static yyconst flex_int16_t yy_accept[64] = 343 343 { 0, 344 0, 0, 4 2, 39, 40, 39, 39, 36, 39, 35,345 3 7, 38, 39, 39, 39, 39, 39, 18, 8, 0,346 0, 35, 35, 0, 23, 22, 29, 0, 0, 31,347 2 7, 30, 0, 0, 19, 20, 21, 9, 10, 11,348 3, 15, 16, 17, 0, 5, 6, 7, 0, 0,349 35, 32, 28, 0, 0, 0, 2, 1, 4, 12,350 13, 14, 33, 25, 24, 26, 34, 0344 0, 0, 41, 39, 38, 37, 39, 39, 34, 39, 345 33, 35, 36, 39, 39, 39, 16, 6, 0, 0, 346 33, 33, 0, 21, 20, 27, 0, 0, 29, 25, 347 28, 17, 18, 19, 7, 8, 9, 1, 13, 14, 348 15, 0, 3, 4, 5, 0, 0, 33, 30, 26, 349 0, 0, 0, 2, 10, 11, 12, 31, 23, 22, 350 24, 32, 0 351 351 } ; 352 352 … … 356 356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 357 357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 358 1, 1, 1, 1, 3, 1, 1, 1, 1, 1,359 1, 1, 4, 1, 5, 6, 1, 7, 7, 7,360 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,361 1, 1, 1, 1, 1, 1, 1, 1, 8, 1,358 1, 3, 1, 1, 4, 1, 1, 1, 1, 1, 359 1, 1, 5, 3, 6, 7, 1, 8, 8, 8, 360 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 361 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 362 362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 363 363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 364 9, 1, 10, 1, 1, 1, 11, 12, 13, 14,365 366 1 5, 16, 17, 18, 19, 1, 1, 1, 20, 1,364 10, 1, 11, 1, 1, 1, 12, 13, 14, 15, 365 366 16, 17, 18, 19, 1, 1, 1, 1, 20, 1, 367 367 1, 21, 22, 23, 24, 25, 1, 1, 1, 26, 368 368 27, 28, 1, 1, 1, 1, 1, 1, 1, 1, … … 385 385 static yyconst flex_int32_t yy_meta[29] = 386 386 { 0, 387 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,388 2, 2, 2, 2, 2, 2, 1, 1, 1, 1,387 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 388 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 389 389 1, 1, 1, 1, 1, 1, 1, 1 390 390 } ; 391 391 392 static yyconst flex_int16_t yy_base[ 73] =392 static yyconst flex_int16_t yy_base[68] = 393 393 { 0, 394 0, 0, 93, 94, 94, 0, 23, 25, 85, 27, 395 94, 94, 31, 68, 67, 10, 13, 35, 38, 0, 396 82, 44, 60, 53, 94, 71, 94, 63, 73, 94, 397 56, 94, 73, 72, 94, 94, 94, 94, 94, 94, 398 71, 94, 94, 94, 44, 94, 94, 94, 0, 75, 399 74, 94, 94, 68, 67, 60, 94, 94, 94, 94, 400 94, 94, 0, 94, 94, 94, 94, 94, 74, 72, 401 71, 52 394 0, 0, 89, 90, 90, 90, 0, 22, 24, 80, 395 26, 90, 90, 30, 10, 13, 34, 37, 0, 79, 396 50, 59, 45, 90, 68, 90, 61, 70, 90, 55, 397 90, 90, 90, 90, 90, 90, 90, 70, 90, 90, 398 90, 44, 90, 90, 90, 0, 74, 73, 90, 90, 399 67, 66, 59, 90, 90, 90, 90, 0, 90, 90, 400 90, 90, 90, 75, 72, 71, 54 402 401 } ; 403 402 404 static yyconst flex_int16_t yy_def[ 73] =403 static yyconst flex_int16_t yy_def[68] = 405 404 { 0, 406 68, 1, 68, 68, 68, 69, 68, 68, 68, 68, 407 68, 68, 68, 68, 68, 68, 68, 68, 68, 70, 408 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 409 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 410 68, 68, 68, 68, 68, 68, 68, 68, 71, 68, 411 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 412 68, 68, 72, 68, 68, 68, 68, 0, 68, 68, 413 68, 68 405 63, 1, 63, 63, 63, 63, 64, 63, 63, 63, 406 63, 63, 63, 63, 63, 63, 63, 63, 65, 63, 407 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 408 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 409 63, 63, 63, 63, 63, 66, 63, 63, 63, 63, 410 63, 63, 63, 63, 63, 63, 63, 67, 63, 63, 411 63, 63, 0, 63, 63, 63, 63 414 412 } ; 415 413 416 static yyconst flex_int16_t yy_nxt[1 23] =414 static yyconst flex_int16_t yy_nxt[119] = 417 415 { 0, 418 4, 5, 6, 7, 8, 9, 10, 4, 11, 12, 419 13, 4, 4, 4, 4, 14, 4, 4, 15, 16, 420 4, 4, 17, 18, 19, 4, 4, 4, 21, 22, 421 21, 22, 21, 22, 24, 35, 36, 37, 38, 39, 422 40, 24, 25, 26, 27, 28, 29, 41, 45, 21, 423 22, 24, 30, 67, 31, 32, 50, 50, 24, 51, 424 42, 43, 44, 46, 47, 48, 23, 24, 55, 60, 425 61, 62, 63, 49, 24, 20, 56, 66, 65, 64, 426 51, 51, 59, 58, 57, 54, 53, 52, 23, 34, 427 33, 23, 68, 3, 68, 68, 68, 68, 68, 68, 428 429 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 430 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 431 68, 68 416 4, 5, 6, 7, 8, 9, 10, 11, 4, 12, 417 13, 14, 4, 4, 4, 4, 4, 4, 4, 15, 418 4, 4, 16, 17, 18, 4, 4, 4, 20, 21, 419 20, 21, 20, 21, 23, 32, 33, 34, 35, 36, 420 37, 23, 24, 25, 26, 27, 28, 38, 42, 47, 421 47, 29, 48, 30, 31, 62, 20, 21, 23, 39, 422 40, 41, 43, 44, 45, 23, 22, 23, 52, 55, 423 56, 57, 58, 46, 23, 53, 19, 61, 60, 59, 424 48, 48, 54, 51, 50, 49, 22, 22, 63, 3, 425 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 426 427 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 428 63, 63, 63, 63, 63, 63, 63, 63 432 429 } ; 433 430 434 static yyconst flex_int16_t yy_chk[1 23] =431 static yyconst flex_int16_t yy_chk[119] = 435 432 { 0, 436 433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 437 434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 438 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 439 8, 8, 10, 10, 10, 16, 16, 16, 17, 17, 440 17, 10, 13, 13, 13, 13, 13, 18, 19, 22, 441 22, 22, 13, 72, 13, 13, 24, 24, 22, 24, 442 18, 18, 18, 19, 19, 19, 23, 23, 31, 45, 443 45, 45, 71, 70, 23, 69, 31, 56, 55, 54, 444 51, 50, 41, 34, 33, 29, 28, 26, 21, 15, 445 14, 9, 3, 68, 68, 68, 68, 68, 68, 68, 446 447 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 448 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 449 68, 68 435 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 436 9, 9, 11, 11, 11, 15, 15, 15, 16, 16, 437 16, 11, 14, 14, 14, 14, 14, 17, 18, 23, 438 23, 14, 23, 14, 14, 67, 21, 21, 21, 17, 439 17, 17, 18, 18, 18, 21, 22, 22, 30, 42, 440 42, 42, 66, 65, 22, 30, 64, 53, 52, 51, 441 48, 47, 38, 28, 27, 25, 20, 10, 3, 63, 442 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 443 444 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 445 63, 63, 63, 63, 63, 63, 63, 63 450 446 } ; 451 447 … … 490 486 #define YY_NO_UNISTD_H 491 487 #define YY_USER_ACTION yylloc->columns(yyleng); 492 #line 4 93"generated/mesh-scanner.cpp"488 #line 489 "generated/mesh-scanner.cpp" 493 489 494 490 #define INITIAL 0 … … 603 599 604 600 605 #line 60 6"generated/mesh-scanner.cpp"601 #line 602 "generated/mesh-scanner.cpp" 606 602 607 603 if ( !(yy_init) ) … … 656 652 { 657 653 yy_current_state = (int) yy_def[yy_current_state]; 658 if ( yy_current_state >= 6 9)654 if ( yy_current_state >= 64 ) 659 655 yy_c = yy_meta[(unsigned int) yy_c]; 660 656 } … … 662 658 ++yy_cp; 663 659 } 664 while ( yy_current_state != 6 8);660 while ( yy_current_state != 63 ); 665 661 yy_cp = (yy_last_accepting_cpos); 666 662 yy_current_state = (yy_last_accepting_state); … … 685 681 YY_RULE_SETUP 686 682 #line 45 "mesh-scanner.l" 687 { return token::T_ INITRB; }683 { return token::T_COLOR; } 688 684 YY_BREAK 689 685 case 2: 690 686 YY_RULE_SETUP 691 687 #line 46 "mesh-scanner.l" 692 { return token::T_ FREERB; }688 { return token::T_BGCOLOR; } 693 689 YY_BREAK 694 690 case 3: 695 691 YY_RULE_SETUP 696 692 #line 48 "mesh-scanner.l" 697 { return token::T_ COLOR; }693 { return token::T_TRANSLATEX; } 698 694 YY_BREAK 699 695 case 4: 700 696 YY_RULE_SETUP 701 697 #line 49 "mesh-scanner.l" 702 { return token::T_ BGCOLOR; }698 { return token::T_TRANSLATEY; } 703 699 YY_BREAK 704 700 case 5: 705 701 YY_RULE_SETUP 702 #line 50 "mesh-scanner.l" 703 { return token::T_TRANSLATEZ; } 704 YY_BREAK 705 case 6: 706 YY_RULE_SETUP 706 707 #line 51 "mesh-scanner.l" 707 { return token::T_TRANSLATE X; }708 YY_BREAK 709 case 6:708 { return token::T_TRANSLATE; } 709 YY_BREAK 710 case 7: 710 711 YY_RULE_SETUP 711 712 #line 52 "mesh-scanner.l" 712 { return token::T_ TRANSLATEY; }713 YY_BREAK 714 case 7:713 { return token::T_ROTATEX; } 714 YY_BREAK 715 case 8: 715 716 YY_RULE_SETUP 716 717 #line 53 "mesh-scanner.l" 717 { return token::T_ TRANSLATEZ; }718 YY_BREAK 719 case 8:718 { return token::T_ROTATEY; } 719 YY_BREAK 720 case 9: 720 721 YY_RULE_SETUP 721 722 #line 54 "mesh-scanner.l" 722 { return token::T_ TRANSLATE; }723 YY_BREAK 724 case 9:723 { return token::T_ROTATEZ; } 724 YY_BREAK 725 case 10: 725 726 YY_RULE_SETUP 726 727 #line 55 "mesh-scanner.l" 727 { return token::T_ ROTATEX; }728 YY_BREAK 729 case 1 0:728 { return token::T_TAPERX; } 729 YY_BREAK 730 case 11: 730 731 YY_RULE_SETUP 731 732 #line 56 "mesh-scanner.l" 732 { return token::T_ ROTATEY; }733 YY_BREAK 734 case 1 1:733 { return token::T_TAPERY; } 734 YY_BREAK 735 case 12: 735 736 YY_RULE_SETUP 736 737 #line 57 "mesh-scanner.l" 737 { return token::T_ ROTATEZ; }738 YY_BREAK 739 case 1 2:738 { return token::T_TAPERZ; } 739 YY_BREAK 740 case 13: 740 741 YY_RULE_SETUP 741 742 #line 58 "mesh-scanner.l" 742 { return token::T_ TAPERX; }743 YY_BREAK 744 case 1 3:743 { return token::T_SCALEX; } 744 YY_BREAK 745 case 14: 745 746 YY_RULE_SETUP 746 747 #line 59 "mesh-scanner.l" 747 { return token::T_ TAPERY; }748 YY_BREAK 749 case 1 4:748 { return token::T_SCALEY; } 749 YY_BREAK 750 case 15: 750 751 YY_RULE_SETUP 751 752 #line 60 "mesh-scanner.l" 752 { return token::T_ TAPERZ; }753 YY_BREAK 754 case 1 5:753 { return token::T_SCALEZ; } 754 YY_BREAK 755 case 16: 755 756 YY_RULE_SETUP 756 757 #line 61 "mesh-scanner.l" 757 { return token::T_SCALE X; }758 YY_BREAK 759 case 1 6:758 { return token::T_SCALE; } 759 YY_BREAK 760 case 17: 760 761 YY_RULE_SETUP 761 762 #line 62 "mesh-scanner.l" 762 { return token::T_ SCALEY; }763 YY_BREAK 764 case 1 7:763 { return token::T_MIRRORX; } 764 YY_BREAK 765 case 18: 765 766 YY_RULE_SETUP 766 767 #line 63 "mesh-scanner.l" 767 { return token::T_ SCALEZ; }768 YY_BREAK 769 case 1 8:768 { return token::T_MIRRORY; } 769 YY_BREAK 770 case 19: 770 771 YY_RULE_SETUP 771 772 #line 64 "mesh-scanner.l" 772 { return token::T_SCALE; } 773 YY_BREAK 774 case 19: 775 YY_RULE_SETUP 776 #line 65 "mesh-scanner.l" 777 { return token::T_MIRRORX; } 773 { return token::T_MIRRORZ; } 778 774 YY_BREAK 779 775 case 20: 780 776 YY_RULE_SETUP 781 777 #line 66 "mesh-scanner.l" 782 { return token::T_ MIRRORY; }778 { return token::T_CYLINDER; } 783 779 YY_BREAK 784 780 case 21: 785 781 YY_RULE_SETUP 786 782 #line 67 "mesh-scanner.l" 787 { return token::T_ MIRRORZ; }783 { return token::T_BOX; } 788 784 YY_BREAK 789 785 case 22: 790 786 YY_RULE_SETUP 787 #line 68 "mesh-scanner.l" 788 { return token::T_SMOOTHCHAMFBOX; } 789 YY_BREAK 790 case 23: 791 YY_RULE_SETUP 791 792 #line 69 "mesh-scanner.l" 792 { return token::T_ CYLINDER; }793 YY_BREAK 794 case 2 3:793 { return token::T_FLATCHAMFBOX; } 794 YY_BREAK 795 case 24: 795 796 YY_RULE_SETUP 796 797 #line 70 "mesh-scanner.l" 797 { return token::T_ BOX; }798 YY_BREAK 799 case 2 4:798 { return token::T_SPHERE; } 799 YY_BREAK 800 case 25: 800 801 YY_RULE_SETUP 801 802 #line 71 "mesh-scanner.l" 802 { return token::T_S MOOTHCHAMFBOX; }803 YY_BREAK 804 case 2 5:803 { return token::T_STAR; } 804 YY_BREAK 805 case 26: 805 806 YY_RULE_SETUP 806 807 #line 72 "mesh-scanner.l" 807 { return token::T_ FLATCHAMFBOX; }808 YY_BREAK 809 case 2 6:808 { return token::T_EXPANDEDSTAR; } 809 YY_BREAK 810 case 27: 810 811 YY_RULE_SETUP 811 812 #line 73 "mesh-scanner.l" 812 { return token::T_ SPHERE; }813 YY_BREAK 814 case 2 7:813 { return token::T_DISC; } 814 YY_BREAK 815 case 28: 815 816 YY_RULE_SETUP 816 817 #line 74 "mesh-scanner.l" 817 { return token::T_ STAR; }818 YY_BREAK 819 case 2 8:818 { return token::T_TRIANGLE; } 819 YY_BREAK 820 case 29: 820 821 YY_RULE_SETUP 821 822 #line 75 "mesh-scanner.l" 822 { return token::T_ EXPANDEDSTAR; }823 YY_BREAK 824 case 29:823 { return token::T_QUAD; } 824 YY_BREAK 825 case 30: 825 826 YY_RULE_SETUP 826 827 #line 76 "mesh-scanner.l" 827 { return token::T_DISC; } 828 YY_BREAK 829 case 30: 830 YY_RULE_SETUP 831 #line 77 "mesh-scanner.l" 832 { return token::T_TRIANGLE; } 828 { return token::T_COG; } 833 829 YY_BREAK 834 830 case 31: 835 831 YY_RULE_SETUP 836 832 #line 78 "mesh-scanner.l" 837 { return token::T_QUAD; }838 YY_BREAK839 case 32:840 YY_RULE_SETUP841 #line 79 "mesh-scanner.l"842 { return token::T_COG; }843 YY_BREAK844 case 33:845 YY_RULE_SETUP846 #line 81 "mesh-scanner.l"847 833 { 848 834 yylval->u32val = 0xf + 0x10 * strtol(yytext + 1, NULL, 16); 849 835 return token::COLOR; } 850 836 YY_BREAK 851 case 3 4:852 YY_RULE_SETUP 853 #line 8 4"mesh-scanner.l"837 case 32: 838 YY_RULE_SETUP 839 #line 81 "mesh-scanner.l" 854 840 { 855 841 yylval->u32val = strtol(yytext + 1, NULL, 16); 856 842 return token::COLOR; } 857 843 YY_BREAK 844 case 33: 845 YY_RULE_SETUP 846 #line 84 "mesh-scanner.l" 847 { 848 yylval->fval = atof(yytext); return token::NUMBER; } 849 YY_BREAK 850 case 34: 851 YY_RULE_SETUP 852 #line 86 "mesh-scanner.l" 853 { return token_type('-'); } 854 YY_BREAK 858 855 case 35: 859 856 YY_RULE_SETUP 860 857 #line 87 "mesh-scanner.l" 861 { 862 yylval->fval = atof(yytext); return token::NUMBER; } 858 { return token_type('['); } 863 859 YY_BREAK 864 860 case 36: 865 861 YY_RULE_SETUP 862 #line 88 "mesh-scanner.l" 863 { return token_type(']'); } 864 YY_BREAK 865 case 37: 866 YY_RULE_SETUP 866 867 #line 89 "mesh-scanner.l" 867 { return token_type('-'); } 868 YY_BREAK 869 case 37: 868 { /* ignore this */ } 869 YY_BREAK 870 case 38: 871 /* rule 38 can match eol */ 870 872 YY_RULE_SETUP 871 873 #line 90 "mesh-scanner.l" 872 { return token_type('[');}873 YY_BREAK 874 case 3 8:874 { /* ignore this */ } 875 YY_BREAK 876 case 39: 875 877 YY_RULE_SETUP 876 878 #line 91 "mesh-scanner.l" 877 { return token_type(']'); } 878 YY_BREAK 879 case 39: 880 YY_RULE_SETUP 881 #line 92 "mesh-scanner.l" 882 { /* ignore everything else */ } 879 { return token::T_ERROR; } 883 880 YY_BREAK 884 881 case 40: 885 /* rule 40 can match eol */886 882 YY_RULE_SETUP 887 883 #line 93 "mesh-scanner.l" 888 { /* ignore everything else */ }889 YY_BREAK890 case 41:891 YY_RULE_SETUP892 #line 95 "mesh-scanner.l"893 884 ECHO; 894 885 YY_BREAK 895 #line 8 96"generated/mesh-scanner.cpp"886 #line 887 "generated/mesh-scanner.cpp" 896 887 case YY_STATE_EOF(INITIAL): 897 888 yyterminate(); … … 1275 1266 { 1276 1267 yy_current_state = (int) yy_def[yy_current_state]; 1277 if ( yy_current_state >= 6 9)1268 if ( yy_current_state >= 64 ) 1278 1269 yy_c = yy_meta[(unsigned int) yy_c]; 1279 1270 } … … 1303 1294 { 1304 1295 yy_current_state = (int) yy_def[yy_current_state]; 1305 if ( yy_current_state >= 6 9)1296 if ( yy_current_state >= 64 ) 1306 1297 yy_c = yy_meta[(unsigned int) yy_c]; 1307 1298 } 1308 1299 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1309 yy_is_jam = (yy_current_state == 6 8);1300 yy_is_jam = (yy_current_state == 63); 1310 1301 1311 1302 return yy_is_jam ? 0 : yy_current_state; … … 1794 1785 #define YYTABLES_NAME "yytables" 1795 1786 1796 #line 9 5"mesh-scanner.l"1787 #line 93 "mesh-scanner.l" 1797 1788 1798 1789 -
trunk/orbital/generated/position.hh
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Positions for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify -
trunk/orbital/generated/stack.hh
r1437 r1442 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Stack handling for Bison parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 39 39 namespace orbital { 40 40 41 /* Line 1 149of lalr1.cc */41 /* Line 1066 of lalr1.cc */ 42 42 #line 43 "generated/stack.hh" 43 43 template <class T, class S = std::deque<T> > … … 129 129 } // orbital 130 130 131 /* Line 1 235of lalr1.cc */131 /* Line 1152 of lalr1.cc */ 132 132 #line 133 "generated/stack.hh" 133 133 -
trunk/orbital/gun.cpp
r1433 r1442 34 34 #include "gun-compiler.h" 35 35 36 void Gun:: SendCommand(char const *command)36 void Gun::Compile(char const *command) 37 37 { 38 38 orbital::GunCompiler gc(*this); -
trunk/orbital/gun.h
r1424 r1442 30 30 {} 31 31 32 void SendCommand(char const *command);32 void Compile(char const *command); 33 33 34 34 void Shoot(int count) -
trunk/orbital/mesh-compiler.cpp
r1434 r1442 12 12 13 13 #include <string> 14 15 #include "core.h" 16 17 using namespace lol; 14 18 15 19 #include "mesh-compiler.h" … … 34 38 void MeshCompiler::Error(const class location& l, const std::string& m) 35 39 { 36 std::cerr << l << ": " << m << std::endl; 40 Log::Error("Syntax error line %d column %d: %s", 41 l.begin.line, l.begin.column, m.c_str()); 37 42 } 38 43 39 44 void MeshCompiler::Error(const std::string& m) 40 45 { 41 std::cerr << m << std::endl;46 Log::Error("Syntax error: %s", m.c_str()); 42 47 } 43 48 -
trunk/orbital/mesh-parser.y
r1434 r1442 42 42 %start mesh_description 43 43 44 %token T_INITRB T_FREERB45 46 44 %token T_COLOR T_BGCOLOR 47 45 … … 55 53 56 54 %token T_END 0 55 %token T_ERROR 57 56 58 57 %token <fval> NUMBER … … 99 98 100 99 mesh_command: 101 rb_command 102 | color_command 100 color_command 103 101 | transform_command 104 102 | primitive_command 105 ;106 107 rb_command:108 T_INITRB { mc.m_mesh.MeshConvert(); }109 | T_FREERB { /* TODO */ }110 103 ; 111 104 -
trunk/orbital/mesh-scanner.l
r1434 r1442 42 42 yylloc->step(); 43 43 %} 44 45 irb { return token::T_INITRB; }46 frb { return token::T_FREERB; }47 44 48 45 sc { return token::T_COLOR; } … … 90 87 "[" { return token_type('['); } 91 88 "]" { return token_type(']'); } 92 . { /* ignore everything else */ } 93 [\n] { /* ignore everything else */ } 89 [ ,] { /* ignore this */ } 90 [\n] { /* ignore this */ } 91 . { return token::T_ERROR; } 94 92 95 93 %% -
trunk/orbital/mesh.cpp
r1433 r1442 34 34 #include "mesh-compiler.h" 35 35 36 void Mesh::SendCommand(char const *command)36 bool Mesh::Compile(char const *command) 37 37 { 38 38 orbital::MeshCompiler mc(*this); -
trunk/orbital/mesh.h
r1434 r1442 26 26 } 27 27 28 void SendCommand(char const *command);28 bool Compile(char const *command); 29 29 30 30 void OpenBrace() -
trunk/orbital/orbital.cpp
r1441 r1442 45 45 { 46 46 #if 0 47 48 47 int max_x = 20; 48 int max_y = 20; 49 49 for (int j = 0; j < max_x; j++) 50 50 { 51 51 for (int i = 0; i < max_y; i++) 52 52 { 53 m. SendCommand(((i + j) % 2) ? "sc.0,.1,.2,1,scb.0,.1,.2,1"53 m.Compile(((i + j) % 2) ? "sc.0,.1,.2,1,scb.0,.1,.2,1" 54 54 : "sc.0,.0,.1,1,scb.0,.0,.1,1"); 55 m. SendCommand("ac4,2,44,40,0,0,ty-1,ad4,40,0,ry45");55 m.Compile("ac4,2,44,40,0,0,ty-1,ad4,40,0,ry45"); 56 56 m.Scale(vec3(std::sqrt(0.5f))); 57 57 m.Translate(vec3( i * 44 - (44 * (max_x * 0.5f)), 0, 58 58 j * 44 - (44 * (max_y * 0.5f)))); 59 59 m.Flush(); 60 60 } … … 63 63 64 64 /* Grey/red bonus */ 65 m. SendCommand("[sc#9ac afcb7 4 7 0.6 sc#f04 afcb4 7 4 0.6 t-40 20 -30]");65 m.Compile("[sc#9ac afcb7 4 7 0.6 sc#f04 afcb4 7 4 0.6 t-40 20 -30]"); 66 66 67 67 #if 0 68 68 /* Yellow sphere */ 69 m. SendCommand("sc1,1,0,1,asph10,30,20,24");70 m. SendCommand("t0,0,60,fl");69 m.Compile("sc1,1,0,1,asph10,30,20,24"); 70 m.Compile("t0,0,60,fl"); 71 71 72 72 /* Pink box */ 73 m. SendCommand("sc1,0,1,1,afcb10,10,10,1,rx45,rz45");74 m. SendCommand("t-20,20,0,fl");73 m.Compile("sc1,0,1,1,afcb10,10,10,1,rx45,rz45"); 74 m.Compile("t-20,20,0,fl"); 75 75 76 76 /* Large meteor */ 77 m. SendCommand("sc0,0,0.3,1,afcb30,30,30,5,ry45,rx45,afcb30,30,30,5");78 m. SendCommand("t40,40,0,fl");77 m.Compile("sc0,0,0.3,1,afcb30,30,30,5,ry45,rx45,afcb30,30,30,5"); 78 m.Compile("t40,40,0,fl"); 79 79 80 80 /* Orange/white alien */ 81 m. SendCommand("sc1,0.7,0,1,afcb12,3,10,0.4,tz3,sc1,1,1,1,afcb2,10,10,0.4");82 m. SendCommand("t0,40,-20,fl");83 //m. SendCommand("rx20,ry30,t0,40,-20,fl");81 m.Compile("sc1,0.7,0,1,afcb12,3,10,0.4,tz3,sc1,1,1,1,afcb2,10,10,0.4"); 82 m.Compile("t0,40,-20,fl"); 83 //m.Compile("rx20,ry30,t0,40,-20,fl"); 84 84 85 85 /* Orange fire */ 86 m. SendCommand("sc1,1,0,1,scb1,0,0,0,at4,1,s1.5,1,4,tz-13,ad6,5.8,1");87 m. SendCommand("t-40,40,0,fl");86 m.Compile("sc1,1,0,1,scb1,0,0,0,at4,1,s1.5,1,4,tz-13,ad6,5.8,1"); 87 m.Compile("t-40,40,0,fl"); 88 88 89 89 /* Lasers */ 90 m. SendCommand("sc1,1,1,1,scb0,0,0,1,aq8,1,sx0.25,tx-3,sc1,0,0,1,scb0,0,0,1,aq8,1,tx4,sz50,sx0.3,tz-200,mx,as10,12,8,1,1,ty60,fl");90 m.Compile("sc1,1,1,1,scb0,0,0,1,aq8,1,sx0.25,tx-3,sc1,0,0,1,scb0,0,0,1,aq8,1,tx4,sz50,sx0.3,tz-200,mx,as10,12,8,1,1,ty60,fl"); 91 91 #endif 92 92 … … 177 177 for (int n = 0; n < 3; n++) 178 178 { 179 180 181 182 179 if (m_angle[n] > 180.f) 180 m_angle[n] -= 360.f; 181 else if (m_angle[n] < -180.f) 182 m_angle[n] += 360.f; 183 183 } 184 184 … … 189 189 190 190 #if 0 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 191 vec3 new_camera_pos = vec3(0,0,0); 192 193 for (int i = 0; i < m_tanks.Count(); i++) 194 new_camera_pos += m_tanks[i]->m_position; 195 for (int i = 0; i < m_snakes.Count(); i++) 196 new_camera_pos += m_snakes[i]->GetBarycenter(); 197 for (int i = 0; i < m_players.Count(); i++) 198 new_camera_pos += m_players[i]->m_position; 199 200 new_camera_pos /= (float)(m_players.Count() + m_tanks.Count() + m_snakes.Count()); 201 new_camera_pos += vec3(0.f, 0.f, -50.f); 202 203 new_camera_pos = m_camera->GetTarget() + (new_camera_pos - m_camera->GetTarget()) * (seconds / (seconds + 0.15f)); 204 m_camera->SetPosition(new_camera_pos + vec3(0.f, 600.f, 0.f)); 205 m_camera->SetTarget(new_camera_pos); 206 206 #endif 207 207 … … 215 215 if (!m_ready) 216 216 { 217 m. SendCommand("irb");217 m.MeshConvert(); 218 218 219 219 /* FIXME: this object never cleans up */ -
trunk/orbital/particlesystem.h
r1434 r1442 19 19 m_ready(false) 20 20 { 21 m_mesh. SendCommand("[sc#ccc acg8 2 5 5 1.5 1.5 .1 0 rx15 t0 -100 -30]");21 m_mesh.Compile("[sc#ccc acg8 2 5 5 1.5 1.5 .1 0 rx15 t0 -100 -30]"); 22 22 23 23 for (int i = 0; i < 200; i++) … … 58 58 if (!m_ready) 59 59 { 60 m_mesh. SendCommand("irb");60 m_mesh.MeshConvert(); 61 61 m_ready = true; 62 62 } -
trunk/orbital/player.h
r1441 r1442 24 24 m_ready(false) 25 25 { 26 char const *color[2] = { "sc#c32", "sc#229" };27 28 //Red Mesh29 26 if (type == 0) 30 27 { 31 /* Ship centre */ 32 m_ship_mesh.SendCommand("[sc#c32 afcb3 6 7 .4 t0 0 7 sc#fff afcb3 4 4 .4 t4 0 -4 mx]"); 33 /* Sides */ 34 m_ship_mesh.SendCommand("[sc#c32 afcb3 6 5 .4 sc#fff afcb2 3 9 .4]"); 35 m_ship_mesh.SendCommand("[sc#fff ac4 15 .2 .6 1 1 tz-2 ac4 15 .2 .6 1 1 rx90 t0 -2 -7]"); 36 37 m_exhaust_mesh.SendCommand("[sc#0ff scb#000 ac5 15 0 1.5 0 1 ac7 35 1.1 4 0 1 rx90 tz27]"); 38 } 39 //Blue Mesh 40 else 41 { 42 /* Sides */ 43 m_ship_mesh.SendCommand("[sc#fff scb#fff ac4 15 .2 .6 1 1 t0 0 -4 ac4 1.5 .2 .6 1 1 rx90 t1.3 -2 -6 afcb3 6 5 .4 t0 0 -7 sc#229 afcb3 4 7 .4 t4 0 0 mx]"); 44 /* Ship centre */ 45 m_ship_mesh.SendCommand("[afcb3 6 5 .4 sc#fff afcb2 3 9 .4]"); 46 47 m_exhaust_mesh.SendCommand("[sc#0ff scb#000 ac5 10 0 1.5 0 1 ac7 25 1.1 4 0 1 rx90 tz19]"); 48 } 49 50 m_option_mesh.SendCommand(color[type]); 51 m_option_mesh.SendCommand("[afcb5 1 3 0.6]sc#fff[afcb1 5 3 0.6 tz-1]"); 52 53 m_laser_mesh.SendCommand("[sc#fff scb#000 aq8 1 sx0.25 tx-3 sc#f00 aq8 1 tx4 sz50 sx0.3 tz-200 mx as10 12 8 1 1]"); 28 /* Red Mesh */ 29 m_ship_mesh.Compile("[sc#c32 afcb3 6 7 .4 t0 0 7" 30 " sc#fff afcb3 4 4 .4 t4 0 -4 mx]" 31 "[sc#c32 afcb3 6 5 .4 sc#fff afcb2 3 9 .4]" 32 "[sc#fff ac4 15 .2 .6 1 1 tz-2" 33 " ac4 15 .2 .6 1 1 rx90 t0 -2 -7]"); 34 35 m_exhaust_mesh.Compile("oifds9898432890fds"); 36 m_exhaust_mesh.Compile("[sc#0ff scb#000 ac5 15 0 1.5 0 1" 37 " ac7 35 1.1 4 0 1 rx90 tz27]"); 38 39 m_option_mesh.Compile("sc#c32[afcb5 1 3 0.6]" 40 "sc#fff[afcb1 5 3 0.6 tz-1]"); 41 } 42 else 43 { 44 /* Blue Mesh */ 45 m_ship_mesh.Compile("[sc#fff scb#fff ac4 15 .2 .6 1 1 t0 0 -4" 46 " ac4 1.5 .2 .6 1 1 rx90 t1.3 -2 -6" 47 " afcb3 6 5 .4 t0 0 -7" 48 " sc#229 afcb3 4 7 .4 t4 0 0 mx]" 49 "[afcb3 6 5 .4 sc#fff afcb2 3 9 .4]"); 50 51 m_exhaust_mesh.Compile("[sc#0ff scb#000 ac5 10 0 1.5 0 1" 52 " ac7 25 1.1 4 0 1 rx90 tz19]"); 53 54 m_option_mesh.Compile("sc#229[afcb5 1 3 0.6]" 55 "sc#fff[afcb1 5 3 0.6 tz-1]"); 56 } 57 58 m_laser_mesh.Compile("[sc#fff scb#000 aq8 1 sx0.25 tx-3 sc#f00" 59 " aq8 1 tx4 sz50 sx0.3 tz-200 mx as10 12 8 1 1]"); 54 60 55 61 m_position = vec3(0.f + type * 80.f, 3.5f + 50.f, 0.f); … … 175 181 if (!m_ready) 176 182 { 177 m_ship_mesh. SendCommand("irb");178 m_option_mesh. SendCommand("irb");179 m_laser_mesh. SendCommand("irb");180 m_exhaust_mesh. SendCommand("irb");183 m_ship_mesh.MeshConvert(); 184 m_option_mesh.MeshConvert(); 185 m_laser_mesh.MeshConvert(); 186 m_exhaust_mesh.MeshConvert(); 181 187 m_ready = true; 182 188 } -
trunk/orbital/snake.h
r1441 r1442 20 20 m_ready(false) 21 21 { 22 m_head. SendCommand("sc#d91"22 m_head.Compile("sc#d91" 23 23 "[afcb30 3 3 .8]" 24 24 "sc#cca" … … 29 29 "[afcb5 8 8 1 ty3 tz3]"); 30 30 31 m_body. SendCommand("sc#d91"31 m_body.Compile("sc#d91" 32 32 "[afcb3 20 3 .8 afcb20 3 3 .8]" 33 33 "sc#cca" … … 36 36 "[afcb.4 .4 7 .4 tx8 mx]"); 37 37 38 m_tail. SendCommand("sc#cca"38 m_tail.Compile("sc#cca" 39 39 "[afcb6 6 10 1 tz-1]" 40 40 "[afcb.4 .4 8 .4 tz-1 ty8]" … … 152 152 if (!m_ready) 153 153 { 154 m_head. SendCommand("irb");155 m_body. SendCommand("irb");156 m_tail. SendCommand("irb");154 m_head.MeshConvert(); 155 m_body.MeshConvert(); 156 m_tail.MeshConvert(); 157 157 m_ready = true; 158 158 } -
trunk/orbital/starfield.h
r1434 r1442 19 19 { 20 20 if (z == 1.f) 21 m_mesh. SendCommand("sc#fff scb#fff0 ad4 1.8 1");21 m_mesh.Compile("sc#fff scb#fff0 ad4 1.8 1"); 22 22 else 23 m_mesh. SendCommand("sc#fff scb#fff0 ad3 0.8 1");23 m_mesh.Compile("sc#fff scb#fff0 ad3 0.8 1"); 24 24 25 25 for (int i = 0; i < count; i++) … … 58 58 if (!m_ready) 59 59 { 60 m_mesh. SendCommand("irb");60 m_mesh.MeshConvert(); 61 61 m_ready = true; 62 62 } -
trunk/orbital/tank.h
r1434 r1442 19 19 m_ready(false) 20 20 { 21 m_body.SendCommand("[sc#110 ab6 6 15 ty-2" 22 " sc#aca afcb4 5 16 0.4 tx4 ty5 mx]" 23 "[sc#3a0 afcb8 7 10 0.4 tz-4 ty5]"); 24 m_turret.SendCommand("[sc#3a0 afcb3 6 10 0.4 tx-8 afcb3 6 10 0.4 tx4 ty13]" 25 "[sc#aca afcb3 6 10 0.4 rx-30 ty13]"); 21 m_body.Compile("[sc#110 ab6 6 15 ty-2 sc#aca afcb4 5 16 0.4 tx4 ty5 mx]" 22 "[sc#3a0 afcb8 7 10 0.4 tz-4 ty5]"); 23 m_turret.Compile("[sc#3a0 afcb3 6 10 0.4 tx-8 afcb3 6 10 0.4 tx4 ty13]" 24 "[sc#aca afcb3 6 10 0.4 rx-30 ty13]"); 26 25 27 26 m_rotation = quat::rotate(RandF(0.f, 360.f), vec3(0, 1, 0)); … … 59 58 if (!m_ready) 60 59 { 61 m_body. SendCommand("irb");62 m_turret. SendCommand("irb");60 m_body.MeshConvert(); 61 m_turret.MeshConvert(); 63 62 m_ready = true; 64 63 } -
trunk/src/camera.cpp
r1375 r1442 20 20 #if defined _WIN32 || defined _XBOX 21 21 # define strcasecmp _stricmp 22 # undef near 23 # undef far 22 24 #endif 23 25
Note: See TracChangeset
for help on using the changeset viewer.