Changeset 2318
- Timestamp:
- Feb 2, 2013, 4:25:31 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/easymesh/easymesh-parser.y
r2294 r2318 110 110 | T_COLOR COLOR { uint32_t x = $2; 111 111 vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); 112 mc.m_mesh.SetCurColor(vec4(v) * (1. / 255)); }112 mc.m_mesh.SetCurColor(vec4(v) * (1.f / 255)); } 113 113 | T_BGCOLOR args4 { mc.m_mesh.SetCurColor2(vec4($2.f0, $2.f1, $2.f2, $2.f3)); } 114 114 | T_BGCOLOR COLOR { uint32_t x = $2; 115 115 vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); 116 mc.m_mesh.SetCurColor2(vec4(v) * (1. / 255)); }116 mc.m_mesh.SetCurColor2(vec4(v) * (1.f / 255)); } 117 117 ; 118 118 -
trunk/src/easymesh/easymesh.cpp
r2289 r2318 881 881 for (int v = 0, x = 0, y = 0; x < ndivisions + 1; v++) 882 882 { 883 vec3 p[] = { a + x * vb +y * vc,883 vec3 p[] = { a + (float)x * vb + (float)y * vc, 884 884 p[0] + vb, 885 885 p[0] + vc, -
trunk/src/generated/easymesh-parser.cpp
r2226 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 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 310of lalr1.cc */38 /* Line 293 of lalr1.cc */ 39 39 #line 1 "easymesh/easymesh-parser.y" 40 40 … … 62 62 63 63 64 /* Line 310of lalr1.cc */64 /* Line 293 of lalr1.cc */ 65 65 #line 66 "generated/easymesh-parser.cpp" 66 66 … … 70 70 /* User implementation prologue. */ 71 71 72 /* Line 316of lalr1.cc */72 /* Line 299 of lalr1.cc */ 73 73 #line 66 "easymesh/easymesh-parser.y" 74 74 … … 79 79 80 80 81 /* Line 316of lalr1.cc */81 /* Line 299 of lalr1.cc */ 82 82 #line 83 "generated/easymesh-parser.cpp" 83 83 … … 94 94 #endif 95 95 96 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 97 If N is 0, then set CURRENT to the empty location which ends 98 the previous symbol: RHS[0] (always defined). */ 99 100 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 101 #ifndef YYLLOC_DEFAULT 102 # 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 115 96 116 /* Suppress unused-variable warnings by "using" E. */ 97 117 #define YYUSE(e) ((void) (e)) … … 145 165 namespace lol { 146 166 147 /* Line 379 of lalr1.cc */ 148 #line 149 "generated/easymesh-parser.cpp" 149 #if YYERROR_VERBOSE 167 /* Line 382 of lalr1.cc */ 168 #line 169 "generated/easymesh-parser.cpp" 150 169 151 170 /* Return YYSTR after stripping away unnecessary quotes and … … 186 205 } 187 206 188 #endif189 207 190 208 /// Build a parser object. … … 287 305 #endif 288 306 307 inline bool 308 EasyMeshParser::yy_pact_value_is_default_ (int yyvalue) 309 { 310 return yyvalue == yypact_ninf_; 311 } 312 313 inline bool 314 EasyMeshParser::yy_table_value_is_error_ (int yyvalue) 315 { 316 return yyvalue == yytable_ninf_; 317 } 318 289 319 int 290 320 EasyMeshParser::parse () … … 308 338 location_type yylloc; 309 339 /// The locations where the error started and ended. 310 location_type yyerror_range[ 2];340 location_type yyerror_range[3]; 311 341 312 342 /// $$. … … 346 376 /* Try to take a decision without lookahead. */ 347 377 yyn = yypact_[yystate]; 348 if (yy n == yypact_ninf_)378 if (yy_pact_value_is_default_ (yyn)) 349 379 goto yydefault; 350 380 … … 379 409 if (yyn <= 0) 380 410 { 381 if (yy n == 0 || yyn == yytable_ninf_)382 goto yyerrlab;411 if (yy_table_value_is_error_ (yyn)) 412 goto yyerrlab; 383 413 yyn = -yyn; 384 414 goto yyreduce; … … 436 466 case 7: 437 467 438 /* Line 6 77of lalr1.cc */468 /* Line 690 of lalr1.cc */ 439 469 #line 90 "easymesh/easymesh-parser.y" 440 470 { mc.m_mesh.OpenBrace(); } … … 443 473 case 8: 444 474 445 /* Line 6 77of lalr1.cc */475 /* Line 690 of lalr1.cc */ 446 476 #line 94 "easymesh/easymesh-parser.y" 447 477 { mc.m_mesh.CloseBrace(); } … … 450 480 case 14: 451 481 452 /* Line 6 77of lalr1.cc */482 /* Line 690 of lalr1.cc */ 453 483 #line 109 "easymesh/easymesh-parser.y" 454 484 { 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)); } … … 457 487 case 15: 458 488 459 /* Line 6 77of lalr1.cc */489 /* Line 690 of lalr1.cc */ 460 490 #line 110 "easymesh/easymesh-parser.y" 461 491 { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); 462 492 vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); 463 mc.m_mesh.SetCurColor(vec4(v) * (1. / 255)); }493 mc.m_mesh.SetCurColor(vec4(v) * (1.f / 255)); } 464 494 break; 465 495 466 496 case 16: 467 497 468 /* Line 6 77of lalr1.cc */498 /* Line 690 of lalr1.cc */ 469 499 #line 113 "easymesh/easymesh-parser.y" 470 500 { 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)); } … … 473 503 case 17: 474 504 475 /* Line 6 77of lalr1.cc */505 /* Line 690 of lalr1.cc */ 476 506 #line 114 "easymesh/easymesh-parser.y" 477 507 { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); 478 508 vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); 479 mc.m_mesh.SetCurColor2(vec4(v) * (1. / 255)); }509 mc.m_mesh.SetCurColor2(vec4(v) * (1.f / 255)); } 480 510 break; 481 511 482 512 case 18: 483 513 484 /* Line 6 77of lalr1.cc */514 /* Line 690 of lalr1.cc */ 485 515 #line 120 "easymesh/easymesh-parser.y" 486 516 { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); } … … 489 519 case 19: 490 520 491 /* Line 6 77of lalr1.cc */521 /* Line 690 of lalr1.cc */ 492 522 #line 121 "easymesh/easymesh-parser.y" 493 523 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } … … 496 526 case 20: 497 527 498 /* Line 6 77of lalr1.cc */528 /* Line 690 of lalr1.cc */ 499 529 #line 122 "easymesh/easymesh-parser.y" 500 530 { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } … … 503 533 case 21: 504 534 505 /* Line 6 77of lalr1.cc */535 /* Line 690 of lalr1.cc */ 506 536 #line 123 "easymesh/easymesh-parser.y" 507 537 { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } … … 510 540 case 22: 511 541 512 /* Line 6 77of lalr1.cc */542 /* Line 690 of lalr1.cc */ 513 543 #line 124 "easymesh/easymesh-parser.y" 514 544 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } … … 517 547 case 23: 518 548 519 /* Line 6 77of lalr1.cc */549 /* Line 690 of lalr1.cc */ 520 550 #line 125 "easymesh/easymesh-parser.y" 521 551 { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); } … … 524 554 case 24: 525 555 526 /* Line 6 77of lalr1.cc */556 /* Line 690 of lalr1.cc */ 527 557 #line 126 "easymesh/easymesh-parser.y" 528 558 { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); } … … 531 561 case 25: 532 562 533 /* Line 6 77of lalr1.cc */563 /* Line 690 of lalr1.cc */ 534 564 #line 127 "easymesh/easymesh-parser.y" 535 565 { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); } … … 538 568 case 26: 539 569 540 /* Line 6 77of lalr1.cc */570 /* Line 690 of lalr1.cc */ 541 571 #line 128 "easymesh/easymesh-parser.y" 542 572 { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 545 575 case 27: 546 576 547 /* Line 6 77of lalr1.cc */577 /* Line 690 of lalr1.cc */ 548 578 #line 129 "easymesh/easymesh-parser.y" 549 579 { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 552 582 case 28: 553 583 554 /* Line 6 77of lalr1.cc */584 /* Line 690 of lalr1.cc */ 555 585 #line 130 "easymesh/easymesh-parser.y" 556 586 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 559 589 case 29: 560 590 561 /* Line 6 77of lalr1.cc */591 /* Line 690 of lalr1.cc */ 562 592 #line 131 "easymesh/easymesh-parser.y" 563 593 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); } … … 566 596 case 30: 567 597 568 /* Line 6 77of lalr1.cc */598 /* Line 690 of lalr1.cc */ 569 599 #line 132 "easymesh/easymesh-parser.y" 570 600 { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); } … … 573 603 case 31: 574 604 575 /* Line 6 77of lalr1.cc */605 /* Line 690 of lalr1.cc */ 576 606 #line 133 "easymesh/easymesh-parser.y" 577 607 { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); } … … 580 610 case 32: 581 611 582 /* Line 6 77of lalr1.cc */612 /* Line 690 of lalr1.cc */ 583 613 #line 134 "easymesh/easymesh-parser.y" 584 614 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } … … 587 617 case 33: 588 618 589 /* Line 6 77of lalr1.cc */619 /* Line 690 of lalr1.cc */ 590 620 #line 135 "easymesh/easymesh-parser.y" 591 621 { mc.m_mesh.MirrorX(); } … … 594 624 case 34: 595 625 596 /* Line 6 77of lalr1.cc */626 /* Line 690 of lalr1.cc */ 597 627 #line 136 "easymesh/easymesh-parser.y" 598 628 { mc.m_mesh.MirrorY(); } … … 601 631 case 35: 602 632 603 /* Line 6 77of lalr1.cc */633 /* Line 690 of lalr1.cc */ 604 634 #line 137 "easymesh/easymesh-parser.y" 605 635 { mc.m_mesh.MirrorZ(); } … … 608 638 case 36: 609 639 610 /* Line 6 77of lalr1.cc */640 /* Line 690 of lalr1.cc */ 611 641 #line 138 "easymesh/easymesh-parser.y" 642 { mc.m_mesh.RadialJitter((yysemantic_stack_[(2) - (2)].args).f0); } 643 break; 644 645 case 37: 646 647 /* Line 690 of lalr1.cc */ 648 #line 139 "easymesh/easymesh-parser.y" 612 649 { mc.m_mesh.ToggleScaleWinding(); } 613 650 break; 614 651 615 case 3 7:616 617 /* Line 6 77of lalr1.cc */618 #line 1 39"easymesh/easymesh-parser.y"652 case 38: 653 654 /* Line 690 of lalr1.cc */ 655 #line 140 "easymesh/easymesh-parser.y" 619 656 { mc.m_mesh.CsgUnion(); } 620 657 break; 621 658 622 case 3 8:623 624 /* Line 6 77of lalr1.cc */625 #line 14 0"easymesh/easymesh-parser.y"659 case 39: 660 661 /* Line 690 of lalr1.cc */ 662 #line 141 "easymesh/easymesh-parser.y" 626 663 { mc.m_mesh.CsgSubstract(); } 627 664 break; 628 665 629 case 39:630 631 /* Line 6 77of lalr1.cc */632 #line 14 1"easymesh/easymesh-parser.y"666 case 40: 667 668 /* Line 690 of lalr1.cc */ 669 #line 142 "easymesh/easymesh-parser.y" 633 670 { mc.m_mesh.CsgAnd(); } 634 671 break; 635 672 636 case 4 0:637 638 /* Line 6 77of lalr1.cc */639 #line 14 2"easymesh/easymesh-parser.y"673 case 41: 674 675 /* Line 690 of lalr1.cc */ 676 #line 143 "easymesh/easymesh-parser.y" 640 677 { mc.m_mesh.CsgXor(); } 641 678 break; 642 679 643 case 4 1:644 645 /* Line 6 77of lalr1.cc */646 #line 14 6"easymesh/easymesh-parser.y"680 case 42: 681 682 /* Line 690 of lalr1.cc */ 683 #line 147 "easymesh/easymesh-parser.y" 647 684 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 648 685 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 650 687 break; 651 688 652 case 4 2:653 654 /* Line 6 77of lalr1.cc */655 #line 1 49"easymesh/easymesh-parser.y"689 case 43: 690 691 /* Line 690 of lalr1.cc */ 692 #line 150 "easymesh/easymesh-parser.y" 656 693 { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 657 694 break; 658 695 659 case 4 3:660 661 /* Line 6 77of lalr1.cc */662 #line 15 0"easymesh/easymesh-parser.y"696 case 44: 697 698 /* Line 690 of lalr1.cc */ 699 #line 151 "easymesh/easymesh-parser.y" 663 700 { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 664 701 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 665 702 break; 666 703 667 case 4 4:668 669 /* Line 6 77of lalr1.cc */670 #line 15 2"easymesh/easymesh-parser.y"704 case 45: 705 706 /* Line 690 of lalr1.cc */ 707 #line 153 "easymesh/easymesh-parser.y" 671 708 { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 672 709 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 673 710 break; 674 711 675 case 4 5:676 677 /* Line 6 77of lalr1.cc */678 #line 15 4"easymesh/easymesh-parser.y"712 case 46: 713 714 /* Line 690 of lalr1.cc */ 715 #line 155 "easymesh/easymesh-parser.y" 679 716 { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, 680 717 vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } 681 718 break; 682 719 683 case 4 6:684 685 /* Line 6 77of lalr1.cc */686 #line 15 6"easymesh/easymesh-parser.y"720 case 47: 721 722 /* Line 690 of lalr1.cc */ 723 #line 157 "easymesh/easymesh-parser.y" 687 724 { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 688 725 break; 689 726 690 case 4 7:691 692 /* Line 6 77of lalr1.cc */693 #line 15 7"easymesh/easymesh-parser.y"727 case 48: 728 729 /* Line 690 of lalr1.cc */ 730 #line 158 "easymesh/easymesh-parser.y" 694 731 { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 695 732 break; 696 733 697 case 4 8:698 699 /* Line 6 77of lalr1.cc */700 #line 15 8"easymesh/easymesh-parser.y"734 case 49: 735 736 /* Line 690 of lalr1.cc */ 737 #line 159 "easymesh/easymesh-parser.y" 701 738 { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, 702 739 (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } 703 740 break; 704 741 705 case 49:706 707 /* Line 6 77of lalr1.cc */708 #line 16 0"easymesh/easymesh-parser.y"742 case 50: 743 744 /* Line 690 of lalr1.cc */ 745 #line 161 "easymesh/easymesh-parser.y" 709 746 { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 710 747 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 711 748 break; 712 749 713 case 5 0:714 715 /* Line 6 77of lalr1.cc */716 #line 16 2"easymesh/easymesh-parser.y"750 case 51: 751 752 /* Line 690 of lalr1.cc */ 753 #line 163 "easymesh/easymesh-parser.y" 717 754 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } 718 755 break; 719 756 720 case 5 1:721 722 /* Line 6 77of lalr1.cc */723 #line 16 3"easymesh/easymesh-parser.y"757 case 52: 758 759 /* Line 690 of lalr1.cc */ 760 #line 164 "easymesh/easymesh-parser.y" 724 761 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 725 762 break; 726 763 727 case 5 2:728 729 /* Line 6 77of lalr1.cc */730 #line 16 4"easymesh/easymesh-parser.y"764 case 53: 765 766 /* Line 690 of lalr1.cc */ 767 #line 165 "easymesh/easymesh-parser.y" 731 768 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 732 769 break; 733 770 734 case 5 3:735 736 /* Line 6 77of lalr1.cc */737 #line 16 5"easymesh/easymesh-parser.y"771 case 54: 772 773 /* Line 690 of lalr1.cc */ 774 #line 166 "easymesh/easymesh-parser.y" 738 775 { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 739 776 (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, … … 741 778 break; 742 779 743 case 5 4:744 745 /* Line 6 77of lalr1.cc */746 #line 17 0"easymesh/easymesh-parser.y"780 case 55: 781 782 /* Line 690 of lalr1.cc */ 783 #line 171 "easymesh/easymesh-parser.y" 747 784 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } 748 785 break; 749 786 750 case 5 5:751 752 /* Line 6 77of lalr1.cc */753 #line 17 1"easymesh/easymesh-parser.y"787 case 56: 788 789 /* Line 690 of lalr1.cc */ 790 #line 172 "easymesh/easymesh-parser.y" 754 791 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } 755 792 break; 756 793 757 case 5 6:758 759 /* Line 6 77of lalr1.cc */760 #line 17 2"easymesh/easymesh-parser.y"794 case 57: 795 796 /* Line 690 of lalr1.cc */ 797 #line 173 "easymesh/easymesh-parser.y" 761 798 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } 762 799 break; 763 800 764 case 5 7:765 766 /* Line 6 77of lalr1.cc */767 #line 17 3"easymesh/easymesh-parser.y"801 case 58: 802 803 /* Line 690 of lalr1.cc */ 804 #line 174 "easymesh/easymesh-parser.y" 768 805 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } 769 806 break; 770 807 771 case 5 8:772 773 /* Line 6 77of lalr1.cc */774 #line 17 4"easymesh/easymesh-parser.y"808 case 59: 809 810 /* Line 690 of lalr1.cc */ 811 #line 175 "easymesh/easymesh-parser.y" 775 812 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } 776 813 break; 777 814 778 case 59:779 780 /* Line 6 77of lalr1.cc */781 #line 17 5"easymesh/easymesh-parser.y"815 case 60: 816 817 /* Line 690 of lalr1.cc */ 818 #line 176 "easymesh/easymesh-parser.y" 782 819 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } 783 820 break; 784 821 785 case 6 0:786 787 /* Line 6 77of lalr1.cc */788 #line 17 6"easymesh/easymesh-parser.y"822 case 61: 823 824 /* Line 690 of lalr1.cc */ 825 #line 177 "easymesh/easymesh-parser.y" 789 826 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } 790 827 break; 791 828 792 case 6 1:793 794 /* Line 6 77of lalr1.cc */795 #line 17 7"easymesh/easymesh-parser.y"829 case 62: 830 831 /* Line 690 of lalr1.cc */ 832 #line 178 "easymesh/easymesh-parser.y" 796 833 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } 797 834 break; 798 835 799 case 6 2:800 801 /* Line 6 77of lalr1.cc */802 #line 17 8"easymesh/easymesh-parser.y"836 case 63: 837 838 /* Line 690 of lalr1.cc */ 839 #line 179 "easymesh/easymesh-parser.y" 803 840 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); } 804 841 break; 805 842 806 case 6 3:807 808 /* Line 6 77of lalr1.cc */809 #line 1 79"easymesh/easymesh-parser.y"843 case 64: 844 845 /* Line 690 of lalr1.cc */ 846 #line 180 "easymesh/easymesh-parser.y" 810 847 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); } 811 848 break; 812 849 813 case 6 4:814 815 /* Line 6 77of lalr1.cc */816 #line 18 2"easymesh/easymesh-parser.y"850 case 65: 851 852 /* Line 690 of lalr1.cc */ 853 #line 183 "easymesh/easymesh-parser.y" 817 854 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } 818 855 break; 819 856 820 case 6 5:821 822 /* Line 6 77of lalr1.cc */823 #line 18 3"easymesh/easymesh-parser.y"857 case 66: 858 859 /* Line 690 of lalr1.cc */ 860 #line 184 "easymesh/easymesh-parser.y" 824 861 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } 825 862 break; … … 827 864 828 865 829 /* Line 6 77of lalr1.cc */830 #line 8 31"generated/easymesh-parser.cpp"866 /* Line 690 of lalr1.cc */ 867 #line 868 "generated/easymesh-parser.cpp" 831 868 default: 832 869 break; 833 870 } 871 /* User semantic actions sometimes alter yychar, and that requires 872 that yytoken be updated with the new translation. We take the 873 approach of translating immediately before every use of yytoken. 874 One alternative is translating here after every semantic action, 875 but that translation would be missed if the semantic action 876 invokes YYABORT, YYACCEPT, or YYERROR immediately after altering 877 yychar. In the case of YYABORT or YYACCEPT, an incorrect 878 destructor might then be invoked immediately. In the case of 879 YYERROR, subsequent parser actions might lead to an incorrect 880 destructor call or verbose syntax error message before the 881 lookahead is translated. */ 834 882 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 835 883 … … 855 903 `------------------------------------*/ 856 904 yyerrlab: 905 /* Make sure we have latest lookahead translation. See comments at 906 user semantic actions for why this is necessary. */ 907 yytoken = yytranslate_ (yychar); 908 857 909 /* If not already recovering from an error, report this error. */ 858 910 if (!yyerrstatus_) 859 911 { 860 912 ++yynerrs_; 913 if (yychar == yyempty_) 914 yytoken = yyempty_; 861 915 error (yylloc, yysyntax_error_ (yystate, yytoken)); 862 916 } 863 917 864 yyerror_range[ 0] = yylloc;918 yyerror_range[1] = yylloc; 865 919 if (yyerrstatus_ == 3) 866 920 { … … 897 951 goto yyerrorlab; 898 952 899 yyerror_range[ 0] = yylocation_stack_[yylen - 1];953 yyerror_range[1] = yylocation_stack_[yylen - 1]; 900 954 /* Do not reclaim the symbols of the rule which action triggered 901 955 this YYERROR. */ … … 914 968 { 915 969 yyn = yypact_[yystate]; 916 if ( yyn != yypact_ninf_)970 if (!yy_pact_value_is_default_ (yyn)) 917 971 { 918 972 yyn += yyterror_; … … 929 983 YYABORT; 930 984 931 yyerror_range[ 0] = yylocation_stack_[0];985 yyerror_range[1] = yylocation_stack_[0]; 932 986 yydestruct_ ("Error: popping", 933 987 yystos_[yystate], … … 938 992 } 939 993 940 yyerror_range[ 1] = yylloc;994 yyerror_range[2] = yylloc; 941 995 // Using YYLLOC is tempting, but would change the location of 942 996 // the lookahead. YYLOC is available though. 943 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);997 YYLLOC_DEFAULT (yyloc, yyerror_range, 2); 944 998 yysemantic_stack_.push (yylval); 945 999 yylocation_stack_.push (yyloc); … … 964 1018 yyreturn: 965 1019 if (yychar != yyempty_) 966 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 1020 { 1021 /* Make sure we have latest lookahead translation. See comments 1022 at user semantic actions for why this is necessary. */ 1023 yytoken = yytranslate_ (yychar); 1024 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, 1025 &yylloc); 1026 } 967 1027 968 1028 /* Do not reclaim the symbols of the rule which action triggered … … 983 1043 // Generate an error message. 984 1044 std::string 985 EasyMeshParser::yysyntax_error_ (int yystate, int tok) 986 { 987 std::string res; 988 YYUSE (yystate); 989 #if YYERROR_VERBOSE 990 int yyn = yypact_[yystate]; 991 if (yypact_ninf_ < yyn && yyn <= yylast_) 1045 EasyMeshParser::yysyntax_error_ (int yystate, int yytoken) 1046 { 1047 std::string yyres; 1048 // Number of reported tokens (one for the "unexpected", one per 1049 // "expected"). 1050 size_t yycount = 0; 1051 // Its maximum. 1052 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1053 // Arguments of yyformat. 1054 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1055 1056 /* There are many possibilities here to consider: 1057 - If this state is a consistent state with a default action, then 1058 the only way this function was invoked is if the default action 1059 is an error action. In that case, don't check for expected 1060 tokens because there are none. 1061 - The only way there can be no lookahead present (in yytoken) is 1062 if this state is a consistent state with a default action. 1063 Thus, detecting the absence of a lookahead is sufficient to 1064 determine that there is no unexpected or expected token to 1065 report. In that case, just report a simple "syntax error". 1066 - Don't assume there isn't a lookahead just because this state is 1067 a consistent state with a default action. There might have 1068 been a previous inconsistent state, consistent state with a 1069 non-default action, or user semantic action that manipulated 1070 yychar. 1071 - Of course, the expected token list depends on states to have 1072 correct lookahead information, and it depends on the parser not 1073 to perform extra reductions after fetching a lookahead from the 1074 scanner and before detecting a syntax error. Thus, state 1075 merging (from LALR or IELR) and default reductions corrupt the 1076 expected token list. However, the list is correct for 1077 canonical LR with one exception: it will still contain any 1078 token that will not be accepted due to an error action in a 1079 later state. 1080 */ 1081 if (yytoken != yyempty_) 992 1082 { 993 /* Start YYX at -YYN if negative to avoid negative indexes in 994 YYCHECK. */ 995 int yyxbegin = yyn < 0 ? -yyn : 0; 996 997 /* Stay within bounds of both yycheck and yytname. */ 998 int yychecklim = yylast_ - yyn + 1; 999 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 1000 int count = 0; 1001 for (int x = yyxbegin; x < yyxend; ++x) 1002 if (yycheck_[x + yyn] == x && x != yyterror_) 1003 ++count; 1004 1005 // FIXME: This method of building the message is not compatible 1006 // with internationalization. It should work like yacc.c does it. 1007 // That is, first build a string that looks like this: 1008 // "syntax error, unexpected %s or %s or %s" 1009 // Then, invoke YY_ on this string. 1010 // Finally, use the string as a format to output 1011 // yytname_[tok], etc. 1012 // Until this gets fixed, this message appears in English only. 1013 res = "syntax error, unexpected "; 1014 res += yytnamerr_ (yytname_[tok]); 1015 if (count < 5) 1016 { 1017 count = 0; 1018 for (int x = yyxbegin; x < yyxend; ++x) 1019 if (yycheck_[x + yyn] == x && x != yyterror_) 1020 { 1021 res += (!count++) ? ", expecting " : " or "; 1022 res += yytnamerr_ (yytname_[x]); 1023 } 1024 } 1083 yyarg[yycount++] = yytname_[yytoken]; 1084 int yyn = yypact_[yystate]; 1085 if (!yy_pact_value_is_default_ (yyn)) 1086 { 1087 /* Start YYX at -YYN if negative to avoid negative indexes in 1088 YYCHECK. In other words, skip the first -YYN actions for 1089 this state because they are default actions. */ 1090 int yyxbegin = yyn < 0 ? -yyn : 0; 1091 /* Stay within bounds of both yycheck and yytname. */ 1092 int yychecklim = yylast_ - yyn + 1; 1093 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 1094 for (int yyx = yyxbegin; yyx < yyxend; ++yyx) 1095 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ 1096 && !yy_table_value_is_error_ (yytable_[yyx + yyn])) 1097 { 1098 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1099 { 1100 yycount = 1; 1101 break; 1102 } 1103 else 1104 yyarg[yycount++] = yytname_[yyx]; 1105 } 1106 } 1025 1107 } 1026 else 1027 #endif 1028 res = YY_("syntax error"); 1029 return res; 1108 1109 char const* yyformat = 0; 1110 switch (yycount) 1111 { 1112 #define YYCASE_(N, S) \ 1113 case N: \ 1114 yyformat = S; \ 1115 break 1116 YYCASE_(0, YY_("syntax error")); 1117 YYCASE_(1, YY_("syntax error, unexpected %s")); 1118 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1119 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1120 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1121 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1122 #undef YYCASE_ 1123 } 1124 1125 // Argument number. 1126 size_t yyi = 0; 1127 for (char const* yyp = yyformat; *yyp; ++yyp) 1128 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) 1129 { 1130 yyres += yytnamerr_ (yyarg[yyi++]); 1131 ++yyp; 1132 } 1133 else 1134 yyres += *yyp; 1135 return yyres; 1030 1136 } 1031 1137 … … 1037 1143 EasyMeshParser::yypact_[] = 1038 1144 { 1039 -3, 1 8, 27, 16, 16, 16, 16, -10, 16, 16,1040 16, 16, -10, 16, 16, 16, 16, -10, 16, 16,1041 -10, -10, -10, -10, -10, 16, 16, 16, 16, 16,1042 16, 16, 16, 16, 16, 16, 16, 16, 16, -10,1043 40, 48, -3, -3, 79, -10, -10, -10, -10, -10,1044 -10, 16, 16, 16, 16, -10, -10, -10, -10, -10,1145 -3, 19, 28, 26, 26, 26, 26, -10, 26, 26, 1146 26, 26, -10, 26, 26, 26, 26, -10, 26, 26, 1147 -10, 26, -10, -10, -10, -10, 26, 26, 26, 26, 1148 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 1149 -10, 41, 49, -3, -3, 81, -10, -10, -10, -10, 1150 -10, -10, 26, 26, 26, 26, -10, -10, -10, -10, 1045 1151 -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, 1046 -10, -10, -10, -10, 16, 16, -10, -10, -10, -10, 1047 -10, -10, -10, -10, -10, -10, -10, 16, 16, 16, 1048 16, -10, -10, -10, -10, -10, 5, -10, -10, -10, 1049 -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 1152 -10, -10, -10, -10, -10, -10, 26, 26, -10, -10, 1153 -10, -10, -10, -10, -10, -10, -10, -10, -10, 26, 1154 26, 26, 26, -10, -10, -10, -10, -10, 5, -10, 1155 -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, 1156 -10, -10 1050 1157 }; 1051 1158 1052 /* YYDEFACT[S] -- default r ule to reduce with in state S when YYTABLE1053 doesn't specify something else to do. Zero means the default is an1054 error. */1159 /* YYDEFACT[S] -- default reduction number in state S. Performed when 1160 YYTABLE doesn't specify something else to do. Zero means the 1161 default is an error. */ 1055 1162 const unsigned char 1056 1163 EasyMeshParser::yydefact_[] = … … 1058 1165 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 1059 1166 0, 0, 34, 0, 0, 0, 0, 35, 0, 0, 1060 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 1061 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 1062 0, 0, 3, 0, 5, 9, 11, 12, 13, 64, 1063 15, 0, 0, 0, 0, 14, 54, 17, 16, 19, 1064 23, 26, 29, 20, 24, 27, 30, 21, 25, 28, 1065 31, 22, 32, 18, 0, 0, 41, 42, 43, 44, 1066 45, 46, 48, 49, 50, 51, 52, 0, 0, 0, 1067 0, 53, 47, 1, 2, 4, 0, 10, 65, 55, 1068 56, 57, 58, 59, 60, 61, 62, 63, 8, 6 1167 37, 0, 38, 39, 40, 41, 0, 0, 0, 0, 1168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1169 7, 0, 0, 3, 0, 5, 9, 11, 12, 13, 1170 65, 15, 0, 0, 0, 0, 14, 55, 17, 16, 1171 19, 23, 26, 29, 20, 24, 27, 30, 21, 25, 1172 28, 31, 22, 32, 36, 18, 0, 0, 42, 43, 1173 44, 45, 46, 47, 49, 50, 51, 52, 53, 0, 1174 0, 0, 0, 54, 48, 1, 2, 4, 0, 10, 1175 66, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1176 8, 6 1069 1177 }; 1070 1178 … … 1074 1182 { 1075 1183 -10, -10, -4, -10, -10, -10, -10, 9, -10, -10, 1076 -10, 4 3, 36, 115, 122, 23, 26, -10, -10, -10,1184 -10, 44, 40, 118, 125, 23, 21, -10, -10, -10, 1077 1185 -10, -9 1078 1186 }; … … 1082 1190 EasyMeshParser::yydefgoto_[] = 1083 1191 { 1084 -1, 4 0, 41, 42, 43, 109, 44, 45, 46, 47,1085 4 8, 52, 53, 54, 74, 75, 76, 88, 89, 90,1086 9 1, 561192 -1, 41, 42, 43, 44, 111, 45, 46, 47, 48, 1193 49, 53, 54, 55, 76, 77, 78, 90, 91, 92, 1194 93, 57 1087 1195 }; 1088 1196 1089 1197 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 1090 1198 positive, shift that token. If negative, reduce the rule which 1091 number is the opposite. If zero, do what YYDEFACT says. */1199 number is the opposite. If YYTABLE_NINF_, syntax error. */ 1092 1200 const signed char EasyMeshParser::yytable_ninf_ = -1; 1093 1201 const unsigned char … … 1097 1205 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1098 1206 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1099 31, 32, 33, 34, 35, 36, 37, 38, 95, 96, 1100 93, 39, 98, 99, 100, 101, 59, 60, 94, 62, 1101 108, 63, 64, 97, 66, 82, 67, 68, 49, 70, 1102 49, 50, 51, 87, 51, 102, 103, 0, 73, 49, 1103 57, 85, 86, 51, 0, 0, 0, 0, 104, 105, 1104 106, 107, 1, 2, 3, 4, 5, 6, 7, 8, 1207 31, 32, 33, 34, 35, 36, 37, 38, 39, 97, 1208 98, 95, 40, 100, 101, 102, 103, 60, 61, 96, 1209 63, 110, 64, 65, 99, 67, 84, 68, 69, 89, 1210 71, 0, 50, 51, 0, 74, 52, 104, 105, 50, 1211 75, 50, 58, 52, 0, 52, 87, 88, 0, 0, 1212 106, 107, 108, 109, 1, 2, 3, 4, 5, 6, 1213 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1214 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1215 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1216 37, 38, 39, 62, 0, 0, 56, 59, 66, 0, 1217 0, 0, 0, 70, 0, 0, 72, 73, 0, 0, 1218 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 1219 83, 0, 0, 86, 80, 81, 82, 94, 0, 85 1220 }; 1221 1222 /* YYCHECK. */ 1223 const signed char 1224 EasyMeshParser::yycheck_[] = 1225 { 1226 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1227 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1228 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1229 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 1230 44, 0, 45, 52, 53, 54, 55, 3, 4, 0, 1231 6, 46, 8, 9, 45, 11, 33, 13, 14, 38, 1232 16, -1, 43, 44, -1, 21, 47, 76, 77, 43, 1233 26, 43, 44, 47, -1, 47, 36, 37, -1, -1, 1234 89, 90, 91, 92, 3, 4, 5, 6, 7, 8, 1105 1235 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1106 1236 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1107 1237 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 1108 61, 0, 0, 55, 58, 65, 0, 0, 0, 0, 1109 69, 0, 0, 71, 72, 0, 0, 0, 0, 0, 1110 0, 0, 77, 0, 0, 0, 81, 0, 0, 84, 1111 78, 79, 80, 92, 0, 83 1112 }; 1113 1114 /* YYCHECK. */ 1115 const signed char 1116 EasyMeshParser::yycheck_[] = 1117 { 1118 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1119 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1120 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1121 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 1122 0, 44, 51, 52, 53, 54, 3, 4, 0, 6, 1123 45, 8, 9, 44, 11, 32, 13, 14, 42, 16, 1124 42, 43, 46, 37, 46, 74, 75, -1, 25, 42, 1125 43, 35, 36, 46, -1, -1, -1, -1, 87, 88, 1126 89, 90, 3, 4, 5, 6, 7, 8, 9, 10, 1127 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1128 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1129 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 1130 5, -1, -1, 1, 2, 10, -1, -1, -1, -1, 1131 15, -1, -1, 18, 19, -1, -1, -1, -1, -1, 1132 -1, -1, 27, -1, -1, -1, 31, -1, -1, 34, 1133 28, 29, 30, 38, -1, 33 1238 39, 40, 41, 5, -1, -1, 1, 2, 10, -1, 1239 -1, -1, -1, 15, -1, -1, 18, 19, -1, -1, 1240 -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, 1241 32, -1, -1, 35, 29, 30, 31, 39, -1, 34 1134 1242 }; 1135 1243 … … 1142 1250 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1143 1251 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1144 32, 33, 34, 35, 36, 37, 38, 39, 40, 44, 1145 48, 49, 50, 51, 53, 54, 55, 56, 57, 42, 1146 43, 46, 58, 59, 60, 61, 68, 43, 61, 58, 1147 58, 60, 58, 58, 58, 60, 58, 58, 58, 60, 1148 58, 60, 60, 58, 61, 62, 63, 60, 61, 61, 1149 61, 60, 62, 61, 60, 59, 59, 63, 64, 65, 1150 66, 67, 60, 0, 0, 49, 49, 54, 68, 68, 1151 68, 68, 68, 68, 68, 68, 68, 68, 45, 52 1252 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 1253 45, 49, 50, 51, 52, 54, 55, 56, 57, 58, 1254 43, 44, 47, 59, 60, 61, 62, 69, 44, 62, 1255 59, 59, 61, 59, 59, 59, 61, 59, 59, 59, 1256 61, 59, 61, 61, 59, 59, 62, 63, 64, 61, 1257 62, 62, 62, 61, 63, 62, 61, 60, 60, 64, 1258 65, 66, 67, 68, 61, 0, 0, 50, 50, 55, 1259 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 1260 46, 53 1152 1261 }; 1153 1262 … … 1162 1271 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 1163 1272 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 1164 295, 296, 297, 298, 91, 93, 451273 295, 296, 297, 298, 299, 91, 93, 45 1165 1274 }; 1166 1275 #endif … … 1170 1279 EasyMeshParser::yyr1_[] = 1171 1280 { 1172 0, 4 7, 48, 49, 49, 50, 50, 51, 52, 53,1173 5 3, 54, 54, 54, 55, 55, 55, 55, 56, 56,1174 5 6, 56, 56, 56, 56, 56, 56, 56, 56, 56,1175 5 6, 56, 56, 56, 56, 56, 56, 56, 56, 56,1176 5 6, 57, 57, 57, 57, 57, 57, 57, 57, 57,1177 5 7, 57, 57, 57, 58, 59, 60, 61, 62, 63,1178 64, 65, 66, 67, 68, 6 81281 0, 48, 49, 50, 50, 51, 51, 52, 53, 54, 1282 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 1283 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 1284 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 1285 57, 57, 58, 58, 58, 58, 58, 58, 58, 58, 1286 58, 58, 58, 58, 58, 59, 60, 61, 62, 63, 1287 64, 65, 66, 67, 68, 69, 69 1179 1288 }; 1180 1289 … … 1186 1295 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1187 1296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1188 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,1189 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,1190 2, 2, 2, 2, 1, 2, 2, 2, 2, 2,1191 2, 2, 2, 2, 1, 21297 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1298 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1299 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1300 2, 2, 2, 2, 2, 1, 2 1192 1301 }; 1193 1302 … … 1202 1311 "T_ROTATEY", "T_TAPERY", "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ", 1203 1312 "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE", 1204 "T_SCALE", "T_TOGGLESCALEWINDING", "T_ CSGUNION", "T_CSGSUBSTRACT",1205 "T_CSG AND", "T_CSGXOR", "T_CHAMFER", "T_CYLINDER", "T_BOX",1206 "T_ SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR",1207 "T_ EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS",1208 "T_ ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept",1313 "T_SCALE", "T_TOGGLESCALEWINDING", "T_RADIALJITTER", "T_CSGUNION", 1314 "T_CSGSUBSTRACT", "T_CSGAND", "T_CSGXOR", "T_CHAMFER", "T_CYLINDER", 1315 "T_BOX", "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", 1316 "T_STAR", "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", 1317 "T_TORUS", "T_ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", 1209 1318 "mesh_description", "mesh_expression_list", "mesh_expression", 1210 1319 "mesh_open", "mesh_close", "mesh_command_list", "mesh_command", … … 1220 1329 EasyMeshParser::yyrhs_[] = 1221 1330 { 1222 48, 0, -1, 49, 0, -1, 50, -1, 50, 49, 1223 -1, 53, -1, 51, 49, 52, -1, 44, -1, 45, 1224 -1, 54, -1, 53, 54, -1, 55, -1, 56, -1, 1225 57, -1, 3, 61, -1, 3, 43, -1, 4, 61, 1226 -1, 4, 43, -1, 27, 58, -1, 5, 58, -1, 1227 10, 58, -1, 15, 58, -1, 20, 60, -1, 6, 1228 58, -1, 11, 58, -1, 16, 58, -1, 7, 60, 1229 -1, 12, 60, -1, 17, 60, -1, 8, 58, -1, 1230 13, 58, -1, 18, 58, -1, 21, 60, -1, 9, 1231 -1, 14, -1, 19, -1, 22, -1, 23, -1, 24, 1232 -1, 25, -1, 26, -1, 28, 63, -1, 29, 60, 1233 -1, 30, 61, -1, 31, 61, -1, 32, 61, -1, 1234 33, 60, -1, 40, 60, -1, 34, 62, -1, 35, 1235 61, -1, 36, 60, -1, 37, 59, -1, 38, 59, 1236 -1, 39, 67, -1, 68, -1, 58, 68, -1, 59, 1237 68, -1, 60, 68, -1, 61, 68, -1, 62, 68, 1238 -1, 63, 68, -1, 64, 68, -1, 65, 68, -1, 1239 66, 68, -1, 42, -1, 46, 68, -1 1331 49, 0, -1, 50, 0, -1, 51, -1, 51, 50, 1332 -1, 54, -1, 52, 50, 53, -1, 45, -1, 46, 1333 -1, 55, -1, 54, 55, -1, 56, -1, 57, -1, 1334 58, -1, 3, 62, -1, 3, 44, -1, 4, 62, 1335 -1, 4, 44, -1, 28, 59, -1, 5, 59, -1, 1336 10, 59, -1, 15, 59, -1, 20, 61, -1, 6, 1337 59, -1, 11, 59, -1, 16, 59, -1, 7, 61, 1338 -1, 12, 61, -1, 17, 61, -1, 8, 59, -1, 1339 13, 59, -1, 18, 59, -1, 21, 61, -1, 9, 1340 -1, 14, -1, 19, -1, 23, 59, -1, 22, -1, 1341 24, -1, 25, -1, 26, -1, 27, -1, 29, 64, 1342 -1, 30, 61, -1, 31, 62, -1, 32, 62, -1, 1343 33, 62, -1, 34, 61, -1, 41, 61, -1, 35, 1344 63, -1, 36, 62, -1, 37, 61, -1, 38, 60, 1345 -1, 39, 60, -1, 40, 68, -1, 69, -1, 59, 1346 69, -1, 60, 69, -1, 61, 69, -1, 62, 69, 1347 -1, 63, 69, -1, 64, 69, -1, 65, 69, -1, 1348 66, 69, -1, 67, 69, -1, 43, -1, 47, 69, 1349 -1 1240 1350 }; 1241 1351 … … 1248 1358 23, 26, 28, 30, 32, 35, 38, 41, 44, 47, 1249 1359 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 1250 80, 83, 86, 89, 91, 93, 95, 9 7, 99, 101,1251 10 3, 105, 108, 111, 114, 117, 120, 123, 126, 129,1252 132, 135, 138, 141, 144, 14 6, 149, 152, 155, 158,1253 161, 164, 167, 170, 173, 17 51360 80, 83, 86, 89, 91, 93, 95, 98, 100, 102, 1361 104, 106, 108, 111, 114, 117, 120, 123, 126, 129, 1362 132, 135, 138, 141, 144, 147, 149, 152, 155, 158, 1363 161, 164, 167, 170, 173, 176, 178 1254 1364 }; 1255 1365 … … 1262 1372 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 1263 1373 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 1264 142, 14 6, 149, 150, 152, 154, 156, 157, 158, 160,1265 16 2, 163, 164, 165, 170, 171, 172, 173, 174, 175,1266 176, 177, 178, 179, 18 2, 1831374 142, 143, 147, 150, 151, 153, 155, 157, 158, 159, 1375 161, 163, 164, 165, 166, 171, 172, 173, 174, 175, 1376 176, 177, 178, 179, 180, 183, 184 1267 1377 }; 1268 1378 … … 1308 1418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1309 1419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1310 2, 2, 2, 2, 2, 4 6, 2, 2, 2, 2,1311 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1312 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1313 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1314 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1315 2, 4 4, 2, 45, 2, 2, 2, 2, 2, 2,1420 2, 2, 2, 2, 2, 47, 2, 2, 2, 2, 1421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1425 2, 45, 2, 46, 2, 2, 2, 2, 2, 2, 1316 1426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1317 1427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, … … 1333 1443 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1334 1444 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 1335 35, 36, 37, 38, 39, 40, 41, 42, 43 1445 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 1336 1446 }; 1337 1447 if ((unsigned int) t <= yyuser_token_number_max_) … … 1342 1452 1343 1453 const int EasyMeshParser::yyeof_ = 0; 1344 const int EasyMeshParser::yylast_ = 15 5;1454 const int EasyMeshParser::yylast_ = 159; 1345 1455 const int EasyMeshParser::yynnts_ = 22; 1346 1456 const int EasyMeshParser::yyempty_ = -2; 1347 const int EasyMeshParser::yyfinal_ = 9 3;1457 const int EasyMeshParser::yyfinal_ = 95; 1348 1458 const int EasyMeshParser::yyterror_ = 1; 1349 1459 const int EasyMeshParser::yyerrcode_ = 256; 1350 const int EasyMeshParser::yyntokens_ = 4 7;1351 1352 const unsigned int EasyMeshParser::yyuser_token_number_max_ = 29 8;1460 const int EasyMeshParser::yyntokens_ = 48; 1461 1462 const unsigned int EasyMeshParser::yyuser_token_number_max_ = 299; 1353 1463 const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2; 1354 1464 … … 1356 1466 } // lol 1357 1467 1358 /* Line 1 053of lalr1.cc */1359 #line 1 360 "generated/easymesh-parser.cpp"1360 1361 1362 /* Line 1 055of lalr1.cc */1363 #line 18 6"easymesh/easymesh-parser.y"1468 /* Line 1136 of lalr1.cc */ 1469 #line 1470 "generated/easymesh-parser.cpp" 1470 1471 1472 /* Line 1138 of lalr1.cc */ 1473 #line 187 "easymesh/easymesh-parser.y" 1364 1474 1365 1475 -
trunk/src/generated/easymesh-parser.h
r2226 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 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 lol {46 47 /* Line 34 of lalr1.cc */48 #line 49 "generated/easymesh-parser.h"49 class position;50 class location;51 52 } // lol53 54 /* Line 34 of lalr1.cc */55 #line 56 "generated/easymesh-parser.h"56 57 43 #include "location.hh" 58 44 … … 75 61 #endif 76 62 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 ends79 the previous symbol: RHS[0] (always defined). */80 81 #ifndef YYLLOC_DEFAULT82 # 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 #endif95 96 63 97 64 namespace lol { 98 65 99 /* Line 3 4of lalr1.cc */100 #line 101"generated/easymesh-parser.h"66 /* Line 35 of lalr1.cc */ 67 #line 68 "generated/easymesh-parser.h" 101 68 102 69 /// A Bison parser. … … 109 76 { 110 77 111 /* Line 3 4of lalr1.cc */78 /* Line 35 of lalr1.cc */ 112 79 #line 36 "easymesh/easymesh-parser.y" 113 80 … … 119 86 120 87 121 /* Line 3 4of lalr1.cc */122 #line 123"generated/easymesh-parser.h"88 /* Line 35 of lalr1.cc */ 89 #line 90 "generated/easymesh-parser.h" 123 90 }; 124 91 #else … … 153 120 T_SCALE = 276, 154 121 T_TOGGLESCALEWINDING = 277, 155 T_CSGUNION = 278, 156 T_CSGSUBSTRACT = 279, 157 T_CSGAND = 280, 158 T_CSGXOR = 281, 159 T_CHAMFER = 282, 160 T_CYLINDER = 283, 161 T_BOX = 284, 162 T_SMOOTHCHAMFBOX = 285, 163 T_FLATCHAMFBOX = 286, 164 T_SPHERE = 287, 165 T_CAPSULE = 288, 166 T_STAR = 289, 167 T_EXPANDEDSTAR = 290, 168 T_DISC = 291, 169 T_TRIANGLE = 292, 170 T_QUAD = 293, 171 T_COG = 294, 172 T_TORUS = 295, 173 T_ERROR = 296, 174 NUMBER = 297, 175 COLOR = 298 122 T_RADIALJITTER = 278, 123 T_CSGUNION = 279, 124 T_CSGSUBSTRACT = 280, 125 T_CSGAND = 281, 126 T_CSGXOR = 282, 127 T_CHAMFER = 283, 128 T_CYLINDER = 284, 129 T_BOX = 285, 130 T_SMOOTHCHAMFBOX = 286, 131 T_FLATCHAMFBOX = 287, 132 T_SPHERE = 288, 133 T_CAPSULE = 289, 134 T_STAR = 290, 135 T_EXPANDEDSTAR = 291, 136 T_DISC = 292, 137 T_TRIANGLE = 293, 138 T_QUAD = 294, 139 T_COG = 295, 140 T_TORUS = 296, 141 T_ERROR = 297, 142 NUMBER = 298, 143 COLOR = 299 176 144 }; 177 145 … … 247 215 location_stack_type yylocation_stack_; 248 216 217 /// Whether the given \c yypact_ value indicates a defaulted state. 218 /// \param yyvalue the value to check 219 static bool yy_pact_value_is_default_ (int yyvalue); 220 221 /// Whether the given \c yytable_ value indicates a syntax error. 222 /// \param yyvalue the value to check 223 static bool yy_table_value_is_error_ (int yyvalue); 224 249 225 /// Internal symbol numbers. 250 226 typedef unsigned char token_number_type; … … 254 230 static const signed char yypact_ninf_; 255 231 256 /// For a state, default r ule to reduce.232 /// For a state, default reduction number. 257 233 /// Unless\a yytable_ specifies something else to do. 258 234 /// Zero means the default is an error. … … 285 261 #endif 286 262 287 #if YYERROR_VERBOSE288 263 /// Convert the symbol name \a n to a form suitable for a diagnostic. 289 virtual std::string yytnamerr_ (const char *n); 290 #endif 264 static std::string yytnamerr_ (const char *n); 291 265 292 266 #if YYDEBUG … … 346 320 } // lol 347 321 348 /* Line 3 4of lalr1.cc */349 #line 3 50"generated/easymesh-parser.h"322 /* Line 35 of lalr1.cc */ 323 #line 324 "generated/easymesh-parser.h" 350 324 351 325 -
trunk/src/generated/easymesh-scanner.cpp
r2226 r2318 331 331 (yy_c_buf_p) = yy_cp; 332 332 333 #define YY_NUM_RULES 5 0334 #define YY_END_OF_BUFFER 5 1333 #define YY_NUM_RULES 51 334 #define YY_END_OF_BUFFER 52 335 335 /* This struct is not used in this scanner, 336 336 but its presence is necessary. */ … … 340 340 flex_int32_t yy_nxt; 341 341 }; 342 static yyconst flex_int16_t yy_accept[8 1] =342 static yyconst flex_int16_t yy_accept[82] = 343 343 { 0, 344 0, 0, 51, 49, 48, 47, 49, 49, 44, 49, 345 43, 45, 46, 49, 49, 49, 49, 17, 7, 0, 346 0, 43, 43, 0, 26, 27, 30, 0, 0, 33, 347 34, 37, 3, 0, 19, 20, 21, 8, 9, 10, 348 1, 14, 15, 16, 0, 0, 4, 5, 6, 0, 349 0, 43, 0, 29, 31, 0, 0, 0, 38, 0, 350 2, 11, 12, 13, 18, 39, 28, 32, 35, 36, 351 24, 23, 22, 25, 40, 0, 41, 0, 42, 0 344 0, 0, 52, 50, 49, 48, 50, 50, 45, 50, 345 44, 46, 47, 50, 50, 50, 50, 17, 7, 0, 346 0, 44, 44, 0, 27, 28, 31, 0, 0, 34, 347 35, 38, 3, 0, 19, 20, 21, 22, 8, 9, 348 10, 1, 14, 15, 16, 0, 0, 4, 5, 6, 349 0, 0, 44, 0, 30, 32, 0, 0, 0, 39, 350 0, 2, 11, 12, 13, 18, 40, 29, 33, 36, 351 37, 25, 24, 23, 26, 41, 0, 42, 0, 43, 352 0 352 353 } ; 353 354 … … 365 366 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, 366 367 367 17, 18, 19, 20, 1, 1, 1, 1, 21, 1,368 2 2, 23, 24, 25, 26, 27, 28, 1, 29, 30,369 3 1, 32, 1, 1, 1, 1, 1, 1, 1, 1,368 17, 18, 19, 20, 1, 21, 1, 1, 22, 1, 369 23, 24, 25, 26, 27, 28, 29, 1, 30, 31, 370 32, 33, 1, 1, 1, 1, 1, 1, 1, 1, 370 371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 371 372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … … 384 385 } ; 385 386 386 static yyconst flex_int32_t yy_meta[3 3] =387 static yyconst flex_int32_t yy_meta[34] = 387 388 { 0, 388 389 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 389 390 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 390 391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 391 1, 1 392 1, 1, 1 392 393 } ; 393 394 394 static yyconst flex_int16_t yy_base[ 89] =395 static yyconst flex_int16_t yy_base[90] = 395 396 { 0, 396 0, 0, 1 09, 110, 110, 110, 0, 26, 28, 100,397 3 0, 110, 110, 34, 19, 11, 23, 41, 61, 0,398 99, 58, 59, 72, 110, 44, 110, 80, 90, 110,399 47, 82, 110, 84, 110, 110, 110, 110, 110, 110,400 88, 110, 110, 110, 51, 71, 110, 110, 110, 0,401 90, 88, 72, 110, 110, 80, 76, 69, 110, 71,402 110, 110, 110, 110, 110, 0, 110, 110, 110, 110,403 11 0, 110, 110, 110, 0, 0, 0, 0, 110, 110,404 86, 84, 83, 77, 62, 57, 44, 42397 0, 0, 111, 112, 112, 112, 0, 27, 29, 102, 398 31, 112, 112, 35, 20, 11, 24, 39, 60, 0, 399 101, 51, 57, 70, 112, 64, 112, 81, 92, 112, 400 64, 83, 112, 86, 112, 112, 112, 112, 112, 112, 401 112, 90, 112, 112, 112, 49, 73, 112, 112, 112, 402 0, 93, 91, 73, 112, 112, 82, 81, 74, 112, 403 71, 112, 112, 112, 112, 112, 0, 112, 112, 112, 404 112, 112, 112, 112, 112, 0, 0, 0, 0, 112, 405 112, 88, 87, 84, 83, 67, 64, 62, 44 405 406 } ; 406 407 407 static yyconst flex_int16_t yy_def[ 89] =408 static yyconst flex_int16_t yy_def[90] = 408 409 { 0, 409 8 0, 1, 80, 80, 80, 80, 81, 80, 80, 80,410 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 82,411 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,412 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,413 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 83,414 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,415 8 0, 80, 80, 80, 80, 84, 80, 80, 80, 80,416 8 0, 80, 80, 80, 85, 86, 87, 88, 80, 0,417 80, 80, 80, 80, 80, 80, 80, 80410 81, 1, 81, 81, 81, 81, 82, 81, 81, 81, 411 81, 81, 81, 81, 81, 81, 81, 81, 81, 83, 412 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 413 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 414 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 415 84, 81, 81, 81, 81, 81, 81, 81, 81, 81, 416 81, 81, 81, 81, 81, 81, 85, 81, 81, 81, 417 81, 81, 81, 81, 81, 86, 87, 88, 89, 81, 418 0, 81, 81, 81, 81, 81, 81, 81, 81 418 419 } ; 419 420 420 static yyconst flex_int16_t yy_nxt[14 3] =421 static yyconst flex_int16_t yy_nxt[146] = 421 422 { 0, 422 423 4, 5, 6, 7, 8, 9, 10, 11, 4, 4, 423 424 12, 13, 14, 4, 15, 4, 4, 4, 4, 4, 424 16, 4, 4, 4, 17, 18, 19, 4, 4, 4,425 4, 4, 21, 22, 21, 22, 21, 22, 33, 24,426 35, 36, 37, 79, 34, 78, 24, 25, 26, 27,427 2 8, 29, 38, 39, 40, 41, 53, 30, 77, 31,428 32, 57, 54, 76, 21, 22, 23, 24, 24, 58,429 4 2, 43, 44, 45, 24, 24, 51, 51, 75, 52,430 6 2, 63, 64, 71, 66, 50, 46, 20, 70, 69,431 4 7, 48, 49, 68, 67, 52, 72, 52, 73, 65,432 433 74, 61, 60, 59, 56, 55, 23, 23, 80,3,434 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,435 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,436 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,437 8 0, 80425 4, 16, 4, 4, 4, 17, 18, 19, 4, 4, 426 4, 4, 4, 21, 22, 21, 22, 21, 22, 33, 427 24, 35, 36, 37, 38, 80, 34, 24, 25, 26, 428 27, 28, 29, 42, 39, 40, 41, 21, 22, 30, 429 24, 31, 32, 79, 23, 78, 24, 24, 77, 43, 430 44, 45, 46, 24, 52, 52, 54, 53, 58, 63, 431 64, 65, 55, 72, 76, 67, 47, 59, 51, 20, 432 48, 49, 50, 71, 70, 69, 68, 73, 53, 74, 433 434 53, 75, 66, 62, 61, 60, 57, 56, 23, 23, 435 81, 3, 81, 81, 81, 81, 81, 81, 81, 81, 436 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 437 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 438 81, 81, 81, 81, 81 438 439 } ; 439 440 440 static yyconst flex_int16_t yy_chk[14 3] =441 static yyconst flex_int16_t yy_chk[146] = 441 442 { 0, 442 443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 443 444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 444 445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 445 1, 1, 8, 8, 9, 9, 11, 11, 15, 11,446 1 6, 16, 16, 88, 15, 87, 11, 14, 14, 14,447 14, 14, 1 7, 17, 17, 18, 26, 14, 86, 14,448 14, 31, 26, 85, 22, 22, 23, 22, 23, 31,449 18, 18, 1 8, 19, 22, 23, 24, 24, 84, 24,450 4 5, 45, 45, 60, 83, 82, 19, 81, 58, 57,451 19, 19, 19, 5 6, 53, 52, 60, 51, 60, 46,452 453 60, 41, 34, 32, 29, 28, 21, 10, 3, 80,454 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,455 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,456 8 0, 80, 80, 80, 80, 80, 80, 80, 80, 80,457 8 0, 80446 1, 1, 1, 8, 8, 9, 9, 11, 11, 15, 447 11, 16, 16, 16, 17, 89, 15, 11, 14, 14, 448 14, 14, 14, 18, 17, 17, 17, 22, 22, 14, 449 22, 14, 14, 88, 23, 87, 23, 22, 86, 18, 450 18, 18, 19, 23, 24, 24, 26, 24, 31, 46, 451 46, 46, 26, 61, 85, 84, 19, 31, 83, 82, 452 19, 19, 19, 59, 58, 57, 54, 61, 53, 61, 453 454 52, 61, 47, 42, 34, 32, 29, 28, 21, 10, 455 3, 81, 81, 81, 81, 81, 81, 81, 81, 81, 456 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 457 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 458 81, 81, 81, 81, 81 458 459 } ; 459 460 … … 504 505 #define YY_NO_UNISTD_H 505 506 #define YY_USER_ACTION yylloc->columns(yyleng); 506 #line 50 7"generated/easymesh-scanner.cpp"507 #line 508 "generated/easymesh-scanner.cpp" 507 508 508 509 #define INITIAL 0 … … 617 618 618 619 619 #line 62 0"generated/easymesh-scanner.cpp"620 #line 621 "generated/easymesh-scanner.cpp" 620 621 621 622 if ( !(yy_init) ) … … 670 671 { 671 672 yy_current_state = (int) yy_def[yy_current_state]; 672 if ( yy_current_state >= 8 1)673 if ( yy_current_state >= 82 ) 673 674 yy_c = yy_meta[(unsigned int) yy_c]; 674 675 } … … 676 677 ++yy_cp; 677 678 } 678 while ( yy_current_state != 8 0);679 while ( yy_current_state != 81 ); 679 680 yy_cp = (yy_last_accepting_cpos); 680 681 yy_current_state = (yy_last_accepting_state); … … 803 804 case 22: 804 805 YY_RULE_SETUP 805 #line 74 "easymesh/easymesh-scanner.l" 806 #line 73 "easymesh/easymesh-scanner.l" 807 { return token::T_RADIALJITTER; } 808 YY_BREAK 809 case 23: 810 YY_RULE_SETUP 811 #line 75 "easymesh/easymesh-scanner.l" 806 812 { return token::T_CSGUNION; } 807 813 YY_BREAK 808 case 2 3:809 YY_RULE_SETUP 810 #line 7 5"easymesh/easymesh-scanner.l"814 case 24: 815 YY_RULE_SETUP 816 #line 76 "easymesh/easymesh-scanner.l" 811 817 { return token::T_CSGSUBSTRACT; } 812 818 YY_BREAK 813 case 2 4:814 YY_RULE_SETUP 815 #line 7 6"easymesh/easymesh-scanner.l"819 case 25: 820 YY_RULE_SETUP 821 #line 77 "easymesh/easymesh-scanner.l" 816 822 { return token::T_CSGAND; } 817 823 YY_BREAK 818 case 2 5:819 YY_RULE_SETUP 820 #line 7 7"easymesh/easymesh-scanner.l"824 case 26: 825 YY_RULE_SETUP 826 #line 78 "easymesh/easymesh-scanner.l" 821 827 { return token::T_CSGXOR; } 822 828 YY_BREAK 823 case 2 6:824 YY_RULE_SETUP 825 #line 79"easymesh/easymesh-scanner.l"829 case 27: 830 YY_RULE_SETUP 831 #line 80 "easymesh/easymesh-scanner.l" 826 832 { return token::T_BOX; } 827 833 YY_BREAK 828 case 2 7:829 YY_RULE_SETUP 830 #line 8 0"easymesh/easymesh-scanner.l"834 case 28: 835 YY_RULE_SETUP 836 #line 81 "easymesh/easymesh-scanner.l" 831 837 { return token::T_CYLINDER; } 832 838 YY_BREAK 833 case 2 8:834 YY_RULE_SETUP 835 #line 8 1"easymesh/easymesh-scanner.l"839 case 29: 840 YY_RULE_SETUP 841 #line 82 "easymesh/easymesh-scanner.l" 836 842 { return token::T_CAPSULE; } 837 843 YY_BREAK 838 case 29:839 YY_RULE_SETUP 840 #line 8 2"easymesh/easymesh-scanner.l"844 case 30: 845 YY_RULE_SETUP 846 #line 83 "easymesh/easymesh-scanner.l" 841 847 { return token::T_COG; } 842 848 YY_BREAK 843 case 3 0:844 YY_RULE_SETUP 845 #line 8 3"easymesh/easymesh-scanner.l"849 case 31: 850 YY_RULE_SETUP 851 #line 84 "easymesh/easymesh-scanner.l" 846 852 { return token::T_DISC; } 847 853 YY_BREAK 848 case 3 1:849 YY_RULE_SETUP 850 #line 8 4"easymesh/easymesh-scanner.l"854 case 32: 855 YY_RULE_SETUP 856 #line 85 "easymesh/easymesh-scanner.l" 851 857 { return token::T_EXPANDEDSTAR; } 852 858 YY_BREAK 853 case 3 2:854 YY_RULE_SETUP 855 #line 8 5"easymesh/easymesh-scanner.l"859 case 33: 860 YY_RULE_SETUP 861 #line 86 "easymesh/easymesh-scanner.l" 856 862 { return token::T_FLATCHAMFBOX; } 857 863 YY_BREAK 858 case 3 3:859 YY_RULE_SETUP 860 #line 8 6"easymesh/easymesh-scanner.l"864 case 34: 865 YY_RULE_SETUP 866 #line 87 "easymesh/easymesh-scanner.l" 861 867 { return token::T_QUAD; } 862 868 YY_BREAK 863 case 3 4:864 YY_RULE_SETUP 865 #line 8 7"easymesh/easymesh-scanner.l"869 case 35: 870 YY_RULE_SETUP 871 #line 88 "easymesh/easymesh-scanner.l" 866 872 { return token::T_STAR; } 867 873 YY_BREAK 868 case 3 5:869 YY_RULE_SETUP 870 #line 8 8"easymesh/easymesh-scanner.l"874 case 36: 875 YY_RULE_SETUP 876 #line 89 "easymesh/easymesh-scanner.l" 871 877 { return token::T_SMOOTHCHAMFBOX; } 872 878 YY_BREAK 873 case 3 6:874 YY_RULE_SETUP 875 #line 89"easymesh/easymesh-scanner.l"879 case 37: 880 YY_RULE_SETUP 881 #line 90 "easymesh/easymesh-scanner.l" 876 882 { return token::T_SPHERE; } 877 883 YY_BREAK 878 case 3 7:879 YY_RULE_SETUP 880 #line 9 0"easymesh/easymesh-scanner.l"884 case 38: 885 YY_RULE_SETUP 886 #line 91 "easymesh/easymesh-scanner.l" 881 887 { return token::T_TRIANGLE; } 882 888 YY_BREAK 883 case 3 8:884 YY_RULE_SETUP 885 #line 9 1"easymesh/easymesh-scanner.l"889 case 39: 890 YY_RULE_SETUP 891 #line 92 "easymesh/easymesh-scanner.l" 886 892 { return token::T_TORUS; } 887 893 YY_BREAK 888 case 39:889 YY_RULE_SETUP 890 #line 9 3"easymesh/easymesh-scanner.l"894 case 40: 895 YY_RULE_SETUP 896 #line 94 "easymesh/easymesh-scanner.l" 891 897 { 892 898 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); … … 897 903 return token::COLOR; } 898 904 YY_BREAK 899 case 4 0:900 YY_RULE_SETUP 901 #line 10 0"easymesh/easymesh-scanner.l"905 case 41: 906 YY_RULE_SETUP 907 #line 101 "easymesh/easymesh-scanner.l" 902 908 { 903 909 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); … … 908 914 return token::COLOR; } 909 915 YY_BREAK 910 case 4 1:911 YY_RULE_SETUP 912 #line 10 7"easymesh/easymesh-scanner.l"916 case 42: 917 YY_RULE_SETUP 918 #line 108 "easymesh/easymesh-scanner.l" 913 919 { 914 920 yylval->u32val = 0xffu … … 916 922 return token::COLOR; } 917 923 YY_BREAK 918 case 4 2:919 YY_RULE_SETUP 920 #line 11 1"easymesh/easymesh-scanner.l"924 case 43: 925 YY_RULE_SETUP 926 #line 112 "easymesh/easymesh-scanner.l" 921 927 { 922 928 yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16); 923 929 return token::COLOR; } 924 930 YY_BREAK 925 case 4 3:926 YY_RULE_SETUP 927 #line 11 4"easymesh/easymesh-scanner.l"931 case 44: 932 YY_RULE_SETUP 933 #line 115 "easymesh/easymesh-scanner.l" 928 934 { 929 935 yylval->fval = std::atof(yytext); return token::NUMBER; } 930 936 YY_BREAK 931 case 4 4:932 YY_RULE_SETUP 933 #line 11 6"easymesh/easymesh-scanner.l"937 case 45: 938 YY_RULE_SETUP 939 #line 117 "easymesh/easymesh-scanner.l" 934 940 { return token_type('-'); } 935 941 YY_BREAK 936 case 4 5:937 YY_RULE_SETUP 938 #line 11 7"easymesh/easymesh-scanner.l"942 case 46: 943 YY_RULE_SETUP 944 #line 118 "easymesh/easymesh-scanner.l" 939 945 { return token_type('['); } 940 946 YY_BREAK 941 case 4 6:942 YY_RULE_SETUP 943 #line 11 8"easymesh/easymesh-scanner.l"947 case 47: 948 YY_RULE_SETUP 949 #line 119 "easymesh/easymesh-scanner.l" 944 950 { return token_type(']'); } 945 951 YY_BREAK 946 case 47:947 YY_RULE_SETUP948 #line 119 "easymesh/easymesh-scanner.l"949 { /* ignore this */ }950 YY_BREAK951 952 case 48: 952 /* rule 48 can match eol */953 953 YY_RULE_SETUP 954 954 #line 120 "easymesh/easymesh-scanner.l" … … 956 956 YY_BREAK 957 957 case 49: 958 /* rule 49 can match eol */ 958 959 YY_RULE_SETUP 959 960 #line 121 "easymesh/easymesh-scanner.l" 961 { /* ignore this */ } 962 YY_BREAK 963 case 50: 964 YY_RULE_SETUP 965 #line 122 "easymesh/easymesh-scanner.l" 960 966 { return token::T_ERROR; } 961 967 YY_BREAK 962 case 5 0:963 YY_RULE_SETUP 964 #line 12 3"easymesh/easymesh-scanner.l"968 case 51: 969 YY_RULE_SETUP 970 #line 124 "easymesh/easymesh-scanner.l" 965 971 ECHO; 966 972 YY_BREAK 967 #line 9 68"generated/easymesh-scanner.cpp"973 #line 974 "generated/easymesh-scanner.cpp" 968 974 case YY_STATE_EOF(INITIAL): 969 975 yyterminate(); … … 1347 1353 { 1348 1354 yy_current_state = (int) yy_def[yy_current_state]; 1349 if ( yy_current_state >= 8 1)1355 if ( yy_current_state >= 82 ) 1350 1356 yy_c = yy_meta[(unsigned int) yy_c]; 1351 1357 } … … 1375 1381 { 1376 1382 yy_current_state = (int) yy_def[yy_current_state]; 1377 if ( yy_current_state >= 8 1)1383 if ( yy_current_state >= 82 ) 1378 1384 yy_c = yy_meta[(unsigned int) yy_c]; 1379 1385 } 1380 1386 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1381 yy_is_jam = (yy_current_state == 8 0);1387 yy_is_jam = (yy_current_state == 81); 1382 1388 1383 1389 return yy_is_jam ? 0 : yy_current_state; … … 1866 1872 #define YYTABLES_NAME "yytables" 1867 1873 1868 #line 12 3"easymesh/easymesh-scanner.l"1874 #line 124 "easymesh/easymesh-scanner.l" 1869 1875 1870 1876 -
trunk/src/generated/location.hh
r2216 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Locations for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify -
trunk/src/generated/lolfx-parser.cpp
r2216 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 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 310of lalr1.cc */38 /* Line 293 of lalr1.cc */ 39 39 #line 1 "gpu/lolfx-parser.y" 40 40 … … 59 59 60 60 61 /* Line 310of lalr1.cc */61 /* Line 293 of lalr1.cc */ 62 62 #line 63 "generated/lolfx-parser.cpp" 63 63 … … 67 67 /* User implementation prologue. */ 68 68 69 /* Line 316of lalr1.cc */69 /* Line 299 of lalr1.cc */ 70 70 #line 241 "gpu/lolfx-parser.y" 71 71 … … 76 76 77 77 78 /* Line 316of lalr1.cc */78 /* Line 299 of lalr1.cc */ 79 79 #line 80 "generated/lolfx-parser.cpp" 80 80 … … 91 91 #endif 92 92 93 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 94 If N is 0, then set CURRENT to the empty location which ends 95 the previous symbol: RHS[0] (always defined). */ 96 97 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 98 #ifndef YYLLOC_DEFAULT 99 # 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 112 93 113 /* Suppress unused-variable warnings by "using" E. */ 94 114 #define YYUSE(e) ((void) (e)) … … 142 162 namespace lol { 143 163 144 /* Line 379 of lalr1.cc */ 145 #line 146 "generated/lolfx-parser.cpp" 146 #if YYERROR_VERBOSE 164 /* Line 382 of lalr1.cc */ 165 #line 166 "generated/lolfx-parser.cpp" 147 166 148 167 /* Return YYSTR after stripping away unnecessary quotes and … … 183 202 } 184 203 185 #endif186 204 187 205 /// Build a parser object. … … 284 302 #endif 285 303 304 inline bool 305 LolFxParser::yy_pact_value_is_default_ (int yyvalue) 306 { 307 return yyvalue == yypact_ninf_; 308 } 309 310 inline bool 311 LolFxParser::yy_table_value_is_error_ (int yyvalue) 312 { 313 return yyvalue == yytable_ninf_; 314 } 315 286 316 int 287 317 LolFxParser::parse () … … 305 335 location_type yylloc; 306 336 /// The locations where the error started and ended. 307 location_type yyerror_range[ 2];337 location_type yyerror_range[3]; 308 338 309 339 /// $$. … … 343 373 /* Try to take a decision without lookahead. */ 344 374 yyn = yypact_[yystate]; 345 if (yy n == yypact_ninf_)375 if (yy_pact_value_is_default_ (yyn)) 346 376 goto yydefault; 347 377 … … 376 406 if (yyn <= 0) 377 407 { 378 if (yy n == 0 || yyn == yytable_ninf_)379 goto yyerrlab;408 if (yy_table_value_is_error_ (yyn)) 409 goto yyerrlab; 380 410 yyn = -yyn; 381 411 goto yyreduce; … … 433 463 case 202: 434 464 435 /* Line 6 77of lalr1.cc */465 /* Line 690 of lalr1.cc */ 436 466 #line 728 "gpu/lolfx-parser.y" 437 467 { std::cout << "New tech " << std::endl; } … … 440 470 case 203: 441 471 442 /* Line 6 77of lalr1.cc */472 /* Line 690 of lalr1.cc */ 443 473 #line 736 "gpu/lolfx-parser.y" 444 474 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } … … 447 477 case 204: 448 478 449 /* Line 6 77of lalr1.cc */479 /* Line 690 of lalr1.cc */ 450 480 #line 737 "gpu/lolfx-parser.y" 451 481 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } … … 454 484 case 207: 455 485 456 /* Line 6 77of lalr1.cc */486 /* Line 690 of lalr1.cc */ 457 487 #line 750 "gpu/lolfx-parser.y" 458 488 { std::cout << "New pass " << std::endl; } … … 461 491 case 226: 462 492 463 /* Line 6 77of lalr1.cc */493 /* Line 690 of lalr1.cc */ 464 494 #line 786 "gpu/lolfx-parser.y" 465 495 { std::cout << "new shader" << std::endl; } … … 468 498 469 499 470 /* Line 6 77of lalr1.cc */471 #line 472 "generated/lolfx-parser.cpp"500 /* Line 690 of lalr1.cc */ 501 #line 502 "generated/lolfx-parser.cpp" 472 502 default: 473 503 break; 474 504 } 505 /* User semantic actions sometimes alter yychar, and that requires 506 that yytoken be updated with the new translation. We take the 507 approach of translating immediately before every use of yytoken. 508 One alternative is translating here after every semantic action, 509 but that translation would be missed if the semantic action 510 invokes YYABORT, YYACCEPT, or YYERROR immediately after altering 511 yychar. In the case of YYABORT or YYACCEPT, an incorrect 512 destructor might then be invoked immediately. In the case of 513 YYERROR, subsequent parser actions might lead to an incorrect 514 destructor call or verbose syntax error message before the 515 lookahead is translated. */ 475 516 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 476 517 … … 496 537 `------------------------------------*/ 497 538 yyerrlab: 539 /* Make sure we have latest lookahead translation. See comments at 540 user semantic actions for why this is necessary. */ 541 yytoken = yytranslate_ (yychar); 542 498 543 /* If not already recovering from an error, report this error. */ 499 544 if (!yyerrstatus_) 500 545 { 501 546 ++yynerrs_; 547 if (yychar == yyempty_) 548 yytoken = yyempty_; 502 549 error (yylloc, yysyntax_error_ (yystate, yytoken)); 503 550 } 504 551 505 yyerror_range[ 0] = yylloc;552 yyerror_range[1] = yylloc; 506 553 if (yyerrstatus_ == 3) 507 554 { … … 538 585 goto yyerrorlab; 539 586 540 yyerror_range[ 0] = yylocation_stack_[yylen - 1];587 yyerror_range[1] = yylocation_stack_[yylen - 1]; 541 588 /* Do not reclaim the symbols of the rule which action triggered 542 589 this YYERROR. */ … … 555 602 { 556 603 yyn = yypact_[yystate]; 557 if ( yyn != yypact_ninf_)604 if (!yy_pact_value_is_default_ (yyn)) 558 605 { 559 606 yyn += yyterror_; … … 570 617 YYABORT; 571 618 572 yyerror_range[ 0] = yylocation_stack_[0];619 yyerror_range[1] = yylocation_stack_[0]; 573 620 yydestruct_ ("Error: popping", 574 621 yystos_[yystate], … … 579 626 } 580 627 581 yyerror_range[ 1] = yylloc;628 yyerror_range[2] = yylloc; 582 629 // Using YYLLOC is tempting, but would change the location of 583 630 // the lookahead. YYLOC is available though. 584 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);631 YYLLOC_DEFAULT (yyloc, yyerror_range, 2); 585 632 yysemantic_stack_.push (yylval); 586 633 yylocation_stack_.push (yyloc); … … 605 652 yyreturn: 606 653 if (yychar != yyempty_) 607 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 654 { 655 /* Make sure we have latest lookahead translation. See comments 656 at user semantic actions for why this is necessary. */ 657 yytoken = yytranslate_ (yychar); 658 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, 659 &yylloc); 660 } 608 661 609 662 /* Do not reclaim the symbols of the rule which action triggered … … 624 677 // Generate an error message. 625 678 std::string 626 LolFxParser::yysyntax_error_ (int yystate, int tok)679 LolFxParser::yysyntax_error_ (int yystate, int yytoken) 627 680 { 628 std::string res; 629 YYUSE (yystate); 630 #if YYERROR_VERBOSE 631 int yyn = yypact_[yystate]; 632 if (yypact_ninf_ < yyn && yyn <= yylast_) 681 std::string yyres; 682 // Number of reported tokens (one for the "unexpected", one per 683 // "expected"). 684 size_t yycount = 0; 685 // Its maximum. 686 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 687 // Arguments of yyformat. 688 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 689 690 /* There are many possibilities here to consider: 691 - If this state is a consistent state with a default action, then 692 the only way this function was invoked is if the default action 693 is an error action. In that case, don't check for expected 694 tokens because there are none. 695 - The only way there can be no lookahead present (in yytoken) is 696 if this state is a consistent state with a default action. 697 Thus, detecting the absence of a lookahead is sufficient to 698 determine that there is no unexpected or expected token to 699 report. In that case, just report a simple "syntax error". 700 - Don't assume there isn't a lookahead just because this state is 701 a consistent state with a default action. There might have 702 been a previous inconsistent state, consistent state with a 703 non-default action, or user semantic action that manipulated 704 yychar. 705 - Of course, the expected token list depends on states to have 706 correct lookahead information, and it depends on the parser not 707 to perform extra reductions after fetching a lookahead from the 708 scanner and before detecting a syntax error. Thus, state 709 merging (from LALR or IELR) and default reductions corrupt the 710 expected token list. However, the list is correct for 711 canonical LR with one exception: it will still contain any 712 token that will not be accepted due to an error action in a 713 later state. 714 */ 715 if (yytoken != yyempty_) 633 716 { 634 /* Start YYX at -YYN if negative to avoid negative indexes in 635 YYCHECK. */ 636 int yyxbegin = yyn < 0 ? -yyn : 0; 637 638 /* Stay within bounds of both yycheck and yytname. */ 639 int yychecklim = yylast_ - yyn + 1; 640 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 641 int count = 0; 642 for (int x = yyxbegin; x < yyxend; ++x) 643 if (yycheck_[x + yyn] == x && x != yyterror_) 644 ++count; 645 646 // FIXME: This method of building the message is not compatible 647 // with internationalization. It should work like yacc.c does it. 648 // That is, first build a string that looks like this: 649 // "syntax error, unexpected %s or %s or %s" 650 // Then, invoke YY_ on this string. 651 // Finally, use the string as a format to output 652 // yytname_[tok], etc. 653 // Until this gets fixed, this message appears in English only. 654 res = "syntax error, unexpected "; 655 res += yytnamerr_ (yytname_[tok]); 656 if (count < 5) 657 { 658 count = 0; 659 for (int x = yyxbegin; x < yyxend; ++x) 660 if (yycheck_[x + yyn] == x && x != yyterror_) 661 { 662 res += (!count++) ? ", expecting " : " or "; 663 res += yytnamerr_ (yytname_[x]); 664 } 665 } 717 yyarg[yycount++] = yytname_[yytoken]; 718 int yyn = yypact_[yystate]; 719 if (!yy_pact_value_is_default_ (yyn)) 720 { 721 /* Start YYX at -YYN if negative to avoid negative indexes in 722 YYCHECK. In other words, skip the first -YYN actions for 723 this state because they are default actions. */ 724 int yyxbegin = yyn < 0 ? -yyn : 0; 725 /* Stay within bounds of both yycheck and yytname. */ 726 int yychecklim = yylast_ - yyn + 1; 727 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 728 for (int yyx = yyxbegin; yyx < yyxend; ++yyx) 729 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ 730 && !yy_table_value_is_error_ (yytable_[yyx + yyn])) 731 { 732 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 733 { 734 yycount = 1; 735 break; 736 } 737 else 738 yyarg[yycount++] = yytname_[yyx]; 739 } 740 } 666 741 } 667 else 668 #endif 669 res = YY_("syntax error"); 670 return res; 742 743 char const* yyformat = 0; 744 switch (yycount) 745 { 746 #define YYCASE_(N, S) \ 747 case N: \ 748 yyformat = S; \ 749 break 750 YYCASE_(0, YY_("syntax error")); 751 YYCASE_(1, YY_("syntax error, unexpected %s")); 752 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 753 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 754 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 755 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 756 #undef YYCASE_ 757 } 758 759 // Argument number. 760 size_t yyi = 0; 761 for (char const* yyp = yyformat; *yyp; ++yyp) 762 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) 763 { 764 yyres += yytnamerr_ (yyarg[yyi++]); 765 ++yyp; 766 } 767 else 768 yyres += *yyp; 769 return yyres; 671 770 } 672 771 … … 747 846 }; 748 847 749 /* YYDEFACT[S] -- default r ule to reduce with in state S when YYTABLE750 doesn't specify something else to do. Zero means the default is an751 error. */848 /* YYDEFACT[S] -- default reduction number in state S. Performed when 849 YYTABLE doesn't specify something else to do. Zero means the 850 default is an error. */ 752 851 const unsigned short int 753 852 LolFxParser::yydefact_[] = … … 856 955 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 857 956 positive, shift that token. If negative, reduce the rule which 858 number is the opposite. If zero, do what YYDEFACT says. */957 number is the opposite. If YYTABLE_NINF_, syntax error. */ 859 958 const short int LolFxParser::yytable_ninf_ = -323; 860 959 const short int … … 3792 3891 } // lol 3793 3892 3794 /* Line 1 053of lalr1.cc */3795 #line 3 796"generated/lolfx-parser.cpp"3796 3797 3798 /* Line 1 055of lalr1.cc */3893 /* Line 1136 of lalr1.cc */ 3894 #line 3895 "generated/lolfx-parser.cpp" 3895 3896 3897 /* Line 1138 of lalr1.cc */ 3799 3898 #line 1298 "gpu/lolfx-parser.y" 3800 3899 -
trunk/src/generated/lolfx-parser.h
r2216 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 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 lol {46 47 /* Line 34 of lalr1.cc */48 #line 49 "generated/lolfx-parser.h"49 class position;50 class location;51 52 } // lol53 54 /* Line 34 of lalr1.cc */55 #line 56 "generated/lolfx-parser.h"56 57 43 #include "location.hh" 58 44 … … 75 61 #endif 76 62 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 ends79 the previous symbol: RHS[0] (always defined). */80 81 #ifndef YYLLOC_DEFAULT82 # 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 #endif95 96 63 97 64 namespace lol { 98 65 99 /* Line 3 4of lalr1.cc */100 #line 101"generated/lolfx-parser.h"66 /* Line 35 of lalr1.cc */ 67 #line 68 "generated/lolfx-parser.h" 101 68 102 69 /// A Bison parser. … … 109 76 { 110 77 111 /* Line 3 4of lalr1.cc */78 /* Line 35 of lalr1.cc */ 112 79 #line 34 "gpu/lolfx-parser.y" 113 80 … … 119 86 120 87 121 /* Line 3 4of lalr1.cc */122 #line 123"generated/lolfx-parser.h"88 /* Line 35 of lalr1.cc */ 89 #line 90 "generated/lolfx-parser.h" 123 90 }; 124 91 #else … … 641 608 location_stack_type yylocation_stack_; 642 609 610 /// Whether the given \c yypact_ value indicates a defaulted state. 611 /// \param yyvalue the value to check 612 static bool yy_pact_value_is_default_ (int yyvalue); 613 614 /// Whether the given \c yytable_ value indicates a syntax error. 615 /// \param yyvalue the value to check 616 static bool yy_table_value_is_error_ (int yyvalue); 617 643 618 /// Internal symbol numbers. 644 619 typedef unsigned short int token_number_type; … … 648 623 static const short int yypact_ninf_; 649 624 650 /// For a state, default r ule to reduce.625 /// For a state, default reduction number. 651 626 /// Unless\a yytable_ specifies something else to do. 652 627 /// Zero means the default is an error. … … 679 654 #endif 680 655 681 #if YYERROR_VERBOSE682 656 /// Convert the symbol name \a n to a form suitable for a diagnostic. 683 virtual std::string yytnamerr_ (const char *n); 684 #endif 657 static std::string yytnamerr_ (const char *n); 685 658 686 659 #if YYDEBUG … … 740 713 } // lol 741 714 742 /* Line 3 4of lalr1.cc */743 #line 7 44"generated/lolfx-parser.h"715 /* Line 35 of lalr1.cc */ 716 #line 717 "generated/lolfx-parser.h" 744 717 745 718 -
trunk/src/generated/position.hh
r2216 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Positions for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify -
trunk/src/generated/stack.hh
r2216 r2318 1 /* A Bison parser, made by GNU Bison 2. 4.2. */1 /* A Bison parser, made by GNU Bison 2.5. */ 2 2 3 3 /* Stack handling for Bison parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 39 39 namespace lol { 40 40 41 /* Line 1 066of lalr1.cc */41 /* Line 1149 of lalr1.cc */ 42 42 #line 43 "generated/stack.hh" 43 43 template <class T, class S = std::deque<T> > … … 129 129 } // lol 130 130 131 /* Line 1 152of lalr1.cc */131 /* Line 1235 of lalr1.cc */ 132 132 #line 133 "generated/stack.hh" 133 133 -
trunk/src/lol/math/vector.h
r2317 r2318 20 20 #include <ostream> 21 21 22 #include "lol/math/math.h"23 #include "lol/math/half.h"24 #include "lol/math/real.h"22 #include <lol/math/math.h> 23 #include <lol/math/half.h> 24 #include <lol/math/real.h> 25 25 26 26 namespace lol … … 1371 1371 LOL_ALL_VECTOR_OPS_AND_FUNS(double) 1372 1372 LOL_ALL_VECTOR_OPS_AND_FUNS(ldouble) 1373 LOL_ALL_VECTOR_OPS_AND_FUNS(real) 1374 1373 1375 LOL_ALL_VECTOR_OPS_AND_FUNS(int8_t) 1374 1376 LOL_ALL_VECTOR_OPS_AND_FUNS(uint8_t) … … 1379 1381 LOL_ALL_VECTOR_OPS_AND_FUNS(int64_t) 1380 1382 LOL_ALL_VECTOR_OPS_AND_FUNS(uint64_t) 1381 1382 /* FIXME: vectors of "real" are deactivated for now, because we do1383 * not implement all combinations of operators for these types yet. */1384 LOL_ALL_VECTOR_OPS_AND_FUNS(real)1385 1383 1386 1384 #if defined _MSC_VER -
trunk/tools/neercs/video/render.cpp
r2277 r2318 1547 1547 shader_blur_h->Bind(); 1548 1548 shader_blur_h->SetUniform(shader_blur_h_texture, fbo_back->GetTexture(), 0); 1549 shader_blur_h->SetUniform(shader_blur_h_radius, glow_large / screen_size.x);1549 shader_blur_h->SetUniform(shader_blur_h_radius, glow_large / (float)screen_size.x); 1550 1550 TraceQuad(); 1551 1551 shader_blur_h->Unbind(); … … 1555 1555 shader_blur_v->Bind(); 1556 1556 shader_blur_v->SetUniform(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 1557 shader_blur_v->SetUniform(shader_blur_v_radius, glow_large / screen_size.y);1557 shader_blur_v->SetUniform(shader_blur_v_radius, glow_large / (float)screen_size.y); 1558 1558 TraceQuad(); 1559 1559 shader_blur_v->Unbind(); … … 1563 1563 shader_blur_h->Bind(); 1564 1564 shader_blur_h->SetUniform(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0); 1565 shader_blur_h->SetUniform(shader_blur_h_radius, glow_small / screen_size.x);1565 shader_blur_h->SetUniform(shader_blur_h_radius, glow_small / (float)screen_size.x); 1566 1566 TraceQuad(); 1567 1567 shader_blur_h->Unbind(); … … 1571 1571 shader_blur_v->Bind(); 1572 1572 shader_blur_v->SetUniform(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0); 1573 shader_blur_v->SetUniform(shader_blur_v_radius, glow_small / screen_size.y);1573 shader_blur_v->SetUniform(shader_blur_v_radius, glow_small / (float)screen_size.y); 1574 1574 TraceQuad(); 1575 1575 shader_blur_v->Unbind(); … … 1638 1638 shader_blur_h->Bind(); 1639 1639 shader_blur_h->SetUniform(shader_blur_h_texture, fbo_screen->GetTexture(), 0); 1640 shader_blur_h->SetUniform(shader_blur_h_radius, blur / screen_size.x);1640 shader_blur_h->SetUniform(shader_blur_h_radius, blur / (float)screen_size.x); 1641 1641 TraceQuad(); 1642 1642 shader_blur_h->Unbind(); … … 1646 1646 shader_blur_v->Bind(); 1647 1647 shader_blur_v->SetUniform(shader_blur_v_texture, fbo_tmp->GetTexture(), 0); 1648 shader_blur_v->SetUniform(shader_blur_v_radius, blur / screen_size.y);1648 shader_blur_v->SetUniform(shader_blur_v_radius, blur / (float)screen_size.y); 1649 1649 TraceQuad(); 1650 1650 shader_blur_v->Unbind(); … … 1659 1659 shader_postfx->SetUniform(shader_postfx_texture, fbo_screen->GetTexture(), 0); 1660 1660 shader_postfx->SetUniform(shader_postfx_screen_size, (vec2)screen_size); 1661 shader_postfx->SetUniform(shader_postfx_ratio_2d, (vec2)ratio_2d / 2);1661 shader_postfx->SetUniform(shader_postfx_ratio_2d, (vec2)ratio_2d * 0.5f); 1662 1662 shader_postfx->SetUniform(shader_postfx_time, fx_angle); 1663 1663 shader_postfx->SetUniform(shader_postfx_deform, postfx_deform); 1664 shader_postfx->SetUniform(shader_postfx_ghost1, vec4(postfx_ghost1.xyz * 0.01 , postfx_ghost1.w));1665 shader_postfx->SetUniform(shader_postfx_ghost2, vec4(postfx_ghost2.xyz * 0.01 , postfx_ghost2.w));1666 shader_postfx->SetUniform(shader_postfx_glass, vec4(postfx_glass.xy * 0.01 , postfx_glass.z * 0.1, postfx_glass.w));1664 shader_postfx->SetUniform(shader_postfx_ghost1, vec4(postfx_ghost1.xyz * 0.01f, postfx_ghost1.w)); 1665 shader_postfx->SetUniform(shader_postfx_ghost2, vec4(postfx_ghost2.xyz * 0.01f, postfx_ghost2.w)); 1666 shader_postfx->SetUniform(shader_postfx_glass, vec4(postfx_glass.xy * 0.01f, postfx_glass.z * 0.1f, postfx_glass.w)); 1667 1667 shader_postfx->SetUniform(shader_postfx_gradient, postfx_gradient); 1668 1668 shader_postfx->SetUniform(shader_postfx_gradient_color, postfx_gradient_color); 1669 1669 shader_postfx->SetUniform(shader_postfx_vignetting, postfx_vignetting); 1670 1670 shader_postfx->SetUniform(shader_postfx_aberration, postfx_aberration); 1671 shader_postfx->SetUniform(shader_postfx_moire_h, vec4(postfx_moire_h.xyz, postfx_moire_h.w * 2 * M_PI));1672 shader_postfx->SetUniform(shader_postfx_moire_v, vec4(postfx_moire_v.xyz, postfx_moire_v.w * 2 * M_PI));1673 shader_postfx->SetUniform(shader_postfx_scanline_h, vec4(postfx_scanline_h.xyz, postfx_scanline_h.w * 2 * M_PI));1674 shader_postfx->SetUniform(shader_postfx_scanline_v, vec4(postfx_scanline_v.xyz, postfx_scanline_v.w * 2 * M_PI));1671 shader_postfx->SetUniform(shader_postfx_moire_h, vec4(postfx_moire_h.xyz, postfx_moire_h.w * (float)(2 * M_PI))); 1672 shader_postfx->SetUniform(shader_postfx_moire_v, vec4(postfx_moire_v.xyz, postfx_moire_v.w * (float)(2 * M_PI))); 1673 shader_postfx->SetUniform(shader_postfx_scanline_h, vec4(postfx_scanline_h.xyz, postfx_scanline_h.w * (float)(2 * M_PI))); 1674 shader_postfx->SetUniform(shader_postfx_scanline_v, vec4(postfx_scanline_v.xyz, postfx_scanline_v.w * (float)(2 * M_PI))); 1675 1675 shader_postfx->SetUniform(shader_postfx_corner, postfx_corner); 1676 1676 shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(sync_value * cosf((main_angle - sync_angle) * 6.0f))); -
trunk/tools/neercs/video/text-render.cpp
r2317 r2318 116 116 mat4 xform = mat4::translate(-1.f, -1.f + 2.0f * m_font_size.y 117 117 * m_canvas_size.y / m_fbo_size.y, 0.f) 118 * mat4::scale(vec3( 2.f * m_font_size /m_fbo_size, 1.f)119 * vec3( 1.f, -1.f, 1.f))118 * mat4::scale(vec3((vec2)m_font_size / (vec2)m_fbo_size, 1.f) 119 * vec3(2.f, -2.f, 1.f)) 120 120 * mat4::translate(0.5f, 0.5f, 0.f); 121 121 -
trunk/tools/neercs/video/text-render.h
r2155 r2318 6 6 #define __TEXT_RENDER_H__ 7 7 8 structTextRender8 class TextRender 9 9 { 10 public: 10 11 TextRender(caca_canvas_t *caca, ivec2 font_size); 11 12 void Init();
Note: See TracChangeset
for help on using the changeset viewer.