Changeset 1434
- Timestamp:
- Jun 1, 2012, 7:42:36 PM (11 years ago)
- Location:
- trunk/orbital
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/orbital/generated/gun-parser.cpp
r1425 r1434 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
r1425 r1434 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
r1418 r1434 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
r1432 r1434 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 */71 /* Line 316 of lalr1.cc */ 72 72 #line 64 "mesh-parser.y" 73 73 … … 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; … … 463 433 switch (yyn) 464 434 { 465 case 9: 466 467 /* Line 690 of lalr1.cc */ 468 #line 90 "mesh-parser.y" 469 { mc.m_mesh.Flush(); } 470 break; 471 472 case 10: 473 474 /* Line 690 of lalr1.cc */ 475 #line 91 "mesh-parser.y" 435 case 7: 436 437 /* Line 677 of lalr1.cc */ 438 #line 88 "mesh-parser.y" 439 { mc.m_mesh.OpenBrace(); } 440 break; 441 442 case 8: 443 444 /* Line 677 of lalr1.cc */ 445 #line 92 "mesh-parser.y" 446 { mc.m_mesh.CloseBrace(); } 447 break; 448 449 case 15: 450 451 /* Line 677 of lalr1.cc */ 452 #line 108 "mesh-parser.y" 476 453 { mc.m_mesh.MeshConvert(); } 477 454 break; 478 455 479 case 1 1:480 481 /* Line 6 90of lalr1.cc */482 #line 92"mesh-parser.y"456 case 16: 457 458 /* Line 677 of lalr1.cc */ 459 #line 109 "mesh-parser.y" 483 460 { /* TODO */ } 484 461 break; 485 462 486 case 1 2:487 488 /* Line 6 90of lalr1.cc */489 #line 96"mesh-parser.y"463 case 17: 464 465 /* Line 677 of lalr1.cc */ 466 #line 113 "mesh-parser.y" 490 467 { 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)); } 491 468 break; 492 469 493 case 1 3:494 495 /* Line 6 90of lalr1.cc */496 #line 97"mesh-parser.y"470 case 18: 471 472 /* Line 677 of lalr1.cc */ 473 #line 114 "mesh-parser.y" 497 474 { uint16_t x = (uint16_t)(yysemantic_stack_[(2) - (2)].u32val); 498 475 vec4 v(x >> 12, (x >> 8) & 0xf, (x >> 4) & 0xf, x & 0xf); … … 500 477 break; 501 478 502 case 1 4:503 504 /* Line 6 90of lalr1.cc */505 #line 1 00"mesh-parser.y"479 case 19: 480 481 /* Line 677 of lalr1.cc */ 482 #line 117 "mesh-parser.y" 506 483 { 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)); } 507 484 break; 508 485 509 case 15:510 511 /* Line 6 90of lalr1.cc */512 #line 1 01"mesh-parser.y"486 case 20: 487 488 /* Line 677 of lalr1.cc */ 489 #line 118 "mesh-parser.y" 513 490 { uint16_t x = (uint16_t)(yysemantic_stack_[(2) - (2)].u32val); 514 491 vec4 v(x >> 12, (x >> 8) & 0xf, (x >> 4) & 0xf, x & 0xf); 515 mc.m_mesh.SetCurColor (vec4(v) * (1. / 15)); }516 break; 517 518 case 16:519 520 /* Line 6 90of lalr1.cc */521 #line 1 07"mesh-parser.y"492 mc.m_mesh.SetCurColor2(vec4(v) * (1. / 15)); } 493 break; 494 495 case 21: 496 497 /* Line 677 of lalr1.cc */ 498 #line 124 "mesh-parser.y" 522 499 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } 523 500 break; 524 501 525 case 17:526 527 /* Line 6 90of lalr1.cc */528 #line 1 08"mesh-parser.y"502 case 22: 503 504 /* Line 677 of lalr1.cc */ 505 #line 125 "mesh-parser.y" 529 506 { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } 530 507 break; 531 508 532 case 18:533 534 /* Line 6 90of lalr1.cc */535 #line 1 09"mesh-parser.y"509 case 23: 510 511 /* Line 677 of lalr1.cc */ 512 #line 126 "mesh-parser.y" 536 513 { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } 537 514 break; 538 515 539 case 19:540 541 /* Line 6 90of lalr1.cc */542 #line 1 10"mesh-parser.y"516 case 24: 517 518 /* Line 677 of lalr1.cc */ 519 #line 127 "mesh-parser.y" 543 520 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 544 521 break; 545 522 546 case 2 0:547 548 /* Line 6 90of lalr1.cc */549 #line 1 11"mesh-parser.y"523 case 25: 524 525 /* Line 677 of lalr1.cc */ 526 #line 128 "mesh-parser.y" 550 527 { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); } 551 528 break; 552 529 553 case 2 1:554 555 /* Line 6 90of lalr1.cc */556 #line 1 12"mesh-parser.y"530 case 26: 531 532 /* Line 677 of lalr1.cc */ 533 #line 129 "mesh-parser.y" 557 534 { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); } 558 535 break; 559 536 560 case 2 2:561 562 /* Line 6 90of lalr1.cc */563 #line 1 13"mesh-parser.y"537 case 27: 538 539 /* Line 677 of lalr1.cc */ 540 #line 130 "mesh-parser.y" 564 541 { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); } 565 542 break; 566 543 567 case 2 3:568 569 /* Line 6 90of lalr1.cc */570 #line 1 14"mesh-parser.y"544 case 28: 545 546 /* Line 677 of lalr1.cc */ 547 #line 131 "mesh-parser.y" 571 548 { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 572 549 break; 573 550 574 case 2 4:575 576 /* Line 6 90of lalr1.cc */577 #line 1 15"mesh-parser.y"551 case 29: 552 553 /* Line 677 of lalr1.cc */ 554 #line 132 "mesh-parser.y" 578 555 { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 579 556 break; 580 557 581 case 25:582 583 /* Line 6 90of lalr1.cc */584 #line 1 16"mesh-parser.y"558 case 30: 559 560 /* Line 677 of lalr1.cc */ 561 #line 133 "mesh-parser.y" 585 562 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 586 563 break; 587 564 588 case 26:589 590 /* Line 6 90of lalr1.cc */591 #line 1 17"mesh-parser.y"565 case 31: 566 567 /* Line 677 of lalr1.cc */ 568 #line 134 "mesh-parser.y" 592 569 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } 593 570 break; 594 571 595 case 27:596 597 /* Line 6 90of lalr1.cc */598 #line 1 18"mesh-parser.y"572 case 32: 573 574 /* Line 677 of lalr1.cc */ 575 #line 135 "mesh-parser.y" 599 576 { mc.m_mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } 600 577 break; 601 578 602 case 28:603 604 /* Line 6 90of lalr1.cc */605 #line 1 19"mesh-parser.y"579 case 33: 580 581 /* Line 677 of lalr1.cc */ 582 #line 136 "mesh-parser.y" 606 583 { mc.m_mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } 607 584 break; 608 585 609 case 29:610 611 /* Line 6 90of lalr1.cc */612 #line 1 20"mesh-parser.y"586 case 34: 587 588 /* Line 677 of lalr1.cc */ 589 #line 137 "mesh-parser.y" 613 590 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 614 591 break; 615 592 616 case 3 0:617 618 /* Line 6 90of lalr1.cc */619 #line 1 21"mesh-parser.y"593 case 35: 594 595 /* Line 677 of lalr1.cc */ 596 #line 138 "mesh-parser.y" 620 597 { mc.m_mesh.MirrorX(); } 621 598 break; 622 599 623 case 3 1:624 625 /* Line 6 90of lalr1.cc */626 #line 1 22"mesh-parser.y"600 case 36: 601 602 /* Line 677 of lalr1.cc */ 603 #line 139 "mesh-parser.y" 627 604 { mc.m_mesh.MirrorY(); } 628 605 break; 629 606 630 case 3 2:631 632 /* Line 6 90of lalr1.cc */633 #line 1 23"mesh-parser.y"607 case 37: 608 609 /* Line 677 of lalr1.cc */ 610 #line 140 "mesh-parser.y" 634 611 { mc.m_mesh.MirrorZ(); } 635 612 break; 636 613 637 case 3 3:638 639 /* Line 6 90of lalr1.cc */640 #line 1 27"mesh-parser.y"614 case 38: 615 616 /* Line 677 of lalr1.cc */ 617 #line 144 "mesh-parser.y" 641 618 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 642 619 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 644 621 break; 645 622 646 case 3 4:647 648 /* Line 6 90of lalr1.cc */649 #line 1 30"mesh-parser.y"623 case 39: 624 625 /* Line 677 of lalr1.cc */ 626 #line 147 "mesh-parser.y" 650 627 { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 651 628 break; 652 629 653 case 35:654 655 /* Line 6 90of lalr1.cc */656 #line 1 31"mesh-parser.y"630 case 40: 631 632 /* Line 677 of lalr1.cc */ 633 #line 148 "mesh-parser.y" 657 634 { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 658 635 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 659 636 break; 660 637 661 case 36:662 663 /* Line 6 90of lalr1.cc */664 #line 1 33"mesh-parser.y"638 case 41: 639 640 /* Line 677 of lalr1.cc */ 641 #line 150 "mesh-parser.y" 665 642 { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 666 643 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 667 644 break; 668 645 669 case 37:670 671 /* Line 6 90of lalr1.cc */672 #line 1 35"mesh-parser.y"646 case 42: 647 648 /* Line 677 of lalr1.cc */ 649 #line 152 "mesh-parser.y" 673 650 { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, 674 651 vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } 675 652 break; 676 653 677 case 38:678 679 /* Line 6 90of lalr1.cc */680 #line 1 37"mesh-parser.y"654 case 43: 655 656 /* Line 677 of lalr1.cc */ 657 #line 154 "mesh-parser.y" 681 658 { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, 682 659 (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } 683 660 break; 684 661 685 case 39:686 687 /* Line 6 90of lalr1.cc */688 #line 1 39"mesh-parser.y"662 case 44: 663 664 /* Line 677 of lalr1.cc */ 665 #line 156 "mesh-parser.y" 689 666 { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 690 667 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 691 668 break; 692 669 693 case 4 0:694 695 /* Line 6 90of lalr1.cc */696 #line 1 41"mesh-parser.y"670 case 45: 671 672 /* Line 677 of lalr1.cc */ 673 #line 158 "mesh-parser.y" 697 674 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } 698 675 break; 699 676 700 case 4 1:701 702 /* Line 6 90of lalr1.cc */703 #line 1 42"mesh-parser.y"677 case 46: 678 679 /* Line 677 of lalr1.cc */ 680 #line 159 "mesh-parser.y" 704 681 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 705 682 break; 706 683 707 case 4 2:708 709 /* Line 6 90of lalr1.cc */710 #line 1 43"mesh-parser.y"684 case 47: 685 686 /* Line 677 of lalr1.cc */ 687 #line 160 "mesh-parser.y" 711 688 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 712 689 break; 713 690 714 case 4 3:715 716 /* Line 6 90of lalr1.cc */717 #line 1 44"mesh-parser.y"691 case 48: 692 693 /* Line 677 of lalr1.cc */ 694 #line 161 "mesh-parser.y" 718 695 { 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, 719 696 (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); } 720 697 break; 721 698 722 case 4 4:723 724 /* Line 6 90of lalr1.cc */725 #line 1 48"mesh-parser.y"699 case 49: 700 701 /* Line 677 of lalr1.cc */ 702 #line 165 "mesh-parser.y" 726 703 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } 727 704 break; 728 705 729 case 45:730 731 /* Line 690 of lalr1.cc */732 #line 149 "mesh-parser.y"733 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(3) - (3)].fval); }734 break;735 736 case 46:737 738 /* Line 690 of lalr1.cc */739 #line 150 "mesh-parser.y"740 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(3) - (3)].fval); }741 break;742 743 case 47:744 745 /* Line 690 of lalr1.cc */746 #line 151 "mesh-parser.y"747 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(3) - (3)].fval); }748 break;749 750 case 48:751 752 /* Line 690 of lalr1.cc */753 #line 152 "mesh-parser.y"754 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(3) - (3)].fval); }755 break;756 757 case 49:758 759 /* Line 690 of lalr1.cc */760 #line 153 "mesh-parser.y"761 { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(3) - (3)].fval); }762 break;763 764 706 case 50: 765 707 766 /* Line 6 90of lalr1.cc */767 #line 1 54"mesh-parser.y"768 { (yyval.args) = (yysemantic_stack_[( 3) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(3) - (3)].fval); }708 /* Line 677 of lalr1.cc */ 709 #line 166 "mesh-parser.y" 710 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } 769 711 break; 770 712 771 713 case 51: 772 714 773 /* Line 6 90of lalr1.cc */774 #line 1 55"mesh-parser.y"775 { (yyval.args) = (yysemantic_stack_[( 3) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(3) - (3)].fval); }715 /* Line 677 of lalr1.cc */ 716 #line 167 "mesh-parser.y" 717 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } 776 718 break; 777 719 778 720 case 52: 779 721 780 /* Line 690 of lalr1.cc */ 781 #line 158 "mesh-parser.y" 722 /* Line 677 of lalr1.cc */ 723 #line 168 "mesh-parser.y" 724 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } 725 break; 726 727 case 53: 728 729 /* Line 677 of lalr1.cc */ 730 #line 169 "mesh-parser.y" 731 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } 732 break; 733 734 case 54: 735 736 /* Line 677 of lalr1.cc */ 737 #line 170 "mesh-parser.y" 738 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } 739 break; 740 741 case 55: 742 743 /* Line 677 of lalr1.cc */ 744 #line 171 "mesh-parser.y" 745 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } 746 break; 747 748 case 56: 749 750 /* Line 677 of lalr1.cc */ 751 #line 172 "mesh-parser.y" 752 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } 753 break; 754 755 case 57: 756 757 /* Line 677 of lalr1.cc */ 758 #line 175 "mesh-parser.y" 782 759 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } 783 760 break; 784 761 785 case 5 3:786 787 /* Line 6 90of lalr1.cc */788 #line 1 59"mesh-parser.y"762 case 58: 763 764 /* Line 677 of lalr1.cc */ 765 #line 176 "mesh-parser.y" 789 766 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } 790 767 break; … … 792 769 793 770 794 /* Line 6 90of lalr1.cc */795 #line 7 96"generated/mesh-parser.cpp"771 /* Line 677 of lalr1.cc */ 772 #line 773 "generated/mesh-parser.cpp" 796 773 default: 797 774 break; 798 775 } 799 /* User semantic actions sometimes alter yychar, and that requires800 that yytoken be updated with the new translation. We take the801 approach of translating immediately before every use of yytoken.802 One alternative is translating here after every semantic action,803 but that translation would be missed if the semantic action804 invokes YYABORT, YYACCEPT, or YYERROR immediately after altering805 yychar. In the case of YYABORT or YYACCEPT, an incorrect806 destructor might then be invoked immediately. In the case of807 YYERROR, subsequent parser actions might lead to an incorrect808 destructor call or verbose syntax error message before the809 lookahead is translated. */810 776 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 811 777 … … 831 797 `------------------------------------*/ 832 798 yyerrlab: 833 /* Make sure we have latest lookahead translation. See comments at834 user semantic actions for why this is necessary. */835 yytoken = yytranslate_ (yychar);836 837 799 /* If not already recovering from an error, report this error. */ 838 800 if (!yyerrstatus_) 839 801 { 840 802 ++yynerrs_; 841 if (yychar == yyempty_)842 yytoken = yyempty_;843 803 error (yylloc, yysyntax_error_ (yystate, yytoken)); 844 804 } 845 805 846 yyerror_range[ 1] = yylloc;806 yyerror_range[0] = yylloc; 847 807 if (yyerrstatus_ == 3) 848 808 { … … 879 839 goto yyerrorlab; 880 840 881 yyerror_range[ 1] = yylocation_stack_[yylen - 1];841 yyerror_range[0] = yylocation_stack_[yylen - 1]; 882 842 /* Do not reclaim the symbols of the rule which action triggered 883 843 this YYERROR. */ … … 896 856 { 897 857 yyn = yypact_[yystate]; 898 if ( !yy_pact_value_is_default_ (yyn))858 if (yyn != yypact_ninf_) 899 859 { 900 860 yyn += yyterror_; … … 911 871 YYABORT; 912 872 913 yyerror_range[ 1] = yylocation_stack_[0];873 yyerror_range[0] = yylocation_stack_[0]; 914 874 yydestruct_ ("Error: popping", 915 875 yystos_[yystate], … … 920 880 } 921 881 922 yyerror_range[ 2] = yylloc;882 yyerror_range[1] = yylloc; 923 883 // Using YYLLOC is tempting, but would change the location of 924 884 // the lookahead. YYLOC is available though. 925 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);885 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); 926 886 yysemantic_stack_.push (yylval); 927 887 yylocation_stack_.push (yyloc); … … 946 906 yyreturn: 947 907 if (yychar != yyempty_) 948 { 949 /* Make sure we have latest lookahead translation. See comments 950 at user semantic actions for why this is necessary. */ 951 yytoken = yytranslate_ (yychar); 952 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, 953 &yylloc); 954 } 908 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 955 909 956 910 /* Do not reclaim the symbols of the rule which action triggered … … 971 925 // Generate an error message. 972 926 std::string 973 MeshParser::yysyntax_error_ (int yystate, int yytoken) 974 { 975 std::string yyres; 976 // Number of reported tokens (one for the "unexpected", one per 977 // "expected"). 978 size_t yycount = 0; 979 // Its maximum. 980 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 981 // Arguments of yyformat. 982 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 983 984 /* There are many possibilities here to consider: 985 - If this state is a consistent state with a default action, then 986 the only way this function was invoked is if the default action 987 is an error action. In that case, don't check for expected 988 tokens because there are none. 989 - The only way there can be no lookahead present (in yytoken) is 990 if this state is a consistent state with a default action. 991 Thus, detecting the absence of a lookahead is sufficient to 992 determine that there is no unexpected or expected token to 993 report. In that case, just report a simple "syntax error". 994 - Don't assume there isn't a lookahead just because this state is 995 a consistent state with a default action. There might have 996 been a previous inconsistent state, consistent state with a 997 non-default action, or user semantic action that manipulated 998 yychar. 999 - Of course, the expected token list depends on states to have 1000 correct lookahead information, and it depends on the parser not 1001 to perform extra reductions after fetching a lookahead from the 1002 scanner and before detecting a syntax error. Thus, state 1003 merging (from LALR or IELR) and default reductions corrupt the 1004 expected token list. However, the list is correct for 1005 canonical LR with one exception: it will still contain any 1006 token that will not be accepted due to an error action in a 1007 later state. 1008 */ 1009 if (yytoken != yyempty_) 927 MeshParser::yysyntax_error_ (int yystate, int tok) 928 { 929 std::string res; 930 YYUSE (yystate); 931 #if YYERROR_VERBOSE 932 int yyn = yypact_[yystate]; 933 if (yypact_ninf_ < yyn && yyn <= yylast_) 1010 934 { 1011 yyarg[yycount++] = yytname_[yytoken]; 1012 int yyn = yypact_[yystate]; 1013 if (!yy_pact_value_is_default_ (yyn)) 1014 { 1015 /* Start YYX at -YYN if negative to avoid negative indexes in 1016 YYCHECK. In other words, skip the first -YYN actions for 1017 this state because they are default actions. */ 1018 int yyxbegin = yyn < 0 ? -yyn : 0; 1019 /* Stay within bounds of both yycheck and yytname. */ 1020 int yychecklim = yylast_ - yyn + 1; 1021 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 1022 for (int yyx = yyxbegin; yyx < yyxend; ++yyx) 1023 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ 1024 && !yy_table_value_is_error_ (yytable_[yyx + yyn])) 1025 { 1026 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1027 { 1028 yycount = 1; 1029 break; 1030 } 1031 else 1032 yyarg[yycount++] = yytname_[yyx]; 1033 } 1034 } 935 /* Start YYX at -YYN if negative to avoid negative indexes in 936 YYCHECK. */ 937 int yyxbegin = yyn < 0 ? -yyn : 0; 938 939 /* Stay within bounds of both yycheck and yytname. */ 940 int yychecklim = yylast_ - yyn + 1; 941 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 942 int count = 0; 943 for (int x = yyxbegin; x < yyxend; ++x) 944 if (yycheck_[x + yyn] == x && x != yyterror_) 945 ++count; 946 947 // FIXME: This method of building the message is not compatible 948 // with internationalization. It should work like yacc.c does it. 949 // That is, first build a string that looks like this: 950 // "syntax error, unexpected %s or %s or %s" 951 // Then, invoke YY_ on this string. 952 // Finally, use the string as a format to output 953 // yytname_[tok], etc. 954 // Until this gets fixed, this message appears in English only. 955 res = "syntax error, unexpected "; 956 res += yytnamerr_ (yytname_[tok]); 957 if (count < 5) 958 { 959 count = 0; 960 for (int x = yyxbegin; x < yyxend; ++x) 961 if (yycheck_[x + yyn] == x && x != yyterror_) 962 { 963 res += (!count++) ? ", expecting " : " or "; 964 res += yytnamerr_ (yytname_[x]); 965 } 966 } 1035 967 } 1036 1037 char const* yyformat = 0; 1038 switch (yycount) 1039 { 1040 #define YYCASE_(N, S) \ 1041 case N: \ 1042 yyformat = S; \ 1043 break 1044 YYCASE_(0, YY_("syntax error")); 1045 YYCASE_(1, YY_("syntax error, unexpected %s")); 1046 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1047 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1048 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1049 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1050 #undef YYCASE_ 1051 } 1052 1053 // Argument number. 1054 size_t yyi = 0; 1055 for (char const* yyp = yyformat; *yyp; ++yyp) 1056 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) 1057 { 1058 yyres += yytnamerr_ (yyarg[yyi++]); 1059 ++yyp; 1060 } 1061 else 1062 yyres += *yyp; 1063 return yyres; 968 else 969 #endif 970 res = YY_("syntax error"); 971 return res; 1064 972 } 1065 973 … … 1067 975 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 1068 976 STATE-NUM. */ 1069 const signed char MeshParser::yypact_ninf_ = -4 4;977 const signed char MeshParser::yypact_ninf_ = -47; 1070 978 const signed char 1071 979 MeshParser::yypact_[] = 1072 980 { 1073 -1, -44, -44, -44, 14, 45, 16, 16, 16, 16,1074 - 44, 16, 16, 16, 16, -44, 16, 16, 16, 16,1075 - 44, 16, 16, 16, 16, 16, 16, 16, 16, 16,1076 16, 16, 16, 16, 40, 1, -44, -44, -44, -44,1077 -4 4, -44, -44, 16, 10, 23, 26, -44, -44, -44,1078 -4 4, -44, -44, -44, -44, -44, -44, -44, -44, -44,1079 -4 4, -44, -44, -44, -44, 28, 36, -44, -44, -44,1080 -4 4, -44, -44, -44, -44, -44, -44, 38, 47, -44,1081 - 44, -44, -1, -44, 16, 16, 16, 16, 16, 16,1082 16, -44, -44, -44, -44, -44, -44, -44, -441083 }; 1084 1085 /* YYDEFACT[S] -- default r eduction number in state S. Performed when1086 YYTABLE doesn't specify something else to do. Zero means the1087 default is anerror. */981 33, -47, -47, 70, 75, -11, -11, -11, -11, -47, 982 -11, -11, -11, -11, -47, -11, -11, -11, -11, -47, 983 -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, 984 -11, -11, -11, -47, 6, 9, 33, 33, 68, -47, 985 -47, -47, -47, -47, -47, -47, -11, -11, -11, -11, 986 -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, 987 -47, -47, -47, -47, -47, -47, -47, -47, -11, -11, 988 -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, 989 -11, -11, -47, -47, -47, -47, -27, -47, -47, -47, 990 -47, -47, -47, -47, -47, -47, -47, -47 991 }; 992 993 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE 994 doesn't specify something else to do. Zero means the default is an 995 error. */ 1088 996 const unsigned char 1089 997 MeshParser::yydefact_[] = 1090 998 { 1091 0, 9, 10, 11, 0, 0, 0, 0, 0, 0,1092 30, 0, 0, 0, 0, 31, 0, 0, 0, 0,1093 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,1094 0, 0, 0, 0, 0, 0, 3, 5, 6, 7,1095 8, 52, 13, 0, 0, 0, 0, 12, 44, 15,1096 1 4, 16, 20, 23, 26, 17, 21, 24, 27, 18,1097 2 2, 25, 28, 19, 29, 0, 0, 33, 34, 35,1098 3 6, 37, 38, 39, 40, 41, 42, 0, 0, 43,1099 1, 2, 0, 53, 0, 0, 0, 0, 0,0,1100 0, 4, 45, 46, 47, 48, 49, 50, 51999 0, 15, 16, 0, 0, 0, 0, 0, 0, 35, 1000 0, 0, 0, 0, 36, 0, 0, 0, 0, 37, 1001 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1002 0, 0, 0, 7, 0, 0, 3, 0, 5, 9, 1003 11, 12, 13, 14, 57, 18, 0, 0, 0, 0, 1004 17, 49, 20, 19, 21, 25, 28, 31, 22, 26, 1005 29, 32, 23, 27, 30, 33, 24, 34, 0, 0, 1006 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 1007 0, 0, 48, 1, 2, 4, 0, 10, 58, 50, 1008 51, 52, 53, 54, 55, 56, 8, 6 1101 1009 }; 1102 1010 … … 1105 1013 MeshParser::yypgoto_[] = 1106 1014 { 1107 -44, -44, -44, -13, -44, -44, -44, -44, 61, 6, 1108 41, 31, 51, 50, -44, -44, -43 1015 -47, -47, -6, -47, -47, -47, -47, -24, -47, -47, 1016 -47, -47, 2, 38, 96, 1, -8, -16, -47, -47, 1017 -46 1109 1018 }; 1110 1019 … … 1113 1022 MeshParser::yydefgoto_[] = 1114 1023 { 1115 -1, 34, 35, 36, 37, 38, 39, 40, 44, 45, 1116 46, 65, 66, 67, 78, 79, 48 1024 -1, 34, 35, 36, 37, 97, 38, 39, 40, 41, 1025 42, 43, 47, 48, 49, 68, 69, 70, 81, 82, 1026 51 1117 1027 }; 1118 1028 1119 1029 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 1120 1030 positive, shift that token. If negative, reduce the rule which 1121 number is the opposite. If YYTABLE_NINF_, syntax error. */1031 number is the opposite. If zero, do what YYDEFACT says. */ 1122 1032 const signed char MeshParser::yytable_ninf_ = -1; 1123 1033 const unsigned char 1124 1034 MeshParser::yytable_[] = 1125 1035 { 1126 83, 81, 1, 2, 3, 4, 5, 6, 7, 8, 1127 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1128 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1129 29, 30, 31, 32, 33, 47, 50, 75, 76, 82, 1130 80, 92, 93, 94, 95, 96, 97, 98, 84, 53, 1131 41, 42, 41, 43, 57, 43, 69, 70, 71, 61, 1132 73, 85, 63, 64, 86, 68, 87, 51, 52, 91, 1133 54, 74, 55, 56, 88, 58, 89, 59, 60, 72, 1134 62, 41, 49, 77, 43, 90 1036 88, 89, 90, 91, 50, 53, 83, 54, 55, 84, 1037 57, 96, 58, 59, 87, 61, 80, 62, 63, 75, 1038 65, 0, 92, 93, 44, 72, 73, 74, 46, 76, 1039 85, 86, 0, 0, 94, 95, 1, 2, 3, 4, 1040 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1041 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1042 25, 26, 27, 28, 29, 30, 31, 32, 78, 79, 1043 33, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1044 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1045 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1046 30, 31, 32, 56, 0, 44, 45, 0, 60, 46, 1047 44, 52, 0, 64, 46, 0, 66, 67, 0, 71, 1048 0, 0, 0, 0, 0, 77 1135 1049 }; 1136 1050 1137 1051 /* YYCHECK. */ 1138 const unsigned char1052 const signed char 1139 1053 MeshParser::yycheck_[] = 1140 1054 { 1141 43, 0, 3, 4, 5, 6, 7, 8, 9, 10, 1142 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1143 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1144 31, 32, 33, 34, 35, 4, 5, 31, 32, 38, 1145 0, 84, 85, 86, 87, 88, 89, 90, 38, 8, 1146 36, 37, 36, 39, 13, 39, 25, 26, 27, 18, 1147 29, 38, 21, 22, 38, 24, 38, 6, 7, 82, 1148 9, 30, 11, 12, 38, 14, 38, 16, 17, 28, 1149 19, 36, 37, 33, 39, 38 1055 46, 47, 48, 49, 3, 4, 0, 5, 6, 0, 1056 8, 38, 10, 11, 38, 13, 32, 15, 16, 27, 1057 18, -1, 68, 69, 35, 24, 25, 26, 39, 28, 1058 36, 37, -1, -1, 80, 81, 3, 4, 5, 6, 1059 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1060 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1061 27, 28, 29, 30, 31, 32, 33, 34, 30, 31, 1062 37, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1063 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1064 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1065 32, 33, 34, 7, -1, 35, 36, -1, 12, 39, 1066 35, 36, -1, 17, 39, -1, 20, 21, -1, 23, 1067 -1, -1, -1, -1, -1, 29 1150 1068 }; 1151 1069 … … 1158 1076 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1159 1077 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1160 32, 33, 34, 3 5, 41, 42, 43, 44, 45, 46,1161 4 7, 36, 37, 39, 48, 49, 50, 51, 56, 37,1162 5 1, 48, 48, 50, 48, 48, 48, 50, 48, 48,1163 48, 50, 48, 50, 50, 51, 52, 53, 50, 51,1164 5 1, 51, 52, 51, 50, 49, 49, 53, 54, 55,1165 0, 0, 38, 56, 38, 38, 38, 38, 38, 38,1166 38, 43, 56, 56, 56, 56, 56, 56, 561078 32, 33, 34, 37, 41, 42, 43, 44, 46, 47, 1079 48, 49, 50, 51, 35, 36, 39, 52, 53, 54, 1080 55, 60, 36, 55, 52, 52, 54, 52, 52, 52, 1081 54, 52, 52, 52, 54, 52, 54, 54, 55, 56, 1082 57, 54, 55, 55, 55, 56, 55, 54, 53, 53, 1083 57, 58, 59, 0, 0, 42, 42, 47, 60, 60, 1084 60, 60, 60, 60, 60, 60, 38, 45 1167 1085 }; 1168 1086 … … 1176 1094 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 1177 1095 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 1178 285, 286, 287, 288, 289, 290, 291, 292, 44, 451096 285, 286, 287, 288, 289, 290, 291, 91, 93, 45 1179 1097 }; 1180 1098 #endif … … 1184 1102 MeshParser::yyr1_[] = 1185 1103 { 1186 0, 40, 41, 42, 42, 43, 43, 4 3, 43, 44,1187 4 4, 44, 45, 45, 45, 45, 46, 46, 46, 46,1188 4 6, 46, 46, 46, 46, 46, 46, 46, 46, 46,1189 46, 46, 46, 47, 47, 47, 47, 47, 47, 47,1190 47, 47, 47, 47, 48, 49, 50, 51, 52, 53,1191 5 4, 55, 56, 561104 0, 40, 41, 42, 42, 43, 43, 44, 45, 46, 1105 46, 47, 47, 47, 47, 48, 48, 49, 49, 49, 1106 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 1107 50, 50, 50, 50, 50, 50, 50, 50, 51, 51, 1108 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 1109 53, 54, 55, 56, 57, 58, 59, 60, 60 1192 1110 }; 1193 1111 … … 1196 1114 MeshParser::yyr2_[] = 1197 1115 { 1198 0, 2, 2, 1, 3, 1, 1, 1, 1, 1,1199 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,1200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1201 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,1202 2, 2, 2, 2, 1, 3, 3, 3, 3, 3,1203 3, 3, 1, 21116 0, 2, 2, 1, 2, 1, 3, 1, 1, 1, 1117 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1119 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 1120 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1121 2, 2, 2, 2, 2, 2, 2, 1, 2 1204 1122 }; 1205 1123 … … 1210 1128 const MeshParser::yytname_[] = 1211 1129 { 1212 "T_END", "error", "$undefined", "T_ FLUSH", "T_INITRB", "T_FREERB",1213 "T_ COLOR", "T_BGCOLOR", "T_TRANSLATEX", "T_ROTATEX", "T_TAPERX",1214 "T_ SCALEX", "T_MIRRORX", "T_TRANSLATEY", "T_ROTATEY", "T_TAPERY",1215 "T_ SCALEY", "T_MIRRORY", "T_TRANSLATEZ", "T_ROTATEZ", "T_TAPERZ",1216 "T_ SCALEZ", "T_MIRRORZ", "T_TRANSLATE", "T_SCALE", "T_CYLINDER", "T_BOX",1130 "T_END", "error", "$undefined", "T_INITRB", "T_FREERB", "T_COLOR", 1131 "T_BGCOLOR", "T_TRANSLATEX", "T_ROTATEX", "T_TAPERX", "T_SCALEX", 1132 "T_MIRRORX", "T_TRANSLATEY", "T_ROTATEY", "T_TAPERY", "T_SCALEY", 1133 "T_MIRRORY", "T_TRANSLATEZ", "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", 1134 "T_MIRRORZ", "T_TRANSLATE", "T_SCALE", "T_CYLINDER", "T_BOX", 1217 1135 "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_STAR", 1218 1136 "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "NUMBER", 1219 "COLOR", "','", "'-'", "$accept", "mesh_description", 1137 "COLOR", "'['", "']'", "'-'", "$accept", "mesh_description", 1138 "mesh_expression_list", "mesh_expression", "mesh_open", "mesh_close", 1220 1139 "mesh_command_list", "mesh_command", "rb_command", "color_command", 1221 1140 "transform_command", "primitive_command", "args1", "args2", "args3", … … 1229 1148 MeshParser::yyrhs_[] = 1230 1149 { 1231 41, 0, -1, 42, 0, -1, 43, -1, 4 2, 38,1232 43, -1, 44, -1, 45, -1, 46, -1, 47, -1,1233 3, -1, 4, -1, 5, -1, 6, 51, -1, 6,1234 37, -1, 7, 51, -1, 7, 37, -1, 8, 48,1235 -1, 13, 48, -1, 18, 48, -1, 23, 50, -1,1236 9, 48, -1, 14, 48, -1, 19, 48, -1, 10,1237 5 0, -1, 15, 50, -1, 20, 50, -1, 11, 48,1238 -1, 16, 48, -1, 21, 48, -1, 24, 50, -1,1239 1 2, -1, 17, -1, 22, -1, 25, 53, -1, 26,1240 5 0, -1, 27, 51, -1, 28, 51, -1, 29, 51,1241 -1, 30, 52, -1, 31, 51, -1, 32, 50, -1,1242 33, 49, -1, 34, 49, -1, 35, 55, -1, 56,1243 -1, 48, 38, 56, -1, 49, 38, 56, -1, 50,1244 38, 56, -1, 51, 38, 56, -1, 52, 38, 56,1245 -1, 53, 38, 56, -1, 54, 38, 56, -1, 36,1246 -1, 39, 56, -11150 41, 0, -1, 42, 0, -1, 43, -1, 43, 42, 1151 -1, 46, -1, 44, 42, 45, -1, 37, -1, 38, 1152 -1, 47, -1, 46, 47, -1, 48, -1, 49, -1, 1153 50, -1, 51, -1, 3, -1, 4, -1, 5, 55, 1154 -1, 5, 36, -1, 6, 55, -1, 6, 36, -1, 1155 7, 52, -1, 12, 52, -1, 17, 52, -1, 22, 1156 54, -1, 8, 52, -1, 13, 52, -1, 18, 52, 1157 -1, 9, 54, -1, 14, 54, -1, 19, 54, -1, 1158 10, 52, -1, 15, 52, -1, 20, 52, -1, 23, 1159 54, -1, 11, -1, 16, -1, 21, -1, 24, 57, 1160 -1, 25, 54, -1, 26, 55, -1, 27, 55, -1, 1161 28, 55, -1, 29, 56, -1, 30, 55, -1, 31, 1162 54, -1, 32, 53, -1, 33, 53, -1, 34, 59, 1163 -1, 60, -1, 52, 60, -1, 53, 60, -1, 54, 1164 60, -1, 55, 60, -1, 56, 60, -1, 57, 60, 1165 -1, 58, 60, -1, 35, -1, 39, 60, -1 1247 1166 }; 1248 1167 … … 1252 1171 MeshParser::yyprhs_[] = 1253 1172 { 1254 0, 0, 3, 6, 8, 1 2, 14, 16, 18, 20,1255 2 2, 24, 26, 29, 32, 35, 38, 41, 44, 47,1256 50, 53, 56, 59, 62, 65, 68, 71, 74, 77,1257 80, 82, 84, 86, 89, 92, 95, 98, 101, 104,1258 10 7, 110, 113, 116, 119, 121, 125, 129, 133, 137,1259 1 41, 145, 149, 1511173 0, 0, 3, 6, 8, 11, 13, 17, 19, 21, 1174 23, 26, 28, 30, 32, 34, 36, 38, 41, 44, 1175 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 1176 77, 80, 83, 86, 89, 92, 94, 96, 98, 101, 1177 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 1178 133, 136, 139, 142, 145, 148, 151, 154, 156 1260 1179 }; 1261 1180 … … 1264 1183 MeshParser::yyrline_[] = 1265 1184 { 1266 0, 74, 74, 78, 79, 83, 84, 8 5, 86, 90,1267 9 1, 92, 96, 97, 100, 101, 107, 108, 109, 110,1268 11 1, 112, 113, 114, 115, 116, 117, 118, 119, 120,1269 1 21, 122, 123, 127, 130, 131, 133, 135, 137, 139,1270 14 1, 142, 143, 144, 148, 149, 150, 151, 152, 153,1271 1 54, 155, 158, 1591185 0, 74, 74, 78, 79, 83, 84, 88, 92, 96, 1186 97, 101, 102, 103, 104, 108, 109, 113, 114, 117, 1187 118, 124, 125, 126, 127, 128, 129, 130, 131, 132, 1188 133, 134, 135, 136, 137, 138, 139, 140, 144, 147, 1189 148, 150, 152, 154, 156, 158, 159, 160, 161, 165, 1190 166, 167, 168, 169, 170, 171, 172, 175, 176 1272 1191 }; 1273 1192 … … 1313 1232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1314 1233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1315 2, 2, 2, 2, 38, 39, 2, 2, 2, 2,1316 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1317 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1318 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1319 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1320 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,1234 2, 2, 2, 2, 2, 39, 2, 2, 2, 2, 1235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1237 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1239 2, 37, 2, 38, 2, 2, 2, 2, 2, 2, 1321 1240 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1322 1241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, … … 1338 1257 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1339 1258 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 1340 35, 36 , 371259 35, 36 1341 1260 }; 1342 1261 if ((unsigned int) t <= yyuser_token_number_max_) … … 1347 1266 1348 1267 const int MeshParser::yyeof_ = 0; 1349 const int MeshParser::yylast_ = 85;1350 const int MeshParser::yynnts_ = 17;1268 const int MeshParser::yylast_ = 125; 1269 const int MeshParser::yynnts_ = 21; 1351 1270 const int MeshParser::yyempty_ = -2; 1352 const int MeshParser::yyfinal_ = 8 0;1271 const int MeshParser::yyfinal_ = 83; 1353 1272 const int MeshParser::yyterror_ = 1; 1354 1273 const int MeshParser::yyerrcode_ = 256; 1355 1274 const int MeshParser::yyntokens_ = 40; 1356 1275 1357 const unsigned int MeshParser::yyuser_token_number_max_ = 29 2;1276 const unsigned int MeshParser::yyuser_token_number_max_ = 291; 1358 1277 const MeshParser::token_number_type MeshParser::yyundef_token_ = 2; 1359 1278 … … 1361 1280 } // orbital 1362 1281 1363 /* Line 1 136of lalr1.cc */1364 #line 1 365"generated/mesh-parser.cpp"1365 1366 1367 /* Line 1 138of lalr1.cc */1368 #line 1 62"mesh-parser.y"1282 /* Line 1053 of lalr1.cc */ 1283 #line 1284 "generated/mesh-parser.cpp" 1284 1285 1286 /* Line 1055 of lalr1.cc */ 1287 #line 179 "mesh-parser.y" 1369 1288 1370 1289 -
trunk/orbital/generated/mesh-parser.h
r1432 r1434 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_FLUSH = 258, 103 T_INITRB = 259, 104 T_FREERB = 260, 105 T_COLOR = 261, 106 T_BGCOLOR = 262, 107 T_TRANSLATEX = 263, 108 T_ROTATEX = 264, 109 T_TAPERX = 265, 110 T_SCALEX = 266, 111 T_MIRRORX = 267, 112 T_TRANSLATEY = 268, 113 T_ROTATEY = 269, 114 T_TAPERY = 270, 115 T_SCALEY = 271, 116 T_MIRRORY = 272, 117 T_TRANSLATEZ = 273, 118 T_ROTATEZ = 274, 119 T_TAPERZ = 275, 120 T_SCALEZ = 276, 121 T_MIRRORZ = 277, 122 T_TRANSLATE = 278, 123 T_SCALE = 279, 124 T_CYLINDER = 280, 125 T_BOX = 281, 126 T_SMOOTHCHAMFBOX = 282, 127 T_FLATCHAMFBOX = 283, 128 T_SPHERE = 284, 129 T_STAR = 285, 130 T_EXPANDEDSTAR = 286, 131 T_DISC = 287, 132 T_TRIANGLE = 288, 133 T_QUAD = 289, 134 T_COG = 290, 135 NUMBER = 291, 136 COLOR = 292 135 T_INITRB = 258, 136 T_FREERB = 259, 137 T_COLOR = 260, 138 T_BGCOLOR = 261, 139 T_TRANSLATEX = 262, 140 T_ROTATEX = 263, 141 T_TAPERX = 264, 142 T_SCALEX = 265, 143 T_MIRRORX = 266, 144 T_TRANSLATEY = 267, 145 T_ROTATEY = 268, 146 T_TAPERY = 269, 147 T_SCALEY = 270, 148 T_MIRRORY = 271, 149 T_TRANSLATEZ = 272, 150 T_ROTATEZ = 273, 151 T_TAPERZ = 274, 152 T_SCALEZ = 275, 153 T_MIRRORZ = 276, 154 T_TRANSLATE = 277, 155 T_SCALE = 278, 156 T_CYLINDER = 279, 157 T_BOX = 280, 158 T_SMOOTHCHAMFBOX = 281, 159 T_FLATCHAMFBOX = 282, 160 T_SPHERE = 283, 161 T_STAR = 284, 162 T_EXPANDEDSTAR = 285, 163 T_DISC = 286, 164 T_TRIANGLE = 287, 165 T_QUAD = 288, 166 T_COG = 289, 167 NUMBER = 290, 168 COLOR = 291 137 169 }; 138 170 … … 208 240 location_stack_type yylocation_stack_; 209 241 210 /// Whether the given \c yypact_ value indicates a defaulted state.211 /// \param yyvalue the value to check212 static bool yy_pact_value_is_default_ (int yyvalue);213 214 /// Whether the given \c yytable_ value indicates a syntax error.215 /// \param yyvalue the value to check216 static bool yy_table_value_is_error_ (int yyvalue);217 218 242 /// Internal symbol numbers. 219 243 typedef unsigned char token_number_type; … … 223 247 static const signed char yypact_ninf_; 224 248 225 /// For a state, default r eduction number.249 /// For a state, default rule to reduce. 226 250 /// Unless\a yytable_ specifies something else to do. 227 251 /// Zero means the default is an error. … … 239 263 static const signed char yytable_ninf_; 240 264 241 static const unsigned char yycheck_[];265 static const signed char yycheck_[]; 242 266 243 267 /// For a state, its accessing symbol. … … 254 278 #endif 255 279 280 #if YYERROR_VERBOSE 256 281 /// Convert the symbol name \a n to a form suitable for a diagnostic. 257 static std::string yytnamerr_ (const char *n); 282 virtual std::string yytnamerr_ (const char *n); 283 #endif 258 284 259 285 #if YYDEBUG … … 313 339 } // orbital 314 340 315 /* Line 3 5of lalr1.cc */316 #line 3 17"generated/mesh-parser.h"341 /* Line 34 of lalr1.cc */ 342 #line 343 "generated/mesh-parser.h" 317 343 318 344 -
trunk/orbital/generated/mesh-scanner.cpp
r1430 r1434 331 331 (yy_c_buf_p) = yy_cp; 332 332 333 #define YY_NUM_RULES 4 0334 #define YY_END_OF_BUFFER 4 1333 #define YY_NUM_RULES 41 334 #define YY_END_OF_BUFFER 42 335 335 /* This struct is not used in this scanner, 336 336 but its presence is necessary. */ … … 342 342 static yyconst flex_int16_t yy_accept[69] = 343 343 { 0, 344 0, 0, 4 1, 40, 39, 40, 40, 38, 37, 39,345 3 6, 40, 40, 40, 40, 40, 19, 9, 0, 0,346 36, 36, 0, 24, 23, 30, 0, 0, 32, 28,347 31, 1, 0, 0, 20, 21, 22, 10, 11, 12,348 4, 16, 17, 18, 0, 6, 7, 8, 0, 0,349 3 6, 33, 29, 0, 0, 0, 3, 2, 5, 13,350 1 4, 15, 34, 26, 25, 27, 35, 0344 0, 0, 42, 39, 40, 39, 39, 36, 39, 35, 345 37, 38, 39, 39, 39, 39, 39, 18, 8, 0, 346 0, 35, 35, 0, 23, 22, 29, 0, 0, 31, 347 27, 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, 0 351 351 } ; 352 352 … … 357 357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 358 358 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 359 1, 1, 4, 5, 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,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, 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 1, 1, 1, 1, 1, 1, 10, 11, 12, 13,365 366 1 4, 15, 16, 17, 18, 1, 1, 19, 20, 1,364 9, 1, 10, 1, 1, 1, 11, 12, 13, 14, 365 366 15, 16, 17, 18, 19, 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, 1, 2, 1, 2,388 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,387 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 388 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 389 389 1, 1, 1, 1, 1, 1, 1, 1 390 390 } ; … … 392 392 static yyconst flex_int16_t yy_base[73] = 393 393 { 0, 394 0, 0, 9 4, 95, 95, 0, 22, 95, 24, 85,395 26, 30, 27, 69, 10, 21, 39, 43, 0, 83,396 49, 64, 56, 95, 74, 95, 65, 76, 95, 47,397 95, 95, 76, 75, 95, 95, 95, 95, 95, 95,398 7 4, 95, 95, 95, 48, 95, 95, 95, 0, 76,399 7 5, 95, 95, 71, 70, 63, 95, 95, 95, 95,400 9 5, 95, 0, 95, 95, 95, 95, 95, 77, 75,401 59, 37394 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 402 402 } ; 403 403 … … 405 405 { 0, 406 406 68, 1, 68, 68, 68, 69, 68, 68, 68, 68, 407 68, 68, 68, 68, 68, 68, 68, 68, 70, 68,407 68, 68, 68, 68, 68, 68, 68, 68, 68, 70, 408 408 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 409 409 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, … … 414 414 } ; 415 415 416 static yyconst flex_int16_t yy_nxt[12 4] =416 static yyconst flex_int16_t yy_nxt[123] = 417 417 { 0, 418 4, 5, 6, 7, 8, 9, 10, 11, 4, 12,419 4, 4, 4, 4, 13, 4, 4, 14, 4, 15,420 4, 4, 1 6, 17, 18, 4, 4, 4, 20, 21,421 2 0, 21, 20, 21, 23, 35, 36, 37, 67, 23,422 24, 25, 26, 27, 28, 32, 38, 39, 40, 33,423 41, 29, 45, 30, 31, 20, 21, 23, 55, 50,424 63, 50, 23, 51, 42, 43, 44, 56, 46, 47,425 48, 22, 23, 60, 61, 62, 49, 23, 19, 66,426 65, 64, 51, 51, 59, 58, 57, 54, 53, 52,427 22, 34, 22, 68, 3, 68, 68, 68, 68, 68,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 428 429 429 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 430 430 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 431 68, 68 , 68431 68, 68 432 432 } ; 433 433 434 static yyconst flex_int16_t yy_chk[12 4] =434 static yyconst flex_int16_t yy_chk[123] = 435 435 { 0, 436 436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 437 437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 438 438 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 439 9, 9, 11, 11, 11, 15, 15, 15, 72, 11,440 1 2, 12, 12, 12, 12, 13, 16, 16, 16, 13,441 17, 12, 18, 12, 12, 21, 21, 21, 30, 23,442 71, 23, 21, 23, 17, 17, 17, 30, 18, 18,443 18, 22, 22, 45, 45, 45, 70, 22, 69, 56,444 5 5, 54, 51, 50, 41, 34, 33, 28, 27, 25,445 20, 14, 10, 3, 68, 68, 68, 68, 68, 68,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 446 447 447 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 448 448 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 449 68, 68 , 68449 68, 68 450 450 } ; 451 451 … … 685 685 YY_RULE_SETUP 686 686 #line 45 "mesh-scanner.l" 687 { return token::T_ FLUSH; }687 { return token::T_INITRB; } 688 688 YY_BREAK 689 689 case 2: 690 690 YY_RULE_SETUP 691 691 #line 46 "mesh-scanner.l" 692 { return token::T_ INITRB; }692 { return token::T_FREERB; } 693 693 YY_BREAK 694 694 case 3: 695 695 YY_RULE_SETUP 696 #line 4 7"mesh-scanner.l"697 { return token::T_ FREERB; }696 #line 48 "mesh-scanner.l" 697 { return token::T_COLOR; } 698 698 YY_BREAK 699 699 case 4: 700 700 YY_RULE_SETUP 701 701 #line 49 "mesh-scanner.l" 702 { return token::T_ COLOR; }702 { return token::T_BGCOLOR; } 703 703 YY_BREAK 704 704 case 5: 705 705 YY_RULE_SETUP 706 #line 5 0"mesh-scanner.l"707 { return token::T_ BGCOLOR; }706 #line 51 "mesh-scanner.l" 707 { return token::T_TRANSLATEX; } 708 708 YY_BREAK 709 709 case 6: 710 710 YY_RULE_SETUP 711 711 #line 52 "mesh-scanner.l" 712 { return token::T_TRANSLATE X; }712 { return token::T_TRANSLATEY; } 713 713 YY_BREAK 714 714 case 7: 715 715 YY_RULE_SETUP 716 716 #line 53 "mesh-scanner.l" 717 { return token::T_TRANSLATE Y; }717 { return token::T_TRANSLATEZ; } 718 718 YY_BREAK 719 719 case 8: 720 720 YY_RULE_SETUP 721 721 #line 54 "mesh-scanner.l" 722 { return token::T_TRANSLATE Z; }722 { return token::T_TRANSLATE; } 723 723 YY_BREAK 724 724 case 9: 725 725 YY_RULE_SETUP 726 726 #line 55 "mesh-scanner.l" 727 { return token::T_ TRANSLATE; }727 { return token::T_ROTATEX; } 728 728 YY_BREAK 729 729 case 10: 730 730 YY_RULE_SETUP 731 731 #line 56 "mesh-scanner.l" 732 { return token::T_ROTATE X; }732 { return token::T_ROTATEY; } 733 733 YY_BREAK 734 734 case 11: 735 735 YY_RULE_SETUP 736 736 #line 57 "mesh-scanner.l" 737 { return token::T_ROTATE Y; }737 { return token::T_ROTATEZ; } 738 738 YY_BREAK 739 739 case 12: 740 740 YY_RULE_SETUP 741 741 #line 58 "mesh-scanner.l" 742 { return token::T_ ROTATEZ; }742 { return token::T_TAPERX; } 743 743 YY_BREAK 744 744 case 13: 745 745 YY_RULE_SETUP 746 746 #line 59 "mesh-scanner.l" 747 { return token::T_TAPER X; }747 { return token::T_TAPERY; } 748 748 YY_BREAK 749 749 case 14: 750 750 YY_RULE_SETUP 751 751 #line 60 "mesh-scanner.l" 752 { return token::T_TAPER Y; }752 { return token::T_TAPERZ; } 753 753 YY_BREAK 754 754 case 15: 755 755 YY_RULE_SETUP 756 756 #line 61 "mesh-scanner.l" 757 { return token::T_ TAPERZ; }757 { return token::T_SCALEX; } 758 758 YY_BREAK 759 759 case 16: 760 760 YY_RULE_SETUP 761 761 #line 62 "mesh-scanner.l" 762 { return token::T_SCALE X; }762 { return token::T_SCALEY; } 763 763 YY_BREAK 764 764 case 17: 765 765 YY_RULE_SETUP 766 766 #line 63 "mesh-scanner.l" 767 { return token::T_SCALE Y; }767 { return token::T_SCALEZ; } 768 768 YY_BREAK 769 769 case 18: 770 770 YY_RULE_SETUP 771 771 #line 64 "mesh-scanner.l" 772 { return token::T_SCALE Z; }772 { return token::T_SCALE; } 773 773 YY_BREAK 774 774 case 19: 775 775 YY_RULE_SETUP 776 776 #line 65 "mesh-scanner.l" 777 { return token::T_ SCALE; }777 { return token::T_MIRRORX; } 778 778 YY_BREAK 779 779 case 20: 780 780 YY_RULE_SETUP 781 781 #line 66 "mesh-scanner.l" 782 { return token::T_MIRROR X; }782 { return token::T_MIRRORY; } 783 783 YY_BREAK 784 784 case 21: 785 785 YY_RULE_SETUP 786 786 #line 67 "mesh-scanner.l" 787 { return token::T_MIRROR Y; }787 { return token::T_MIRRORZ; } 788 788 YY_BREAK 789 789 case 22: 790 790 YY_RULE_SETUP 791 #line 6 8"mesh-scanner.l"792 { return token::T_ MIRRORZ; }791 #line 69 "mesh-scanner.l" 792 { return token::T_CYLINDER; } 793 793 YY_BREAK 794 794 case 23: 795 795 YY_RULE_SETUP 796 796 #line 70 "mesh-scanner.l" 797 { return token::T_ CYLINDER; }797 { return token::T_BOX; } 798 798 YY_BREAK 799 799 case 24: 800 800 YY_RULE_SETUP 801 801 #line 71 "mesh-scanner.l" 802 { return token::T_ BOX; }802 { return token::T_SMOOTHCHAMFBOX; } 803 803 YY_BREAK 804 804 case 25: 805 805 YY_RULE_SETUP 806 806 #line 72 "mesh-scanner.l" 807 { return token::T_ SMOOTHCHAMFBOX; }807 { return token::T_FLATCHAMFBOX; } 808 808 YY_BREAK 809 809 case 26: 810 810 YY_RULE_SETUP 811 811 #line 73 "mesh-scanner.l" 812 { return token::T_ FLATCHAMFBOX; }812 { return token::T_SPHERE; } 813 813 YY_BREAK 814 814 case 27: 815 815 YY_RULE_SETUP 816 816 #line 74 "mesh-scanner.l" 817 { return token::T_S PHERE; }817 { return token::T_STAR; } 818 818 YY_BREAK 819 819 case 28: 820 820 YY_RULE_SETUP 821 821 #line 75 "mesh-scanner.l" 822 { return token::T_ STAR; }822 { return token::T_EXPANDEDSTAR; } 823 823 YY_BREAK 824 824 case 29: 825 825 YY_RULE_SETUP 826 826 #line 76 "mesh-scanner.l" 827 { return token::T_ EXPANDEDSTAR; }827 { return token::T_DISC; } 828 828 YY_BREAK 829 829 case 30: 830 830 YY_RULE_SETUP 831 831 #line 77 "mesh-scanner.l" 832 { return token::T_ DISC; }832 { return token::T_TRIANGLE; } 833 833 YY_BREAK 834 834 case 31: 835 835 YY_RULE_SETUP 836 836 #line 78 "mesh-scanner.l" 837 { return token::T_ TRIANGLE; }837 { return token::T_QUAD; } 838 838 YY_BREAK 839 839 case 32: 840 840 YY_RULE_SETUP 841 841 #line 79 "mesh-scanner.l" 842 { return token::T_ QUAD; }842 { return token::T_COG; } 843 843 YY_BREAK 844 844 case 33: 845 845 YY_RULE_SETUP 846 #line 80 "mesh-scanner.l" 847 { return token::T_COG; } 848 YY_BREAK 849 case 34: 850 YY_RULE_SETUP 851 #line 82 "mesh-scanner.l" 846 #line 81 "mesh-scanner.l" 852 847 { 853 848 yylval->u32val = 0xf + 0x10 * strtol(yytext + 1, NULL, 16); 854 849 return token::COLOR; } 855 850 YY_BREAK 856 case 3 5:857 YY_RULE_SETUP 858 #line 8 5"mesh-scanner.l"851 case 34: 852 YY_RULE_SETUP 853 #line 84 "mesh-scanner.l" 859 854 { 860 855 yylval->u32val = strtol(yytext + 1, NULL, 16); 861 856 return token::COLOR; } 862 857 YY_BREAK 858 case 35: 859 YY_RULE_SETUP 860 #line 87 "mesh-scanner.l" 861 { 862 yylval->fval = atof(yytext); return token::NUMBER; } 863 YY_BREAK 863 864 case 36: 864 865 YY_RULE_SETUP 865 #line 88 "mesh-scanner.l" 866 { 867 yylval->fval = atof(yytext); return token::NUMBER; } 866 #line 89 "mesh-scanner.l" 867 { return token_type('-'); } 868 868 YY_BREAK 869 869 case 37: 870 870 YY_RULE_SETUP 871 871 #line 90 "mesh-scanner.l" 872 { return token_type(' -'); }872 { return token_type('['); } 873 873 YY_BREAK 874 874 case 38: 875 875 YY_RULE_SETUP 876 876 #line 91 "mesh-scanner.l" 877 { return token_type(' ,'); }877 { return token_type(']'); } 878 878 YY_BREAK 879 879 case 39: 880 /* rule 39 can match eol */881 880 YY_RULE_SETUP 882 881 #line 92 "mesh-scanner.l" … … 884 883 YY_BREAK 885 884 case 40: 886 YY_RULE_SETUP 887 #line 94 "mesh-scanner.l" 885 /* rule 40 can match eol */ 886 YY_RULE_SETUP 887 #line 93 "mesh-scanner.l" 888 { /* ignore everything else */ } 889 YY_BREAK 890 case 41: 891 YY_RULE_SETUP 892 #line 95 "mesh-scanner.l" 888 893 ECHO; 889 894 YY_BREAK 890 #line 89 1"generated/mesh-scanner.cpp"895 #line 896 "generated/mesh-scanner.cpp" 891 896 case YY_STATE_EOF(INITIAL): 892 897 yyterminate(); … … 1789 1794 #define YYTABLES_NAME "yytables" 1790 1795 1791 #line 9 4"mesh-scanner.l"1796 #line 95 "mesh-scanner.l" 1792 1797 1793 1798 -
trunk/orbital/generated/position.hh
r1418 r1434 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
r1418 r1434 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-compiler.cpp
r1424 r1434 27 27 m_lexer = &scanner; 28 28 GunParser parser(*this); 29 return (parser.parse() == 0); 29 if (parser.parse() != 0) 30 return false; 31 return true; 30 32 } 31 33 -
trunk/orbital/mesh-compiler.cpp
r1423 r1434 27 27 m_lexer = &scanner; 28 28 MeshParser parser(*this); 29 return (parser.parse() == 0); 29 if (parser.parse() != 0) 30 return false; 31 return true; 30 32 } 31 33 -
trunk/orbital/mesh-parser.y
r1432 r1434 42 42 %start mesh_description 43 43 44 %token T_ FLUSH T_INITRB T_FREERB44 %token T_INITRB T_FREERB 45 45 46 46 %token T_COLOR T_BGCOLOR … … 72 72 73 73 mesh_description: 74 mesh_command_list T_END 74 mesh_expression_list T_END 75 ; 76 77 mesh_expression_list: 78 mesh_expression 79 | mesh_expression mesh_expression_list 80 ; 81 82 mesh_expression: 83 mesh_command_list 84 | mesh_open mesh_expression_list mesh_close 85 ; 86 87 mesh_open: 88 '[' { mc.m_mesh.OpenBrace(); } 89 ; 90 91 mesh_close: 92 ']' { mc.m_mesh.CloseBrace(); } 75 93 ; 76 94 77 95 mesh_command_list: 78 96 mesh_command 79 | mesh_command_list ','mesh_command97 | mesh_command_list mesh_command 80 98 ; 81 99 … … 88 106 89 107 rb_command: 90 T_FLUSH { mc.m_mesh.Flush(); } 91 | T_INITRB { mc.m_mesh.MeshConvert(); } 108 T_INITRB { mc.m_mesh.MeshConvert(); } 92 109 | T_FREERB { /* TODO */ } 93 110 ; … … 101 118 | T_BGCOLOR COLOR { uint16_t x = (uint16_t)$2; 102 119 vec4 v(x >> 12, (x >> 8) & 0xf, (x >> 4) & 0xf, x & 0xf); 103 mc.m_mesh.SetCurColor (vec4(v) * (1. / 15)); }120 mc.m_mesh.SetCurColor2(vec4(v) * (1. / 15)); } 104 121 ; 105 122 … … 147 164 148 165 args1: number { $$.f0 = $1; } ; 149 args2: args1 ',' number { $$ = $1; $$.f1 = $3; } ;150 args3: args2 ',' number { $$ = $1; $$.f2 = $3; } ;151 args4: args3 ',' number { $$ = $1; $$.f3 = $3; } ;152 args5: args4 ',' number { $$ = $1; $$.f4 = $3; } ;153 args6: args5 ',' number { $$ = $1; $$.f5 = $3; } ;154 args7: args6 ',' number { $$ = $1; $$.f6 = $3; } ;155 args8: args7 ',' number { $$ = $1; $$.f7 = $3; } ;166 args2: args1 number { $$ = $1; $$.f1 = $2; } ; 167 args3: args2 number { $$ = $1; $$.f2 = $2; } ; 168 args4: args3 number { $$ = $1; $$.f3 = $2; } ; 169 args5: args4 number { $$ = $1; $$.f4 = $2; } ; 170 args6: args5 number { $$ = $1; $$.f5 = $2; } ; 171 args7: args6 number { $$ = $1; $$.f6 = $2; } ; 172 args8: args7 number { $$ = $1; $$.f7 = $2; } ; 156 173 157 174 number: -
trunk/orbital/mesh-scanner.l
r1430 r1434 43 43 %} 44 44 45 fl { return token::T_FLUSH; }46 45 irb { return token::T_INITRB; } 47 46 frb { return token::T_FREERB; } … … 89 88 yylval->fval = atof(yytext); return token::NUMBER; } 90 89 - { return token_type('-'); } 91 , { return token_type(','); } 92 [.\n] { /* ignore everything else */ } 90 "[" { return token_type('['); } 91 "]" { return token_type(']'); } 92 . { /* ignore everything else */ } 93 [\n] { /* ignore everything else */ } 93 94 94 95 %% -
trunk/orbital/mesh.h
r1424 r1434 21 21 public: 22 22 Mesh() 23 : m_color(0), m_color2(0), 24 m_vert_cursor(0), m_quadidx_cursor(0), m_triidx_cursor(0) 25 {} 23 : m_color(0), m_color2(0) 24 { 25 m_cursors.Push(0, 0, 0); 26 } 26 27 27 28 void SendCommand(char const *command); 28 29 29 void Flush() 30 { 31 m_vert_cursor = m_vert.Count(); 32 m_quadidx_cursor = m_quadidx.Count(); 33 m_triidx_cursor = m_triidx.Count(); 30 void OpenBrace() 31 { 32 m_cursors.Push(m_vert.Count(), m_quadidx.Count(), m_triidx.Count()); 33 } 34 35 void CloseBrace() 36 { 37 m_cursors.Pop(); 34 38 } 35 39 … … 187 191 void SetVertColor(vec4 const &color) 188 192 { 189 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)193 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 190 194 m_vert[i].m3 = color; 191 195 } … … 203 207 void Translate(vec3 const &v) 204 208 { 205 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)209 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 206 210 m_vert[i].m1 += v; 207 211 } … … 214 218 { 215 219 mat3 m = mat3::rotate(t, axis); 216 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)220 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 217 221 { 218 222 m_vert[i].m1 = m * m_vert[i].m1; … … 224 228 { 225 229 /* FIXME: this code breaks normals! */ 226 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)230 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 227 231 { 228 232 m_vert[i].m1.y *= 1.f + (y * m_vert[i].m1.x + xoff); … … 233 237 void TaperY(float x, float z, float yoff) 234 238 { 235 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)239 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 236 240 { 237 241 m_vert[i].m1.x *= 1.f + (x * m_vert[i].m1.y + yoff); … … 242 246 void TaperZ(float x, float y, float zoff) 243 247 { 244 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)248 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 245 249 { 246 250 m_vert[i].m1.x *= 1.f + (x * m_vert[i].m1.z + zoff); … … 253 257 vec3 const invs = vec3(1) / s; 254 258 255 for (int i = m_ vert_cursor; i < m_vert.Count(); i++)259 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 256 260 { 257 261 m_vert[i].m1 *= s; … … 262 266 if (s.x * s.y * s.z < 0) 263 267 { 264 for (int i = m_ quadidx_cursor; i < m_quadidx.Count(); i += 2)268 for (int i = m_cursors.Last().m2; i < m_quadidx.Count(); i += 2) 265 269 { 266 270 uint16_t tmp = m_quadidx[i + 0]; … … 269 273 } 270 274 271 for (int i = m_ triidx_cursor; i < m_triidx.Count(); i += 3)275 for (int i = m_cursors.Last().m3; i < m_triidx.Count(); i += 3) 272 276 { 273 277 uint16_t tmp = m_triidx[i + 0]; … … 278 282 } 279 283 280 void MirrorX() { Dup licate();Scale(vec3(-1, 1, 1)); }281 void MirrorY() { Dup licate();Scale(vec3(1, -1, 1)); }282 void MirrorZ() { Dup licate();Scale(vec3(1, 1, -1)); }283 284 void Dup licate()285 { 286 int vlen = m_vert.Count() - m_ vert_cursor;287 int qlen = m_quadidx.Count() - m_ quadidx_cursor;288 int tlen = m_triidx.Count() - m_ triidx_cursor;284 void MirrorX() { DupAndScale(vec3(-1, 1, 1)); } 285 void MirrorY() { DupAndScale(vec3(1, -1, 1)); } 286 void MirrorZ() { DupAndScale(vec3(1, 1, -1)); } 287 288 void DupAndScale(vec3 const &s) 289 { 290 int vlen = m_vert.Count() - m_cursors.Last().m1; 291 int qlen = m_quadidx.Count() - m_cursors.Last().m2; 292 int tlen = m_triidx.Count() - m_cursors.Last().m3; 289 293 290 294 for (int i = 0; i < vlen; i++) 291 m_vert << m_vert[m_ vert_cursor++];295 m_vert << m_vert[m_cursors.Last().m1++]; 292 296 293 297 for (int i = 0; i < qlen; i++) 294 m_quadidx << m_quadidx[m_ quadidx_cursor++] + vlen;298 m_quadidx << m_quadidx[m_cursors.Last().m2++] + vlen; 295 299 296 300 for (int i = 0; i < tlen; i++) 297 m_triidx << m_triidx[m_triidx_cursor++] + vlen; 301 m_triidx << m_triidx[m_cursors.Last().m3++] + vlen; 302 303 Scale(s); 304 305 m_cursors.Last().m1 -= vlen; 306 m_cursors.Last().m2 -= qlen; 307 m_cursors.Last().m3 -= tlen; 298 308 } 299 309 … … 677 687 Array<uint16_t> m_triidx, m_quadidx; 678 688 Array<vec3, vec3, vec4> m_vert; 679 int m_vert_cursor, m_quadidx_cursor, m_triidx_cursor;689 Array<int, int, int> m_cursors; 680 690 681 691 /* FIXME: put this in a separate class so that we can copy meshes. */ -
trunk/orbital/orbital.cpp
r1423 r1434 63 63 64 64 /* Grey/red bonus */ 65 m.SendCommand("sc0.6,0.7,0.8,1,afcb7,4,7,0.6,sc1,0,0.3,1,afcb4,7,4,0.6"); 66 m.SendCommand("t-40,20,-30,fl"); 65 m.SendCommand("[sc#9ac afcb7 4 7 0.6 sc#f04 afcb4 7 4 0.6 t-40 20 -30]"); 67 66 68 67 #if 0 -
trunk/orbital/particlesystem.h
r1423 r1434 19 19 m_ready(false) 20 20 { 21 m_mesh.SendCommand("sc.8,.8,.8,1,acg8,2,5,5,1.5,1.5,.1,0,rx15"); 22 m_mesh.SendCommand("t0,-100,-30,fl"); 21 m_mesh.SendCommand("[sc#ccc acg8 2 5 5 1.5 1.5 .1 0 rx15 t0 -100 -30]"); 23 22 24 23 for (int i = 0; i < 200; i++) -
trunk/orbital/player.h
r1433 r1434 29 29 if (type == 0) 30 30 { 31 m_ship_mesh.SendCommand(color[type]);32 m_ship_mesh.SendCommand(" afcb3,6,7,.4,t0,0,7,sc1,1,1,1,afcb3,4,4,.4,t4,0,-4,mx,fl");33 m_ship_mesh.SendCommand(color[type]);34 m_ship_mesh.SendCommand(" afcb3,6,5,.4,sc1,1,1,1,afcb2,3,9,.4,fl");35 m_ship_mesh.SendCommand(" scb1,1,1,1,ac4,15,.2,.6,1,1,tz-2,ac4,15,.2,.6,1,1,rx90,t0,-2,-7,fl");36 37 m_exhaust_mesh.SendCommand(" sc0,1,1,1,scb0,0,0,1,ac5,15,0,1.5,0,1,ac7,35,1.1,4,0,1,rx90,t0,0,27,fl");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 38 } 39 39 //Blue Mesh 40 40 else 41 41 { 42 m_ship_mesh.SendCommand("sc1,1,1,1,scb1,1,1,1,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"); 43 m_ship_mesh.SendCommand(color[type]); 44 m_ship_mesh.SendCommand("afcb3,4,7,.4,t4,0,0,mx,fl,afcb3,6,5,.4,sc1,1,1,1,afcb2,3,9,.4"); 45 46 m_exhaust_mesh.SendCommand("sc0,1,1,1,scb0,0,0,1,ac5,10,0,1.5,0,1,ac7,25,1.1,4,0,1,rx90,t0,0,19"); 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]"); 47 48 } 48 49 49 50 m_option_mesh.SendCommand(color[type]); 50 m_option_mesh.SendCommand(" afcb5,1,3,0.6,fl,sc1,1,1,1,afcb1,5,3,0.6,tz-1,fl");51 52 m_laser_mesh.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,fl");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]"); 53 54 54 55 m_position = vec3(0.f + type * 80.f, 3.5f + 50.f, 0.f); -
trunk/orbital/snake.h
r1433 r1434 20 20 m_ready(false) 21 21 { 22 m_head.SendCommand("sc#d91 ,"23 " afcb30,3,3,.8,fl,"24 "sc#cca ,"25 " afcb10,10,10,1,fl,"26 " afcb.4,.4,12,.4,tz3,tx8,mx,fl,"27 " afcb.4,.4,12,.4,tz3,tx12,mx,fl,"28 "sc#69c9 ,"29 " afcb5,8,8,1,ty3,tz3,fl");22 m_head.SendCommand("sc#d91" 23 "[afcb30 3 3 .8]" 24 "sc#cca" 25 "[afcb10 10 10 1]" 26 "[afcb.4 .4 12 .4 tz3 tx8 mx]" 27 "[afcb.4 .4 12 .4 tz3 tx12 mx]" 28 "sc#69c9" 29 "[afcb5 8 8 1 ty3 tz3]"); 30 30 31 m_body.SendCommand("sc#d91 ,"32 " afcb3,20,3,.8,afcb20,3,3,.8,fl,"33 "sc#cca ,"34 " afcb6,6,12,1,fl,"35 " afcb.4,.4,7,.4,ty8,my,fl,"36 " afcb.4,.4,7,.4,tx8,mx,fl");31 m_body.SendCommand("sc#d91" 32 "[afcb3 20 3 .8 afcb20 3 3 .8]" 33 "sc#cca" 34 "[afcb6 6 12 1]" 35 "[afcb.4 .4 7 .4 ty8 my]" 36 "[afcb.4 .4 7 .4 tx8 mx]"); 37 37 38 m_tail.SendCommand("sc#cca ,"39 " afcb6,6,10,1,tz-1,fl,"40 " afcb.4,.4,8,.4,tz-1,ty8,fl,"41 " afcb.4,.4,8,.4,tz-1,ty12,fl,"42 " afcb.4,.4,8,.4,tz-1,tx8,fl,"43 " afcb.4,.4,8,.4,tz-1,tx12,fl,"44 "sc#d91 ,"45 " afcb3,15,3,.8,ty8,fl,"46 " afcb15,3,3,.8,tx8,fl");38 m_tail.SendCommand("sc#cca" 39 "[afcb6 6 10 1 tz-1]" 40 "[afcb.4 .4 8 .4 tz-1 ty8]" 41 "[afcb.4 .4 8 .4 tz-1 ty12]" 42 "[afcb.4 .4 8 .4 tz-1 tx8]" 43 "[afcb.4 .4 8 .4 tz-1 tx12]" 44 "sc#d91" 45 "[afcb3 15 3 .8 ty8]" 46 "[afcb15 3 3 .8 tx8]"); 47 47 48 48 m_position = vec3(RandF(0.f, 100.f), 20.f, RandF(150.f, 250.f)); -
trunk/orbital/starfield.h
r1423 r1434 19 19 { 20 20 if (z == 1.f) 21 m_mesh.SendCommand("sc 1,1,1,1,scb1,1,1,0,ad4,1.8,1");21 m_mesh.SendCommand("sc#fff scb#fff0 ad4 1.8 1"); 22 22 else 23 m_mesh.SendCommand("sc 1,1,1,1,scb1,1,1,0,ad3,0.8,1");23 m_mesh.SendCommand("sc#fff scb#fff0 ad3 0.8 1"); 24 24 25 25 for (int i = 0; i < count; i++) -
trunk/orbital/tank.h
r1433 r1434 19 19 m_ready(false) 20 20 { 21 m_body.SendCommand("sc#110," 22 "ab6,6,15,ty-2," 23 "sc#aca," 24 "afcb4,5,16,0.4,tx4,ty5,mx,fl," 25 "sc#3a0," 26 "afcb8,7,10,0.4,tz-4,ty5,fl"); 27 m_turret.SendCommand("sc#3a0," 28 "afcb3,6,10,0.4,tx-8,afcb3,6,10,0.4,tx4,ty13,fl," 29 "sc#aca," 30 "afcb3,6,10,0.4,rx-30,ty13,fl"); 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]"); 31 26 32 27 m_rotation = quat::rotate(RandF(0.f, 360.f), vec3(0, 1, 0));
Note: See TracChangeset
for help on using the changeset viewer.