Changeset 2410
- Timestamp:
- Feb 14, 2013, 6:34:47 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/easymesh/easymesh-parser.y
r2408 r2410 48 48 %token T_TRANSLATEY T_ROTATEY T_TAPERY T_TWISTY T_SHEARY T_STRETCHY T_BENDYX T_BENDYZ T_SCALEY T_MIRRORY 49 49 %token T_TRANSLATEZ T_ROTATEZ T_TAPERZ T_TWISTZ T_SHEARZ T_STRETCHZ T_BENDZX T_BENDZY T_SCALEZ T_MIRRORZ 50 %token T_TRANSLATE T_SCALE T_TOGGLESCALEWINDING T_RADIALJITTER T_SPLITTRIANGLE 50 %token T_TRANSLATE T_SCALE T_TOGGLESCALEWINDING T_RADIALJITTER T_SPLITTRIANGLE T_SMOOTHMESH 51 51 %token T_CSGUNION T_CSGSUBSTRACT T_CSGSUBSTRACTLOSS T_CSGAND T_CSGXOR 52 52 %token T_CHAMFER … … 159 159 | T_RADIALJITTER args1 { mc.m_mesh.RadialJitter($2.f0); } 160 160 | T_SPLITTRIANGLE args1 { mc.m_mesh.SplitTriangles($2.f0); } 161 | T_SMOOTHMESH args3 { mc.m_mesh.SmoothMesh($2.f0, $2.f1, $2.f2); } 161 162 | T_TOGGLESCALEWINDING { mc.m_mesh.ToggleScaleWinding(); } 162 163 | T_CSGUNION { mc.m_mesh.CsgUnion(); } -
trunk/src/easymesh/easymesh-scanner.l
r2407 r2410 88 88 rj { return token::T_RADIALJITTER; } 89 89 splt { return token::T_SPLITTRIANGLE; } 90 smth { return token::T_SMOOTHMESH; } 90 91 91 92 csgu { return token::T_CSGUNION; } -
trunk/src/easymesh/easymesh.cpp
r2408 r2410 247 247 for (int j = 0; j < vertex_list.Count(); j++) 248 248 if (vertex_list[j].m3 == cur_mast && vertex_list[j].m1 != search_idx) 249 matching_ids << vertex_list[ cur_mast].m1;249 matching_ids << vertex_list[j].m1; 250 250 251 251 return (matching_ids.Count() > 0); … … 254 254 //----------------------------------------------------------------------------- 255 255 //Will return connected vertices (through triangles), if returned vertex has matching ones, it only returns the master. 256 bool VertexDictionnary::FindConnectedVertices(const int search_idx, const Array< int> &tri_list, Array<int> &connected_vert, Array<int> const *ignored_tri)256 bool VertexDictionnary::FindConnectedVertices(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_vert, Array<int> const *ignored_tri) 257 257 { 258 258 Array<int> connected_tri; 259 FindConnectedTriangles(search_idx, tri_list, connected_tri, ignored_tri);259 FindConnectedTriangles(search_idx, tri_list, tri0, connected_tri, ignored_tri); 260 260 261 261 for (int i = 0; i < connected_tri.Count(); i++) … … 263 263 for (int j = 0; j < 3; j++) 264 264 { 265 int v_indice = tri_list[connected_tri[ j] + j];265 int v_indice = tri_list[connected_tri[i] + j]; 266 266 if (v_indice != search_idx) 267 267 { 268 int found_master = FindVertexMaster(tri_list[connected_tri[ j] + j]);268 int found_master = FindVertexMaster(tri_list[connected_tri[i] + j]); 269 269 if (found_master == VDictType::Alone || found_master == VDictType::Master) 270 connected_vert << v_indice; 271 else 272 connected_vert << found_master; 270 found_master = v_indice; 271 if (found_master != search_idx) 272 { 273 bool already_exist = false; 274 for (int k = 0; !already_exist && k < connected_vert.Count(); k++) 275 if (connected_vert[k] == found_master) 276 already_exist = true; 277 if (!already_exist) 278 connected_vert << found_master; 279 } 273 280 } 274 281 } … … 277 284 } 278 285 //----------------------------------------------------------------------------- 279 bool VertexDictionnary::FindConnectedTriangles(const int search_idx, const Array< int> &tri_list, Array<int> &connected_tri, Array<int> const *ignored_tri)280 { 281 return FindConnectedTriangles(ivec3(search_idx, search_idx, search_idx), tri_list, connected_tri, ignored_tri);282 } 283 //----------------------------------------------------------------------------- 284 bool VertexDictionnary::FindConnectedTriangles(const ivec2 &search_idx, const Array< int> &tri_list, Array<int> &connected_tri, Array<int> const *ignored_tri)285 { 286 return FindConnectedTriangles(ivec3(search_idx, search_idx.x), tri_list, connected_tri, ignored_tri);287 } 288 //----------------------------------------------------------------------------- 289 bool VertexDictionnary::FindConnectedTriangles(const ivec3 &search_idx, const Array< int> &tri_list, Array<int> &connected_tri, Array<int> const *ignored_tri)286 bool VertexDictionnary::FindConnectedTriangles(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri) 287 { 288 return FindConnectedTriangles(ivec3(search_idx, search_idx, search_idx), tri_list, tri0, connected_tri, ignored_tri); 289 } 290 //----------------------------------------------------------------------------- 291 bool VertexDictionnary::FindConnectedTriangles(const ivec2 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri) 292 { 293 return FindConnectedTriangles(ivec3(search_idx, search_idx.x), tri_list, tri0, connected_tri, ignored_tri); 294 } 295 //----------------------------------------------------------------------------- 296 bool VertexDictionnary::FindConnectedTriangles(const ivec3 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri) 290 297 { 291 298 int needed_validation = 0; … … 306 313 } 307 314 308 for (int i = 0; i < tri_list.Count(); i += 3)315 for (int i = tri0; i < tri_list.Count(); i += 3) 309 316 { 310 317 if (ignored_tri) … … 668 675 void EasyMesh::ComputeTexCoord(float uv_scale, int uv_offset) 669 676 { 670 #if VERTEX_USEAGE == VU_TEX_UV677 #if 0//VERTEX_USEAGE == VU_TEX_UV 671 678 VertexDictionnary vert_dict; 672 679 Array<int> tri_list; … … 1072 1079 } 1073 1080 1074 //-----------------------------------------------------------------------------1075 void EasyMesh::SplitTriangles(int pass)1076 {1077 while (pass--)1078 {1079 int trimax = m_indices.Count();1080 for (int i = m_cursors.Last().m2; i < trimax; i += 3)1081 {1082 int vbase = m_vert.Count();1083 int j = -1;1084 while (++j < 3)1085 AddLerpVertex(m_indices[i + j], m_indices[i + (j + 1) % 3], .5f);1086 //Add new triangles1087 AppendTriangle(vbase, m_indices[i + 1], vbase + 1, 0);1088 AppendTriangle(vbase + 2, vbase + 1, m_indices[i + 2], 0);1089 AppendTriangle(vbase, vbase + 1, vbase + 2, 0);1090 //Change current triangle1091 m_indices[i + 1] = vbase;1092 m_indices[i + 2] = vbase + 2;1093 }1094 }1095 ComputeNormals(m_cursors.Last().m2, m_indices.Count() - m_cursors.Last().m2);1096 }1097 1081 //----------------------------------------------------------------------------- 1098 1082 void EasyMesh::AppendCylinder(int nsides, float h, float d1, float d2, … … 1965 1949 } 1966 1950 1951 //----------------------------------------------------------------------------- 1952 void EasyMesh::SplitTriangles(int pass) { SplitTriangles(pass, NULL); } 1953 1954 //----------------------------------------------------------------------------- 1955 void EasyMesh::SplitTriangles(int pass, VertexDictionnary *vert_dict) 1956 { 1957 while (pass--) 1958 { 1959 int trimax = m_indices.Count(); 1960 for (int i = m_cursors.Last().m2; i < trimax; i += 3) 1961 { 1962 int vbase = m_vert.Count(); 1963 int j = -1; 1964 while (++j < 3) 1965 { 1966 AddLerpVertex(m_indices[i + j], m_indices[i + (j + 1) % 3], .5f); 1967 if (vert_dict) 1968 vert_dict->AddVertex(vbase + j, m_vert[vbase + j].m1); 1969 } 1970 //Add new triangles 1971 AppendTriangle(vbase, m_indices[i + 1], vbase + 1, 0); 1972 AppendTriangle(vbase + 2, vbase + 1, m_indices[i + 2], 0); 1973 AppendTriangle(vbase, vbase + 1, vbase + 2, 0); 1974 //Change current triangle 1975 m_indices[i + 1] = vbase; 1976 m_indices[i + 2] = vbase + 2; 1977 } 1978 } 1979 ComputeNormals(m_cursors.Last().m2, m_indices.Count() - m_cursors.Last().m2); 1980 } 1981 1982 //----------------------------------------------------------------------------- 1983 void EasyMesh::SmoothMesh(int main_pass, int split_per_main_pass, int smooth_per_main_pass) 1984 { 1985 VertexDictionnary vert_dict; 1986 Array<vec3> smooth_buf[2]; 1987 Array<int> master_list; 1988 Array<int> matching_ids; 1989 Array<int> connected_vert; 1990 int smbuf = 0; 1991 1992 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 1993 vert_dict.AddVertex(i, m_vert[i].m1); 1994 1995 while (main_pass--) 1996 { 1997 int split_pass = split_per_main_pass; 1998 int smooth_pass = smooth_per_main_pass; 1999 2000 SplitTriangles(split_pass, &vert_dict); 2001 2002 matching_ids.Reserve(m_vert.Count() - m_cursors.Last().m1); 2003 connected_vert.Reserve(m_vert.Count() - m_cursors.Last().m1); 2004 smooth_buf[0].Resize(m_vert.Count() - m_cursors.Last().m1); 2005 smooth_buf[1].Resize(m_vert.Count() - m_cursors.Last().m1); 2006 2007 for (int i = m_cursors.Last().m1; i < m_vert.Count(); i++) 2008 smooth_buf[smbuf][i - m_cursors.Last().m1] = m_vert[i].m1; 2009 2010 while (smooth_pass--) 2011 { 2012 master_list.Empty(); 2013 if (vert_dict.GetMasterList(master_list)) 2014 { 2015 for (int i = 0; i < master_list.Count(); i++) 2016 { 2017 connected_vert.Empty(); 2018 if (vert_dict.FindConnectedVertices(master_list[i], m_indices, m_cursors.Last().m2, connected_vert)) 2019 { 2020 //Calculate vertices sum 2021 vec3 vert_sum = vec3(.0f); 2022 for (int j = 0; j < connected_vert.Count(); j++) 2023 vert_sum += smooth_buf[smbuf][connected_vert[j] - m_cursors.Last().m1]; 2024 2025 //Calculate new master vertex 2026 float n = (float)connected_vert.Count(); 2027 //b(n) = 5/4 - pow(3 + 2 * cos(2 * M_PI / n), 2) / 32 2028 float beta = 3.f + 2.f * cos(2.f * (float)M_PI / n); 2029 beta = 5.f / 4.f - beta * beta / 32.f; 2030 //a(n) = n * (1 - b(n)) / b(n) 2031 float alpha = (n * (1 - beta)) / beta; 2032 //V = (a(n) * v + v1 + ... + vn) / (a(n) + n) 2033 vec3 new_vert = (alpha * smooth_buf[smbuf][master_list[i] - m_cursors.Last().m1] + vert_sum) / (alpha + n); 2034 2035 //Set all matching vertices to new value 2036 matching_ids.Empty(); 2037 matching_ids << master_list[i]; 2038 vert_dict.FindMatchingVertices(master_list[i], matching_ids); 2039 for (int j = 0; j < matching_ids.Count(); j++) 2040 smooth_buf[1 - smbuf][matching_ids[j] - m_cursors.Last().m1] = new_vert; 2041 } 2042 } 2043 } 2044 smbuf = 1 - smbuf; 2045 } 2046 2047 for (int i = 0; i < smooth_buf[smbuf].Count(); i++) 2048 m_vert[i + m_cursors.Last().m1].m1 = smooth_buf[smbuf][i]; 2049 } 2050 } 2051 1967 2052 } /* namespace lol */ 1968 -
trunk/src/easymesh/easymesh.h
r2407 r2410 66 66 int FindVertexMaster(const int search_idx); 67 67 bool FindMatchingVertices(const int search_idx, Array<int> &matching_ids); 68 bool FindConnectedVertices(const int search_idx, const Array< int> &tri_list, Array<int> &connected_vert, Array<int> const *ignored_tri = NULL);69 bool FindConnectedTriangles(const int search_idx, const Array< int> &tri_list, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL);70 bool FindConnectedTriangles(const ivec2 &search_idx, const Array< int> &tri_list, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL);71 bool FindConnectedTriangles(const ivec3 &search_idx, const Array< int> &tri_list, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL);68 bool FindConnectedVertices(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_vert, Array<int> const *ignored_tri = NULL); 69 bool FindConnectedTriangles(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL); 70 bool FindConnectedTriangles(const ivec2 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL); 71 bool FindConnectedTriangles(const ivec3 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL); 72 72 void AddVertex(int vert_id, vec3 vert_coord); 73 bool GetMasterList(Array<int> &ret_master_list) { ret_master_list = master_list; return ret_master_list.Count() > 0; } 73 74 void Clear() { vertex_list.Empty(); } 74 75 private: … … 298 299 */ 299 300 void Chamfer(float f); 301 /* [cmd:splt] split triangles in 4 smaller ones. 302 - pass : Number of pass applied. 303 */ 304 void SplitTriangles(int pass); 305 private: 306 void SplitTriangles(int pass, VertexDictionnary *vert_dict); 307 public: 308 /* [cmd:smth] Smooth the mesh by subdivising it. 309 - main_pass : a main pass is made of (n0 split then n1 smooth) repeat. 310 - split_per_main_pass : n0 value in above explanation. 311 - smooth_per_main_pass : n1 value in above explanation. 312 */ 313 void SmoothMesh(int main_pass, int split_per_main_pass, int smooth_per_main_pass); 300 314 301 315 //------------------------------------------------------------------------- … … 303 317 //------------------------------------------------------------------------- 304 318 305 /*306 */307 void SplitTriangles(int pass);308 319 /* [cmd:ac] Cylinder centered on (0,0,0) with BBox [-.5*max(d1, d2), -.5*h, -.5*max(d1, d2)] 309 320 - nbsides : Number of sides. [+.5*max(d1, d2), +.5*h, +.5*max(d1, d2)] -
trunk/src/generated/easymesh-parser.cpp
r2407 r2410 771 771 /* Line 677 of lalr1.cc */ 772 772 #line 161 "easymesh/easymesh-parser.y" 773 { mc.m_mesh.SmoothMesh((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 774 break; 775 776 case 60: 777 778 /* Line 677 of lalr1.cc */ 779 #line 162 "easymesh/easymesh-parser.y" 773 780 { mc.m_mesh.ToggleScaleWinding(); } 774 781 break; 775 782 776 case 6 0:777 778 /* Line 677 of lalr1.cc */ 779 #line 16 2"easymesh/easymesh-parser.y"783 case 61: 784 785 /* Line 677 of lalr1.cc */ 786 #line 163 "easymesh/easymesh-parser.y" 780 787 { mc.m_mesh.CsgUnion(); } 781 788 break; 782 789 783 case 6 1:784 785 /* Line 677 of lalr1.cc */ 786 #line 16 3"easymesh/easymesh-parser.y"790 case 62: 791 792 /* Line 677 of lalr1.cc */ 793 #line 164 "easymesh/easymesh-parser.y" 787 794 { mc.m_mesh.CsgSubstract(); } 788 795 break; 789 796 790 case 6 2:791 792 /* Line 677 of lalr1.cc */ 793 #line 16 4"easymesh/easymesh-parser.y"797 case 63: 798 799 /* Line 677 of lalr1.cc */ 800 #line 165 "easymesh/easymesh-parser.y" 794 801 { mc.m_mesh.CsgSubstractLoss(); } 795 802 break; 796 803 797 case 6 3:798 799 /* Line 677 of lalr1.cc */ 800 #line 16 5"easymesh/easymesh-parser.y"804 case 64: 805 806 /* Line 677 of lalr1.cc */ 807 #line 166 "easymesh/easymesh-parser.y" 801 808 { mc.m_mesh.CsgAnd(); } 802 809 break; 803 810 804 case 6 4:805 806 /* Line 677 of lalr1.cc */ 807 #line 16 6"easymesh/easymesh-parser.y"811 case 65: 812 813 /* Line 677 of lalr1.cc */ 814 #line 167 "easymesh/easymesh-parser.y" 808 815 { mc.m_mesh.CsgXor(); } 809 816 break; 810 817 811 case 6 5:812 813 /* Line 677 of lalr1.cc */ 814 #line 17 0"easymesh/easymesh-parser.y"818 case 66: 819 820 /* Line 677 of lalr1.cc */ 821 #line 171 "easymesh/easymesh-parser.y" 815 822 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 816 823 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 818 825 break; 819 826 820 case 6 6:821 822 /* Line 677 of lalr1.cc */ 823 #line 17 3"easymesh/easymesh-parser.y"827 case 67: 828 829 /* Line 677 of lalr1.cc */ 830 #line 174 "easymesh/easymesh-parser.y" 824 831 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 825 832 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, … … 827 834 break; 828 835 829 case 6 7:830 831 /* Line 677 of lalr1.cc */ 832 #line 17 6"easymesh/easymesh-parser.y"836 case 68: 837 838 /* Line 677 of lalr1.cc */ 839 #line 177 "easymesh/easymesh-parser.y" 833 840 { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } 834 841 break; 835 842 836 case 6 8:837 838 /* Line 677 of lalr1.cc */ 839 #line 17 7"easymesh/easymesh-parser.y"843 case 69: 844 845 /* Line 677 of lalr1.cc */ 846 #line 178 "easymesh/easymesh-parser.y" 840 847 { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 841 848 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 842 849 break; 843 850 844 case 69:845 846 /* Line 677 of lalr1.cc */ 847 #line 1 79"easymesh/easymesh-parser.y"851 case 70: 852 853 /* Line 677 of lalr1.cc */ 854 #line 180 "easymesh/easymesh-parser.y" 848 855 { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 849 856 (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); } 850 857 break; 851 858 852 case 7 0:853 854 /* Line 677 of lalr1.cc */ 855 #line 18 1"easymesh/easymesh-parser.y"859 case 71: 860 861 /* Line 677 of lalr1.cc */ 862 #line 182 "easymesh/easymesh-parser.y" 856 863 { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } 857 864 break; 858 865 859 case 7 1:860 861 /* Line 677 of lalr1.cc */ 862 #line 18 2"easymesh/easymesh-parser.y"866 case 72: 867 868 /* Line 677 of lalr1.cc */ 869 #line 183 "easymesh/easymesh-parser.y" 863 870 { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 864 871 break; 865 872 866 case 7 2:867 868 /* Line 677 of lalr1.cc */ 869 #line 18 3"easymesh/easymesh-parser.y"873 case 73: 874 875 /* Line 677 of lalr1.cc */ 876 #line 184 "easymesh/easymesh-parser.y" 870 877 { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } 871 878 break; 872 879 873 case 7 3:874 875 /* Line 677 of lalr1.cc */ 876 #line 18 4"easymesh/easymesh-parser.y"880 case 74: 881 882 /* Line 677 of lalr1.cc */ 883 #line 185 "easymesh/easymesh-parser.y" 877 884 { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, 878 885 (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); } 879 886 break; 880 887 881 case 7 4:882 883 /* Line 677 of lalr1.cc */ 884 #line 18 6"easymesh/easymesh-parser.y"888 case 75: 889 890 /* Line 677 of lalr1.cc */ 891 #line 187 "easymesh/easymesh-parser.y" 885 892 { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 886 893 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); } 887 894 break; 888 895 889 case 7 5:890 891 /* Line 677 of lalr1.cc */ 892 #line 18 8"easymesh/easymesh-parser.y"896 case 76: 897 898 /* Line 677 of lalr1.cc */ 899 #line 189 "easymesh/easymesh-parser.y" 893 900 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } 894 901 break; 895 902 896 case 7 6:897 898 /* Line 677 of lalr1.cc */ 899 #line 1 89"easymesh/easymesh-parser.y"903 case 77: 904 905 /* Line 677 of lalr1.cc */ 906 #line 190 "easymesh/easymesh-parser.y" 900 907 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 901 908 break; 902 909 903 case 7 7:904 905 /* Line 677 of lalr1.cc */ 906 #line 19 0"easymesh/easymesh-parser.y"910 case 78: 911 912 /* Line 677 of lalr1.cc */ 913 #line 191 "easymesh/easymesh-parser.y" 907 914 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } 908 915 break; 909 916 910 case 7 8:911 912 /* Line 677 of lalr1.cc */ 913 #line 19 1"easymesh/easymesh-parser.y"917 case 79: 918 919 /* Line 677 of lalr1.cc */ 920 #line 192 "easymesh/easymesh-parser.y" 914 921 { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, 915 922 (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, … … 917 924 break; 918 925 919 case 79:920 921 /* Line 677 of lalr1.cc */ 922 #line 19 6"easymesh/easymesh-parser.y"926 case 80: 927 928 /* Line 677 of lalr1.cc */ 929 #line 197 "easymesh/easymesh-parser.y" 923 930 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } 924 931 break; 925 932 926 case 8 0:927 928 /* Line 677 of lalr1.cc */ 929 #line 19 7"easymesh/easymesh-parser.y"933 case 81: 934 935 /* Line 677 of lalr1.cc */ 936 #line 198 "easymesh/easymesh-parser.y" 930 937 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } 931 938 break; 932 939 933 case 8 1:934 935 /* Line 677 of lalr1.cc */ 936 #line 19 8"easymesh/easymesh-parser.y"940 case 82: 941 942 /* Line 677 of lalr1.cc */ 943 #line 199 "easymesh/easymesh-parser.y" 937 944 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } 938 945 break; 939 946 940 case 8 2:941 942 /* Line 677 of lalr1.cc */ 943 #line 199"easymesh/easymesh-parser.y"947 case 83: 948 949 /* Line 677 of lalr1.cc */ 950 #line 200 "easymesh/easymesh-parser.y" 944 951 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } 945 952 break; 946 953 947 case 8 3:948 949 /* Line 677 of lalr1.cc */ 950 #line 20 0"easymesh/easymesh-parser.y"954 case 84: 955 956 /* Line 677 of lalr1.cc */ 957 #line 201 "easymesh/easymesh-parser.y" 951 958 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } 952 959 break; 953 960 954 case 8 4:955 956 /* Line 677 of lalr1.cc */ 957 #line 20 1"easymesh/easymesh-parser.y"961 case 85: 962 963 /* Line 677 of lalr1.cc */ 964 #line 202 "easymesh/easymesh-parser.y" 958 965 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } 959 966 break; 960 967 961 case 8 5:962 963 /* Line 677 of lalr1.cc */ 964 #line 20 2"easymesh/easymesh-parser.y"968 case 86: 969 970 /* Line 677 of lalr1.cc */ 971 #line 203 "easymesh/easymesh-parser.y" 965 972 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } 966 973 break; 967 974 968 case 8 6:969 970 /* Line 677 of lalr1.cc */ 971 #line 20 3"easymesh/easymesh-parser.y"975 case 87: 976 977 /* Line 677 of lalr1.cc */ 978 #line 204 "easymesh/easymesh-parser.y" 972 979 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } 973 980 break; 974 981 975 case 8 7:976 977 /* Line 677 of lalr1.cc */ 978 #line 20 4"easymesh/easymesh-parser.y"982 case 88: 983 984 /* Line 677 of lalr1.cc */ 985 #line 205 "easymesh/easymesh-parser.y" 979 986 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); } 980 987 break; 981 988 982 case 8 8:983 984 /* Line 677 of lalr1.cc */ 985 #line 20 5"easymesh/easymesh-parser.y"989 case 89: 990 991 /* Line 677 of lalr1.cc */ 992 #line 206 "easymesh/easymesh-parser.y" 986 993 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); } 987 994 break; 988 995 989 case 89:990 991 /* Line 677 of lalr1.cc */ 992 #line 20 8"easymesh/easymesh-parser.y"996 case 90: 997 998 /* Line 677 of lalr1.cc */ 999 #line 209 "easymesh/easymesh-parser.y" 993 1000 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } 994 1001 break; 995 1002 996 case 9 0:997 998 /* Line 677 of lalr1.cc */ 999 #line 2 09"easymesh/easymesh-parser.y"1003 case 91: 1004 1005 /* Line 677 of lalr1.cc */ 1006 #line 210 "easymesh/easymesh-parser.y" 1000 1007 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } 1001 1008 break; … … 1004 1011 1005 1012 /* Line 677 of lalr1.cc */ 1006 #line 10 07"generated/easymesh-parser.cpp"1013 #line 1014 "generated/easymesh-parser.cpp" 1007 1014 default: 1008 1015 break; … … 1209 1216 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 1210 1217 STATE-NUM. */ 1211 const signed char EasyMeshParser::yypact_ninf_ = -7 0;1218 const signed char EasyMeshParser::yypact_ninf_ = -71; 1212 1219 const signed char 1213 1220 EasyMeshParser::yypact_[] = 1214 1221 { 1215 6 1, -41, -24, -48, -48, -48, -48, -48, -48, -48,1216 -4 8, -48, -70, -48, -48, -48, -48, -48, -48, -48,1217 -4 8, -48, -70, -48, -48, -48, -48, -48, -48, -48,1218 -4 8, -48, -70, -48, -48, -70, -48, -48, -70, -70,1219 -7 0, -70, -70, -48, -48, -48, -48, -48, -48, -48,1220 -4 8, -48, -48, -48, -48, -48, -48, -70, 4, 6,1221 61, 61, 121, -70, -70, -70, -70, -70, -70, -48,1222 -4 8, -48, -48, -70, -70, -70, -70, -70, -70, -48,1223 - 70, -70, -48, -70, -70, -70, -70, -70, -70, -70,1224 - 48, -70, -70, -48, -70, -70, -70, -70, -70, -70,1225 -7 0, -48, -70, -70, -48, -70, -70, -70, -70, -70,1226 -7 0, -70, -70, -70, -70, -48, -48, -48, -70, -70,1227 -7 0, -70, -70, -70, -70, -70, -70, -70, -70, -48,1228 - 48, -48, -48, -70, -70, -70, -70, -70, -54, -70,1229 - 70, -70, -70, -70, -70, -70, -70, -70, -70, -70,1230 -7 0, -701222 62, -42, -25, -49, -49, -49, -49, -49, -49, -49, 1223 -49, -49, -71, -49, -49, -49, -49, -49, -49, -49, 1224 -49, -49, -71, -49, -49, -49, -49, -49, -49, -49, 1225 -49, -49, -71, -49, -49, -71, -49, -49, -49, -71, 1226 -71, -71, -71, -71, -49, -49, -49, -49, -49, -49, 1227 -49, -49, -49, -49, -49, -49, -49, -49, -71, 4, 1228 6, 62, 62, 123, -71, -71, -71, -71, -71, -71, 1229 -49, -49, -49, -49, -71, -71, -71, -71, -71, -71, 1230 -49, -71, -71, -49, -71, -71, -71, -71, -71, -71, 1231 -71, -49, -71, -71, -49, -71, -71, -71, -71, -71, 1232 -71, -71, -49, -71, -71, -49, -71, -71, -71, -71, 1233 -71, -71, -71, -71, -71, -71, -71, -49, -49, -49, 1234 -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, 1235 -71, -49, -49, -49, -49, -71, -71, -71, -71, -71, 1236 -55, -71, -71, -71, -71, -71, -71, -71, -71, -71, 1237 -71, -71, -71, -71 1231 1238 }; 1232 1239 … … 1240 1247 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 1241 1248 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 1242 0, 0, 56, 0, 0, 59, 0, 0, 60, 61,1243 62, 63, 64, 0, 0, 0, 0, 0, 0, 0,1244 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,1245 3, 0, 5, 9, 11, 12, 13, 89, 15, 0,1246 0, 0, 0, 14, 79, 17, 16, 19, 23, 26,1247 2 7, 32, 35, 36, 41, 44, 45, 50, 20, 24,1248 2 8, 29, 33, 37, 38, 42, 46, 47, 51, 21,1249 2 5, 30, 31, 34, 39, 40, 43, 48, 49, 52,1250 22, 53, 57, 58, 18, 0, 0, 65, 66, 67,1251 6 8, 69, 70, 71, 73, 74, 75, 76, 77, 0,1252 0, 0, 0, 78, 72, 1, 2, 4, 0, 10,1253 90, 80, 81, 82, 83, 84, 85, 86, 87, 88,1254 8, 61249 0, 0, 56, 0, 0, 60, 0, 0, 0, 61, 1250 62, 63, 64, 65, 0, 0, 0, 0, 0, 0, 1251 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1252 0, 3, 0, 5, 9, 11, 12, 13, 90, 15, 1253 0, 0, 0, 0, 14, 80, 17, 16, 19, 23, 1254 26, 27, 32, 35, 36, 41, 44, 45, 50, 20, 1255 24, 28, 29, 33, 37, 38, 42, 46, 47, 51, 1256 21, 25, 30, 31, 34, 39, 40, 43, 48, 49, 1257 52, 22, 53, 57, 58, 59, 18, 0, 0, 66, 1258 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 1259 78, 0, 0, 0, 0, 79, 73, 1, 2, 4, 1260 0, 10, 91, 81, 82, 83, 84, 85, 86, 87, 1261 88, 89, 8, 6 1255 1262 }; 1256 1263 … … 1259 1266 EasyMeshParser::yypgoto_[] = 1260 1267 { 1261 -7 0, -70, -31, -70, -70, -70, -70, -51, -70, -70,1262 -7 0, 228, 181, 0, 179, -36, -33, -29, -70, -70,1263 -7 0, -691268 -71, -71, -32, -71, -71, -71, -71, -52, -71, -71, 1269 -71, 232, 184, 0, 182, -37, -34, -30, -71, -71, 1270 -71, -70 1264 1271 }; 1265 1272 … … 1268 1275 EasyMeshParser::yydefgoto_[] = 1269 1276 { 1270 -1, 5 8, 59, 60, 61, 151, 62, 63, 64, 65,1271 6 6, 70, 71, 72, 115, 116, 117, 118, 131, 132,1272 13 3, 741277 -1, 59, 60, 61, 62, 153, 63, 64, 65, 66, 1278 67, 71, 72, 73, 117, 118, 119, 120, 133, 134, 1279 135, 75 1273 1280 }; 1274 1281 … … 1280 1287 EasyMeshParser::yytable_[] = 1281 1288 { 1282 140, 141, 142, 143, 135, 79, 136, 82, 84, 150, 1283 143, 139, 67, 143, 124, 90, 69, 93, 95, 67, 1284 68, 143, 129, 69, 143, 101, 130, 104, 106, 137, 1285 138, 0, 143, 110, 111, 143, 67, 75, 0, 0, 1286 69, 0, 0, 0, 0, 119, 144, 145, 146, 123, 1287 0, 0, 126, 0, 0, 0, 134, 0, 0, 0, 1288 146, 147, 148, 149, 1, 2, 3, 4, 5, 6, 1289 142, 143, 144, 145, 137, 80, 138, 83, 85, 152, 1290 145, 141, 68, 145, 126, 91, 70, 94, 96, 68, 1291 69, 145, 131, 70, 145, 102, 132, 105, 107, 139, 1292 140, 0, 145, 111, 112, 145, 68, 76, 115, 0, 1293 70, 0, 0, 0, 0, 0, 121, 146, 147, 148, 1294 125, 0, 0, 128, 0, 0, 0, 136, 0, 0, 1295 0, 148, 149, 150, 151, 1, 2, 3, 4, 5, 1296 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1297 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1298 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 1299 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 1300 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 1301 56, 57, 0, 0, 0, 58, 1, 2, 3, 4, 1302 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1303 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1304 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 1305 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 1306 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 1307 55, 56, 57, 74, 77, 0, 0, 81, 0, 84, 1308 82, 0, 0, 86, 87, 0, 0, 92, 0, 95, 1309 93, 0, 0, 97, 98, 0, 0, 103, 0, 106, 1310 104, 0, 0, 108, 109, 0, 0, 0, 0, 0, 1311 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 1312 123, 0, 0, 124, 127, 78, 79, 0, 129, 130, 1313 0, 0, 0, 88, 0, 89, 90, 0, 0, 0, 1314 0, 0, 0, 99, 0, 100, 101, 0, 0, 0, 1315 0, 0, 0, 110, 0, 0, 0, 0, 113, 114, 1316 0, 0, 0, 0, 0, 0, 116 1317 }; 1318 1319 /* YYCHECK. */ 1320 const short int 1321 EasyMeshParser::yycheck_[] = 1322 { 1323 70, 71, 72, 73, 0, 5, 0, 7, 8, 64, 1324 80, 63, 61, 83, 51, 15, 65, 17, 18, 61, 1325 62, 91, 56, 65, 94, 25, 56, 27, 28, 61, 1326 62, -1, 102, 33, 34, 105, 61, 62, 38, -1, 1327 65, -1, -1, -1, -1, -1, 46, 117, 118, 119, 1328 50, -1, -1, 53, -1, -1, -1, 57, -1, -1, 1329 -1, 131, 132, 133, 134, 3, 4, 5, 6, 7, 1330 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1331 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 1332 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 1333 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 1334 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 1335 58, 59, -1, -1, -1, 63, 3, 4, 5, 6, 1289 1336 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1290 1337 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, … … 1292 1339 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 1293 1340 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 1294 0, 0, 0, 57, 1, 2, 3, 4, 5, 6, 1295 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1296 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1297 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1298 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 1299 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 1300 73, 76, 0, 0, 80, 0, 83, 81, 0, 0, 1301 85, 86, 0, 0, 91, 0, 94, 92, 0, 0, 1302 96, 97, 0, 0, 102, 0, 105, 103, 0, 0, 1303 107, 108, 0, 0, 0, 0, 0, 0, 0, 0, 1304 0, 0, 0, 0, 0, 120, 121, 0, 0, 122, 1305 125, 77, 78, 0, 127, 128, 0, 0, 0, 87, 1306 0, 88, 89, 0, 0, 0, 0, 0, 0, 98, 1307 0, 99, 100, 0, 0, 0, 0, 0, 0, 109, 1308 0, 0, 0, 0, 112, 113, 0, 0, 0, 0, 1309 0, 114 1310 }; 1311 1312 /* YYCHECK. */ 1313 const short int 1314 EasyMeshParser::yycheck_[] = 1315 { 1316 69, 70, 71, 72, 0, 5, 0, 7, 8, 63, 1317 79, 62, 60, 82, 50, 15, 64, 17, 18, 60, 1318 61, 90, 55, 64, 93, 25, 55, 27, 28, 60, 1319 61, -1, 101, 33, 34, 104, 60, 61, -1, -1, 1320 64, -1, -1, -1, -1, 45, 115, 116, 117, 49, 1321 -1, -1, 52, -1, -1, -1, 56, -1, -1, -1, 1322 129, 130, 131, 132, 3, 4, 5, 6, 7, 8, 1323 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1324 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1325 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 1326 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 1327 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 1328 -1, -1, -1, 62, 3, 4, 5, 6, 7, 8, 1329 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1330 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1331 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 1332 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 1333 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 1334 1, 2, -1, -1, 5, -1, 7, 6, -1, -1, 1335 9, 10, -1, -1, 15, -1, 17, 16, -1, -1, 1336 19, 20, -1, -1, 25, -1, 27, 26, -1, -1, 1337 29, 30, -1, -1, -1, -1, -1, -1, -1, -1, 1338 -1, -1, -1, -1, -1, 46, 47, -1, -1, 48, 1339 51, 3, 4, -1, 53, 54, -1, -1, -1, 11, 1340 -1, 13, 14, -1, -1, -1, -1, -1, -1, 21, 1341 -1, 23, 24, -1, -1, -1, -1, -1, -1, 31, 1342 -1, -1, -1, -1, 36, 37, -1, -1, -1, -1, 1343 -1, 43 1341 57, 58, 59, 1, 2, -1, -1, 5, -1, 7, 1342 6, -1, -1, 9, 10, -1, -1, 15, -1, 17, 1343 16, -1, -1, 19, 20, -1, -1, 25, -1, 27, 1344 26, -1, -1, 29, 30, -1, -1, -1, -1, -1, 1345 -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, 1346 48, -1, -1, 49, 52, 3, 4, -1, 54, 55, 1347 -1, -1, -1, 11, -1, 13, 14, -1, -1, -1, 1348 -1, -1, -1, 21, -1, 23, 24, -1, -1, -1, 1349 -1, -1, -1, 31, -1, -1, -1, -1, 36, 37, 1350 -1, -1, -1, -1, -1, -1, 44 1344 1351 }; 1345 1352 … … 1354 1361 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 1355 1362 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 1356 52, 53, 54, 55, 56, 57, 58, 62, 66, 67,1357 68, 69, 7 1, 72, 73, 74, 75, 60, 61, 64,1358 76, 77, 78, 79, 86, 61, 79, 76, 76, 78,1359 79, 77, 78, 79, 78, 77, 77, 76, 76, 76,1360 7 8, 79, 77, 78, 79, 78, 77, 77, 76, 76,1361 7 6, 78, 79, 77, 78, 79, 78, 77, 77, 76,1362 7 8, 78, 76, 76, 76, 79, 80, 81, 82, 78,1363 79, 79, 77, 78, 80, 79, 78, 77, 77, 81,1364 82, 83, 84, 85, 78, 0, 0, 67, 67, 72,1365 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,1366 63, 701363 52, 53, 54, 55, 56, 57, 58, 59, 63, 67, 1364 68, 69, 70, 72, 73, 74, 75, 76, 61, 62, 1365 65, 77, 78, 79, 80, 87, 62, 80, 77, 77, 1366 79, 80, 78, 79, 80, 79, 78, 78, 77, 77, 1367 77, 79, 80, 78, 79, 80, 79, 78, 78, 77, 1368 77, 77, 79, 80, 78, 79, 80, 79, 78, 78, 1369 77, 79, 79, 77, 77, 79, 77, 80, 81, 82, 1370 83, 79, 80, 80, 78, 79, 81, 80, 79, 78, 1371 78, 82, 83, 84, 85, 86, 79, 0, 0, 68, 1372 68, 73, 87, 87, 87, 87, 87, 87, 87, 87, 1373 87, 87, 64, 71 1367 1374 }; 1368 1375 … … 1379 1386 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 1380 1387 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 1381 315, 316, 91, 93, 451388 315, 316, 317, 91, 93, 45 1382 1389 }; 1383 1390 #endif … … 1387 1394 EasyMeshParser::yyr1_[] = 1388 1395 { 1389 0, 6 5, 66, 67, 67, 68, 68, 69, 70, 71,1390 7 1, 72, 72, 72, 73, 73, 73, 73, 74, 74,1391 7 4, 74, 74, 74, 74, 74, 74, 74, 74, 74,1392 7 4, 74, 74, 74, 74, 74, 74, 74, 74, 74,1393 7 4, 74, 74, 74, 74, 74, 74, 74, 74, 74,1394 7 4, 74, 74, 74, 74, 74, 74, 74, 74, 74,1395 7 4, 74, 74, 74, 74, 75, 75, 75, 75, 75,1396 7 5, 75, 75, 75, 75, 75, 75, 75, 75, 76,1396 0, 66, 67, 68, 68, 69, 69, 70, 71, 72, 1397 72, 73, 73, 73, 74, 74, 74, 74, 75, 75, 1398 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 1399 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 1400 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 1401 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 1402 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 1403 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 1397 1404 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 1398 8 61405 87, 87 1399 1406 }; 1400 1407 … … 1408 1415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1409 1416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1410 2, 2, 2, 2, 1, 1, 1, 2, 2, 1,1411 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,1412 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,1413 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,1414 21417 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1418 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1420 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1421 1, 2 1415 1422 }; 1416 1423 … … 1429 1436 "T_BENDZX", "T_BENDZY", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE", 1430 1437 "T_SCALE", "T_TOGGLESCALEWINDING", "T_RADIALJITTER", "T_SPLITTRIANGLE", 1431 "T_CSGUNION", "T_CSGSUBSTRACT", "T_CSGSUBSTRACTLOSS", "T_CSGAND", 1432 "T_CSGXOR", "T_CHAMFER", "T_CYLINDER", "T_BOX", "T_SMOOTHCHAMFBOX", 1433 "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR", "T_EXPANDEDSTAR", 1434 "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS", "T_ERROR", 1435 "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", "mesh_description", 1436 "mesh_expression_list", "mesh_expression", "mesh_open", "mesh_close", 1437 "mesh_command_list", "mesh_command", "color_command", 1438 "transform_command", "primitive_command", "args1", "args2", "args3", 1439 "args4", "args5", "args6", "args7", "args8", "args9", "args10", "number", 0 1438 "T_SMOOTHMESH", "T_CSGUNION", "T_CSGSUBSTRACT", "T_CSGSUBSTRACTLOSS", 1439 "T_CSGAND", "T_CSGXOR", "T_CHAMFER", "T_CYLINDER", "T_BOX", 1440 "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR", 1441 "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS", 1442 "T_ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", 1443 "mesh_description", "mesh_expression_list", "mesh_expression", 1444 "mesh_open", "mesh_close", "mesh_command_list", "mesh_command", 1445 "color_command", "transform_command", "primitive_command", "args1", 1446 "args2", "args3", "args4", "args5", "args6", "args7", "args8", "args9", 1447 "args10", "number", 0 1440 1448 }; 1441 1449 #endif … … 1446 1454 EasyMeshParser::yyrhs_[] = 1447 1455 { 1448 6 6, 0, -1, 67, 0, -1, 68, -1, 68, 67,1449 -1, 7 1, -1, 69, 67, 70, -1, 62, -1, 63,1450 -1, 7 2, -1, 71, 72, -1, 73, -1, 74, -1,1451 7 5, -1, 3, 79, -1, 3, 61, -1, 4, 79,1452 -1, 4, 6 1, -1, 45, 76, -1, 5, 76, -1,1453 15, 7 6, -1, 25, 76, -1, 35, 78, -1, 6,1454 7 6, -1, 16, 76, -1, 26, 76, -1, 7, 78,1455 -1, 7, 79, -1, 17, 78, -1, 17, 79, -1,1456 27, 7 8, -1, 27, 79, -1, 8, 77, -1, 18,1457 7 7, -1, 28, 77, -1, 9, 78, -1, 9, 79,1458 -1, 19, 7 8, -1, 19, 79, -1, 29, 78, -1,1459 29, 79, -1, 10, 78, -1, 20, 78, -1, 30,1460 7 8, -1, 11, 77, -1, 12, 77, -1, 21, 77,1461 -1, 22, 7 7, -1, 31, 77, -1, 32, 77, -1,1462 13, 7 6, -1, 23, 76, -1, 33, 76, -1, 36,1463 7 8, -1, 14, -1, 24, -1, 34, -1, 38, 76,1464 -1, 39, 7 6, -1, 37, -1, 40, -1, 41, -1,1465 42, -1, 43, -1, 44, -1, 46, 81, -1, 46,1466 82, -1, 47, 78, -1, 48, 79, -1, 49, 79,1467 -1, 50, 77, -1, 51, 78, -1, 58, 78, -1,1468 5 2, 80, -1, 53, 79, -1, 54, 78, -1, 55,1469 7 7, -1, 56, 77, -1, 57, 85, -1, 86, -1,1470 76, 86, -1, 77, 86, -1, 78, 86, -1, 79,1471 8 6, -1, 80, 86, -1, 81, 86, -1, 82, 86,1472 -1, 83, 8 6, -1, 84, 86, -1, 60, -1, 64,1473 86, -11456 67, 0, -1, 68, 0, -1, 69, -1, 69, 68, 1457 -1, 72, -1, 70, 68, 71, -1, 63, -1, 64, 1458 -1, 73, -1, 72, 73, -1, 74, -1, 75, -1, 1459 76, -1, 3, 80, -1, 3, 62, -1, 4, 80, 1460 -1, 4, 62, -1, 46, 77, -1, 5, 77, -1, 1461 15, 77, -1, 25, 77, -1, 35, 79, -1, 6, 1462 77, -1, 16, 77, -1, 26, 77, -1, 7, 79, 1463 -1, 7, 80, -1, 17, 79, -1, 17, 80, -1, 1464 27, 79, -1, 27, 80, -1, 8, 78, -1, 18, 1465 78, -1, 28, 78, -1, 9, 79, -1, 9, 80, 1466 -1, 19, 79, -1, 19, 80, -1, 29, 79, -1, 1467 29, 80, -1, 10, 79, -1, 20, 79, -1, 30, 1468 79, -1, 11, 78, -1, 12, 78, -1, 21, 78, 1469 -1, 22, 78, -1, 31, 78, -1, 32, 78, -1, 1470 13, 77, -1, 23, 77, -1, 33, 77, -1, 36, 1471 79, -1, 14, -1, 24, -1, 34, -1, 38, 77, 1472 -1, 39, 77, -1, 40, 79, -1, 37, -1, 41, 1473 -1, 42, -1, 43, -1, 44, -1, 45, -1, 47, 1474 82, -1, 47, 83, -1, 48, 79, -1, 49, 80, 1475 -1, 50, 80, -1, 51, 78, -1, 52, 79, -1, 1476 59, 79, -1, 53, 81, -1, 54, 80, -1, 55, 1477 79, -1, 56, 78, -1, 57, 78, -1, 58, 86, 1478 -1, 87, -1, 77, 87, -1, 78, 87, -1, 79, 1479 87, -1, 80, 87, -1, 81, 87, -1, 82, 87, 1480 -1, 83, 87, -1, 84, 87, -1, 85, 87, -1, 1481 61, -1, 65, 87, -1 1474 1482 }; 1475 1483 … … 1485 1493 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 1486 1494 140, 143, 146, 149, 152, 154, 156, 158, 161, 164, 1487 16 6, 168, 170, 172, 174, 176, 179, 182, 185, 188,1495 167, 169, 171, 173, 175, 177, 179, 182, 185, 188, 1488 1496 191, 194, 197, 200, 203, 206, 209, 212, 215, 218, 1489 22 0, 223, 226, 229, 232, 235, 238, 241, 244, 247,1490 2 491497 221, 223, 226, 229, 232, 235, 238, 241, 244, 247, 1498 250, 252 1491 1499 }; 1492 1500 … … 1501 1509 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 1502 1510 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 1503 162, 163, 164, 165, 166, 1 70, 173, 176, 177, 179,1504 18 1, 182, 183, 184, 186, 188, 189, 190, 191, 196,1505 197, 198, 199, 200, 201, 202, 203, 204, 205, 20 8,1506 209 1511 162, 163, 164, 165, 166, 167, 171, 174, 177, 178, 1512 180, 182, 183, 184, 185, 187, 189, 190, 191, 192, 1513 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 1514 209, 210 1507 1515 }; 1508 1516 … … 1548 1556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1549 1557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1550 2, 2, 2, 2, 2, 6 4, 2, 2, 2, 2,1551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1555 2, 6 2, 2, 63, 2, 2, 2, 2, 2, 2,1558 2, 2, 2, 2, 2, 65, 2, 2, 2, 2, 1559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1563 2, 63, 2, 64, 2, 2, 2, 2, 2, 2, 1556 1564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1557 1565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, … … 1575 1583 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 1576 1584 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 1577 55, 56, 57, 58, 59, 60, 61 1585 55, 56, 57, 58, 59, 60, 61, 62 1578 1586 }; 1579 1587 if ((unsigned int) t <= yyuser_token_number_max_) … … 1584 1592 1585 1593 const int EasyMeshParser::yyeof_ = 0; 1586 const int EasyMeshParser::yylast_ = 27 1;1594 const int EasyMeshParser::yylast_ = 276; 1587 1595 const int EasyMeshParser::yynnts_ = 22; 1588 1596 const int EasyMeshParser::yyempty_ = -2; 1589 const int EasyMeshParser::yyfinal_ = 13 5;1597 const int EasyMeshParser::yyfinal_ = 137; 1590 1598 const int EasyMeshParser::yyterror_ = 1; 1591 1599 const int EasyMeshParser::yyerrcode_ = 256; 1592 const int EasyMeshParser::yyntokens_ = 6 5;1593 1594 const unsigned int EasyMeshParser::yyuser_token_number_max_ = 31 6;1600 const int EasyMeshParser::yyntokens_ = 66; 1601 1602 const unsigned int EasyMeshParser::yyuser_token_number_max_ = 317; 1595 1603 const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2; 1596 1604 … … 1599 1607 1600 1608 /* Line 1053 of lalr1.cc */ 1601 #line 16 02"generated/easymesh-parser.cpp"1609 #line 1610 "generated/easymesh-parser.cpp" 1602 1610 1603 1611 1604 1612 /* Line 1055 of lalr1.cc */ 1605 #line 21 2"easymesh/easymesh-parser.y"1613 #line 213 "easymesh/easymesh-parser.y" 1606 1614 1607 1615 -
trunk/src/generated/easymesh-parser.h
r2407 r2410 170 170 T_RADIALJITTER = 293, 171 171 T_SPLITTRIANGLE = 294, 172 T_CSGUNION = 295, 173 T_CSGSUBSTRACT = 296, 174 T_CSGSUBSTRACTLOSS = 297, 175 T_CSGAND = 298, 176 T_CSGXOR = 299, 177 T_CHAMFER = 300, 178 T_CYLINDER = 301, 179 T_BOX = 302, 180 T_SMOOTHCHAMFBOX = 303, 181 T_FLATCHAMFBOX = 304, 182 T_SPHERE = 305, 183 T_CAPSULE = 306, 184 T_STAR = 307, 185 T_EXPANDEDSTAR = 308, 186 T_DISC = 309, 187 T_TRIANGLE = 310, 188 T_QUAD = 311, 189 T_COG = 312, 190 T_TORUS = 313, 191 T_ERROR = 314, 192 NUMBER = 315, 193 COLOR = 316 172 T_SMOOTHMESH = 295, 173 T_CSGUNION = 296, 174 T_CSGSUBSTRACT = 297, 175 T_CSGSUBSTRACTLOSS = 298, 176 T_CSGAND = 299, 177 T_CSGXOR = 300, 178 T_CHAMFER = 301, 179 T_CYLINDER = 302, 180 T_BOX = 303, 181 T_SMOOTHCHAMFBOX = 304, 182 T_FLATCHAMFBOX = 305, 183 T_SPHERE = 306, 184 T_CAPSULE = 307, 185 T_STAR = 308, 186 T_EXPANDEDSTAR = 309, 187 T_DISC = 310, 188 T_TRIANGLE = 311, 189 T_QUAD = 312, 190 T_COG = 313, 191 T_TORUS = 314, 192 T_ERROR = 315, 193 NUMBER = 316, 194 COLOR = 317 194 195 }; 195 196 … … 365 366 366 367 /* Line 34 of lalr1.cc */ 367 #line 36 8"generated/easymesh-parser.h"368 #line 369 "generated/easymesh-parser.h" 368 369 369 370 -
trunk/src/generated/easymesh-scanner.cpp
r2407 r2410 331 331 (yy_c_buf_p) = yy_cp; 332 332 333 #define YY_NUM_RULES 6 8334 #define YY_END_OF_BUFFER 69333 #define YY_NUM_RULES 69 334 #define YY_END_OF_BUFFER 70 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[1 09] =342 static yyconst flex_int16_t yy_accept[112] = 343 343 { 0, 344 0, 0, 69, 67, 66, 65, 67, 67, 62, 67, 345 61, 63, 64, 67, 67, 67, 67, 67, 32, 7, 346 0, 0, 61, 61, 0, 44, 45, 48, 0, 0, 347 51, 52, 55, 0, 3, 0, 34, 35, 36, 37, 348 8, 9, 10, 1, 0, 0, 0, 29, 30, 31, 349 0, 0, 0, 4, 5, 6, 0, 0, 61, 0, 350 47, 49, 0, 0, 0, 56, 0, 0, 0, 0, 351 2, 17, 18, 19, 0, 20, 21, 22, 11, 12, 352 13, 33, 14, 15, 16, 57, 46, 50, 53, 54, 353 23, 24, 25, 26, 27, 28, 42, 40, 39, 43, 354 355 38, 58, 41, 0, 59, 0, 60, 0 344 0, 0, 70, 68, 67, 66, 68, 68, 63, 68, 345 62, 64, 65, 68, 68, 68, 68, 68, 32, 7, 346 0, 0, 62, 62, 0, 45, 46, 49, 0, 0, 347 52, 53, 56, 0, 3, 0, 34, 35, 36, 37, 348 8, 9, 10, 1, 0, 0, 0, 0, 29, 30, 349 31, 0, 0, 0, 4, 5, 6, 0, 0, 62, 350 0, 48, 50, 0, 0, 0, 57, 0, 0, 0, 351 0, 2, 17, 18, 19, 0, 0, 20, 21, 22, 352 11, 12, 13, 33, 14, 15, 16, 58, 47, 51, 353 54, 55, 23, 24, 25, 26, 27, 28, 43, 41, 354 355 40, 44, 39, 38, 59, 42, 0, 60, 0, 61, 356 0 356 357 } ; 357 358 … … 396 397 } ; 397 398 398 static yyconst flex_int16_t yy_base[1 17] =399 static yyconst flex_int16_t yy_base[120] = 399 400 { 0, 400 0, 0, 1 38, 139, 139, 139, 0, 28, 30, 129,401 32, 1 39, 139, 36, 120, 27, 11, 25, 51, 73,402 0, 1 26, 53, 64, 82, 139, 54, 139, 104, 115,403 1 39, 53, 105, 59, 139, 109, 139, 139, 139, 139,404 1 39, 139, 139, 113, 62, 104, 65, 139, 139, 139,405 76, 94, 79, 139, 139, 139, 0, 116, 115, 97,406 1 39, 139, 107, 106, 99, 139, 69, 43, 82, 103,407 139, 139, 139, 139, 89, 139, 139, 139, 139, 139,408 1 39, 139, 139, 139, 139, 0, 139, 139, 139, 139,409 1 39, 139, 139, 139, 139, 139, 139, 95, 139, 139,410 411 1 39, 0, 139, 0, 0, 0, 139, 139, 98, 87,412 80, 77, 67, 54, 46, 39401 0, 0, 141, 142, 142, 142, 0, 28, 30, 132, 402 32, 142, 142, 36, 123, 27, 11, 25, 51, 73, 403 0, 130, 53, 65, 73, 142, 74, 142, 109, 121, 404 142, 52, 111, 56, 142, 115, 142, 142, 142, 142, 405 142, 142, 142, 119, 62, 103, 109, 65, 142, 142, 406 142, 76, 99, 79, 142, 142, 142, 0, 121, 120, 407 102, 142, 142, 112, 111, 104, 142, 35, 68, 59, 408 90, 142, 142, 142, 142, 103, 92, 142, 142, 142, 409 142, 142, 142, 142, 142, 142, 142, 0, 142, 142, 410 142, 142, 142, 142, 142, 142, 142, 142, 142, 97, 411 412 142, 142, 142, 142, 0, 142, 0, 0, 0, 142, 413 142, 115, 114, 113, 112, 70, 54, 46, 39 413 414 } ; 414 415 415 static yyconst flex_int16_t yy_def[1 17] =416 static yyconst flex_int16_t yy_def[120] = 416 417 { 0, 417 1 08, 1, 108, 108, 108, 108, 109, 108, 108, 108,418 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,419 11 0, 108, 108, 108, 108, 108, 108, 108, 108, 108,420 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,421 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,422 1 08, 108, 108, 108, 108, 108, 111, 108, 108, 108,423 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,424 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,425 1 08, 108, 108, 108, 108, 112, 108, 108, 108, 108,426 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,427 428 1 08, 113, 108, 114, 115, 116, 108, 0, 108, 108,429 108, 108, 108, 108, 108, 108418 111, 1, 111, 111, 111, 111, 112, 111, 111, 111, 419 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 420 113, 111, 111, 111, 111, 111, 111, 111, 111, 111, 421 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 422 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 423 111, 111, 111, 111, 111, 111, 111, 114, 111, 111, 424 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 425 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 426 111, 111, 111, 111, 111, 111, 111, 115, 111, 111, 427 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 428 429 111, 111, 111, 111, 116, 111, 117, 118, 119, 111, 430 0, 111, 111, 111, 111, 111, 111, 111, 111 430 431 } ; 431 432 432 static yyconst flex_int16_t yy_nxt[17 4] =433 static yyconst flex_int16_t yy_nxt[177] = 433 434 { 0, 434 435 4, 5, 6, 7, 8, 9, 10, 11, 4, 4, … … 436 437 4, 4, 17, 4, 4, 4, 18, 19, 20, 4, 437 438 4, 4, 4, 4, 22, 23, 22, 23, 22, 23, 438 1 07, 25, 37, 38, 39, 40, 35, 106, 25, 26,439 27, 28, 29, 30, 36, 10 5, 41, 42, 43, 22,440 23, 31, 25, 32, 33, 44, 6 0, 64, 104, 25,441 45, 24, 61, 25, 93, 46, 94, 65, 102, 47,442 25, 86, 48, 49, 50, 51, 58, 58, 57, 59,443 67, 68, 69, 72, 73, 74, 76, 77, 78, 21,444 445 5 2, 91, 92, 53, 54, 55, 56, 79, 80, 81,446 8 3, 84, 85, 95, 96, 97, 103, 101, 90, 89,447 88, 87, 59, 59, 82, 75, 71, 70, 66, 63,448 98, 62, 99, 24, 100, 34, 24, 108, 3, 108,449 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,450 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,451 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,452 1 08, 108, 108439 110, 25, 37, 38, 39, 40, 35, 109, 25, 26, 440 27, 28, 29, 30, 36, 108, 41, 42, 43, 22, 441 23, 31, 25, 32, 33, 44, 65, 93, 94, 25, 442 45, 107, 24, 46, 25, 47, 66, 59, 59, 48, 443 60, 25, 49, 50, 51, 52, 61, 68, 69, 70, 444 97, 98, 62, 73, 74, 75, 78, 79, 80, 95, 445 446 53, 96, 99, 54, 55, 56, 57, 81, 82, 83, 447 85, 86, 87, 105, 88, 58, 21, 100, 106, 101, 448 104, 102, 103, 92, 91, 90, 89, 60, 60, 84, 449 77, 76, 72, 71, 67, 64, 63, 24, 34, 24, 450 111, 3, 111, 111, 111, 111, 111, 111, 111, 111, 451 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 452 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 453 111, 111, 111, 111, 111, 111 453 454 } ; 454 455 455 static yyconst flex_int16_t yy_chk[17 4] =456 static yyconst flex_int16_t yy_chk[177] = 456 457 { 0, 457 458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … … 459 460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 460 461 1, 1, 1, 1, 8, 8, 9, 9, 11, 11, 461 11 6, 11, 17, 17, 17, 18, 16, 115, 11, 14,462 14, 14, 14, 14, 16, 11 4, 18, 18, 18, 23,463 23, 14, 23, 14, 14, 19, 27, 32, 113, 23,464 19, 24, 27, 24, 68, 19, 68, 32, 112, 19,465 2 4, 111, 19, 19, 19, 20, 25, 25, 110, 25,466 34, 34, 34, 45, 45, 45, 47, 47, 47, 109,467 468 20, 6 7, 67, 20, 20, 20, 20, 51, 51, 51,469 5 3, 53, 53, 69, 69, 70, 98, 75, 65, 64,470 63, 60, 59, 58, 52, 46, 44, 36, 33, 30,471 70, 29, 70, 22, 70, 15, 10, 3, 108, 108,472 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,473 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,474 1 08, 108, 108, 108, 108, 108, 108, 108, 108, 108,475 1 08, 108, 108462 119, 11, 17, 17, 17, 18, 16, 118, 11, 14, 463 14, 14, 14, 14, 16, 117, 18, 18, 18, 23, 464 23, 14, 23, 14, 14, 19, 32, 68, 68, 23, 465 19, 116, 24, 19, 24, 19, 32, 25, 25, 19, 466 25, 24, 19, 19, 19, 20, 27, 34, 34, 34, 467 70, 70, 27, 45, 45, 45, 48, 48, 48, 69, 468 469 20, 69, 71, 20, 20, 20, 20, 52, 52, 52, 470 54, 54, 54, 115, 114, 113, 112, 71, 100, 71, 471 77, 71, 76, 66, 65, 64, 61, 60, 59, 53, 472 47, 46, 44, 36, 33, 30, 29, 22, 15, 10, 473 3, 111, 111, 111, 111, 111, 111, 111, 111, 111, 474 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 475 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 476 111, 111, 111, 111, 111, 111 476 477 } ; 477 478 … … 522 523 #define YY_NO_UNISTD_H 523 524 #define YY_USER_ACTION yylloc->columns(yyleng); 524 #line 52 5"generated/easymesh-scanner.cpp"525 #line 526 "generated/easymesh-scanner.cpp" 525 526 526 527 #define INITIAL 0 … … 635 636 636 637 637 #line 63 8"generated/easymesh-scanner.cpp"638 #line 639 "generated/easymesh-scanner.cpp" 638 639 639 640 if ( !(yy_init) ) … … 688 689 { 689 690 yy_current_state = (int) yy_def[yy_current_state]; 690 if ( yy_current_state >= 1 09)691 if ( yy_current_state >= 112 ) 691 692 yy_c = yy_meta[(unsigned int) yy_c]; 692 693 } … … 694 695 ++yy_cp; 695 696 } 696 while ( yy_current_state != 1 08);697 while ( yy_current_state != 111 ); 697 698 yy_cp = (yy_last_accepting_cpos); 698 699 yy_current_state = (yy_last_accepting_state); … … 906 907 case 39: 907 908 YY_RULE_SETUP 908 #line 91 "easymesh/easymesh-scanner.l" 909 #line 90 "easymesh/easymesh-scanner.l" 910 { return token::T_SMOOTHMESH; } 911 YY_BREAK 912 case 40: 913 YY_RULE_SETUP 914 #line 92 "easymesh/easymesh-scanner.l" 909 915 { return token::T_CSGUNION; } 910 916 YY_BREAK 911 case 4 0:912 YY_RULE_SETUP 913 #line 9 2"easymesh/easymesh-scanner.l"917 case 41: 918 YY_RULE_SETUP 919 #line 93 "easymesh/easymesh-scanner.l" 914 920 { return token::T_CSGSUBSTRACT; } 915 921 YY_BREAK 916 case 4 1:917 YY_RULE_SETUP 918 #line 9 3"easymesh/easymesh-scanner.l"922 case 42: 923 YY_RULE_SETUP 924 #line 94 "easymesh/easymesh-scanner.l" 919 925 { return token::T_CSGSUBSTRACTLOSS; } 920 926 YY_BREAK 921 case 4 2:922 YY_RULE_SETUP 923 #line 9 4"easymesh/easymesh-scanner.l"927 case 43: 928 YY_RULE_SETUP 929 #line 95 "easymesh/easymesh-scanner.l" 924 930 { return token::T_CSGAND; } 925 931 YY_BREAK 926 case 4 3:927 YY_RULE_SETUP 928 #line 9 5"easymesh/easymesh-scanner.l"932 case 44: 933 YY_RULE_SETUP 934 #line 96 "easymesh/easymesh-scanner.l" 929 935 { return token::T_CSGXOR; } 930 936 YY_BREAK 931 case 4 4:932 YY_RULE_SETUP 933 #line 9 7"easymesh/easymesh-scanner.l"937 case 45: 938 YY_RULE_SETUP 939 #line 98 "easymesh/easymesh-scanner.l" 934 940 { return token::T_BOX; } 935 941 YY_BREAK 936 case 4 5:937 YY_RULE_SETUP 938 #line 9 8"easymesh/easymesh-scanner.l"942 case 46: 943 YY_RULE_SETUP 944 #line 99 "easymesh/easymesh-scanner.l" 939 945 { return token::T_CYLINDER; } 940 946 YY_BREAK 941 case 4 6:942 YY_RULE_SETUP 943 #line 99"easymesh/easymesh-scanner.l"947 case 47: 948 YY_RULE_SETUP 949 #line 100 "easymesh/easymesh-scanner.l" 944 950 { return token::T_CAPSULE; } 945 951 YY_BREAK 946 case 4 7:947 YY_RULE_SETUP 948 #line 10 0"easymesh/easymesh-scanner.l"952 case 48: 953 YY_RULE_SETUP 954 #line 101 "easymesh/easymesh-scanner.l" 949 955 { return token::T_COG; } 950 956 YY_BREAK 951 case 4 8:952 YY_RULE_SETUP 953 #line 10 1"easymesh/easymesh-scanner.l"957 case 49: 958 YY_RULE_SETUP 959 #line 102 "easymesh/easymesh-scanner.l" 954 960 { return token::T_DISC; } 955 961 YY_BREAK 956 case 49:957 YY_RULE_SETUP 958 #line 10 2"easymesh/easymesh-scanner.l"962 case 50: 963 YY_RULE_SETUP 964 #line 103 "easymesh/easymesh-scanner.l" 959 965 { return token::T_EXPANDEDSTAR; } 960 966 YY_BREAK 961 case 5 0:962 YY_RULE_SETUP 963 #line 10 3"easymesh/easymesh-scanner.l"967 case 51: 968 YY_RULE_SETUP 969 #line 104 "easymesh/easymesh-scanner.l" 964 970 { return token::T_FLATCHAMFBOX; } 965 971 YY_BREAK 966 case 5 1:967 YY_RULE_SETUP 968 #line 10 4"easymesh/easymesh-scanner.l"972 case 52: 973 YY_RULE_SETUP 974 #line 105 "easymesh/easymesh-scanner.l" 969 975 { return token::T_QUAD; } 970 976 YY_BREAK 971 case 5 2:972 YY_RULE_SETUP 973 #line 10 5"easymesh/easymesh-scanner.l"977 case 53: 978 YY_RULE_SETUP 979 #line 106 "easymesh/easymesh-scanner.l" 974 980 { return token::T_STAR; } 975 981 YY_BREAK 976 case 5 3:977 YY_RULE_SETUP 978 #line 10 6"easymesh/easymesh-scanner.l"982 case 54: 983 YY_RULE_SETUP 984 #line 107 "easymesh/easymesh-scanner.l" 979 985 { return token::T_SMOOTHCHAMFBOX; } 980 986 YY_BREAK 981 case 5 4:982 YY_RULE_SETUP 983 #line 10 7"easymesh/easymesh-scanner.l"987 case 55: 988 YY_RULE_SETUP 989 #line 108 "easymesh/easymesh-scanner.l" 984 990 { return token::T_SPHERE; } 985 991 YY_BREAK 986 case 5 5:987 YY_RULE_SETUP 988 #line 10 8"easymesh/easymesh-scanner.l"992 case 56: 993 YY_RULE_SETUP 994 #line 109 "easymesh/easymesh-scanner.l" 989 995 { return token::T_TRIANGLE; } 990 996 YY_BREAK 991 case 5 6:992 YY_RULE_SETUP 993 #line 1 09"easymesh/easymesh-scanner.l"997 case 57: 998 YY_RULE_SETUP 999 #line 110 "easymesh/easymesh-scanner.l" 994 1000 { return token::T_TORUS; } 995 1001 YY_BREAK 996 case 5 7:997 YY_RULE_SETUP 998 #line 11 1"easymesh/easymesh-scanner.l"1002 case 58: 1003 YY_RULE_SETUP 1004 #line 112 "easymesh/easymesh-scanner.l" 999 1005 { 1000 1006 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); … … 1005 1011 return token::COLOR; } 1006 1012 YY_BREAK 1007 case 5 8:1008 YY_RULE_SETUP 1009 #line 11 8"easymesh/easymesh-scanner.l"1013 case 59: 1014 YY_RULE_SETUP 1015 #line 119 "easymesh/easymesh-scanner.l" 1010 1016 { 1011 1017 uint32_t tmp = std::strtol(yytext + 1, NULL, 16); … … 1016 1022 return token::COLOR; } 1017 1023 YY_BREAK 1018 case 59:1019 YY_RULE_SETUP 1020 #line 12 5"easymesh/easymesh-scanner.l"1024 case 60: 1025 YY_RULE_SETUP 1026 #line 126 "easymesh/easymesh-scanner.l" 1021 1027 { 1022 1028 yylval->u32val = 0xffu … … 1024 1030 return token::COLOR; } 1025 1031 YY_BREAK 1026 case 6 0:1027 YY_RULE_SETUP 1028 #line 1 29"easymesh/easymesh-scanner.l"1032 case 61: 1033 YY_RULE_SETUP 1034 #line 130 "easymesh/easymesh-scanner.l" 1029 1035 { 1030 1036 yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16); 1031 1037 return token::COLOR; } 1032 1038 YY_BREAK 1033 case 6 1:1034 YY_RULE_SETUP 1035 #line 13 2"easymesh/easymesh-scanner.l"1039 case 62: 1040 YY_RULE_SETUP 1041 #line 133 "easymesh/easymesh-scanner.l" 1036 1042 { 1037 1043 yylval->fval = std::atof(yytext); return token::NUMBER; } 1038 1044 YY_BREAK 1039 case 6 2:1040 YY_RULE_SETUP 1041 #line 13 4"easymesh/easymesh-scanner.l"1045 case 63: 1046 YY_RULE_SETUP 1047 #line 135 "easymesh/easymesh-scanner.l" 1042 1048 { return token_type('-'); } 1043 1049 YY_BREAK 1044 case 6 3:1045 YY_RULE_SETUP 1046 #line 13 5"easymesh/easymesh-scanner.l"1050 case 64: 1051 YY_RULE_SETUP 1052 #line 136 "easymesh/easymesh-scanner.l" 1047 1053 { return token_type('['); } 1048 1054 YY_BREAK 1049 case 6 4:1050 YY_RULE_SETUP 1051 #line 13 6"easymesh/easymesh-scanner.l"1055 case 65: 1056 YY_RULE_SETUP 1057 #line 137 "easymesh/easymesh-scanner.l" 1052 1058 { return token_type(']'); } 1053 1059 YY_BREAK 1054 case 65:1055 YY_RULE_SETUP1056 #line 137 "easymesh/easymesh-scanner.l"1057 { /* ignore this */ }1058 YY_BREAK1059 1060 case 66: 1060 /* rule 66 can match eol */1061 1061 YY_RULE_SETUP 1062 1062 #line 138 "easymesh/easymesh-scanner.l" … … 1064 1064 YY_BREAK 1065 1065 case 67: 1066 /* rule 67 can match eol */ 1066 1067 YY_RULE_SETUP 1067 1068 #line 139 "easymesh/easymesh-scanner.l" 1069 { /* ignore this */ } 1070 YY_BREAK 1071 case 68: 1072 YY_RULE_SETUP 1073 #line 140 "easymesh/easymesh-scanner.l" 1068 1074 { return token::T_ERROR; } 1069 1075 YY_BREAK 1070 case 6 8:1071 YY_RULE_SETUP 1072 #line 14 1"easymesh/easymesh-scanner.l"1076 case 69: 1077 YY_RULE_SETUP 1078 #line 142 "easymesh/easymesh-scanner.l" 1073 1079 ECHO; 1074 1080 YY_BREAK 1075 #line 10 76"generated/easymesh-scanner.cpp"1081 #line 1082 "generated/easymesh-scanner.cpp" 1076 1082 case YY_STATE_EOF(INITIAL): 1077 1083 yyterminate(); … … 1455 1461 { 1456 1462 yy_current_state = (int) yy_def[yy_current_state]; 1457 if ( yy_current_state >= 1 09)1463 if ( yy_current_state >= 112 ) 1458 1464 yy_c = yy_meta[(unsigned int) yy_c]; 1459 1465 } … … 1483 1489 { 1484 1490 yy_current_state = (int) yy_def[yy_current_state]; 1485 if ( yy_current_state >= 1 09)1491 if ( yy_current_state >= 112 ) 1486 1492 yy_c = yy_meta[(unsigned int) yy_c]; 1487 1493 } 1488 1494 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1489 yy_is_jam = (yy_current_state == 1 08);1495 yy_is_jam = (yy_current_state == 111); 1490 1496 1491 1497 return yy_is_jam ? 0 : yy_current_state; … … 1974 1980 #define YYTABLES_NAME "yytables" 1975 1981 1976 #line 14 1"easymesh/easymesh-scanner.l"1982 #line 142 "easymesh/easymesh-scanner.l" 1977 1983 1978 1984 -
trunk/src/generated/location.hh
r2318 r2410 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Locations for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify -
trunk/src/generated/lolfx-parser.cpp
r2318 r2410 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 36 36 /* First part of user declarations. */ 37 37 38 /* Line 293of lalr1.cc */38 /* Line 310 of lalr1.cc */ 39 39 #line 1 "gpu/lolfx-parser.y" 40 40 … … 59 59 60 60 61 /* Line 293of lalr1.cc */61 /* Line 310 of lalr1.cc */ 62 62 #line 63 "generated/lolfx-parser.cpp" 63 63 … … 67 67 /* User implementation prologue. */ 68 68 69 /* Line 299of lalr1.cc */69 /* Line 316 of lalr1.cc */ 70 70 #line 241 "gpu/lolfx-parser.y" 71 71 … … 76 76 77 77 78 /* Line 299of lalr1.cc */78 /* Line 316 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 ends95 the previous symbol: RHS[0] (always defined). */96 97 #define YYRHSLOC(Rhs, K) ((Rhs)[K])98 #ifndef YYLLOC_DEFAULT99 # define YYLLOC_DEFAULT(Current, Rhs, N) \100 do \101 if (N) \102 { \103 (Current).begin = YYRHSLOC (Rhs, 1).begin; \104 (Current).end = YYRHSLOC (Rhs, N).end; \105 } \106 else \107 { \108 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \109 } \110 while (false)111 #endif112 113 93 /* Suppress unused-variable warnings by "using" E. */ 114 94 #define YYUSE(e) ((void) (e)) … … 162 142 namespace lol { 163 143 164 /* Line 382 of lalr1.cc */ 165 #line 166 "generated/lolfx-parser.cpp" 144 /* Line 379 of lalr1.cc */ 145 #line 146 "generated/lolfx-parser.cpp" 146 #if YYERROR_VERBOSE 166 147 167 148 /* Return YYSTR after stripping away unnecessary quotes and … … 202 183 } 203 184 185 #endif 204 186 205 187 /// Build a parser object. … … 302 284 #endif 303 285 304 inline bool305 LolFxParser::yy_pact_value_is_default_ (int yyvalue)306 {307 return yyvalue == yypact_ninf_;308 }309 310 inline bool311 LolFxParser::yy_table_value_is_error_ (int yyvalue)312 {313 return yyvalue == yytable_ninf_;314 }315 316 286 int 317 287 LolFxParser::parse () … … 335 305 location_type yylloc; 336 306 /// The locations where the error started and ended. 337 location_type yyerror_range[ 3];307 location_type yyerror_range[2]; 338 308 339 309 /// $$. … … 373 343 /* Try to take a decision without lookahead. */ 374 344 yyn = yypact_[yystate]; 375 if (yy _pact_value_is_default_ (yyn))345 if (yyn == yypact_ninf_) 376 346 goto yydefault; 377 347 … … 406 376 if (yyn <= 0) 407 377 { 408 if (yy _table_value_is_error_ (yyn))409 378 if (yyn == 0 || yyn == yytable_ninf_) 379 goto yyerrlab; 410 380 yyn = -yyn; 411 381 goto yyreduce; … … 463 433 case 202: 464 434 465 /* Line 6 90of lalr1.cc */435 /* Line 677 of lalr1.cc */ 466 436 #line 728 "gpu/lolfx-parser.y" 467 437 { std::cout << "New tech " << std::endl; } … … 470 440 case 203: 471 441 472 /* Line 6 90of lalr1.cc */442 /* Line 677 of lalr1.cc */ 473 443 #line 736 "gpu/lolfx-parser.y" 474 444 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } … … 477 447 case 204: 478 448 479 /* Line 6 90of lalr1.cc */449 /* Line 677 of lalr1.cc */ 480 450 #line 737 "gpu/lolfx-parser.y" 481 451 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } … … 484 454 case 207: 485 455 486 /* Line 6 90of lalr1.cc */456 /* Line 677 of lalr1.cc */ 487 457 #line 750 "gpu/lolfx-parser.y" 488 458 { std::cout << "New pass " << std::endl; } … … 491 461 case 226: 492 462 493 /* Line 6 90of lalr1.cc */463 /* Line 677 of lalr1.cc */ 494 464 #line 786 "gpu/lolfx-parser.y" 495 465 { std::cout << "new shader" << std::endl; } … … 498 468 499 469 500 /* Line 6 90of lalr1.cc */501 #line 502 "generated/lolfx-parser.cpp"470 /* Line 677 of lalr1.cc */ 471 #line 472 "generated/lolfx-parser.cpp" 502 472 default: 503 473 break; 504 474 } 505 /* User semantic actions sometimes alter yychar, and that requires506 that yytoken be updated with the new translation. We take the507 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 action510 invokes YYABORT, YYACCEPT, or YYERROR immediately after altering511 yychar. In the case of YYABORT or YYACCEPT, an incorrect512 destructor might then be invoked immediately. In the case of513 YYERROR, subsequent parser actions might lead to an incorrect514 destructor call or verbose syntax error message before the515 lookahead is translated. */516 475 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 517 476 … … 537 496 `------------------------------------*/ 538 497 yyerrlab: 539 /* Make sure we have latest lookahead translation. See comments at540 user semantic actions for why this is necessary. */541 yytoken = yytranslate_ (yychar);542 543 498 /* If not already recovering from an error, report this error. */ 544 499 if (!yyerrstatus_) 545 500 { 546 501 ++yynerrs_; 547 if (yychar == yyempty_)548 yytoken = yyempty_;549 502 error (yylloc, yysyntax_error_ (yystate, yytoken)); 550 503 } 551 504 552 yyerror_range[ 1] = yylloc;505 yyerror_range[0] = yylloc; 553 506 if (yyerrstatus_ == 3) 554 507 { … … 585 538 goto yyerrorlab; 586 539 587 yyerror_range[ 1] = yylocation_stack_[yylen - 1];540 yyerror_range[0] = yylocation_stack_[yylen - 1]; 588 541 /* Do not reclaim the symbols of the rule which action triggered 589 542 this YYERROR. */ … … 602 555 { 603 556 yyn = yypact_[yystate]; 604 if ( !yy_pact_value_is_default_ (yyn))557 if (yyn != yypact_ninf_) 605 558 { 606 559 yyn += yyterror_; … … 617 570 YYABORT; 618 571 619 yyerror_range[ 1] = yylocation_stack_[0];572 yyerror_range[0] = yylocation_stack_[0]; 620 573 yydestruct_ ("Error: popping", 621 574 yystos_[yystate], … … 626 579 } 627 580 628 yyerror_range[ 2] = yylloc;581 yyerror_range[1] = yylloc; 629 582 // Using YYLLOC is tempting, but would change the location of 630 583 // the lookahead. YYLOC is available though. 631 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);584 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); 632 585 yysemantic_stack_.push (yylval); 633 586 yylocation_stack_.push (yyloc); … … 652 605 yyreturn: 653 606 if (yychar != yyempty_) 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 } 607 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 661 608 662 609 /* Do not reclaim the symbols of the rule which action triggered … … 677 624 // Generate an error message. 678 625 std::string 679 LolFxParser::yysyntax_error_ (int yystate, int yytoken)626 LolFxParser::yysyntax_error_ (int yystate, int tok) 680 627 { 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_) 628 std::string res; 629 YYUSE (yystate); 630 #if YYERROR_VERBOSE 631 int yyn = yypact_[yystate]; 632 if (yypact_ninf_ < yyn && yyn <= yylast_) 716 633 { 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 } 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 } 741 666 } 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; 667 else 668 #endif 669 res = YY_("syntax error"); 670 return res; 770 671 } 771 672 … … 846 747 }; 847 748 848 /* YYDEFACT[S] -- default r eduction number in state S. Performed when849 YYTABLE doesn't specify something else to do. Zero means the850 default is anerror. */749 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE 750 doesn't specify something else to do. Zero means the default is an 751 error. */ 851 752 const unsigned short int 852 753 LolFxParser::yydefact_[] = … … 955 856 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 956 857 positive, shift that token. If negative, reduce the rule which 957 number is the opposite. If YYTABLE_NINF_, syntax error. */858 number is the opposite. If zero, do what YYDEFACT says. */ 958 859 const short int LolFxParser::yytable_ninf_ = -323; 959 860 const short int … … 3891 3792 } // lol 3892 3793 3893 /* Line 1 136of lalr1.cc */3894 #line 3 895"generated/lolfx-parser.cpp"3895 3896 3897 /* Line 1 138of lalr1.cc */3794 /* Line 1053 of lalr1.cc */ 3795 #line 3796 "generated/lolfx-parser.cpp" 3796 3797 3798 /* Line 1055 of lalr1.cc */ 3898 3799 #line 1298 "gpu/lolfx-parser.y" 3899 3800 -
trunk/src/generated/lolfx-parser.h
r2318 r2410 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 41 41 #include <iostream> 42 42 #include "stack.hh" 43 44 45 namespace lol { 46 47 /* Line 34 of lalr1.cc */ 48 #line 49 "generated/lolfx-parser.h" 49 class position; 50 class location; 51 52 } // lol 53 54 /* Line 34 of lalr1.cc */ 55 #line 56 "generated/lolfx-parser.h" 56 43 57 #include "location.hh" 44 58 … … 61 75 #endif 62 76 77 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 78 If N is 0, then set CURRENT to the empty location which ends 79 the previous symbol: RHS[0] (always defined). */ 80 81 #ifndef YYLLOC_DEFAULT 82 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 83 do { \ 84 if (N) \ 85 { \ 86 (Current).begin = (Rhs)[1].begin; \ 87 (Current).end = (Rhs)[N].end; \ 88 } \ 89 else \ 90 { \ 91 (Current).begin = (Current).end = (Rhs)[0].end; \ 92 } \ 93 } while (false) 94 #endif 95 63 96 64 97 namespace lol { 65 98 66 /* Line 3 5of lalr1.cc */67 #line 68"generated/lolfx-parser.h"99 /* Line 34 of lalr1.cc */ 100 #line 101 "generated/lolfx-parser.h" 68 101 69 102 /// A Bison parser. … … 76 109 { 77 110 78 /* Line 3 5of lalr1.cc */111 /* Line 34 of lalr1.cc */ 79 112 #line 34 "gpu/lolfx-parser.y" 80 113 … … 86 119 87 120 88 /* Line 3 5of lalr1.cc */89 #line 90"generated/lolfx-parser.h"121 /* Line 34 of lalr1.cc */ 122 #line 123 "generated/lolfx-parser.h" 90 123 }; 91 124 #else … … 608 641 location_stack_type yylocation_stack_; 609 642 610 /// Whether the given \c yypact_ value indicates a defaulted state.611 /// \param yyvalue the value to check612 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 check616 static bool yy_table_value_is_error_ (int yyvalue);617 618 643 /// Internal symbol numbers. 619 644 typedef unsigned short int token_number_type; … … 623 648 static const short int yypact_ninf_; 624 649 625 /// For a state, default r eduction number.650 /// For a state, default rule to reduce. 626 651 /// Unless\a yytable_ specifies something else to do. 627 652 /// Zero means the default is an error. … … 654 679 #endif 655 680 681 #if YYERROR_VERBOSE 656 682 /// Convert the symbol name \a n to a form suitable for a diagnostic. 657 static std::string yytnamerr_ (const char *n); 683 virtual std::string yytnamerr_ (const char *n); 684 #endif 658 685 659 686 #if YYDEBUG … … 713 740 } // lol 714 741 715 /* Line 3 5of lalr1.cc */716 #line 7 17"generated/lolfx-parser.h"742 /* Line 34 of lalr1.cc */ 743 #line 744 "generated/lolfx-parser.h" 717 744 718 745 -
trunk/src/generated/position.hh
r2318 r2410 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Positions for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify -
trunk/src/generated/stack.hh
r2318 r2410 1 /* A Bison parser, made by GNU Bison 2. 5. */1 /* A Bison parser, made by GNU Bison 2.4.2. */ 2 2 3 3 /* Stack handling for Bison parsers in C++ 4 4 5 Copyright (C) 2002-201 1Free Software Foundation, Inc.5 Copyright (C) 2002-2010 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 39 39 namespace lol { 40 40 41 /* Line 1 149of lalr1.cc */41 /* Line 1066 of lalr1.cc */ 42 42 #line 43 "generated/stack.hh" 43 43 template <class T, class S = std::deque<T> > … … 129 129 } // lol 130 130 131 /* Line 1 235of lalr1.cc */131 /* Line 1152 of lalr1.cc */ 132 132 #line 133 "generated/stack.hh" 133 133 -
trunk/test/MeshViewerBuffer.txt
r2407 r2410 1 [sc#88f ab 4 4 4 s plt 5 tz 4 bdxy 90 0]//twy 45 01 [sc#88f ab 4 4 4 smth 3 1 1 ]//twy 45 0 bdxy 90 0 splt 5 tz 2 2 2 //[sc#88f ab 4 4 4 tx 4 ab 4 4 4 tx -2 tax .4 .4 0] 3 3 //[sc#88f ab .25 1 1 tx .25 ab .25 1 1 tx .25 ab .25 1 1 tx .25 ab .25 1 1 tx .125 stx 10 0 0]
Note: See TracChangeset
for help on using the changeset viewer.