From ea517c2926f339deaa7960baa80ba0b28fac55ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Mon, 26 Nov 2012 10:54:01 +0000 Subject: [PATCH] Added tsw (ToggleScaleWinding) command in EasyMesh Parser to make old-school celShading contour. --- src/easymesh/easymesh-parser.y | 3 +- src/easymesh/easymesh-scanner.l | 1 + src/easymesh/easymesh.cpp | 9 +- src/easymesh/easymesh.h | 2 + src/generated/easymesh-parser.cpp | 638 ++++++++++++----------------- src/generated/easymesh-parser.h | 100 +++-- src/generated/easymesh-scanner.cpp | 216 +++++----- src/generated/location.hh | 4 +- src/generated/lolfx-parser.cpp | 253 ++++-------- src/generated/lolfx-parser.h | 65 ++- src/generated/position.hh | 4 +- src/generated/stack.hh | 8 +- test/PhysicObject.h | 12 +- 13 files changed, 599 insertions(+), 716 deletions(-) diff --git a/src/easymesh/easymesh-parser.y b/src/easymesh/easymesh-parser.y index 8aad8ada..31362e65 100644 --- a/src/easymesh/easymesh-parser.y +++ b/src/easymesh/easymesh-parser.y @@ -47,7 +47,7 @@ %token T_TRANSLATEX T_ROTATEX T_TAPERX T_SCALEX T_MIRRORX %token T_TRANSLATEY T_ROTATEY T_TAPERY T_SCALEY T_MIRRORY %token T_TRANSLATEZ T_ROTATEZ T_TAPERZ T_SCALEZ T_MIRRORZ -%token T_TRANSLATE T_SCALE +%token T_TRANSLATE T_SCALE T_TOGGLESCALEWINDING %token T_CHAMFER %token T_CYLINDER T_BOX T_SMOOTHCHAMFBOX T_FLATCHAMFBOX T_SPHERE T_CAPSULE @@ -134,6 +134,7 @@ transform_command: | T_MIRRORX { mc.m_mesh.MirrorX(); } | T_MIRRORY { mc.m_mesh.MirrorY(); } | T_MIRRORZ { mc.m_mesh.MirrorZ(); } + | T_TOGGLESCALEWINDING { mc.m_mesh.ToggleScaleWinding(); } ; primitive_command: diff --git a/src/easymesh/easymesh-scanner.l b/src/easymesh/easymesh-scanner.l index 31129f07..1075e50d 100644 --- a/src/easymesh/easymesh-scanner.l +++ b/src/easymesh/easymesh-scanner.l @@ -66,6 +66,7 @@ sx { return token::T_SCALEX; } sy { return token::T_SCALEY; } sz { return token::T_SCALEZ; } s { return token::T_SCALE; } +tsw { return token::T_TOGGLESCALEWINDING; } mx { return token::T_MIRRORX; } my { return token::T_MIRRORY; } mz { return token::T_MIRRORZ; } diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index faea6fef..59194157 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -41,7 +41,7 @@ namespace lol { EasyMesh::EasyMesh() - : m_color(0), m_color2(0) + : m_color(0), m_color2(0), m_ignore_winding_on_scale(0) { m_cursors.Push(0, 0); } @@ -130,6 +130,11 @@ void EasyMesh::Render(mat4 const &model, float damage) m_gpu.vdecl->Unbind(); } +void EasyMesh::ToggleScaleWinding() +{ + m_ignore_winding_on_scale = !m_ignore_winding_on_scale; +} + void EasyMesh::SetCurColor(vec4 const &color) { m_color = color; @@ -320,7 +325,7 @@ void EasyMesh::Scale(vec3 const &s) } /* Flip winding if the scaling involves mirroring */ - if (s.x * s.y * s.z < 0) + if (!m_ignore_winding_on_scale && s.x * s.y * s.z < 0) { for (int i = m_cursors.Last().m2; i < m_indices.Count(); i += 3) { diff --git a/src/easymesh/easymesh.h b/src/easymesh/easymesh.h index 348eac00..f1768d8c 100644 --- a/src/easymesh/easymesh.h +++ b/src/easymesh/easymesh.h @@ -35,6 +35,7 @@ public: void OpenBrace(); void CloseBrace(); + void ToggleScaleWinding(); void SetCurColor(vec4 const &color); void SetCurColor2(vec4 const &color); @@ -93,6 +94,7 @@ private: Array m_indices; Array m_vert; Array m_cursors; + bool m_ignore_winding_on_scale; /* FIXME: put this in a separate class so that we can copy meshes. */ struct diff --git a/src/generated/easymesh-parser.cpp b/src/generated/easymesh-parser.cpp index 6dc23149..0480b4b4 100644 --- a/src/generated/easymesh-parser.cpp +++ b/src/generated/easymesh-parser.cpp @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton implementation for Bison LALR(1) parsers in C++ - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ /* First part of user declarations. */ -/* Line 293 of lalr1.cc */ +/* Line 310 of lalr1.cc */ #line 1 "easymesh/easymesh-parser.y" // @@ -61,7 +61,7 @@ -/* Line 293 of lalr1.cc */ +/* Line 310 of lalr1.cc */ #line 66 "generated/easymesh-parser.cpp" @@ -69,7 +69,7 @@ /* User implementation prologue. */ -/* Line 299 of lalr1.cc */ +/* Line 316 of lalr1.cc */ #line 65 "easymesh/easymesh-parser.y" #include "easymesh/easymesh-compiler.h" @@ -78,7 +78,7 @@ #define yylex mc.m_lexer->lex -/* Line 299 of lalr1.cc */ +/* Line 316 of lalr1.cc */ #line 83 "generated/easymesh-parser.cpp" #ifndef YY_ @@ -93,26 +93,6 @@ # endif #endif -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (false) -#endif - /* Suppress unused-variable warnings by "using" E. */ #define YYUSE(e) ((void) (e)) @@ -164,8 +144,9 @@ do { \ namespace lol { -/* Line 382 of lalr1.cc */ -#line 169 "generated/easymesh-parser.cpp" +/* Line 379 of lalr1.cc */ +#line 149 "generated/easymesh-parser.cpp" +#if YYERROR_VERBOSE /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -204,6 +185,7 @@ namespace lol { return yystr; } +#endif /// Build a parser object. EasyMeshParser::EasyMeshParser (class EasyMeshCompiler& mc_yyarg) @@ -304,18 +286,6 @@ namespace lol { } #endif - inline bool - EasyMeshParser::yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - inline bool - EasyMeshParser::yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - int EasyMeshParser::parse () { @@ -337,7 +307,7 @@ namespace lol { /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. - location_type yyerror_range[3]; + location_type yyerror_range[2]; /// $$. semantic_type yyval; @@ -375,7 +345,7 @@ namespace lol { /* Try to take a decision without lookahead. */ yyn = yypact_[yystate]; - if (yy_pact_value_is_default_ (yyn)) + if (yyn == yypact_ninf_) goto yydefault; /* Read a lookahead token. */ @@ -408,8 +378,8 @@ namespace lol { yyn = yytable_[yyn]; if (yyn <= 0) { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == yytable_ninf_) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -465,28 +435,28 @@ namespace lol { { case 7: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 89 "easymesh/easymesh-parser.y" { mc.m_mesh.OpenBrace(); } break; case 8: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 93 "easymesh/easymesh-parser.y" { mc.m_mesh.CloseBrace(); } break; case 14: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 108 "easymesh/easymesh-parser.y" { 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)); } break; case 15: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 109 "easymesh/easymesh-parser.y" { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); @@ -495,14 +465,14 @@ namespace lol { case 16: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 112 "easymesh/easymesh-parser.y" { 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)); } break; case 17: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 113 "easymesh/easymesh-parser.y" { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); @@ -511,317 +481,313 @@ namespace lol { case 18: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 119 "easymesh/easymesh-parser.y" { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); } break; case 19: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 120 "easymesh/easymesh-parser.y" { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } break; case 20: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 121 "easymesh/easymesh-parser.y" { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } break; case 21: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 122 "easymesh/easymesh-parser.y" { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } break; case 22: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 123 "easymesh/easymesh-parser.y" { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } break; case 23: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 124 "easymesh/easymesh-parser.y" { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); } break; case 24: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 125 "easymesh/easymesh-parser.y" { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); } break; case 25: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 126 "easymesh/easymesh-parser.y" { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); } break; case 26: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 127 "easymesh/easymesh-parser.y" { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } break; case 27: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 128 "easymesh/easymesh-parser.y" { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } break; case 28: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 129 "easymesh/easymesh-parser.y" { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } break; case 29: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 130 "easymesh/easymesh-parser.y" { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); } break; case 30: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 131 "easymesh/easymesh-parser.y" { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); } break; case 31: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 132 "easymesh/easymesh-parser.y" { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); } break; case 32: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 133 "easymesh/easymesh-parser.y" { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } break; case 33: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 134 "easymesh/easymesh-parser.y" { mc.m_mesh.MirrorX(); } break; case 34: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 135 "easymesh/easymesh-parser.y" { mc.m_mesh.MirrorY(); } break; case 35: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 136 "easymesh/easymesh-parser.y" { mc.m_mesh.MirrorZ(); } break; case 36: -/* Line 690 of lalr1.cc */ -#line 140 "easymesh/easymesh-parser.y" +/* Line 677 of lalr1.cc */ +#line 137 "easymesh/easymesh-parser.y" + { mc.m_mesh.ToggleScaleWinding(); } + break; + + case 37: + +/* Line 677 of lalr1.cc */ +#line 141 "easymesh/easymesh-parser.y" { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4, (int)(yysemantic_stack_[(2) - (2)].args).f5); } break; - case 37: + case 38: -/* Line 690 of lalr1.cc */ -#line 143 "easymesh/easymesh-parser.y" +/* Line 677 of lalr1.cc */ +#line 144 "easymesh/easymesh-parser.y" { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } break; - case 38: + case 39: -/* Line 690 of lalr1.cc */ -#line 144 "easymesh/easymesh-parser.y" +/* Line 677 of lalr1.cc */ +#line 145 "easymesh/easymesh-parser.y" { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } break; - case 39: + case 40: -/* Line 690 of lalr1.cc */ -#line 146 "easymesh/easymesh-parser.y" +/* Line 677 of lalr1.cc */ +#line 147 "easymesh/easymesh-parser.y" { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } break; - case 40: + case 41: -/* Line 690 of lalr1.cc */ -#line 148 "easymesh/easymesh-parser.y" +/* Line 677 of lalr1.cc */ +#line 149 "easymesh/easymesh-parser.y" { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); } break; - case 41: - -/* Line 690 of lalr1.cc */ -#line 150 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } - break; - case 42: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 151 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } + { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } break; case 43: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 152 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, - (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } + { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } break; case 44: -/* Line 690 of lalr1.cc */ -#line 154 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, - (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } +/* Line 677 of lalr1.cc */ +#line 153 "easymesh/easymesh-parser.y" + { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, + (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } break; case 45: -/* Line 690 of lalr1.cc */ -#line 156 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } +/* Line 677 of lalr1.cc */ +#line 155 "easymesh/easymesh-parser.y" + { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, + (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } break; case 46: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 157 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } + { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } break; case 47: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 158 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } + { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } break; case 48: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 159 "easymesh/easymesh-parser.y" - { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, - (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6, (int)(yysemantic_stack_[(2) - (2)].args).f7); } + { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } break; case 49: -/* Line 690 of lalr1.cc */ -#line 163 "easymesh/easymesh-parser.y" - { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } +/* Line 677 of lalr1.cc */ +#line 160 "easymesh/easymesh-parser.y" + { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, + (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6, (int)(yysemantic_stack_[(2) - (2)].args).f7); } break; case 50: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 164 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } break; case 51: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 165 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } break; case 52: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 166 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } break; case 53: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 167 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } break; case 54: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 168 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } break; case 55: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 169 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } break; case 56: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 170 "easymesh/easymesh-parser.y" - { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } break; case 57: -/* Line 690 of lalr1.cc */ -#line 173 "easymesh/easymesh-parser.y" - { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } +/* Line 677 of lalr1.cc */ +#line 171 "easymesh/easymesh-parser.y" + { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } break; case 58: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 174 "easymesh/easymesh-parser.y" + { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } + break; + + case 59: + +/* Line 677 of lalr1.cc */ +#line 175 "easymesh/easymesh-parser.y" { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } break; -/* Line 690 of lalr1.cc */ -#line 811 "generated/easymesh-parser.cpp" +/* Line 677 of lalr1.cc */ +#line 788 "generated/easymesh-parser.cpp" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action - invokes YYABORT, YYACCEPT, or YYERROR immediately after altering - yychar. In the case of YYABORT or YYACCEPT, an incorrect - destructor might then be invoked immediately. In the case of - YYERROR, subsequent parser actions might lead to an incorrect - destructor call or verbose syntax error message before the - lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); yypop_ (yylen); @@ -845,20 +811,14 @@ namespace lol { | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus_) { ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; error (yylloc, yysyntax_error_ (yystate, yytoken)); } - yyerror_range[1] = yylloc; + yyerror_range[0] = yylloc; if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an @@ -893,7 +853,7 @@ namespace lol { if (false) goto yyerrorlab; - yyerror_range[1] = yylocation_stack_[yylen - 1]; + yyerror_range[0] = yylocation_stack_[yylen - 1]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ yypop_ (yylen); @@ -910,7 +870,7 @@ namespace lol { for (;;) { yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) + if (yyn != yypact_ninf_) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) @@ -925,7 +885,7 @@ namespace lol { if (yystate_stack_.height () == 1) YYABORT; - yyerror_range[1] = yylocation_stack_[0]; + yyerror_range[0] = yylocation_stack_[0]; yydestruct_ ("Error: popping", yystos_[yystate], &yysemantic_stack_[0], &yylocation_stack_[0]); @@ -934,10 +894,10 @@ namespace lol { YY_STACK_PRINT (); } - yyerror_range[2] = yylloc; + yyerror_range[1] = yylloc; // Using YYLLOC is tempting, but would change the location of // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); @@ -960,13 +920,7 @@ namespace lol { yyreturn: if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See comments - at user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, - &yylloc); - } + yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ @@ -985,193 +939,147 @@ namespace lol { // Generate an error message. std::string - EasyMeshParser::yysyntax_error_ (int yystate, int yytoken) + EasyMeshParser::yysyntax_error_ (int yystate, int tok) { - std::string yyres; - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - size_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yytoken) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state - merging (from LALR or IELR) and default reductions corrupt the - expected token list. However, the list is correct for - canonical LR with one exception: it will still contain any - token that will not be accepted due to an error action in a - later state. - */ - if (yytoken != yyempty_) - { - yyarg[yycount++] = yytname_[yytoken]; - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } - } - - char const* yyformat = 0; - switch (yycount) + std::string res; + YYUSE (yystate); +#if YYERROR_VERBOSE + int yyn = yypact_[yystate]; + if (yypact_ninf_ < yyn && yyn <= yylast_) { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + int count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_) + ++count; + + // FIXME: This method of building the message is not compatible + // with internationalization. It should work like yacc.c does it. + // That is, first build a string that looks like this: + // "syntax error, unexpected %s or %s or %s" + // Then, invoke YY_ on this string. + // Finally, use the string as a format to output + // yytname_[tok], etc. + // Until this gets fixed, this message appears in English only. + res = "syntax error, unexpected "; + res += yytnamerr_ (yytname_[tok]); + if (count < 5) + { + count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_) + { + res += (!count++) ? ", expecting " : " or "; + res += yytnamerr_ (yytname_[x]); + } + } } - - // Argument number. - size_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += yytnamerr_ (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; + else +#endif + res = YY_("syntax error"); + return res; } /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const signed char EasyMeshParser::yypact_ninf_ = -47; + const signed char EasyMeshParser::yypact_ninf_ = -10; const signed char EasyMeshParser::yypact_[] = { - 35, -26, 85, -31, -31, -31, -31, -47, -31, -31, - -31, -31, -47, -31, -31, -31, -31, -47, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -47, 5, 13, 35, 35, 72, - -47, -47, -47, -47, -47, -47, -31, -31, -31, -31, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -31, - -31, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -31, -31, -47, -47, -47, -47, -47, -24, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47 + -3, 11, 87, 6, 6, 6, 6, -10, 6, 6, + 6, 6, -10, 6, 6, 6, 6, -10, 6, 6, + -10, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, -10, 36, 43, -3, -3, + 73, -10, -10, -10, -10, -10, -10, 6, 6, 6, + 6, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + 6, 6, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, 6, 6, -10, -10, -10, -10, -10, + 10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10 }; - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ + /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE + doesn't specify something else to do. Zero means the default is an + error. */ const unsigned char EasyMeshParser::yydefact_[] = { 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 34, 0, 0, 0, 0, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 0, 0, 3, 0, 5, - 9, 11, 12, 13, 57, 15, 0, 0, 0, 0, - 14, 49, 17, 16, 19, 23, 26, 29, 20, 24, - 27, 30, 21, 25, 28, 31, 22, 32, 18, 0, - 0, 36, 37, 38, 39, 40, 41, 43, 44, 45, - 46, 47, 0, 0, 48, 42, 1, 2, 4, 0, - 10, 58, 50, 51, 52, 53, 54, 55, 56, 8, - 6 + 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, 3, 0, + 5, 9, 11, 12, 13, 58, 15, 0, 0, 0, + 0, 14, 50, 17, 16, 19, 23, 26, 29, 20, + 24, 27, 30, 21, 25, 28, 31, 22, 32, 18, + 0, 0, 37, 38, 39, 40, 41, 42, 44, 45, + 46, 47, 48, 0, 0, 49, 43, 1, 2, 4, + 0, 10, 59, 51, 52, 53, 54, 55, 56, 57, + 8, 6 }; /* YYPGOTO[NTERM-NUM]. */ const signed char EasyMeshParser::yypgoto_[] = { - -47, -47, -18, -47, -47, -47, -47, -17, -47, -47, - -47, 105, -4, -1, 6, 8, 1, -47, -47, -46 + -10, -10, -4, -10, -10, -10, -10, 14, -10, -10, + -10, 107, 26, 37, 44, 31, 30, -10, -10, -9 }; /* YYDEFGOTO[NTERM-NUM]. */ const signed char EasyMeshParser::yydefgoto_[] = { - -1, 35, 36, 37, 38, 100, 39, 40, 41, 42, - 43, 47, 48, 49, 69, 70, 71, 83, 84, 51 + -1, 36, 37, 38, 39, 101, 40, 41, 42, 43, + 44, 48, 49, 50, 70, 71, 72, 84, 85, 52 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. */ const signed char EasyMeshParser::yytable_ninf_ = -1; const unsigned char EasyMeshParser::yytable_[] = { - 91, 92, 93, 94, 56, 86, 44, 50, 53, 60, - 46, 44, 45, 87, 64, 46, 99, 66, 67, 88, - 89, 72, 90, 95, 96, 76, 80, 81, 79, 73, - 74, 75, 85, 82, 78, 77, 97, 98, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 0, 0, 0, 34, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 54, 55, - 0, 57, 0, 58, 59, 0, 61, 0, 62, 63, - 0, 65, 44, 52, 0, 68, 46 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 89, 90, 87, 35, 92, 93, + 94, 95, 57, 88, 45, 51, 54, 61, 47, 45, + 46, 100, 65, 47, 91, 67, 68, 81, 82, 78, + 73, 96, 97, 83, 77, 0, 0, 80, 74, 75, + 76, 86, 0, 79, 98, 99, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 55, 56, 0, 58, 0, 59, 60, 0, 62, 0, + 63, 64, 0, 66, 0, 45, 53, 0, 69, 47 }; /* YYCHECK. */ const signed char EasyMeshParser::yycheck_[] = { - 46, 47, 48, 49, 5, 0, 37, 1, 2, 10, - 41, 37, 38, 0, 15, 41, 40, 18, 19, 37, - 38, 22, 39, 69, 70, 26, 30, 31, 29, 23, - 24, 25, 33, 32, 28, 27, 82, 83, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, -1, -1, -1, 39, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 3, 4, - -1, 6, -1, 8, 9, -1, 11, -1, 13, 14, - -1, 16, 37, 38, -1, 20, 41 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 38, 39, 0, 40, 47, 48, + 49, 50, 5, 0, 38, 1, 2, 10, 42, 38, + 39, 41, 15, 42, 40, 18, 19, 31, 32, 28, + 23, 70, 71, 33, 27, -1, -1, 30, 24, 25, + 26, 34, -1, 29, 83, 84, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 3, 4, -1, 6, -1, 8, 9, -1, 11, -1, + 13, 14, -1, 16, -1, 38, 39, -1, 21, 42 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -1182,14 +1090,14 @@ namespace lol { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 39, 43, 44, 45, 46, 48, - 49, 50, 51, 52, 37, 38, 41, 53, 54, 55, - 56, 61, 38, 56, 53, 53, 55, 53, 53, 53, - 55, 53, 53, 53, 55, 53, 55, 55, 53, 56, - 57, 58, 55, 56, 56, 56, 55, 57, 56, 55, - 54, 54, 58, 59, 60, 55, 0, 0, 44, 44, - 49, 61, 61, 61, 61, 61, 61, 61, 61, 40, - 47 + 32, 33, 34, 35, 36, 40, 44, 45, 46, 47, + 49, 50, 51, 52, 53, 38, 39, 42, 54, 55, + 56, 57, 62, 39, 57, 54, 54, 56, 54, 54, + 54, 56, 54, 54, 54, 56, 54, 56, 56, 54, + 57, 58, 59, 56, 57, 57, 57, 56, 58, 57, + 56, 55, 55, 59, 60, 61, 56, 0, 0, 45, + 45, 50, 62, 62, 62, 62, 62, 62, 62, 62, + 41, 48 }; #if YYDEBUG @@ -1201,8 +1109,8 @@ namespace lol { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 91, - 93, 45 + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 91, 93, 45 }; #endif @@ -1210,12 +1118,12 @@ namespace lol { const unsigned char EasyMeshParser::yyr1_[] = { - 0, 42, 43, 44, 44, 45, 45, 46, 47, 48, - 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 61 + 0, 43, 44, 45, 45, 46, 46, 47, 48, 49, + 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 62 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1225,9 +1133,9 @@ namespace lol { 0, 2, 2, 1, 2, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, - 2, 2, 2, 2, 2, 2, 2, 1, 2 + 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 2, 1, 2 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE @@ -1240,14 +1148,14 @@ namespace lol { "T_ROTATEX", "T_TAPERX", "T_SCALEX", "T_MIRRORX", "T_TRANSLATEY", "T_ROTATEY", "T_TAPERY", "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ", "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE", - "T_SCALE", "T_CHAMFER", "T_CYLINDER", "T_BOX", "T_SMOOTHCHAMFBOX", - "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR", "T_EXPANDEDSTAR", - "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS", "T_ERROR", - "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", "mesh_description", - "mesh_expression_list", "mesh_expression", "mesh_open", "mesh_close", - "mesh_command_list", "mesh_command", "color_command", - "transform_command", "primitive_command", "args1", "args2", "args3", - "args4", "args5", "args6", "args7", "args8", "number", 0 + "T_SCALE", "T_TOGGLESCALEWINDING", "T_CHAMFER", "T_CYLINDER", "T_BOX", + "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR", + "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS", + "T_ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", + "mesh_description", "mesh_expression_list", "mesh_expression", + "mesh_open", "mesh_close", "mesh_command_list", "mesh_command", + "color_command", "transform_command", "primitive_command", "args1", + "args2", "args3", "args4", "args5", "args6", "args7", "args8", "number", 0 }; #endif @@ -1256,23 +1164,23 @@ namespace lol { const EasyMeshParser::rhs_number_type EasyMeshParser::yyrhs_[] = { - 43, 0, -1, 44, 0, -1, 45, -1, 45, 44, - -1, 48, -1, 46, 44, 47, -1, 39, -1, 40, - -1, 49, -1, 48, 49, -1, 50, -1, 51, -1, - 52, -1, 3, 56, -1, 3, 38, -1, 4, 56, - -1, 4, 38, -1, 22, 53, -1, 5, 53, -1, - 10, 53, -1, 15, 53, -1, 20, 55, -1, 6, - 53, -1, 11, 53, -1, 16, 53, -1, 7, 55, - -1, 12, 55, -1, 17, 55, -1, 8, 53, -1, - 13, 53, -1, 18, 53, -1, 21, 55, -1, 9, - -1, 14, -1, 19, -1, 23, 58, -1, 24, 55, - -1, 25, 56, -1, 26, 56, -1, 27, 56, -1, - 28, 55, -1, 35, 55, -1, 29, 57, -1, 30, - 56, -1, 31, 55, -1, 32, 54, -1, 33, 54, - -1, 34, 60, -1, 61, -1, 53, 61, -1, 54, - 61, -1, 55, 61, -1, 56, 61, -1, 57, 61, - -1, 58, 61, -1, 59, 61, -1, 37, -1, 41, - 61, -1 + 44, 0, -1, 45, 0, -1, 46, -1, 46, 45, + -1, 49, -1, 47, 45, 48, -1, 40, -1, 41, + -1, 50, -1, 49, 50, -1, 51, -1, 52, -1, + 53, -1, 3, 57, -1, 3, 39, -1, 4, 57, + -1, 4, 39, -1, 23, 54, -1, 5, 54, -1, + 10, 54, -1, 15, 54, -1, 20, 56, -1, 6, + 54, -1, 11, 54, -1, 16, 54, -1, 7, 56, + -1, 12, 56, -1, 17, 56, -1, 8, 54, -1, + 13, 54, -1, 18, 54, -1, 21, 56, -1, 9, + -1, 14, -1, 19, -1, 22, -1, 24, 59, -1, + 25, 56, -1, 26, 57, -1, 27, 57, -1, 28, + 57, -1, 29, 56, -1, 36, 56, -1, 30, 58, + -1, 31, 57, -1, 32, 56, -1, 33, 55, -1, + 34, 55, -1, 35, 61, -1, 62, -1, 54, 62, + -1, 55, 62, -1, 56, 62, -1, 57, 62, -1, + 58, 62, -1, 59, 62, -1, 60, 62, -1, 38, + -1, 42, 62, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -1283,9 +1191,9 @@ namespace lol { 0, 0, 3, 6, 8, 11, 13, 17, 19, 21, 23, 26, 28, 30, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, - 80, 83, 86, 89, 91, 93, 95, 98, 101, 104, - 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, - 136, 139, 142, 145, 148, 151, 154, 157, 159 + 80, 83, 86, 89, 91, 93, 95, 97, 100, 103, + 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, + 136, 138, 141, 144, 147, 150, 153, 156, 159, 161 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ @@ -1295,9 +1203,9 @@ namespace lol { 0, 75, 75, 79, 80, 84, 85, 89, 93, 97, 98, 102, 103, 104, 108, 109, 112, 113, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 140, 143, 144, 146, - 148, 150, 151, 152, 154, 156, 157, 158, 159, 163, - 164, 165, 166, 167, 168, 169, 170, 173, 174 + 131, 132, 133, 134, 135, 136, 137, 141, 144, 145, + 147, 149, 151, 152, 153, 155, 157, 158, 159, 160, + 164, 165, 166, 167, 168, 169, 170, 171, 174, 175 }; // Print the state stack on the debug stream. @@ -1341,12 +1249,12 @@ namespace lol { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 41, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 42, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 39, 2, 40, 2, 2, 2, 2, 2, 2, + 2, 40, 2, 41, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1366,7 +1274,7 @@ namespace lol { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38 + 35, 36, 37, 38, 39 }; if ((unsigned int) t <= yyuser_token_number_max_) return translate_table[t]; @@ -1375,26 +1283,26 @@ namespace lol { } const int EasyMeshParser::yyeof_ = 0; - const int EasyMeshParser::yylast_ = 126; + const int EasyMeshParser::yylast_ = 129; const int EasyMeshParser::yynnts_ = 20; const int EasyMeshParser::yyempty_ = -2; - const int EasyMeshParser::yyfinal_ = 86; + const int EasyMeshParser::yyfinal_ = 87; const int EasyMeshParser::yyterror_ = 1; const int EasyMeshParser::yyerrcode_ = 256; - const int EasyMeshParser::yyntokens_ = 42; + const int EasyMeshParser::yyntokens_ = 43; - const unsigned int EasyMeshParser::yyuser_token_number_max_ = 293; + const unsigned int EasyMeshParser::yyuser_token_number_max_ = 294; const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2; } // lol -/* Line 1136 of lalr1.cc */ -#line 1394 "generated/easymesh-parser.cpp" +/* Line 1053 of lalr1.cc */ +#line 1302 "generated/easymesh-parser.cpp" -/* Line 1138 of lalr1.cc */ -#line 177 "easymesh/easymesh-parser.y" +/* Line 1055 of lalr1.cc */ +#line 178 "easymesh/easymesh-parser.y" void lol::EasyMeshParser::error(const EasyMeshParser::location_type& l, diff --git a/src/generated/easymesh-parser.h b/src/generated/easymesh-parser.h index 4ed8cdb6..cd8cb9ee 100644 --- a/src/generated/easymesh-parser.h +++ b/src/generated/easymesh-parser.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton interface for Bison LALR(1) parsers in C++ - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,6 +40,20 @@ #include #include #include "stack.hh" + + +namespace lol { + +/* Line 34 of lalr1.cc */ +#line 49 "generated/easymesh-parser.h" + class position; + class location; + +} // lol + +/* Line 34 of lalr1.cc */ +#line 56 "generated/easymesh-parser.h" + #include "location.hh" /* Enabling traces. */ @@ -60,11 +74,30 @@ # define YYTOKEN_TABLE 0 #endif +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ +do { \ + if (N) \ + { \ + (Current).begin = (Rhs)[1].begin; \ + (Current).end = (Rhs)[N].end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = (Rhs)[0].end; \ + } \ +} while (false) +#endif + namespace lol { -/* Line 35 of lalr1.cc */ -#line 68 "generated/easymesh-parser.h" +/* Line 34 of lalr1.cc */ +#line 101 "generated/easymesh-parser.h" /// A Bison parser. class EasyMeshParser @@ -75,7 +108,7 @@ namespace lol { union semantic_type { -/* Line 35 of lalr1.cc */ +/* Line 34 of lalr1.cc */ #line 36 "easymesh/easymesh-parser.y" float fval; @@ -85,8 +118,8 @@ namespace lol { -/* Line 35 of lalr1.cc */ -#line 90 "generated/easymesh-parser.h" +/* Line 34 of lalr1.cc */ +#line 123 "generated/easymesh-parser.h" }; #else typedef YYSTYPE semantic_type; @@ -118,23 +151,24 @@ namespace lol { T_MIRRORZ = 274, T_TRANSLATE = 275, T_SCALE = 276, - T_CHAMFER = 277, - T_CYLINDER = 278, - T_BOX = 279, - T_SMOOTHCHAMFBOX = 280, - T_FLATCHAMFBOX = 281, - T_SPHERE = 282, - T_CAPSULE = 283, - T_STAR = 284, - T_EXPANDEDSTAR = 285, - T_DISC = 286, - T_TRIANGLE = 287, - T_QUAD = 288, - T_COG = 289, - T_TORUS = 290, - T_ERROR = 291, - NUMBER = 292, - COLOR = 293 + T_TOGGLESCALEWINDING = 277, + T_CHAMFER = 278, + T_CYLINDER = 279, + T_BOX = 280, + T_SMOOTHCHAMFBOX = 281, + T_FLATCHAMFBOX = 282, + T_SPHERE = 283, + T_CAPSULE = 284, + T_STAR = 285, + T_EXPANDEDSTAR = 286, + T_DISC = 287, + T_TRIANGLE = 288, + T_QUAD = 289, + T_COG = 290, + T_TORUS = 291, + T_ERROR = 292, + NUMBER = 293, + COLOR = 294 }; }; @@ -208,14 +242,6 @@ namespace lol { /// The location stack. location_stack_type yylocation_stack_; - /// Whether the given \c yypact_ value indicates a defaulted state. - /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); - - /// Whether the given \c yytable_ value indicates a syntax error. - /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); - /// Internal symbol numbers. typedef unsigned char token_number_type; /* Tables. */ @@ -223,7 +249,7 @@ namespace lol { static const signed char yypact_[]; static const signed char yypact_ninf_; - /// For a state, default reduction number. + /// For a state, default rule to reduce. /// Unless\a yytable_ specifies something else to do. /// Zero means the default is an error. static const unsigned char yydefact_[]; @@ -254,8 +280,10 @@ namespace lol { static const char* const yytname_[]; #endif +#if YYERROR_VERBOSE /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n); + virtual std::string yytnamerr_ (const char *n); +#endif #if YYDEBUG /// A type to store symbol numbers and -1. @@ -313,8 +341,8 @@ namespace lol { } // lol -/* Line 35 of lalr1.cc */ -#line 318 "generated/easymesh-parser.h" +/* Line 34 of lalr1.cc */ +#line 346 "generated/easymesh-parser.h" diff --git a/src/generated/easymesh-scanner.cpp b/src/generated/easymesh-scanner.cpp index 2571d751..366cc49f 100644 --- a/src/generated/easymesh-scanner.cpp +++ b/src/generated/easymesh-scanner.cpp @@ -330,8 +330,8 @@ typedef unsigned char YY_CHAR; *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 45 -#define YY_END_OF_BUFFER 46 +#define YY_NUM_RULES 46 +#define YY_END_OF_BUFFER 47 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -339,16 +339,16 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[73] = +static yyconst flex_int16_t yy_accept[75] = { 0, - 0, 0, 46, 44, 43, 42, 44, 44, 39, 44, - 38, 40, 41, 44, 44, 44, 44, 17, 7, 0, - 0, 38, 38, 0, 21, 22, 25, 0, 0, 28, - 29, 32, 3, 18, 19, 20, 8, 9, 10, 1, - 14, 15, 16, 0, 4, 5, 6, 0, 0, 38, - 0, 24, 26, 0, 0, 0, 33, 2, 11, 12, - 13, 34, 23, 27, 30, 31, 35, 0, 36, 0, - 37, 0 + 0, 0, 47, 45, 44, 43, 45, 45, 40, 45, + 39, 41, 42, 45, 45, 45, 45, 17, 7, 0, + 0, 39, 39, 0, 22, 23, 26, 0, 0, 29, + 30, 33, 3, 19, 20, 21, 8, 9, 10, 1, + 14, 15, 16, 0, 0, 4, 5, 6, 0, 0, + 39, 0, 25, 27, 0, 0, 0, 34, 2, 11, + 12, 13, 18, 35, 24, 28, 31, 32, 36, 0, + 37, 0, 38, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -365,8 +365,8 @@ static yyconst flex_int32_t yy_ec[256] = 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, 17, 18, 19, 20, 1, 1, 1, 1, 21, 1, - 22, 23, 24, 25, 26, 27, 1, 1, 1, 28, - 29, 30, 1, 1, 1, 1, 1, 1, 1, 1, + 22, 23, 24, 25, 26, 27, 1, 1, 28, 29, + 30, 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -383,71 +383,76 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[31] = +static yyconst flex_int32_t yy_meta[32] = { 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 } ; -static yyconst flex_int16_t yy_base[81] = +static yyconst flex_int16_t yy_base[83] = { 0, - 0, 0, 99, 100, 100, 100, 0, 24, 26, 90, - 28, 100, 100, 32, 77, 11, 14, 36, 24, 0, - 88, 53, 59, 66, 100, 49, 100, 69, 79, 100, - 58, 71, 100, 100, 100, 100, 100, 100, 100, 78, - 100, 100, 100, 49, 100, 100, 100, 0, 83, 82, - 66, 100, 100, 74, 73, 66, 100, 100, 100, 100, - 100, 0, 100, 100, 100, 100, 0, 0, 0, 0, - 100, 100, 83, 82, 81, 80, 78, 73, 55, 53 + 0, 0, 102, 103, 103, 103, 0, 25, 27, 93, + 29, 103, 103, 33, 80, 11, 14, 23, 48, 0, + 91, 48, 54, 61, 103, 57, 103, 72, 82, 103, + 57, 74, 103, 103, 103, 103, 103, 103, 103, 81, + 103, 103, 103, 52, 66, 103, 103, 103, 0, 85, + 84, 68, 103, 103, 76, 75, 68, 103, 103, 103, + 103, 103, 103, 0, 103, 103, 103, 103, 0, 0, + 0, 0, 103, 103, 85, 84, 83, 82, 73, 71, + 66, 61 } ; -static yyconst flex_int16_t yy_def[81] = +static yyconst flex_int16_t yy_def[83] = { 0, - 72, 1, 72, 72, 72, 72, 73, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 75, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 76, 72, 72, 72, 72, 77, 78, 79, 80, - 72, 0, 72, 72, 72, 72, 72, 72, 72, 72 + 74, 1, 74, 74, 74, 74, 75, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 76, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 77, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 78, 74, 74, 74, 74, 79, 80, + 81, 82, 74, 0, 74, 74, 74, 74, 74, 74, + 74, 74 } ; -static yyconst flex_int16_t yy_nxt[131] = +static yyconst flex_int16_t yy_nxt[135] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 4, 4, 12, 13, 14, 4, 15, 4, 4, 4, 4, 4, 16, 4, 4, 4, 17, 18, 19, 4, 4, 4, - 21, 22, 21, 22, 21, 22, 44, 24, 34, 35, - 36, 37, 38, 39, 24, 25, 26, 27, 28, 29, - 40, 45, 46, 47, 71, 30, 70, 31, 32, 21, - 22, 51, 24, 41, 42, 43, 23, 52, 24, 24, - 49, 49, 55, 50, 69, 24, 59, 60, 61, 68, - 56, 67, 62, 48, 20, 66, 65, 64, 63, 50, - 50, 58, 57, 54, 53, 23, 33, 23, 72, 3, - - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72 + 4, 21, 22, 21, 22, 21, 22, 40, 24, 34, + 35, 36, 37, 38, 39, 24, 25, 26, 27, 28, + 29, 41, 42, 43, 21, 22, 30, 24, 31, 32, + 44, 23, 73, 24, 24, 50, 50, 72, 51, 52, + 24, 56, 71, 45, 70, 53, 46, 47, 48, 57, + 60, 61, 62, 69, 64, 49, 20, 68, 67, 66, + 65, 51, 51, 63, 59, 58, 55, 54, 23, 33, + + 23, 74, 3, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74 } ; -static yyconst flex_int16_t yy_chk[131] = +static yyconst flex_int16_t yy_chk[135] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 8, 8, 9, 9, 11, 11, 19, 11, 16, 16, - 16, 17, 17, 17, 11, 14, 14, 14, 14, 14, - 18, 19, 19, 19, 80, 14, 79, 14, 14, 22, - 22, 26, 22, 18, 18, 18, 23, 26, 23, 22, - 24, 24, 31, 24, 78, 23, 44, 44, 44, 77, - 31, 76, 75, 74, 73, 56, 55, 54, 51, 50, - 49, 40, 32, 29, 28, 21, 15, 10, 3, 72, - - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72 + 1, 8, 8, 9, 9, 11, 11, 18, 11, 16, + 16, 16, 17, 17, 17, 11, 14, 14, 14, 14, + 14, 18, 18, 18, 22, 22, 14, 22, 14, 14, + 19, 23, 82, 23, 22, 24, 24, 81, 24, 26, + 23, 31, 80, 19, 79, 26, 19, 19, 19, 31, + 44, 44, 44, 78, 77, 76, 75, 57, 56, 55, + 52, 51, 50, 45, 40, 32, 29, 28, 21, 15, + + 10, 3, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74 } ; /* The intent behind this definition is that it'll catch @@ -496,7 +501,7 @@ typedef lol::EasyMeshParser::token_type token_type; #define yyterminate() return token::T_END #define YY_NO_UNISTD_H #define YY_USER_ACTION yylloc->columns(yyleng); -#line 500 "generated/easymesh-scanner.cpp" +#line 505 "generated/easymesh-scanner.cpp" #define INITIAL 0 @@ -609,7 +614,7 @@ YY_DECL yylloc->step(); -#line 613 "generated/easymesh-scanner.cpp" +#line 618 "generated/easymesh-scanner.cpp" if ( !(yy_init) ) { @@ -662,13 +667,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 73 ) + if ( yy_current_state >= 75 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 72 ); + while ( yy_current_state != 74 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -776,86 +781,91 @@ YY_RULE_SETUP case 18: YY_RULE_SETUP #line 69 "easymesh/easymesh-scanner.l" -{ return token::T_MIRRORX; } +{ return token::T_TOGGLESCALEWINDING; } YY_BREAK case 19: YY_RULE_SETUP #line 70 "easymesh/easymesh-scanner.l" -{ return token::T_MIRRORY; } +{ return token::T_MIRRORX; } YY_BREAK case 20: YY_RULE_SETUP #line 71 "easymesh/easymesh-scanner.l" -{ return token::T_MIRRORZ; } +{ return token::T_MIRRORY; } YY_BREAK case 21: YY_RULE_SETUP -#line 73 "easymesh/easymesh-scanner.l" -{ return token::T_BOX; } +#line 72 "easymesh/easymesh-scanner.l" +{ return token::T_MIRRORZ; } YY_BREAK case 22: YY_RULE_SETUP #line 74 "easymesh/easymesh-scanner.l" -{ return token::T_CYLINDER; } +{ return token::T_BOX; } YY_BREAK case 23: YY_RULE_SETUP #line 75 "easymesh/easymesh-scanner.l" -{ return token::T_CAPSULE; } +{ return token::T_CYLINDER; } YY_BREAK case 24: YY_RULE_SETUP #line 76 "easymesh/easymesh-scanner.l" -{ return token::T_COG; } +{ return token::T_CAPSULE; } YY_BREAK case 25: YY_RULE_SETUP #line 77 "easymesh/easymesh-scanner.l" -{ return token::T_DISC; } +{ return token::T_COG; } YY_BREAK case 26: YY_RULE_SETUP #line 78 "easymesh/easymesh-scanner.l" -{ return token::T_EXPANDEDSTAR; } +{ return token::T_DISC; } YY_BREAK case 27: YY_RULE_SETUP #line 79 "easymesh/easymesh-scanner.l" -{ return token::T_FLATCHAMFBOX; } +{ return token::T_EXPANDEDSTAR; } YY_BREAK case 28: YY_RULE_SETUP #line 80 "easymesh/easymesh-scanner.l" -{ return token::T_QUAD; } +{ return token::T_FLATCHAMFBOX; } YY_BREAK case 29: YY_RULE_SETUP #line 81 "easymesh/easymesh-scanner.l" -{ return token::T_STAR; } +{ return token::T_QUAD; } YY_BREAK case 30: YY_RULE_SETUP #line 82 "easymesh/easymesh-scanner.l" -{ return token::T_SMOOTHCHAMFBOX; } +{ return token::T_STAR; } YY_BREAK case 31: YY_RULE_SETUP #line 83 "easymesh/easymesh-scanner.l" -{ return token::T_SPHERE; } +{ return token::T_SMOOTHCHAMFBOX; } YY_BREAK case 32: YY_RULE_SETUP #line 84 "easymesh/easymesh-scanner.l" -{ return token::T_TRIANGLE; } +{ return token::T_SPHERE; } YY_BREAK case 33: YY_RULE_SETUP #line 85 "easymesh/easymesh-scanner.l" -{ return token::T_TORUS; } +{ return token::T_TRIANGLE; } YY_BREAK case 34: YY_RULE_SETUP -#line 87 "easymesh/easymesh-scanner.l" +#line 86 "easymesh/easymesh-scanner.l" +{ return token::T_TORUS; } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 88 "easymesh/easymesh-scanner.l" { uint32_t tmp = std::strtol(yytext + 1, NULL, 16); yylval->u32val = 0x11000000u * (tmp >> 8) @@ -864,9 +874,9 @@ YY_RULE_SETUP | 0x000000ffu; return token::COLOR; } YY_BREAK -case 35: +case 36: YY_RULE_SETUP -#line 94 "easymesh/easymesh-scanner.l" +#line 95 "easymesh/easymesh-scanner.l" { uint32_t tmp = std::strtol(yytext + 1, NULL, 16); yylval->u32val = 0x11000000u * (tmp >> 12) @@ -875,64 +885,64 @@ YY_RULE_SETUP | 0x00000011u * (tmp & 0xf); return token::COLOR; } YY_BREAK -case 36: +case 37: YY_RULE_SETUP -#line 101 "easymesh/easymesh-scanner.l" +#line 102 "easymesh/easymesh-scanner.l" { yylval->u32val = 0xffu | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16); return token::COLOR; } YY_BREAK -case 37: +case 38: YY_RULE_SETUP -#line 105 "easymesh/easymesh-scanner.l" +#line 106 "easymesh/easymesh-scanner.l" { yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16); return token::COLOR; } YY_BREAK -case 38: +case 39: YY_RULE_SETUP -#line 108 "easymesh/easymesh-scanner.l" +#line 109 "easymesh/easymesh-scanner.l" { yylval->fval = std::atof(yytext); return token::NUMBER; } YY_BREAK -case 39: -YY_RULE_SETUP -#line 110 "easymesh/easymesh-scanner.l" -{ return token_type('-'); } - YY_BREAK case 40: YY_RULE_SETUP #line 111 "easymesh/easymesh-scanner.l" -{ return token_type('['); } +{ return token_type('-'); } YY_BREAK case 41: YY_RULE_SETUP #line 112 "easymesh/easymesh-scanner.l" -{ return token_type(']'); } +{ return token_type('['); } YY_BREAK case 42: YY_RULE_SETUP #line 113 "easymesh/easymesh-scanner.l" -{ /* ignore this */ } +{ return token_type(']'); } YY_BREAK case 43: -/* rule 43 can match eol */ YY_RULE_SETUP #line 114 "easymesh/easymesh-scanner.l" { /* ignore this */ } YY_BREAK case 44: +/* rule 44 can match eol */ YY_RULE_SETUP #line 115 "easymesh/easymesh-scanner.l" -{ return token::T_ERROR; } +{ /* ignore this */ } YY_BREAK case 45: YY_RULE_SETUP -#line 117 "easymesh/easymesh-scanner.l" +#line 116 "easymesh/easymesh-scanner.l" +{ return token::T_ERROR; } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 118 "easymesh/easymesh-scanner.l" ECHO; YY_BREAK -#line 936 "generated/easymesh-scanner.cpp" +#line 946 "generated/easymesh-scanner.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1314,7 +1324,7 @@ int yyFlexLexer::yy_get_next_buffer() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 73 ) + if ( yy_current_state >= 75 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1342,11 +1352,11 @@ int yyFlexLexer::yy_get_next_buffer() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 73 ) + if ( yy_current_state >= 75 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 72); + yy_is_jam = (yy_current_state == 74); return yy_is_jam ? 0 : yy_current_state; } @@ -1833,7 +1843,7 @@ void EasyMeshfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 117 "easymesh/easymesh-scanner.l" +#line 118 "easymesh/easymesh-scanner.l" diff --git a/src/generated/location.hh b/src/generated/location.hh index 76061106..0b3d1b94 100644 --- a/src/generated/location.hh +++ b/src/generated/location.hh @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Locations for Bison parsers in C++ - Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/generated/lolfx-parser.cpp b/src/generated/lolfx-parser.cpp index b800a8a0..7b3edc42 100644 --- a/src/generated/lolfx-parser.cpp +++ b/src/generated/lolfx-parser.cpp @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton implementation for Bison LALR(1) parsers in C++ - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ /* First part of user declarations. */ -/* Line 293 of lalr1.cc */ +/* Line 310 of lalr1.cc */ #line 1 "gpu/lolfx-parser.y" // @@ -58,7 +58,7 @@ -/* Line 293 of lalr1.cc */ +/* Line 310 of lalr1.cc */ #line 63 "generated/lolfx-parser.cpp" @@ -66,7 +66,7 @@ /* User implementation prologue. */ -/* Line 299 of lalr1.cc */ +/* Line 316 of lalr1.cc */ #line 241 "gpu/lolfx-parser.y" #include "gpu/lolfx-compiler.h" @@ -75,7 +75,7 @@ #define yylex mc.m_lexer->lex -/* Line 299 of lalr1.cc */ +/* Line 316 of lalr1.cc */ #line 80 "generated/lolfx-parser.cpp" #ifndef YY_ @@ -90,26 +90,6 @@ # endif #endif -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (false) -#endif - /* Suppress unused-variable warnings by "using" E. */ #define YYUSE(e) ((void) (e)) @@ -161,8 +141,9 @@ do { \ namespace lol { -/* Line 382 of lalr1.cc */ -#line 166 "generated/lolfx-parser.cpp" +/* Line 379 of lalr1.cc */ +#line 146 "generated/lolfx-parser.cpp" +#if YYERROR_VERBOSE /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -201,6 +182,7 @@ namespace lol { return yystr; } +#endif /// Build a parser object. LolFxParser::LolFxParser (class LolFxCompiler& mc_yyarg) @@ -301,18 +283,6 @@ namespace lol { } #endif - inline bool - LolFxParser::yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - inline bool - LolFxParser::yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - int LolFxParser::parse () { @@ -334,7 +304,7 @@ namespace lol { /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. - location_type yyerror_range[3]; + location_type yyerror_range[2]; /// $$. semantic_type yyval; @@ -372,7 +342,7 @@ namespace lol { /* Try to take a decision without lookahead. */ yyn = yypact_[yystate]; - if (yy_pact_value_is_default_ (yyn)) + if (yyn == yypact_ninf_) goto yydefault; /* Read a lookahead token. */ @@ -405,8 +375,8 @@ namespace lol { yyn = yytable_[yyn]; if (yyn <= 0) { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == yytable_ninf_) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -462,57 +432,46 @@ namespace lol { { case 202: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 728 "gpu/lolfx-parser.y" { std::cout << "New tech " << std::endl; } break; case 203: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 736 "gpu/lolfx-parser.y" { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } break; case 204: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 737 "gpu/lolfx-parser.y" { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } break; case 207: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 750 "gpu/lolfx-parser.y" { std::cout << "New pass " << std::endl; } break; case 226: -/* Line 690 of lalr1.cc */ +/* Line 677 of lalr1.cc */ #line 786 "gpu/lolfx-parser.y" { std::cout << "new shader" << std::endl; } break; -/* Line 690 of lalr1.cc */ -#line 502 "generated/lolfx-parser.cpp" +/* Line 677 of lalr1.cc */ +#line 472 "generated/lolfx-parser.cpp" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action - invokes YYABORT, YYACCEPT, or YYERROR immediately after altering - yychar. In the case of YYABORT or YYACCEPT, an incorrect - destructor might then be invoked immediately. In the case of - YYERROR, subsequent parser actions might lead to an incorrect - destructor call or verbose syntax error message before the - lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); yypop_ (yylen); @@ -536,20 +495,14 @@ namespace lol { | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus_) { ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; error (yylloc, yysyntax_error_ (yystate, yytoken)); } - yyerror_range[1] = yylloc; + yyerror_range[0] = yylloc; if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an @@ -584,7 +537,7 @@ namespace lol { if (false) goto yyerrorlab; - yyerror_range[1] = yylocation_stack_[yylen - 1]; + yyerror_range[0] = yylocation_stack_[yylen - 1]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ yypop_ (yylen); @@ -601,7 +554,7 @@ namespace lol { for (;;) { yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) + if (yyn != yypact_ninf_) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) @@ -616,7 +569,7 @@ namespace lol { if (yystate_stack_.height () == 1) YYABORT; - yyerror_range[1] = yylocation_stack_[0]; + yyerror_range[0] = yylocation_stack_[0]; yydestruct_ ("Error: popping", yystos_[yystate], &yysemantic_stack_[0], &yylocation_stack_[0]); @@ -625,10 +578,10 @@ namespace lol { YY_STACK_PRINT (); } - yyerror_range[2] = yylloc; + yyerror_range[1] = yylloc; // Using YYLLOC is tempting, but would change the location of // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); @@ -651,13 +604,7 @@ namespace lol { yyreturn: if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See comments - at user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, - &yylloc); - } + yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ @@ -676,97 +623,51 @@ namespace lol { // Generate an error message. std::string - LolFxParser::yysyntax_error_ (int yystate, int yytoken) + LolFxParser::yysyntax_error_ (int yystate, int tok) { - std::string yyres; - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - size_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yytoken) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state - merging (from LALR or IELR) and default reductions corrupt the - expected token list. However, the list is correct for - canonical LR with one exception: it will still contain any - token that will not be accepted due to an error action in a - later state. - */ - if (yytoken != yyempty_) - { - yyarg[yycount++] = yytname_[yytoken]; - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } - } - - char const* yyformat = 0; - switch (yycount) + std::string res; + YYUSE (yystate); +#if YYERROR_VERBOSE + int yyn = yypact_[yystate]; + if (yypact_ninf_ < yyn && yyn <= yylast_) { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + int count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_) + ++count; + + // FIXME: This method of building the message is not compatible + // with internationalization. It should work like yacc.c does it. + // That is, first build a string that looks like this: + // "syntax error, unexpected %s or %s or %s" + // Then, invoke YY_ on this string. + // Finally, use the string as a format to output + // yytname_[tok], etc. + // Until this gets fixed, this message appears in English only. + res = "syntax error, unexpected "; + res += yytnamerr_ (yytname_[tok]); + if (count < 5) + { + count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_) + { + res += (!count++) ? ", expecting " : " or "; + res += yytnamerr_ (yytname_[x]); + } + } } - - // Argument number. - size_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += yytnamerr_ (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; + else +#endif + res = YY_("syntax error"); + return res; } @@ -845,9 +746,9 @@ namespace lol { -68, -559, -559, -559, -559 }; - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ + /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE + doesn't specify something else to do. Zero means the default is an + error. */ const unsigned short int LolFxParser::yydefact_[] = { @@ -954,7 +855,7 @@ namespace lol { /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. */ const short int LolFxParser::yytable_ninf_ = -323; const short int LolFxParser::yytable_[] = @@ -3890,11 +3791,11 @@ namespace lol { } // lol -/* Line 1136 of lalr1.cc */ -#line 3895 "generated/lolfx-parser.cpp" +/* Line 1053 of lalr1.cc */ +#line 3796 "generated/lolfx-parser.cpp" -/* Line 1138 of lalr1.cc */ +/* Line 1055 of lalr1.cc */ #line 1298 "gpu/lolfx-parser.y" diff --git a/src/generated/lolfx-parser.h b/src/generated/lolfx-parser.h index c41899dc..f4119960 100644 --- a/src/generated/lolfx-parser.h +++ b/src/generated/lolfx-parser.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton interface for Bison LALR(1) parsers in C++ - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,6 +40,20 @@ #include #include #include "stack.hh" + + +namespace lol { + +/* Line 34 of lalr1.cc */ +#line 49 "generated/lolfx-parser.h" + class position; + class location; + +} // lol + +/* Line 34 of lalr1.cc */ +#line 56 "generated/lolfx-parser.h" + #include "location.hh" /* Enabling traces. */ @@ -60,11 +74,30 @@ # define YYTOKEN_TABLE 0 #endif +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ +do { \ + if (N) \ + { \ + (Current).begin = (Rhs)[1].begin; \ + (Current).end = (Rhs)[N].end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = (Rhs)[0].end; \ + } \ +} while (false) +#endif + namespace lol { -/* Line 35 of lalr1.cc */ -#line 68 "generated/lolfx-parser.h" +/* Line 34 of lalr1.cc */ +#line 101 "generated/lolfx-parser.h" /// A Bison parser. class LolFxParser @@ -75,7 +108,7 @@ namespace lol { union semantic_type { -/* Line 35 of lalr1.cc */ +/* Line 34 of lalr1.cc */ #line 34 "gpu/lolfx-parser.y" int ival; @@ -85,8 +118,8 @@ namespace lol { -/* Line 35 of lalr1.cc */ -#line 90 "generated/lolfx-parser.h" +/* Line 34 of lalr1.cc */ +#line 123 "generated/lolfx-parser.h" }; #else typedef YYSTYPE semantic_type; @@ -607,14 +640,6 @@ namespace lol { /// The location stack. location_stack_type yylocation_stack_; - /// Whether the given \c yypact_ value indicates a defaulted state. - /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); - - /// Whether the given \c yytable_ value indicates a syntax error. - /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); - /// Internal symbol numbers. typedef unsigned short int token_number_type; /* Tables. */ @@ -622,7 +647,7 @@ namespace lol { static const short int yypact_[]; static const short int yypact_ninf_; - /// For a state, default reduction number. + /// For a state, default rule to reduce. /// Unless\a yytable_ specifies something else to do. /// Zero means the default is an error. static const unsigned short int yydefact_[]; @@ -653,8 +678,10 @@ namespace lol { static const char* const yytname_[]; #endif +#if YYERROR_VERBOSE /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n); + virtual std::string yytnamerr_ (const char *n); +#endif #if YYDEBUG /// A type to store symbol numbers and -1. @@ -712,8 +739,8 @@ namespace lol { } // lol -/* Line 35 of lalr1.cc */ -#line 717 "generated/lolfx-parser.h" +/* Line 34 of lalr1.cc */ +#line 744 "generated/lolfx-parser.h" diff --git a/src/generated/position.hh b/src/generated/position.hh index 5a706fc4..984c21a6 100644 --- a/src/generated/position.hh +++ b/src/generated/position.hh @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Positions for Bison parsers in C++ - Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/generated/stack.hh b/src/generated/stack.hh index e5d1f9cf..cf73da80 100644 --- a/src/generated/stack.hh +++ b/src/generated/stack.hh @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Stack handling for Bison parsers in C++ - Copyright (C) 2002-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ namespace lol { -/* Line 1149 of lalr1.cc */ +/* Line 1066 of lalr1.cc */ #line 43 "generated/stack.hh" template > class stack @@ -128,7 +128,7 @@ namespace lol { } // lol -/* Line 1235 of lalr1.cc */ +/* Line 1152 of lalr1.cc */ #line 133 "generated/stack.hh" #endif // not BISON_STACK_HH[]dnl diff --git a/test/PhysicObject.h b/test/PhysicObject.h index 57d2b912..d803cfe7 100644 --- a/test/PhysicObject.h +++ b/test/PhysicObject.h @@ -116,12 +116,12 @@ public: //MeshRand << "[sc#daa afcb2 2 2 -.1]"; //MeshRand << "[sc#ada afcb2 2 2 -.1]"; //MeshRand << "[sc#aad afcb2 2 2 -.1]"; - MeshRand << "[sc#add afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; - MeshRand << "[sc#dad afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; - MeshRand << "[sc#dda afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; - MeshRand << "[sc#daa afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; - MeshRand << "[sc#ada afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; - MeshRand << "[sc#aad afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; + MeshRand << "[sc#add afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; + MeshRand << "[sc#dad afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; + MeshRand << "[sc#dda afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; + MeshRand << "[sc#daa afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; + MeshRand << "[sc#ada afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; + MeshRand << "[sc#aad afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; int SphereLimit = MeshRand.Count();