Changeset 2779
- Timestamp:
- Jun 24, 2013, 12:53:25 AM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/easymesh/easymesh-parser.y
r2410 r2779 21 21 #include <string> 22 22 23 /* HACK: workaround for Bison who insists on using exceptions */ 24 #define try if (true) 25 #define catch(...) if (false) 26 #define throw (void)0 23 27 %} 24 28 -
trunk/src/generated/easymesh-parser.cpp
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 35 35 36 36 /* First part of user declarations. */ 37 38 /* Line 293 of lalr1.cc */ 37 /* Line 283 of lalr1.cc */ 39 38 #line 1 "easymesh/easymesh-parser.y" 40 39 … … 60 59 #include <string> 61 60 62 63 64 /* Line 293 of lalr1.cc */ 65 #line 66 "generated/easymesh-parser.cpp" 61 /* HACK: workaround for Bison who insists on using exceptions */ 62 #define try if (true) 63 #define catch(...) if (false) 64 #define throw (void)0 65 66 /* Line 283 of lalr1.cc */ 67 #line 68 "generated/easymesh-parser.cpp" 66 68 67 69 … … 69 71 70 72 /* User implementation prologue. */ 71 72 /* Line 299 of lalr1.cc */ 73 #line 66 "easymesh/easymesh-parser.y" 73 /* Line 289 of lalr1.cc */ 74 #line 70 "easymesh/easymesh-parser.y" 74 75 75 76 #include "easymesh/easymesh-compiler.h" … … 78 79 #define yylex mc.m_lexer->lex 79 80 80 81 /* Line 299 of lalr1.cc */ 81 /* Line 289 of lalr1.cc */ 82 82 #line 83 "generated/easymesh-parser.cpp" 83 84 85 # ifndef YY_NULL 86 # if defined __cplusplus && 201103L <= __cplusplus 87 # define YY_NULL nullptr 88 # else 89 # define YY_NULL 0 90 # endif 91 # endif 83 92 84 93 #ifndef YY_ … … 94 103 #endif 95 104 105 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 96 106 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 97 107 If N is 0, then set CURRENT to the empty location which ends 98 108 the previous symbol: RHS[0] (always defined). */ 99 109 100 # define YYRHSLOC(Rhs, K) ((Rhs)[K])101 # ifndef YYLLOC_DEFAULT102 # define YYLLOC_DEFAULT(Current, Rhs, N)\103 do\104 if (N)\105 {\106 (Current).begin = YYRHSLOC (Rhs, 1).begin;\107 (Current).end = YYRHSLOC (Rhs, N).end;\108 }\109 else\110 {\111 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;\112 } \113 while (false) 114 #endif 110 # ifndef YYLLOC_DEFAULT 111 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 112 do \ 113 if (N) \ 114 { \ 115 (Current).begin = YYRHSLOC (Rhs, 1).begin; \ 116 (Current).end = YYRHSLOC (Rhs, N).end; \ 117 } \ 118 else \ 119 { \ 120 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ 121 } \ 122 while (/*CONSTCOND*/ false) 123 # endif 124 115 125 116 126 /* Suppress unused-variable warnings by "using" E. */ … … 148 158 149 159 # define YYCDEBUG if (false) std::cerr 150 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 151 # define YY_REDUCE_PRINT(Rule) 152 # define YY_STACK_PRINT() 160 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) 161 # define YY_REDUCE_PRINT(Rule) static_cast<void>(0) 162 # define YY_STACK_PRINT() static_cast<void>(0) 153 163 154 164 #endif /* !YYDEBUG */ … … 164 174 165 175 namespace lol { 166 167 /* Line 382 of lalr1.cc */ 168 #line 169 "generated/easymesh-parser.cpp" 176 /* Line 357 of lalr1.cc */ 177 #line 178 "generated/easymesh-parser.cpp" 169 178 170 179 /* Return YYSTR after stripping away unnecessary quotes and … … 232 241 YYUSE (yylocationp); 233 242 YYUSE (yyvaluep); 234 switch (yytype) 235 { 236 default: 237 break; 238 } 243 std::ostream& yyo = debug_stream (); 244 std::ostream& yyoutput = yyo; 245 YYUSE (yyoutput); 246 YYUSE (yytype); 239 247 } 240 248 … … 260 268 YYUSE (yyvaluep); 261 269 262 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 263 264 switch (yytype) 265 { 266 267 default: 268 break; 269 } 270 if (yymsg) 271 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 272 273 YYUSE (yytype); 270 274 } 271 275 … … 324 328 int yytoken = 0; 325 329 326 / * State. */330 // State. 327 331 int yyn; 328 332 int yylen = 0; 329 333 int yystate = 0; 330 334 331 / * Error handling. */335 // Error handling. 332 336 int yynerrs_ = 0; 333 337 int yyerrstatus_ = 0; 334 338 335 339 /// Semantic value of the lookahead. 336 semantic_type yylval; 340 static semantic_type yyval_default; 341 semantic_type yylval = yyval_default; 337 342 /// Location of the lookahead. 338 343 location_type yylloc; … … 347 352 int yyresult; 348 353 354 // FIXME: This shoud be completely indented. It is not yet to 355 // avoid gratuitous conflicts when merging into the master branch. 356 try 357 { 349 358 YYCDEBUG << "Starting parse" << std::endl; 350 359 … … 354 363 location values to have been already stored, initialize these 355 364 stacks with a primary value. */ 356 yystate_stack_ = state_stack_type (0);357 yysemantic_stack_ = semantic_stack_type (0);358 yylocation_stack_ = location_stack_type (0);365 yystate_stack_.clear (); 366 yysemantic_stack_.clear (); 367 yylocation_stack_.clear (); 359 368 yysemantic_stack_.push (yylval); 360 369 yylocation_stack_.push (yylloc); … … 382 391 if (yychar == yyempty_) 383 392 { 384 385 393 YYCDEBUG << "Reading a token: "; 394 yychar = yylex (&yylval, &yylloc); 386 395 } 387 388 396 389 397 /* Convert token to internal form. */ … … 457 465 yyval = yysemantic_stack_[0]; 458 466 467 // Compute the default @$. 459 468 { 460 469 slice<location_type, location_stack_type> slice (yylocation_stack_, yylen); 461 470 YYLLOC_DEFAULT (yyloc, slice, yylen); 462 471 } 472 473 // Perform the reduction. 463 474 YY_REDUCE_PRINT (yyn); 464 475 switch (yyn) 465 476 { 466 case 7: 467 468 /* Line 690 of lalr1.cc */ 469 #line 90 "easymesh/easymesh-parser.y" 477 case 7: 478 /* Line 664 of lalr1.cc */ 479 #line 94 "easymesh/easymesh-parser.y" 470 480 { mc.m_mesh.OpenBrace(); } 471 481 break; 472 482 473 483 case 8: 474 475 /* Line 690 of lalr1.cc */ 476 #line 94 "easymesh/easymesh-parser.y" 484 /* Line 664 of lalr1.cc */ 485 #line 98 "easymesh/easymesh-parser.y" 477 486 { mc.m_mesh.CloseBrace(); } 478 487 break; 479 488 480 489 case 14: 481 482 /* Line 690 of lalr1.cc */ 483 #line 109 "easymesh/easymesh-parser.y" 490 /* Line 664 of lalr1.cc */ 491 #line 113 "easymesh/easymesh-parser.y" 484 492 { 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)); } 485 493 break; 486 494 487 495 case 15: 488 489 /* Line 690 of lalr1.cc */ 490 #line 110 "easymesh/easymesh-parser.y" 496 /* Line 664 of lalr1.cc */ 497 #line 114 "easymesh/easymesh-parser.y" 491 498 { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); 492 499 vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); … … 495 502 496 503 case 16: 497 498 /* Line 690 of lalr1.cc */ 499 #line 113 "easymesh/easymesh-parser.y" 504 /* Line 664 of lalr1.cc */ 505 #line 117 "easymesh/easymesh-parser.y" 500 506 { 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)); } 501 507 break; 502 508 503 509 case 17: 504 505 /* Line 690 of lalr1.cc */ 506 #line 114 "easymesh/easymesh-parser.y" 510 /* Line 664 of lalr1.cc */ 511 #line 118 "easymesh/easymesh-parser.y" 507 512 { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); 508 513 vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); … … 511 516 512 517 case 18: 513 514 /* Line 690 of lalr1.cc */ 515 #line 120 "easymesh/easymesh-parser.y" 518 /* Line 664 of lalr1.cc */ 519 #line 124 "easymesh/easymesh-parser.y" 516 520 { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); } 517 521 break; 518 522 519 523 case 19: 520 521 /* Line 690 of lalr1.cc */ 522 #line 121 "easymesh/easymesh-parser.y" 524 /* Line 664 of lalr1.cc */ 525 #line 125 "easymesh/easymesh-parser.y" 523 526 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } 524 527 break; 525 528 526 529 case 20: 527 528 /* Line 690 of lalr1.cc */ 529 #line 122 "easymesh/easymesh-parser.y" 530 /* Line 664 of lalr1.cc */ 531 #line 126 "easymesh/easymesh-parser.y" 530 532 { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } 531 533 break; 532 534 533 535 case 21: 534 535 /* Line 690 of lalr1.cc */ 536 #line 123 "easymesh/easymesh-parser.y" 536 /* Line 664 of lalr1.cc */ 537 #line 127 "easymesh/easymesh-parser.y" 537 538 { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } 538 539 break; 539 540 540 541 case 22: 541 542 /* Line 690 of lalr1.cc */ 543 #line 124 "easymesh/easymesh-parser.y" 542 /* Line 664 of lalr1.cc */ 543 #line 128 "easymesh/easymesh-parser.y" 544 544 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 545 545 break; 546 546 547 547 case 23: 548 549 /* Line 690 of lalr1.cc */ 550 #line 125 "easymesh/easymesh-parser.y" 548 /* Line 664 of lalr1.cc */ 549 #line 129 "easymesh/easymesh-parser.y" 551 550 { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); } 552 551 break; 553 552 554 553 case 24: 555 556 /* Line 690 of lalr1.cc */ 557 #line 126 "easymesh/easymesh-parser.y" 554 /* Line 664 of lalr1.cc */ 555 #line 130 "easymesh/easymesh-parser.y" 558 556 { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); } 559 557 break; 560 558 561 559 case 25: 562 563 /* Line 690 of lalr1.cc */ 564 #line 127 "easymesh/easymesh-parser.y" 560 /* Line 664 of lalr1.cc */ 561 #line 131 "easymesh/easymesh-parser.y" 565 562 { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); } 566 563 break; 567 564 568 565 case 26: 569 570 /* Line 690 of lalr1.cc */ 571 #line 128 "easymesh/easymesh-parser.y" 566 /* Line 664 of lalr1.cc */ 567 #line 132 "easymesh/easymesh-parser.y" 572 568 { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 573 569 break; 574 570 575 571 case 27: 576 577 /* Line 690 of lalr1.cc */ 578 #line 129 "easymesh/easymesh-parser.y" 572 /* Line 664 of lalr1.cc */ 573 #line 133 "easymesh/easymesh-parser.y" 579 574 { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 580 575 break; 581 576 582 577 case 28: 583 584 /* Line 690 of lalr1.cc */ 585 #line 130 "easymesh/easymesh-parser.y" 578 /* Line 664 of lalr1.cc */ 579 #line 134 "easymesh/easymesh-parser.y" 586 580 { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 587 581 break; 588 582 589 583 case 29: 590 591 /* Line 690 of lalr1.cc */ 592 #line 131 "easymesh/easymesh-parser.y" 584 /* Line 664 of lalr1.cc */ 585 #line 135 "easymesh/easymesh-parser.y" 593 586 { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 594 587 break; 595 588 596 589 case 30: 597 598 /* Line 690 of lalr1.cc */ 599 #line 132 "easymesh/easymesh-parser.y" 590 /* Line 664 of lalr1.cc */ 591 #line 136 "easymesh/easymesh-parser.y" 600 592 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 601 593 break; 602 594 603 595 case 31: 604 605 /* Line 690 of lalr1.cc */ 606 #line 133 "easymesh/easymesh-parser.y" 596 /* Line 664 of lalr1.cc */ 597 #line 137 "easymesh/easymesh-parser.y" 607 598 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 608 599 break; 609 600 610 601 case 32: 611 612 /* Line 690 of lalr1.cc */ 613 #line 134 "easymesh/easymesh-parser.y" 602 /* Line 664 of lalr1.cc */ 603 #line 138 "easymesh/easymesh-parser.y" 614 604 { mc.m_mesh.TwistX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 615 605 break; 616 606 617 607 case 33: 618 619 /* Line 690 of lalr1.cc */ 620 #line 135 "easymesh/easymesh-parser.y" 608 /* Line 664 of lalr1.cc */ 609 #line 139 "easymesh/easymesh-parser.y" 621 610 { mc.m_mesh.TwistY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 622 611 break; 623 612 624 613 case 34: 625 626 /* Line 690 of lalr1.cc */ 627 #line 136 "easymesh/easymesh-parser.y" 614 /* Line 664 of lalr1.cc */ 615 #line 140 "easymesh/easymesh-parser.y" 628 616 { mc.m_mesh.TwistZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 629 617 break; 630 618 631 619 case 35: 632 633 /* Line 690 of lalr1.cc */ 634 #line 137 "easymesh/easymesh-parser.y" 620 /* Line 664 of lalr1.cc */ 621 #line 141 "easymesh/easymesh-parser.y" 635 622 { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 636 623 break; 637 624 638 625 case 36: 639 640 /* Line 690 of lalr1.cc */ 641 #line 138 "easymesh/easymesh-parser.y" 626 /* Line 664 of lalr1.cc */ 627 #line 142 "easymesh/easymesh-parser.y" 642 628 { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 643 629 break; 644 630 645 631 case 37: 646 647 /* Line 690 of lalr1.cc */ 648 #line 139 "easymesh/easymesh-parser.y" 632 /* Line 664 of lalr1.cc */ 633 #line 143 "easymesh/easymesh-parser.y" 649 634 { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 650 635 break; 651 636 652 637 case 38: 653 654 /* Line 690 of lalr1.cc */ 655 #line 140 "easymesh/easymesh-parser.y" 638 /* Line 664 of lalr1.cc */ 639 #line 144 "easymesh/easymesh-parser.y" 656 640 { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 657 641 break; 658 642 659 643 case 39: 660 661 /* Line 690 of lalr1.cc */ 662 #line 141 "easymesh/easymesh-parser.y" 644 /* Line 664 of lalr1.cc */ 645 #line 145 "easymesh/easymesh-parser.y" 663 646 { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 664 647 break; 665 648 666 649 case 40: 667 668 /* Line 690 of lalr1.cc */ 669 #line 142 "easymesh/easymesh-parser.y" 650 /* Line 664 of lalr1.cc */ 651 #line 146 "easymesh/easymesh-parser.y" 670 652 { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 671 653 break; 672 654 673 655 case 41: 674 675 /* Line 690 of lalr1.cc */ 676 #line 143 "easymesh/easymesh-parser.y" 656 /* Line 664 of lalr1.cc */ 657 #line 147 "easymesh/easymesh-parser.y" 677 658 { mc.m_mesh.StretchX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 678 659 break; 679 660 680 661 case 42: 681 682 /* Line 690 of lalr1.cc */ 683 #line 144 "easymesh/easymesh-parser.y" 662 /* Line 664 of lalr1.cc */ 663 #line 148 "easymesh/easymesh-parser.y" 684 664 { mc.m_mesh.StretchY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 685 665 break; 686 666 687 667 case 43: 688 689 /* Line 690 of lalr1.cc */ 690 #line 145 "easymesh/easymesh-parser.y" 668 /* Line 664 of lalr1.cc */ 669 #line 149 "easymesh/easymesh-parser.y" 691 670 { mc.m_mesh.StretchZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 692 671 break; 693 672 694 673 case 44: 695 696 /* Line 690 of lalr1.cc */ 697 #line 146 "easymesh/easymesh-parser.y" 674 /* Line 664 of lalr1.cc */ 675 #line 150 "easymesh/easymesh-parser.y" 698 676 { mc.m_mesh.BendXY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 699 677 break; 700 678 701 679 case 45: 702 703 /* Line 690 of lalr1.cc */ 704 #line 147 "easymesh/easymesh-parser.y" 680 /* Line 664 of lalr1.cc */ 681 #line 151 "easymesh/easymesh-parser.y" 705 682 { mc.m_mesh.BendXZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 706 683 break; 707 684 708 685 case 46: 709 710 /* Line 690 of lalr1.cc */ 711 #line 148 "easymesh/easymesh-parser.y" 686 /* Line 664 of lalr1.cc */ 687 #line 152 "easymesh/easymesh-parser.y" 712 688 { mc.m_mesh.BendYX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 713 689 break; 714 690 715 691 case 47: 716 717 /* Line 690 of lalr1.cc */ 718 #line 149 "easymesh/easymesh-parser.y" 692 /* Line 664 of lalr1.cc */ 693 #line 153 "easymesh/easymesh-parser.y" 719 694 { mc.m_mesh.BendYZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 720 695 break; 721 696 722 697 case 48: 723 724 /* Line 690 of lalr1.cc */ 725 #line 150 "easymesh/easymesh-parser.y" 698 /* Line 664 of lalr1.cc */ 699 #line 154 "easymesh/easymesh-parser.y" 726 700 { mc.m_mesh.BendZX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 727 701 break; 728 702 729 703 case 49: 730 731 /* Line 690 of lalr1.cc */ 732 #line 151 "easymesh/easymesh-parser.y" 704 /* Line 664 of lalr1.cc */ 705 #line 155 "easymesh/easymesh-parser.y" 733 706 { mc.m_mesh.BendZY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 734 707 break; 735 708 736 709 case 50: 737 738 /* Line 690 of lalr1.cc */ 739 #line 152 "easymesh/easymesh-parser.y" 710 /* Line 664 of lalr1.cc */ 711 #line 156 "easymesh/easymesh-parser.y" 740 712 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); } 741 713 break; 742 714 743 715 case 51: 744 745 /* Line 690 of lalr1.cc */ 746 #line 153 "easymesh/easymesh-parser.y" 716 /* Line 664 of lalr1.cc */ 717 #line 157 "easymesh/easymesh-parser.y" 747 718 { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); } 748 719 break; 749 720 750 721 case 52: 751 752 /* Line 690 of lalr1.cc */ 753 #line 154 "easymesh/easymesh-parser.y" 722 /* Line 664 of lalr1.cc */ 723 #line 158 "easymesh/easymesh-parser.y" 754 724 { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); } 755 725 break; 756 726 757 727 case 53: 758 759 /* Line 690 of lalr1.cc */ 760 #line 155 "easymesh/easymesh-parser.y" 728 /* Line 664 of lalr1.cc */ 729 #line 159 "easymesh/easymesh-parser.y" 761 730 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 762 731 break; 763 732 764 733 case 54: 765 766 /* Line 690 of lalr1.cc */ 767 #line 156 "easymesh/easymesh-parser.y" 734 /* Line 664 of lalr1.cc */ 735 #line 160 "easymesh/easymesh-parser.y" 768 736 { mc.m_mesh.MirrorX(); } 769 737 break; 770 738 771 739 case 55: 772 773 /* Line 690 of lalr1.cc */ 774 #line 157 "easymesh/easymesh-parser.y" 740 /* Line 664 of lalr1.cc */ 741 #line 161 "easymesh/easymesh-parser.y" 775 742 { mc.m_mesh.MirrorY(); } 776 743 break; 777 744 778 745 case 56: 779 780 /* Line 690 of lalr1.cc */ 781 #line 158 "easymesh/easymesh-parser.y" 746 /* Line 664 of lalr1.cc */ 747 #line 162 "easymesh/easymesh-parser.y" 782 748 { mc.m_mesh.MirrorZ(); } 783 749 break; 784 750 785 751 case 57: 786 787 /* Line 690 of lalr1.cc */ 788 #line 159 "easymesh/easymesh-parser.y" 752 /* Line 664 of lalr1.cc */ 753 #line 163 "easymesh/easymesh-parser.y" 789 754 { mc.m_mesh.RadialJitter((yysemantic_stack_[(2) - (2)].args).f0); } 790 755 break; 791 756 792 757 case 58: 793 794 /* Line 690 of lalr1.cc */ 795 #line 160 "easymesh/easymesh-parser.y" 758 /* Line 664 of lalr1.cc */ 759 #line 164 "easymesh/easymesh-parser.y" 796 760 { mc.m_mesh.SplitTriangles((yysemantic_stack_[(2) - (2)].args).f0); } 797 761 break; 798 762 799 763 case 59: 800 801 /* Line 690 of lalr1.cc */ 802 #line 161 "easymesh/easymesh-parser.y" 764 /* Line 664 of lalr1.cc */ 765 #line 165 "easymesh/easymesh-parser.y" 803 766 { mc.m_mesh.SmoothMesh((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 804 767 break; 805 768 806 769 case 60: 807 808 /* Line 690 of lalr1.cc */ 809 #line 162 "easymesh/easymesh-parser.y" 770 /* Line 664 of lalr1.cc */ 771 #line 166 "easymesh/easymesh-parser.y" 810 772 { mc.m_mesh.ToggleScaleWinding(); } 811 773 break; 812 774 813 775 case 61: 814 815 /* Line 690 of lalr1.cc */ 816 #line 163 "easymesh/easymesh-parser.y" 776 /* Line 664 of lalr1.cc */ 777 #line 167 "easymesh/easymesh-parser.y" 817 778 { mc.m_mesh.CsgUnion(); } 818 779 break; 819 780 820 781 case 62: 821 822 /* Line 690 of lalr1.cc */ 823 #line 164 "easymesh/easymesh-parser.y" 782 /* Line 664 of lalr1.cc */ 783 #line 168 "easymesh/easymesh-parser.y" 824 784 { mc.m_mesh.CsgSubstract(); } 825 785 break; 826 786 827 787 case 63: 828 829 /* Line 690 of lalr1.cc */ 830 #line 165 "easymesh/easymesh-parser.y" 788 /* Line 664 of lalr1.cc */ 789 #line 169 "easymesh/easymesh-parser.y" 831 790 { mc.m_mesh.CsgSubstractLoss(); } 832 791 break; 833 792 834 793 case 64: 835 836 /* Line 690 of lalr1.cc */ 837 #line 166 "easymesh/easymesh-parser.y" 794 /* Line 664 of lalr1.cc */ 795 #line 170 "easymesh/easymesh-parser.y" 838 796 { mc.m_mesh.CsgAnd(); } 839 797 break; 840 798 841 799 case 65: 842 843 /* Line 690 of lalr1.cc */ 844 #line 167 "easymesh/easymesh-parser.y" 800 /* Line 664 of lalr1.cc */ 801 #line 171 "easymesh/easymesh-parser.y" 845 802 { mc.m_mesh.CsgXor(); } 846 803 break; 847 804 848 805 case 66: 849 850 /* Line 690 of lalr1.cc */ 851 #line 171 "easymesh/easymesh-parser.y" 806 /* Line 664 of lalr1.cc */ 807 #line 175 "easymesh/easymesh-parser.y" 852 808 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 853 809 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 856 812 857 813 case 67: 858 859 /* Line 690 of lalr1.cc */ 860 #line 174 "easymesh/easymesh-parser.y" 814 /* Line 664 of lalr1.cc */ 815 #line 178 "easymesh/easymesh-parser.y" 861 816 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 862 817 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 865 820 866 821 case 68: 867 868 /* Line 690 of lalr1.cc */ 869 #line 177 "easymesh/easymesh-parser.y" 822 /* Line 664 of lalr1.cc */ 823 #line 181 "easymesh/easymesh-parser.y" 870 824 { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 871 825 break; 872 826 873 827 case 69: 874 875 /* Line 690 of lalr1.cc */ 876 #line 178 "easymesh/easymesh-parser.y" 828 /* Line 664 of lalr1.cc */ 829 #line 182 "easymesh/easymesh-parser.y" 877 830 { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 878 831 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } … … 880 833 881 834 case 70: 882 883 /* Line 690 of lalr1.cc */ 884 #line 180 "easymesh/easymesh-parser.y" 835 /* Line 664 of lalr1.cc */ 836 #line 184 "easymesh/easymesh-parser.y" 885 837 { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 886 838 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } … … 888 840 889 841 case 71: 890 891 /* Line 690 of lalr1.cc */ 892 #line 182 "easymesh/easymesh-parser.y" 842 /* Line 664 of lalr1.cc */ 843 #line 186 "easymesh/easymesh-parser.y" 893 844 { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 894 845 break; 895 846 896 847 case 72: 897 898 /* Line 690 of lalr1.cc */ 899 #line 183 "easymesh/easymesh-parser.y" 848 /* Line 664 of lalr1.cc */ 849 #line 187 "easymesh/easymesh-parser.y" 900 850 { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 901 851 break; 902 852 903 853 case 73: 904 905 /* Line 690 of lalr1.cc */ 906 #line 184 "easymesh/easymesh-parser.y" 854 /* Line 664 of lalr1.cc */ 855 #line 188 "easymesh/easymesh-parser.y" 907 856 { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 908 857 break; 909 858 910 859 case 74: 911 912 /* Line 690 of lalr1.cc */ 913 #line 185 "easymesh/easymesh-parser.y" 860 /* Line 664 of lalr1.cc */ 861 #line 189 "easymesh/easymesh-parser.y" 914 862 { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, 915 863 (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } … … 917 865 918 866 case 75: 919 920 /* Line 690 of lalr1.cc */ 921 #line 187 "easymesh/easymesh-parser.y" 867 /* Line 664 of lalr1.cc */ 868 #line 191 "easymesh/easymesh-parser.y" 922 869 { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 923 870 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } … … 925 872 926 873 case 76: 927 928 /* Line 690 of lalr1.cc */ 929 #line 189 "easymesh/easymesh-parser.y" 874 /* Line 664 of lalr1.cc */ 875 #line 193 "easymesh/easymesh-parser.y" 930 876 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } 931 877 break; 932 878 933 879 case 77: 934 935 /* Line 690 of lalr1.cc */ 936 #line 190 "easymesh/easymesh-parser.y" 880 /* Line 664 of lalr1.cc */ 881 #line 194 "easymesh/easymesh-parser.y" 937 882 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 938 883 break; 939 884 940 885 case 78: 941 942 /* Line 690 of lalr1.cc */ 943 #line 191 "easymesh/easymesh-parser.y" 886 /* Line 664 of lalr1.cc */ 887 #line 195 "easymesh/easymesh-parser.y" 944 888 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 945 889 break; 946 890 947 891 case 79: 948 949 /* Line 690 of lalr1.cc */ 950 #line 192 "easymesh/easymesh-parser.y" 892 /* Line 664 of lalr1.cc */ 893 #line 196 "easymesh/easymesh-parser.y" 951 894 { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 952 895 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6, … … 955 898 956 899 case 80: 957 958 /* Line 690 of lalr1.cc */ 959 #line 197 "easymesh/easymesh-parser.y" 900 /* Line 664 of lalr1.cc */ 901 #line 201 "easymesh/easymesh-parser.y" 960 902 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } 961 903 break; 962 904 963 905 case 81: 964 965 /* Line 690 of lalr1.cc */ 966 #line 198 "easymesh/easymesh-parser.y" 906 /* Line 664 of lalr1.cc */ 907 #line 202 "easymesh/easymesh-parser.y" 967 908 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } 968 909 break; 969 910 970 911 case 82: 971 972 /* Line 690 of lalr1.cc */ 973 #line 199 "easymesh/easymesh-parser.y" 912 /* Line 664 of lalr1.cc */ 913 #line 203 "easymesh/easymesh-parser.y" 974 914 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } 975 915 break; 976 916 977 917 case 83: 978 979 /* Line 690 of lalr1.cc */ 980 #line 200 "easymesh/easymesh-parser.y" 918 /* Line 664 of lalr1.cc */ 919 #line 204 "easymesh/easymesh-parser.y" 981 920 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } 982 921 break; 983 922 984 923 case 84: 985 986 /* Line 690 of lalr1.cc */ 987 #line 201 "easymesh/easymesh-parser.y" 924 /* Line 664 of lalr1.cc */ 925 #line 205 "easymesh/easymesh-parser.y" 988 926 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } 989 927 break; 990 928 991 929 case 85: 992 993 /* Line 690 of lalr1.cc */ 994 #line 202 "easymesh/easymesh-parser.y" 930 /* Line 664 of lalr1.cc */ 931 #line 206 "easymesh/easymesh-parser.y" 995 932 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } 996 933 break; 997 934 998 935 case 86: 999 1000 /* Line 690 of lalr1.cc */ 1001 #line 203 "easymesh/easymesh-parser.y" 936 /* Line 664 of lalr1.cc */ 937 #line 207 "easymesh/easymesh-parser.y" 1002 938 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } 1003 939 break; 1004 940 1005 941 case 87: 1006 1007 /* Line 690 of lalr1.cc */ 1008 #line 204 "easymesh/easymesh-parser.y" 942 /* Line 664 of lalr1.cc */ 943 #line 208 "easymesh/easymesh-parser.y" 1009 944 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } 1010 945 break; 1011 946 1012 947 case 88: 1013 1014 /* Line 690 of lalr1.cc */ 1015 #line 205 "easymesh/easymesh-parser.y" 948 /* Line 664 of lalr1.cc */ 949 #line 209 "easymesh/easymesh-parser.y" 1016 950 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); } 1017 951 break; 1018 952 1019 953 case 89: 1020 1021 /* Line 690 of lalr1.cc */ 1022 #line 206 "easymesh/easymesh-parser.y" 954 /* Line 664 of lalr1.cc */ 955 #line 210 "easymesh/easymesh-parser.y" 1023 956 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); } 1024 957 break; 1025 958 1026 959 case 90: 1027 1028 /* Line 690 of lalr1.cc */ 1029 #line 209 "easymesh/easymesh-parser.y" 960 /* Line 664 of lalr1.cc */ 961 #line 213 "easymesh/easymesh-parser.y" 1030 962 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } 1031 963 break; 1032 964 1033 965 case 91: 1034 1035 /* Line 690 of lalr1.cc */ 1036 #line 210 "easymesh/easymesh-parser.y" 966 /* Line 664 of lalr1.cc */ 967 #line 214 "easymesh/easymesh-parser.y" 1037 968 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } 1038 969 break; 1039 970 1040 971 1041 1042 /* Line 690 of lalr1.cc */ 1043 #line 1044 "generated/easymesh-parser.cpp" 1044 default: 1045 break; 972 /* Line 664 of lalr1.cc */ 973 #line 974 "generated/easymesh-parser.cpp" 974 default: 975 break; 1046 976 } 977 1047 978 /* User semantic actions sometimes alter yychar, and that requires 1048 979 that yytoken be updated with the new translation. We take the … … 1095 1026 if (yyerrstatus_ == 3) 1096 1027 { 1097 /* If just tried and failed to reuse lookahead token after an 1098 error, discard it. */ 1099 1100 if (yychar <= yyeof_) 1101 { 1102 /* Return failure if at end of input. */ 1103 if (yychar == yyeof_) 1104 YYABORT; 1105 } 1106 else 1107 { 1108 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); 1109 yychar = yyempty_; 1110 } 1028 /* If just tried and failed to reuse lookahead token after an 1029 error, discard it. */ 1030 if (yychar <= yyeof_) 1031 { 1032 /* Return failure if at end of input. */ 1033 if (yychar == yyeof_) 1034 YYABORT; 1035 } 1036 else 1037 { 1038 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); 1039 yychar = yyempty_; 1040 } 1111 1041 } 1112 1042 … … 1157 1087 /* Pop the current state because it cannot handle the error token. */ 1158 1088 if (yystate_stack_.height () == 1) 1159 YYABORT;1089 YYABORT; 1160 1090 1161 1091 yyerror_range[1] = yylocation_stack_[0]; … … 1205 1135 this YYABORT or YYACCEPT. */ 1206 1136 yypop_ (yylen); 1207 while ( yystate_stack_.height () != 1)1137 while (1 < yystate_stack_.height ()) 1208 1138 { 1209 1210 1211 1212 1213 1139 yydestruct_ ("Cleanup: popping", 1140 yystos_[yystate_stack_[0]], 1141 &yysemantic_stack_[0], 1142 &yylocation_stack_[0]); 1143 yypop_ (); 1214 1144 } 1215 1145 1216 1146 return yyresult; 1147 } 1148 catch (...) 1149 { 1150 YYCDEBUG << "Exception caught: cleaning lookahead and stack" 1151 << std::endl; 1152 // Do not try to display the values of the reclaimed symbols, 1153 // as their printer might throw an exception. 1154 if (yychar != yyempty_) 1155 { 1156 /* Make sure we have latest lookahead translation. See 1157 comments at user semantic actions for why this is 1158 necessary. */ 1159 yytoken = yytranslate_ (yychar); 1160 yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); 1161 } 1162 1163 while (1 < yystate_stack_.height ()) 1164 { 1165 yydestruct_ (YY_NULL, 1166 yystos_[yystate_stack_[0]], 1167 &yysemantic_stack_[0], 1168 &yylocation_stack_[0]); 1169 yypop_ (); 1170 } 1171 throw; 1172 } 1217 1173 } 1218 1174 … … 1283 1239 } 1284 1240 1285 char const* yyformat = 0;1241 char const* yyformat = YY_NULL; 1286 1242 switch (yycount) 1287 1243 { … … 1521 1477 }; 1522 1478 1523 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 1479 1524 1480 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 1525 1481 First, the terminals, then, starting at \a yyntokens_, nonterminals. */ … … 1544 1500 "color_command", "transform_command", "primitive_command", "args1", 1545 1501 "args2", "args3", "args4", "args5", "args6", "args7", "args8", "args9", 1546 "args10", "number", 01502 "args10", "number", YY_NULL 1547 1503 }; 1548 #endif1549 1504 1550 1505 #if YYDEBUG … … 1602 1557 EasyMeshParser::yyrline_[] = 1603 1558 { 1604 0, 76, 76, 80, 81, 85, 86, 90, 94, 98,1605 99, 103, 104, 105, 109, 110, 113, 114, 120, 121,1606 12 2, 123, 124, 125, 126, 127, 128, 129, 130, 131,1607 13 2, 133, 134, 135, 136, 137, 138, 139, 140, 141,1608 14 2, 143, 144, 145, 146, 147, 148, 149, 150, 151,1609 15 2, 153, 154, 155, 156, 157, 158, 159, 160, 161,1610 16 2, 163, 164, 165, 166, 167, 171, 174, 177, 178,1611 18 0, 182, 183, 184, 185, 187, 189, 190, 191, 192,1612 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,1613 2 09, 2101559 0, 80, 80, 84, 85, 89, 90, 94, 98, 102, 1560 103, 107, 108, 109, 113, 114, 117, 118, 124, 125, 1561 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 1562 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 1563 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 1564 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 1565 166, 167, 168, 169, 170, 171, 175, 178, 181, 182, 1566 184, 186, 187, 188, 189, 191, 193, 194, 195, 196, 1567 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 1568 213, 214 1614 1569 }; 1615 1570 … … 1704 1659 1705 1660 } // lol 1706 1661 /* Line 1135 of lalr1.cc */ 1662 #line 1663 "generated/easymesh-parser.cpp" 1707 1663 /* Line 1136 of lalr1.cc */ 1708 #line 1709 "generated/easymesh-parser.cpp" 1709 1710 1711 /* Line 1138 of lalr1.cc */ 1712 #line 213 "easymesh/easymesh-parser.y" 1664 #line 217 "easymesh/easymesh-parser.y" 1713 1665 1714 1666 … … 1719 1671 } 1720 1672 1721 -
trunk/src/generated/easymesh-parser.h
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 31 31 version 2.2 of Bison. */ 32 32 33 /** 34 ** \file generated/easymesh-parser.h 35 ** Define the lol::parser class. 36 */ 37 33 38 /* C++ LALR(1) parser skeleton written by Akim Demaille. */ 34 39 35 #ifndef PARSER_HEADER_H36 # define PARSER_HEADER_H40 #ifndef YY_LOL_GENERATED_EASYMESH_PARSER_H_INCLUDED 41 # define YY_LOL_GENERATED_EASYMESH_PARSER_H_INCLUDED 37 42 38 43 … … 48 53 #endif 49 54 50 /* Enabling verbose error messages. */51 #ifdef YYERROR_VERBOSE52 # undef YYERROR_VERBOSE53 # define YYERROR_VERBOSE 154 #else55 # define YYERROR_VERBOSE 156 #endif57 58 /* Enabling the token table. */59 #ifndef YYTOKEN_TABLE60 # define YYTOKEN_TABLE 061 #endif62 63 55 64 56 namespace lol { 65 66 /* Line 35 of lalr1.cc */ 67 #line 68 "generated/easymesh-parser.h" 57 /* Line 33 of lalr1.cc */ 58 #line 59 "generated/easymesh-parser.h" 68 59 69 60 /// A Bison parser. … … 75 66 union semantic_type 76 67 { 77 78 /* Line 35 of lalr1.cc */ 79 #line 36 "easymesh/easymesh-parser.y" 68 /* Line 33 of lalr1.cc */ 69 #line 40 "easymesh/easymesh-parser.y" 80 70 81 71 float fval; … … 85 75 86 76 87 88 /* Line 35 of lalr1.cc */ 89 #line 90 "generated/easymesh-parser.h" 77 /* Line 33 of lalr1.cc */ 78 #line 79 "generated/easymesh-parser.h" 90 79 }; 91 80 #else … … 189 178 190 179 private: 180 /// This class is not copyable. 181 EasyMeshParser (const EasyMeshParser&); 182 EasyMeshParser& operator= (const EasyMeshParser&); 183 191 184 /// Report a syntax error. 192 185 /// \param loc where the syntax error is found. … … 272 265 static const unsigned char yyr1_[]; 273 266 /// For a rule, its RHS length. 274 static const unsigned char yyr2_[]; 275 276 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 267 static const unsigned char yyr2_[]; 268 269 /// Convert the symbol name \a n to a form suitable for a diagnostic. 270 static std::string yytnamerr_ (const char *n); 271 272 277 273 /// For a symbol, its name in clear. 278 274 static const char* const yytname_[]; 279 #endif280 281 /// Convert the symbol name \a n to a form suitable for a diagnostic.282 static std::string yytnamerr_ (const char *n);283 284 275 #if YYDEBUG 285 276 /// A type to store symbol numbers and -1. … … 308 299 /// \brief Reclaim the memory associated to a symbol. 309 300 /// \param yymsg Why this token is reclaimed. 301 /// If null, do not display the symbol, just free it. 310 302 /// \param yytype The symbol type. 311 303 /// \param yyvaluep Its semantic value. … … 337 329 338 330 } // lol 339 340 /* Line 35 of lalr1.cc */ 341 #line 342 "generated/easymesh-parser.h" 342 343 344 345 #endif /* ! defined PARSER_HEADER_H */ 331 /* Line 33 of lalr1.cc */ 332 #line 333 "generated/easymesh-parser.h" 333 334 335 336 #endif /* !YY_LOL_GENERATED_EASYMESH_PARSER_H_INCLUDED */ -
trunk/src/generated/easymesh-scanner.cpp
r2410 r2779 1004 1004 #line 112 "easymesh/easymesh-scanner.l" 1005 1005 { 1006 uint32_t tmp = std::strtol(yytext + 1, NULL, 16);1006 uint32_t tmp = std::strtol(yytext + 1, nullptr, 16); 1007 1007 yylval->u32val = 0x11000000u * (tmp >> 8) 1008 1008 | 0x00110000u * ((tmp >> 4) & 0xf) … … 1015 1015 #line 119 "easymesh/easymesh-scanner.l" 1016 1016 { 1017 uint32_t tmp = std::strtol(yytext + 1, NULL, 16);1017 uint32_t tmp = std::strtol(yytext + 1, nullptr, 16); 1018 1018 yylval->u32val = 0x11000000u * (tmp >> 12) 1019 1019 | 0x00110000u * ((tmp >> 8) & 0xf) … … 1027 1027 { 1028 1028 yylval->u32val = 0xffu 1029 | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);1029 | 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16); 1030 1030 return token::COLOR; } 1031 1031 YY_BREAK … … 1034 1034 #line 130 "easymesh/easymesh-scanner.l" 1035 1035 { 1036 yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);1036 yylval->u32val = (uint32_t)std::strtol(yytext + 1, nullptr, 16); 1037 1037 return token::COLOR; } 1038 1038 YY_BREAK -
trunk/src/generated/location.hh
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 32 32 33 33 /** 34 ** \file location.hh34 ** \file generated/location.hh 35 35 ** Define the lol::location class. 36 36 */ 37 37 38 #ifndef BISON_LOCATION_HH39 # define BISON_LOCATION_HH38 #ifndef YY_LOL_GENERATED_LOCATION_HH_INCLUDED 39 # define YY_LOL_GENERATED_LOCATION_HH_INCLUDED 40 40 41 # include <iostream>42 # include <string>43 41 # include "position.hh" 44 42 45 43 46 44 namespace lol { 47 48 /* Line 162 of location.cc */ 49 #line 50 "generated/location.hh" 45 /* Line 166 of location.cc */ 46 #line 47 "generated/location.hh" 50 47 51 48 /// Abstract a location. … … 54 51 public: 55 52 56 /// Construct a location. 57 location () 58 : begin (), end () 53 /// Construct a location from \a b to \a e. 54 location (const position& b, const position& e) 55 : begin (b) 56 , end (e) 57 { 58 } 59 60 /// Construct a 0-width location in \a p. 61 explicit location (const position& p = position ()) 62 : begin (p) 63 , end (p) 64 { 65 } 66 67 /// Construct a 0-width location in \a f, \a l, \a c. 68 explicit location (std::string* f, 69 unsigned int l = 1u, 70 unsigned int c = 1u) 71 : begin (f, l, c) 72 , end (f, l, c) 59 73 { 60 74 } … … 62 76 63 77 /// Initialization. 64 inline void initialize (std::string* fn) 78 void initialize (std::string* f = YY_NULL, 79 unsigned int l = 1u, 80 unsigned int c = 1u) 65 81 { 66 begin.initialize (f n);82 begin.initialize (f, l, c); 67 83 end = begin; 68 84 } … … 72 88 public: 73 89 /// Reset initial location to final location. 74 inlinevoid step ()90 void step () 75 91 { 76 92 begin = end; … … 78 94 79 95 /// Extend the current location to the COUNT next columns. 80 inlinevoid columns (unsigned int count = 1)96 void columns (unsigned int count = 1) 81 97 { 82 98 end += count; … … 84 100 85 101 /// Extend the current location to the COUNT next lines. 86 inlinevoid lines (unsigned int count = 1)102 void lines (unsigned int count = 1) 87 103 { 88 104 end.lines (count); … … 141 157 ** Avoid duplicate information. 142 158 */ 143 inline std::ostream& operator<< (std::ostream& ostr, const location& loc) 159 template <typename YYChar> 160 inline std::basic_ostream<YYChar>& 161 operator<< (std::basic_ostream<YYChar>& ostr, const location& loc) 144 162 { 145 163 position last = loc.end - 1; … … 158 176 159 177 } // lol 178 /* Line 296 of location.cc */ 179 #line 180 "generated/location.hh" 160 180 161 /* Line 271 of location.cc */ 162 #line 163 "generated/location.hh" 163 164 #endif // not BISON_LOCATION_HH 181 #endif /* !YY_LOL_GENERATED_LOCATION_HH_INCLUDED */ -
trunk/src/generated/lolfx-parser.cpp
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 35 35 36 36 /* First part of user declarations. */ 37 38 /* Line 293 of lalr1.cc */ 37 /* Line 283 of lalr1.cc */ 39 38 #line 1 "gpu/lolfx-parser.y" 40 39 … … 57 56 #include <string> 58 57 59 60 61 /* Line 293 of lalr1.cc */ 62 #line 63 "generated/lolfx-parser.cpp" 58 /* HACK: workaround for Bison who insists on using exceptions */ 59 #define try if (true) 60 #define catch(...) if (false) 61 #define throw (void)0 62 63 /* Line 283 of lalr1.cc */ 64 #line 65 "generated/lolfx-parser.cpp" 63 65 64 66 … … 66 68 67 69 /* User implementation prologue. */ 68 69 /* Line 299 of lalr1.cc */ 70 #line 241 "gpu/lolfx-parser.y" 70 /* Line 289 of lalr1.cc */ 71 #line 245 "gpu/lolfx-parser.y" 71 72 72 73 #include "gpu/lolfx-compiler.h" … … 75 76 #define yylex mc.m_lexer->lex 76 77 77 78 /* Line 299 of lalr1.cc */ 78 /* Line 289 of lalr1.cc */ 79 79 #line 80 "generated/lolfx-parser.cpp" 80 81 82 # ifndef YY_NULL 83 # if defined __cplusplus && 201103L <= __cplusplus 84 # define YY_NULL nullptr 85 # else 86 # define YY_NULL 0 87 # endif 88 # endif 80 89 81 90 #ifndef YY_ … … 91 100 #endif 92 101 102 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 93 103 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 94 104 If N is 0, then set CURRENT to the empty location which ends 95 105 the previous symbol: RHS[0] (always defined). */ 96 106 97 # define YYRHSLOC(Rhs, K) ((Rhs)[K])98 # ifndef YYLLOC_DEFAULT99 # define YYLLOC_DEFAULT(Current, Rhs, N)\100 do\101 if (N)\102 {\103 (Current).begin = YYRHSLOC (Rhs, 1).begin;\104 (Current).end = YYRHSLOC (Rhs, N).end;\105 }\106 else\107 {\108 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;\109 } \110 while (false) 111 #endif 107 # ifndef YYLLOC_DEFAULT 108 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 109 do \ 110 if (N) \ 111 { \ 112 (Current).begin = YYRHSLOC (Rhs, 1).begin; \ 113 (Current).end = YYRHSLOC (Rhs, N).end; \ 114 } \ 115 else \ 116 { \ 117 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ 118 } \ 119 while (/*CONSTCOND*/ false) 120 # endif 121 112 122 113 123 /* Suppress unused-variable warnings by "using" E. */ … … 145 155 146 156 # define YYCDEBUG if (false) std::cerr 147 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 148 # define YY_REDUCE_PRINT(Rule) 149 # define YY_STACK_PRINT() 157 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) 158 # define YY_REDUCE_PRINT(Rule) static_cast<void>(0) 159 # define YY_STACK_PRINT() static_cast<void>(0) 150 160 151 161 #endif /* !YYDEBUG */ … … 161 171 162 172 namespace lol { 163 164 /* Line 382 of lalr1.cc */ 165 #line 166 "generated/lolfx-parser.cpp" 173 /* Line 357 of lalr1.cc */ 174 #line 175 "generated/lolfx-parser.cpp" 166 175 167 176 /* Return YYSTR after stripping away unnecessary quotes and … … 229 238 YYUSE (yylocationp); 230 239 YYUSE (yyvaluep); 231 switch (yytype) 232 { 233 default: 234 break; 235 } 240 std::ostream& yyo = debug_stream (); 241 std::ostream& yyoutput = yyo; 242 YYUSE (yyoutput); 243 YYUSE (yytype); 236 244 } 237 245 … … 257 265 YYUSE (yyvaluep); 258 266 259 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 260 261 switch (yytype) 262 { 263 264 default: 265 break; 266 } 267 if (yymsg) 268 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 269 270 YYUSE (yytype); 267 271 } 268 272 … … 321 325 int yytoken = 0; 322 326 323 / * State. */327 // State. 324 328 int yyn; 325 329 int yylen = 0; 326 330 int yystate = 0; 327 331 328 / * Error handling. */332 // Error handling. 329 333 int yynerrs_ = 0; 330 334 int yyerrstatus_ = 0; 331 335 332 336 /// Semantic value of the lookahead. 333 semantic_type yylval; 337 static semantic_type yyval_default; 338 semantic_type yylval = yyval_default; 334 339 /// Location of the lookahead. 335 340 location_type yylloc; … … 344 349 int yyresult; 345 350 351 // FIXME: This shoud be completely indented. It is not yet to 352 // avoid gratuitous conflicts when merging into the master branch. 353 try 354 { 346 355 YYCDEBUG << "Starting parse" << std::endl; 347 356 … … 351 360 location values to have been already stored, initialize these 352 361 stacks with a primary value. */ 353 yystate_stack_ = state_stack_type (0);354 yysemantic_stack_ = semantic_stack_type (0);355 yylocation_stack_ = location_stack_type (0);362 yystate_stack_.clear (); 363 yysemantic_stack_.clear (); 364 yylocation_stack_.clear (); 356 365 yysemantic_stack_.push (yylval); 357 366 yylocation_stack_.push (yylloc); … … 379 388 if (yychar == yyempty_) 380 389 { 381 382 390 YYCDEBUG << "Reading a token: "; 391 yychar = yylex (&yylval, &yylloc); 383 392 } 384 385 393 386 394 /* Convert token to internal form. */ … … 454 462 yyval = yysemantic_stack_[0]; 455 463 464 // Compute the default @$. 456 465 { 457 466 slice<location_type, location_stack_type> slice (yylocation_stack_, yylen); 458 467 YYLLOC_DEFAULT (yyloc, slice, yylen); 459 468 } 469 470 // Perform the reduction. 460 471 YY_REDUCE_PRINT (yyn); 461 472 switch (yyn) 462 473 { 463 case 202: 464 465 /* Line 690 of lalr1.cc */ 466 #line 728 "gpu/lolfx-parser.y" 474 case 202: 475 /* Line 664 of lalr1.cc */ 476 #line 732 "gpu/lolfx-parser.y" 467 477 { std::cout << "New tech " << std::endl; } 468 478 break; 469 479 470 480 case 203: 471 472 /* Line 690 of lalr1.cc */ 473 #line 736 "gpu/lolfx-parser.y" 481 /* Line 664 of lalr1.cc */ 482 #line 740 "gpu/lolfx-parser.y" 474 483 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } 475 484 break; 476 485 477 486 case 204: 478 479 /* Line 690 of lalr1.cc */ 480 #line 737 "gpu/lolfx-parser.y" 487 /* Line 664 of lalr1.cc */ 488 #line 741 "gpu/lolfx-parser.y" 481 489 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } 482 490 break; 483 491 484 492 case 207: 485 486 /* Line 690 of lalr1.cc */ 487 #line 750 "gpu/lolfx-parser.y" 493 /* Line 664 of lalr1.cc */ 494 #line 754 "gpu/lolfx-parser.y" 488 495 { std::cout << "New pass " << std::endl; } 489 496 break; 490 497 491 498 case 226: 492 493 /* Line 690 of lalr1.cc */ 494 #line 786 "gpu/lolfx-parser.y" 499 /* Line 664 of lalr1.cc */ 500 #line 790 "gpu/lolfx-parser.y" 495 501 { std::cout << "new shader" << std::endl; } 496 502 break; 497 503 498 504 499 500 /* Line 690 of lalr1.cc */ 501 #line 502 "generated/lolfx-parser.cpp" 502 default: 503 break; 505 /* Line 664 of lalr1.cc */ 506 #line 507 "generated/lolfx-parser.cpp" 507 default: 508 break; 504 509 } 510 505 511 /* User semantic actions sometimes alter yychar, and that requires 506 512 that yytoken be updated with the new translation. We take the … … 553 559 if (yyerrstatus_ == 3) 554 560 { 555 /* If just tried and failed to reuse lookahead token after an 556 error, discard it. */ 557 558 if (yychar <= yyeof_) 559 { 560 /* Return failure if at end of input. */ 561 if (yychar == yyeof_) 562 YYABORT; 563 } 564 else 565 { 566 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); 567 yychar = yyempty_; 568 } 561 /* If just tried and failed to reuse lookahead token after an 562 error, discard it. */ 563 if (yychar <= yyeof_) 564 { 565 /* Return failure if at end of input. */ 566 if (yychar == yyeof_) 567 YYABORT; 568 } 569 else 570 { 571 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); 572 yychar = yyempty_; 573 } 569 574 } 570 575 … … 615 620 /* Pop the current state because it cannot handle the error token. */ 616 621 if (yystate_stack_.height () == 1) 617 YYABORT;622 YYABORT; 618 623 619 624 yyerror_range[1] = yylocation_stack_[0]; … … 663 668 this YYABORT or YYACCEPT. */ 664 669 yypop_ (yylen); 665 while ( yystate_stack_.height () != 1)670 while (1 < yystate_stack_.height ()) 666 671 { 667 668 669 670 671 672 yydestruct_ ("Cleanup: popping", 673 yystos_[yystate_stack_[0]], 674 &yysemantic_stack_[0], 675 &yylocation_stack_[0]); 676 yypop_ (); 672 677 } 673 678 674 679 return yyresult; 680 } 681 catch (...) 682 { 683 YYCDEBUG << "Exception caught: cleaning lookahead and stack" 684 << std::endl; 685 // Do not try to display the values of the reclaimed symbols, 686 // as their printer might throw an exception. 687 if (yychar != yyempty_) 688 { 689 /* Make sure we have latest lookahead translation. See 690 comments at user semantic actions for why this is 691 necessary. */ 692 yytoken = yytranslate_ (yychar); 693 yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); 694 } 695 696 while (1 < yystate_stack_.height ()) 697 { 698 yydestruct_ (YY_NULL, 699 yystos_[yystate_stack_[0]], 700 &yysemantic_stack_[0], 701 &yylocation_stack_[0]); 702 yypop_ (); 703 } 704 throw; 705 } 675 706 } 676 707 … … 741 772 } 742 773 743 char const* yyformat = 0;774 char const* yyformat = YY_NULL; 744 775 switch (yycount) 745 776 { … … 3360 3391 }; 3361 3392 3362 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 3393 3363 3394 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 3364 3395 First, the terminals, then, starting at \a yyntokens_, nonterminals. */ … … 3513 3544 "glsl_conditionopt", "glsl_for_rest_statement", "glsl_jump_statement", 3514 3545 "glsl_translation_unit", "glsl_external_declaration", 3515 "glsl_function_definition", 03546 "glsl_function_definition", YY_NULL 3516 3547 }; 3517 #endif3518 3548 3519 3549 #if YYDEBUG … … 3712 3742 LolFxParser::yyrline_[] = 3713 3743 { 3714 0, 25 5, 271, 272, 273, 274, 275, 276, 277, 278,3715 2 79, 280, 281, 282, 283, 284, 285, 286, 287, 288,3716 2 89, 290, 291, 292, 293, 294, 295, 296, 297, 298,3717 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,3718 3 09, 310, 311, 312, 313, 314, 315, 316, 317, 318,3719 3 19, 320, 321, 322, 323, 324, 325, 326, 327, 328,3720 3 29, 330, 331, 332, 333, 334, 335, 336, 337, 338,3721 3 39, 340, 341, 342, 343, 344, 345, 508, 509, 510,3722 51 1, 512, 513, 514, 515, 516, 517, 518, 519, 520,3723 52 1, 522, 523, 524, 525, 526, 527, 528, 529, 530,3724 53 1, 532, 533, 534, 535, 536, 537, 538, 539, 540,3725 54 1, 542, 543, 544, 545, 546, 547, 548, 549, 550,3726 55 1, 552, 553, 554, 555, 556, 557, 558, 559, 560,3727 56 1, 562, 563, 564, 565, 566, 567, 568, 569, 570,3728 57 1, 572, 573, 574, 575, 576, 577, 578, 579, 580,3729 58 1, 582, 583, 584, 585, 586, 587, 588, 589, 590,3730 59 1, 592, 593, 594, 595, 596, 597, 598, 599, 600,3731 60 1, 602, 603, 604, 605, 606, 607, 608, 609, 610,3732 61 1, 612, 613, 614, 615, 616, 617, 618, 619, 620,3733 62 1, 622, 623, 624, 625, 626, 627, 710, 714, 715,3734 7 19, 720, 728, 736, 737, 745, 746, 750, 754, 755,3735 76 0, 761, 762, 763, 764, 765, 766, 767, 768, 769,3736 77 0, 771, 772, 773, 774, 782, 786, 790, 791, 795,3737 80 3, 807, 808, 809, 810, 811, 812, 816, 817, 818,3738 8 19, 820, 821, 825, 829, 833, 834, 838, 839, 843,3739 84 4, 848, 849, 853, 857, 858, 859, 863, 864, 865,3740 8 66, 870, 871, 872, 873, 877, 878, 879, 880, 884,3741 88 5, 886, 890, 891, 892, 896, 897, 898, 899, 900,3742 90 4, 905, 906, 910, 911, 915, 916, 920, 921, 925,3743 9 26, 930, 931, 935, 936, 940, 941, 945, 946, 950,3744 95 1, 952, 953, 954, 955, 956, 957, 958, 959, 960,3745 96 4, 965, 969, 973, 974, 975, 976, 977, 978, 979,3746 98 0, 984, 988, 989, 993, 994, 998, 1002, 1003, 1007,3747 10 08, 1012, 1013, 1014, 1015, 1019, 1020, 1023, 1025, 1026,3748 10 27, 1028, 1029, 1033, 1037, 1038, 1039, 1040, 1041, 1042,3749 104 3, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1058,3750 10 59, 1063, 1067, 1068, 1069, 1073, 1077, 1078, 1082, 1083,3751 10 87, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1102,3752 110 3, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112,3753 111 3, 1117, 1118, 1122, 1123, 1124, 1127, 1128, 1132, 1133,3754 113 4, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143,3755 114 4, 1148, 1149, 1150, 1154, 1155, 1159, 1160, 1164, 1165,3756 11 69, 1170, 1174, 1175, 1176, 1180, 1184, 1188, 1189, 1193,3757 119 4, 1195, 1196, 1197, 1198, 1199, 1203, 1204, 1208, 1209,3758 121 3, 1214, 1218, 1219, 1223, 1224, 1228, 1232, 1233, 1237,3759 12 38, 1242, 1245, 1247, 1251, 1252, 1256, 1257, 1258, 1262,3760 126 3, 1267, 1268, 1272, 1273, 1277, 1278, 1279, 1280, 1281,3761 128 5, 1286, 1290, 1291, 12953744 0, 259, 275, 276, 277, 278, 279, 280, 281, 282, 3745 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 3746 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 3747 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 3748 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 3749 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 3750 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 3751 343, 344, 345, 346, 347, 348, 349, 512, 513, 514, 3752 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 3753 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 3754 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 3755 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 3756 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 3757 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 3758 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 3759 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 3760 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 3761 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 3762 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 3763 625, 626, 627, 628, 629, 630, 631, 714, 718, 719, 3764 723, 724, 732, 740, 741, 749, 750, 754, 758, 759, 3765 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 3766 774, 775, 776, 777, 778, 786, 790, 794, 795, 799, 3767 807, 811, 812, 813, 814, 815, 816, 820, 821, 822, 3768 823, 824, 825, 829, 833, 837, 838, 842, 843, 847, 3769 848, 852, 853, 857, 861, 862, 863, 867, 868, 869, 3770 870, 874, 875, 876, 877, 881, 882, 883, 884, 888, 3771 889, 890, 894, 895, 896, 900, 901, 902, 903, 904, 3772 908, 909, 910, 914, 915, 919, 920, 924, 925, 929, 3773 930, 934, 935, 939, 940, 944, 945, 949, 950, 954, 3774 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 3775 968, 969, 973, 977, 978, 979, 980, 981, 982, 983, 3776 984, 988, 992, 993, 997, 998, 1002, 1006, 1007, 1011, 3777 1012, 1016, 1017, 1018, 1019, 1023, 1024, 1027, 1029, 1030, 3778 1031, 1032, 1033, 1037, 1041, 1042, 1043, 1044, 1045, 1046, 3779 1047, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1062, 3780 1063, 1067, 1071, 1072, 1073, 1077, 1081, 1082, 1086, 1087, 3781 1091, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1106, 3782 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 3783 1117, 1121, 1122, 1126, 1127, 1128, 1131, 1132, 1136, 1137, 3784 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 3785 1148, 1152, 1153, 1154, 1158, 1159, 1163, 1164, 1168, 1169, 3786 1173, 1174, 1178, 1179, 1180, 1184, 1188, 1192, 1193, 1197, 3787 1198, 1199, 1200, 1201, 1202, 1203, 1207, 1208, 1212, 1213, 3788 1217, 1218, 1222, 1223, 1227, 1228, 1232, 1236, 1237, 1241, 3789 1242, 1246, 1249, 1251, 1255, 1256, 1260, 1261, 1262, 1266, 3790 1267, 1271, 1272, 1276, 1277, 1281, 1282, 1283, 1284, 1285, 3791 1289, 1290, 1294, 1295, 1299 3762 3792 }; 3763 3793 … … 3890 3920 3891 3921 } // lol 3892 3922 /* Line 1135 of lalr1.cc */ 3923 #line 3924 "generated/lolfx-parser.cpp" 3893 3924 /* Line 1136 of lalr1.cc */ 3894 #line 3895 "generated/lolfx-parser.cpp" 3895 3896 3897 /* Line 1138 of lalr1.cc */ 3898 #line 1298 "gpu/lolfx-parser.y" 3925 #line 1302 "gpu/lolfx-parser.y" 3899 3926 3900 3927 … … 3905 3932 } 3906 3933 3907 -
trunk/src/generated/lolfx-parser.h
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 31 31 version 2.2 of Bison. */ 32 32 33 /** 34 ** \file generated/lolfx-parser.h 35 ** Define the lol::parser class. 36 */ 37 33 38 /* C++ LALR(1) parser skeleton written by Akim Demaille. */ 34 39 35 #ifndef PARSER_HEADER_H36 # define PARSER_HEADER_H40 #ifndef YY_LOL_GENERATED_LOLFX_PARSER_H_INCLUDED 41 # define YY_LOL_GENERATED_LOLFX_PARSER_H_INCLUDED 37 42 38 43 … … 48 53 #endif 49 54 50 /* Enabling verbose error messages. */51 #ifdef YYERROR_VERBOSE52 # undef YYERROR_VERBOSE53 # define YYERROR_VERBOSE 154 #else55 # define YYERROR_VERBOSE 156 #endif57 58 /* Enabling the token table. */59 #ifndef YYTOKEN_TABLE60 # define YYTOKEN_TABLE 061 #endif62 63 55 64 56 namespace lol { 65 66 /* Line 35 of lalr1.cc */ 67 #line 68 "generated/lolfx-parser.h" 57 /* Line 33 of lalr1.cc */ 58 #line 59 "generated/lolfx-parser.h" 68 59 69 60 /// A Bison parser. … … 75 66 union semantic_type 76 67 { 77 78 /* Line 35 of lalr1.cc */ 79 #line 34 "gpu/lolfx-parser.y" 68 /* Line 33 of lalr1.cc */ 69 #line 38 "gpu/lolfx-parser.y" 80 70 81 71 int ival; … … 85 75 86 76 87 88 /* Line 35 of lalr1.cc */ 89 #line 90 "generated/lolfx-parser.h" 77 /* Line 33 of lalr1.cc */ 78 #line 79 "generated/lolfx-parser.h" 90 79 }; 91 80 #else … … 564 553 565 554 private: 555 /// This class is not copyable. 556 LolFxParser (const LolFxParser&); 557 LolFxParser& operator= (const LolFxParser&); 558 566 559 /// Report a syntax error. 567 560 /// \param loc where the syntax error is found. … … 647 640 static const unsigned short int yyr1_[]; 648 641 /// For a rule, its RHS length. 649 static const unsigned char yyr2_[]; 650 651 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 642 static const unsigned char yyr2_[]; 643 644 /// Convert the symbol name \a n to a form suitable for a diagnostic. 645 static std::string yytnamerr_ (const char *n); 646 647 652 648 /// For a symbol, its name in clear. 653 649 static const char* const yytname_[]; 654 #endif655 656 /// Convert the symbol name \a n to a form suitable for a diagnostic.657 static std::string yytnamerr_ (const char *n);658 659 650 #if YYDEBUG 660 651 /// A type to store symbol numbers and -1. … … 683 674 /// \brief Reclaim the memory associated to a symbol. 684 675 /// \param yymsg Why this token is reclaimed. 676 /// If null, do not display the symbol, just free it. 685 677 /// \param yytype The symbol type. 686 678 /// \param yyvaluep Its semantic value. … … 712 704 713 705 } // lol 714 715 /* Line 35 of lalr1.cc */ 716 #line 717 "generated/lolfx-parser.h" 717 718 719 720 #endif /* ! defined PARSER_HEADER_H */ 706 /* Line 33 of lalr1.cc */ 707 #line 708 "generated/lolfx-parser.h" 708 709 710 711 #endif /* !YY_LOL_GENERATED_LOLFX_PARSER_H_INCLUDED */ -
trunk/src/generated/position.hh
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 32 32 33 33 /** 34 ** \file position.hh34 ** \file generated/position.hh 35 35 ** Define the lol::position class. 36 36 */ 37 37 38 #ifndef BISON_POSITION_HH39 # define BISON_POSITION_HH38 #ifndef YY_LOL_GENERATED_POSITION_HH_INCLUDED 39 # define YY_LOL_GENERATED_POSITION_HH_INCLUDED 40 40 41 # include <algorithm> // std::max 41 42 # include <iostream> 42 43 # include <string> 43 # include <algorithm> 44 45 # ifndef YY_NULL 46 # if defined __cplusplus && 201103L <= __cplusplus 47 # define YY_NULL nullptr 48 # else 49 # define YY_NULL 0 50 # endif 51 # endif 44 52 45 53 46 54 namespace lol { 47 48 /* Line 37 of location.cc */ 49 #line 50 "generated/position.hh" 55 /* Line 36 of location.cc */ 56 #line 57 "generated/position.hh" 50 57 /// Abstract a position. 51 58 class position … … 54 61 55 62 /// Construct a position. 56 position () 57 : filename (0), line (1), column (1) 63 explicit position (std::string* f = YY_NULL, 64 unsigned int l = 1u, 65 unsigned int c = 1u) 66 : filename (f) 67 , line (l) 68 , column (c) 58 69 { 59 70 } … … 61 72 62 73 /// Initialization. 63 inline void initialize (std::string* fn) 74 void initialize (std::string* fn = YY_NULL, 75 unsigned int l = 1u, 76 unsigned int c = 1u) 64 77 { 65 78 filename = fn; 66 line = 1;67 column = 1;79 line = l; 80 column = c; 68 81 } 69 82 70 83 /** \name Line and Column related manipulators 71 84 ** \{ */ 72 public:73 85 /// (line related) Advance to the COUNT next lines. 74 inlinevoid lines (int count = 1)86 void lines (int count = 1) 75 87 { 76 column = 1 ;88 column = 1u; 77 89 line += count; 78 90 } 79 91 80 92 /// (column related) Advance to the COUNT next columns. 81 inlinevoid columns (int count = 1)93 void columns (int count = 1) 82 94 { 83 95 column = std::max (1u, column + count); … … 85 97 /** \} */ 86 98 87 public:88 99 /// File name to which this position refers. 89 100 std::string* filename; … … 95 106 96 107 /// Add and assign a position. 97 inline constposition&108 inline position& 98 109 operator+= (position& res, const int width) 99 110 { … … 111 122 112 123 /// Add and assign a position. 113 inline constposition&124 inline position& 114 125 operator-= (position& res, const int width) 115 126 { … … 146 157 ** \param pos a reference to the position to redirect 147 158 */ 148 inline std::ostream& 149 operator<< (std::ostream& ostr, const position& pos) 159 template <typename YYChar> 160 inline std::basic_ostream<YYChar>& 161 operator<< (std::basic_ostream<YYChar>& ostr, const position& pos) 150 162 { 151 163 if (pos.filename) … … 156 168 157 169 } // lol 158 159 /* Line 144 of location.cc */ 160 #line 161 "generated/position.hh" 161 #endif // not BISON_POSITION_HH 170 /* Line 148 of location.cc */ 171 #line 172 "generated/position.hh" 172 #endif /* !YY_LOL_GENERATED_POSITION_HH_INCLUDED */ -
trunk/src/generated/stack.hh
r2506 r2779 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */ 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-2013 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 31 31 version 2.2 of Bison. */ 32 32 33 #ifndef BISON_STACK_HH 34 # define BISON_STACK_HH 33 /** 34 ** \file generated/stack.hh 35 ** Define the lol::stack class. 36 */ 35 37 36 #include <deque> 38 #ifndef YY_LOL_GENERATED_STACK_HH_INCLUDED 39 # define YY_LOL_GENERATED_STACK_HH_INCLUDED 40 41 # include <deque> 37 42 38 43 39 44 namespace lol { 40 41 /* Line 1149 of lalr1.cc */ 42 #line 43 "generated/stack.hh" 45 /* Line 34 of stack.hh */ 46 #line 47 "generated/stack.hh" 43 47 template <class T, class S = std::deque<T> > 44 48 class stack 45 49 { 46 50 public: 47 48 51 // Hide our reversed order. 49 52 typedef typename S::reverse_iterator iterator; … … 84 87 { 85 88 for (; n; --n) 86 seq_.pop_front (); 89 seq_.pop_front (); 90 } 91 92 void 93 clear () 94 { 95 seq_.clear (); 87 96 } 88 97 … … 98 107 99 108 private: 100 109 stack (const stack&); 110 stack& operator= (const stack&); 101 111 S seq_; 102 112 }; … … 107 117 { 108 118 public: 109 110 slice (const S& stack, 111 unsigned int range) : stack_ (stack), 112 range_ (range) 119 slice (const S& stack, unsigned int range) 120 : stack_ (stack) 121 , range_ (range) 113 122 { 114 123 } … … 122 131 123 132 private: 124 125 133 const S& stack_; 126 134 unsigned int range_; … … 128 136 129 137 } // lol 138 /* Line 124 of stack.hh */ 139 #line 140 "generated/stack.hh" 130 140 131 /* Line 1235 of lalr1.cc */ 132 #line 133 "generated/stack.hh" 133 134 #endif // not BISON_STACK_HH[]dnl 135 141 #endif /* !YY_LOL_GENERATED_STACK_HH_INCLUDED */ -
trunk/src/gpu/lolfx-parser.y
r2216 r2779 18 18 #include <string> 19 19 20 /* HACK: workaround for Bison who insists on using exceptions */ 21 #define try if (true) 22 #define catch(...) if (false) 23 #define throw (void)0 20 24 %} 21 25
Note: See TracChangeset
for help on using the changeset viewer.