Changeset 2410


Ignore:
Timestamp:
Feb 14, 2013, 6:34:47 PM (10 years ago)
Author:
touky
Message:

easymesh : Added SmoothMesh operation, works well with triangle, not well with a box.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/easymesh/easymesh-parser.y

    r2408 r2410  
    4848%token T_TRANSLATEY T_ROTATEY T_TAPERY T_TWISTY T_SHEARY T_STRETCHY T_BENDYX T_BENDYZ T_SCALEY T_MIRRORY
    4949%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
    5151%token T_CSGUNION T_CSGSUBSTRACT T_CSGSUBSTRACTLOSS T_CSGAND T_CSGXOR
    5252%token T_CHAMFER
     
    159159  | T_RADIALJITTER args1   { mc.m_mesh.RadialJitter($2.f0); }
    160160  | T_SPLITTRIANGLE args1  { mc.m_mesh.SplitTriangles($2.f0); }
     161  | T_SMOOTHMESH args3     { mc.m_mesh.SmoothMesh($2.f0, $2.f1, $2.f2); }
    161162  | T_TOGGLESCALEWINDING   { mc.m_mesh.ToggleScaleWinding(); }
    162163  | T_CSGUNION             { mc.m_mesh.CsgUnion(); }
  • trunk/src/easymesh/easymesh-scanner.l

    r2407 r2410  
    8888rj    { return token::T_RADIALJITTER; }
    8989splt  { return token::T_SPLITTRIANGLE; }
     90smth  { return token::T_SMOOTHMESH; }
    9091
    9192csgu  { return token::T_CSGUNION; }
  • trunk/src/easymesh/easymesh.cpp

    r2408 r2410  
    247247    for (int j = 0; j < vertex_list.Count(); j++)
    248248        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;
    250250
    251251    return (matching_ids.Count() > 0);
     
    254254//-----------------------------------------------------------------------------
    255255//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)
     256bool VertexDictionnary::FindConnectedVertices(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_vert, Array<int> const *ignored_tri)
    257257{
    258258    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);
    260260
    261261    for (int i = 0; i < connected_tri.Count(); i++)
     
    263263        for (int j = 0; j < 3; j++)
    264264        {
    265             int v_indice = tri_list[connected_tri[j] + j];
     265            int v_indice = tri_list[connected_tri[i] + j];
    266266            if (v_indice != search_idx)
    267267            {
    268                 int found_master = FindVertexMaster(tri_list[connected_tri[j] + j]);
     268                int found_master = FindVertexMaster(tri_list[connected_tri[i] + j]);
    269269                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                }
    273280            }
    274281        }
     
    277284}
    278285//-----------------------------------------------------------------------------
    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)
     286bool 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//-----------------------------------------------------------------------------
     291bool 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//-----------------------------------------------------------------------------
     296bool VertexDictionnary::FindConnectedTriangles(const ivec3 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri)
    290297{
    291298    int needed_validation = 0;
     
    306313    }
    307314
    308     for (int i = 0; i < tri_list.Count(); i += 3)
     315    for (int i = tri0; i < tri_list.Count(); i += 3)
    309316    {
    310317        if (ignored_tri)
     
    668675void EasyMesh::ComputeTexCoord(float uv_scale, int uv_offset)
    669676{
    670 #if VERTEX_USEAGE == VU_TEX_UV
     677#if 0//VERTEX_USEAGE == VU_TEX_UV
    671678    VertexDictionnary vert_dict;
    672679    Array<int> tri_list;
     
    10721079}
    10731080
    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 triangles
    1087             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 triangle
    1091             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 }
    10971081//-----------------------------------------------------------------------------
    10981082void EasyMesh::AppendCylinder(int nsides, float h, float d1, float d2,
     
    19651949}
    19661950
     1951//-----------------------------------------------------------------------------
     1952void EasyMesh::SplitTriangles(int pass) { SplitTriangles(pass, NULL); }
     1953
     1954//-----------------------------------------------------------------------------
     1955void 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//-----------------------------------------------------------------------------
     1983void 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
    19672052} /* namespace lol */
    1968 
  • trunk/src/easymesh/easymesh.h

    r2407 r2410  
    6666    int FindVertexMaster(const int search_idx);
    6767    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);
    7272    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; }
    7374    void Clear() { vertex_list.Empty(); }
    7475private:
     
    298299     */
    299300    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);
     305private:
     306    void SplitTriangles(int pass, VertexDictionnary *vert_dict);
     307public:
     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);
    300314
    301315    //-------------------------------------------------------------------------
     
    303317    //-------------------------------------------------------------------------
    304318
    305     /*
    306     */
    307     void SplitTriangles(int pass);
    308319    /* [cmd:ac] Cylinder centered on (0,0,0) with BBox [-.5*max(d1, d2), -.5*h, -.5*max(d1, d2)]
    309320        - nbsides : Number of sides.                   [+.5*max(d1, d2), +.5*h, +.5*max(d1, d2)]
  • trunk/src/generated/easymesh-parser.cpp

    r2407 r2410  
    771771/* Line 677 of lalr1.cc  */
    772772#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"
    773780    { mc.m_mesh.ToggleScaleWinding(); }
    774781    break;
    775782
    776   case 60:
    777 
    778 /* Line 677 of lalr1.cc  */
    779 #line 162 "easymesh/easymesh-parser.y"
     783  case 61:
     784
     785/* Line 677 of lalr1.cc  */
     786#line 163 "easymesh/easymesh-parser.y"
    780787    { mc.m_mesh.CsgUnion(); }
    781788    break;
    782789
    783   case 61:
    784 
    785 /* Line 677 of lalr1.cc  */
    786 #line 163 "easymesh/easymesh-parser.y"
     790  case 62:
     791
     792/* Line 677 of lalr1.cc  */
     793#line 164 "easymesh/easymesh-parser.y"
    787794    { mc.m_mesh.CsgSubstract(); }
    788795    break;
    789796
    790   case 62:
    791 
    792 /* Line 677 of lalr1.cc  */
    793 #line 164 "easymesh/easymesh-parser.y"
     797  case 63:
     798
     799/* Line 677 of lalr1.cc  */
     800#line 165 "easymesh/easymesh-parser.y"
    794801    { mc.m_mesh.CsgSubstractLoss(); }
    795802    break;
    796803
    797   case 63:
    798 
    799 /* Line 677 of lalr1.cc  */
    800 #line 165 "easymesh/easymesh-parser.y"
     804  case 64:
     805
     806/* Line 677 of lalr1.cc  */
     807#line 166 "easymesh/easymesh-parser.y"
    801808    { mc.m_mesh.CsgAnd(); }
    802809    break;
    803810
    804   case 64:
    805 
    806 /* Line 677 of lalr1.cc  */
    807 #line 166 "easymesh/easymesh-parser.y"
     811  case 65:
     812
     813/* Line 677 of lalr1.cc  */
     814#line 167 "easymesh/easymesh-parser.y"
    808815    { mc.m_mesh.CsgXor(); }
    809816    break;
    810817
    811   case 65:
    812 
    813 /* Line 677 of lalr1.cc  */
    814 #line 170 "easymesh/easymesh-parser.y"
     818  case 66:
     819
     820/* Line 677 of lalr1.cc  */
     821#line 171 "easymesh/easymesh-parser.y"
    815822    { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    816823                                                 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
     
    818825    break;
    819826
    820   case 66:
    821 
    822 /* Line 677 of lalr1.cc  */
    823 #line 173 "easymesh/easymesh-parser.y"
     827  case 67:
     828
     829/* Line 677 of lalr1.cc  */
     830#line 174 "easymesh/easymesh-parser.y"
    824831    { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    825832                                                 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
     
    827834    break;
    828835
    829   case 67:
    830 
    831 /* Line 677 of lalr1.cc  */
    832 #line 176 "easymesh/easymesh-parser.y"
     836  case 68:
     837
     838/* Line 677 of lalr1.cc  */
     839#line 177 "easymesh/easymesh-parser.y"
    833840    { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    834841    break;
    835842
    836   case 68:
    837 
    838 /* Line 677 of lalr1.cc  */
    839 #line 177 "easymesh/easymesh-parser.y"
     843  case 69:
     844
     845/* Line 677 of lalr1.cc  */
     846#line 178 "easymesh/easymesh-parser.y"
    840847    { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    841848                                                            (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    842849    break;
    843850
    844   case 69:
    845 
    846 /* Line 677 of lalr1.cc  */
    847 #line 179 "easymesh/easymesh-parser.y"
     851  case 70:
     852
     853/* Line 677 of lalr1.cc  */
     854#line 180 "easymesh/easymesh-parser.y"
    848855    { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    849856                                                          (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    850857    break;
    851858
    852   case 70:
    853 
    854 /* Line 677 of lalr1.cc  */
    855 #line 181 "easymesh/easymesh-parser.y"
     859  case 71:
     860
     861/* Line 677 of lalr1.cc  */
     862#line 182 "easymesh/easymesh-parser.y"
    856863    { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
    857864    break;
    858865
    859   case 71:
    860 
    861 /* Line 677 of lalr1.cc  */
    862 #line 182 "easymesh/easymesh-parser.y"
     866  case 72:
     867
     868/* Line 677 of lalr1.cc  */
     869#line 183 "easymesh/easymesh-parser.y"
    863870    { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    864871    break;
    865872
    866   case 72:
    867 
    868 /* Line 677 of lalr1.cc  */
    869 #line 183 "easymesh/easymesh-parser.y"
     873  case 73:
     874
     875/* Line 677 of lalr1.cc  */
     876#line 184 "easymesh/easymesh-parser.y"
    870877    { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    871878    break;
    872879
    873   case 73:
    874 
    875 /* Line 677 of lalr1.cc  */
    876 #line 184 "easymesh/easymesh-parser.y"
     880  case 74:
     881
     882/* Line 677 of lalr1.cc  */
     883#line 185 "easymesh/easymesh-parser.y"
    877884    { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
    878885                                             (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); }
    879886    break;
    880887
    881   case 74:
    882 
    883 /* Line 677 of lalr1.cc  */
    884 #line 186 "easymesh/easymesh-parser.y"
     888  case 75:
     889
     890/* Line 677 of lalr1.cc  */
     891#line 187 "easymesh/easymesh-parser.y"
    885892    { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    886893                                                     (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
    887894    break;
    888895
    889   case 75:
    890 
    891 /* Line 677 of lalr1.cc  */
    892 #line 188 "easymesh/easymesh-parser.y"
     896  case 76:
     897
     898/* Line 677 of lalr1.cc  */
     899#line 189 "easymesh/easymesh-parser.y"
    893900    { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
    894901    break;
    895902
    896   case 76:
    897 
    898 /* Line 677 of lalr1.cc  */
    899 #line 189 "easymesh/easymesh-parser.y"
     903  case 77:
     904
     905/* Line 677 of lalr1.cc  */
     906#line 190 "easymesh/easymesh-parser.y"
    900907    { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    901908    break;
    902909
    903   case 77:
    904 
    905 /* Line 677 of lalr1.cc  */
    906 #line 190 "easymesh/easymesh-parser.y"
     910  case 78:
     911
     912/* Line 677 of lalr1.cc  */
     913#line 191 "easymesh/easymesh-parser.y"
    907914    { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    908915    break;
    909916
    910   case 78:
    911 
    912 /* Line 677 of lalr1.cc  */
    913 #line 191 "easymesh/easymesh-parser.y"
     917  case 79:
     918
     919/* Line 677 of lalr1.cc  */
     920#line 192 "easymesh/easymesh-parser.y"
    914921    { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    915922                                 (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,
     
    917924    break;
    918925
    919   case 79:
    920 
    921 /* Line 677 of lalr1.cc  */
    922 #line 196 "easymesh/easymesh-parser.y"
     926  case 80:
     927
     928/* Line 677 of lalr1.cc  */
     929#line 197 "easymesh/easymesh-parser.y"
    923930    { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
    924931    break;
    925932
    926   case 80:
    927 
    928 /* Line 677 of lalr1.cc  */
    929 #line 197 "easymesh/easymesh-parser.y"
     933  case 81:
     934
     935/* Line 677 of lalr1.cc  */
     936#line 198 "easymesh/easymesh-parser.y"
    930937    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); }
    931938    break;
    932939
    933   case 81:
    934 
    935 /* Line 677 of lalr1.cc  */
    936 #line 198 "easymesh/easymesh-parser.y"
     940  case 82:
     941
     942/* Line 677 of lalr1.cc  */
     943#line 199 "easymesh/easymesh-parser.y"
    937944    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); }
    938945    break;
    939946
    940   case 82:
    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"
    944951    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); }
    945952    break;
    946953
    947   case 83:
    948 
    949 /* Line 677 of lalr1.cc  */
    950 #line 200 "easymesh/easymesh-parser.y"
     954  case 84:
     955
     956/* Line 677 of lalr1.cc  */
     957#line 201 "easymesh/easymesh-parser.y"
    951958    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); }
    952959    break;
    953960
    954   case 84:
    955 
    956 /* Line 677 of lalr1.cc  */
    957 #line 201 "easymesh/easymesh-parser.y"
     961  case 85:
     962
     963/* Line 677 of lalr1.cc  */
     964#line 202 "easymesh/easymesh-parser.y"
    958965    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); }
    959966    break;
    960967
    961   case 85:
    962 
    963 /* Line 677 of lalr1.cc  */
    964 #line 202 "easymesh/easymesh-parser.y"
     968  case 86:
     969
     970/* Line 677 of lalr1.cc  */
     971#line 203 "easymesh/easymesh-parser.y"
    965972    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); }
    966973    break;
    967974
    968   case 86:
    969 
    970 /* Line 677 of lalr1.cc  */
    971 #line 203 "easymesh/easymesh-parser.y"
     975  case 87:
     976
     977/* Line 677 of lalr1.cc  */
     978#line 204 "easymesh/easymesh-parser.y"
    972979    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); }
    973980    break;
    974981
    975   case 87:
    976 
    977 /* Line 677 of lalr1.cc  */
    978 #line 204 "easymesh/easymesh-parser.y"
     982  case 88:
     983
     984/* Line 677 of lalr1.cc  */
     985#line 205 "easymesh/easymesh-parser.y"
    979986    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); }
    980987    break;
    981988
    982   case 88:
    983 
    984 /* Line 677 of lalr1.cc  */
    985 #line 205 "easymesh/easymesh-parser.y"
     989  case 89:
     990
     991/* Line 677 of lalr1.cc  */
     992#line 206 "easymesh/easymesh-parser.y"
    986993    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); }
    987994    break;
    988995
    989   case 89:
    990 
    991 /* Line 677 of lalr1.cc  */
    992 #line 208 "easymesh/easymesh-parser.y"
     996  case 90:
     997
     998/* Line 677 of lalr1.cc  */
     999#line 209 "easymesh/easymesh-parser.y"
    9931000    { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
    9941001    break;
    9951002
    996   case 90:
    997 
    998 /* Line 677 of lalr1.cc  */
    999 #line 209 "easymesh/easymesh-parser.y"
     1003  case 91:
     1004
     1005/* Line 677 of lalr1.cc  */
     1006#line 210 "easymesh/easymesh-parser.y"
    10001007    { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
    10011008    break;
     
    10041011
    10051012/* Line 677 of lalr1.cc  */
    1006 #line 1007 "generated/easymesh-parser.cpp"
     1013#line 1014 "generated/easymesh-parser.cpp"
    10071014        default:
    10081015          break;
     
    12091216  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    12101217     STATE-NUM.  */
    1211   const signed char EasyMeshParser::yypact_ninf_ = -70;
     1218  const signed char EasyMeshParser::yypact_ninf_ = -71;
    12121219  const signed char
    12131220  EasyMeshParser::yypact_[] =
    12141221  {
    1215         61,   -41,   -24,   -48,   -48,   -48,   -48,   -48,   -48,   -48,
    1216      -48,   -48,   -70,   -48,   -48,   -48,   -48,   -48,   -48,   -48,
    1217      -48,   -48,   -70,   -48,   -48,   -48,   -48,   -48,   -48,   -48,
    1218      -48,   -48,   -70,   -48,   -48,   -70,   -48,   -48,   -70,   -70,
    1219      -70,   -70,   -70,   -48,   -48,   -48,   -48,   -48,   -48,   -48,
    1220      -48,   -48,   -48,   -48,   -48,   -48,   -48,   -70,     4,     6,
    1221       61,    61,   121,   -70,   -70,   -70,   -70,   -70,   -70,   -48,
    1222      -48,   -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      -70,   -48,   -70,   -70,   -48,   -70,   -70,   -70,   -70,   -70,
    1226      -70,   -70,   -70,   -70,   -70,   -48,   -48,   -48,   -70,   -70,
    1227      -70,   -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      -70,   -70
     1222        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
    12311238  };
    12321239
     
    12401247       0,     0,    54,     0,     0,     0,     0,     0,     0,     0,
    12411248       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       27,    32,    35,    36,    41,    44,    45,    50,    20,    24,
    1248       28,    29,    33,    37,    38,    42,    46,    47,    51,    21,
    1249       25,    30,    31,    34,    39,    40,    43,    48,    49,    52,
    1250       22,    53,    57,    58,    18,     0,     0,    65,    66,    67,
    1251       68,    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,     6
     1249       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
    12551262  };
    12561263
     
    12591266  EasyMeshParser::yypgoto_[] =
    12601267  {
    1261        -70,   -70,   -31,   -70,   -70,   -70,   -70,   -51,   -70,   -70,
    1262      -70,   228,   181,     0,   179,   -36,   -33,   -29,   -70,   -70,
    1263      -70,   -69
     1268       -71,   -71,   -32,   -71,   -71,   -71,   -71,   -52,   -71,   -71,
     1269     -71,   232,   184,     0,   182,   -37,   -34,   -30,   -71,   -71,
     1270     -71,   -70
    12641271  };
    12651272
     
    12681275  EasyMeshParser::yydefgoto_[] =
    12691276  {
    1270         -1,    58,    59,    60,    61,   151,    62,    63,    64,    65,
    1271       66,    70,    71,    72,   115,   116,   117,   118,   131,   132,
    1272      133,    74
     1277        -1,    59,    60,    61,    62,   153,    63,    64,    65,    66,
     1278      67,    71,    72,    73,   117,   118,   119,   120,   133,   134,
     1279     135,    75
    12731280  };
    12741281
     
    12801287  EasyMeshParser::yytable_[] =
    12811288  {
    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,
    12891336       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
    12901337      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
     
    12921339      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
    12931340      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
    13441351  };
    13451352
     
    13541361      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
    13551362      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
    1356       52,    53,    54,    55,    56,    57,    58,    62,    66,    67,
    1357       68,    69,    71,    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       78,    79,    77,    78,    79,    78,    77,    77,    76,    76,
    1361       76,    78,    79,    77,    78,    79,    78,    77,    77,    76,
    1362       78,    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,    70
     1363      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
    13671374  };
    13681375
     
    13791386     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
    13801387     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
    1381      315,   316,    91,    93,    45
     1388     315,   316,   317,    91,    93,    45
    13821389  };
    13831390#endif
     
    13871394  EasyMeshParser::yyr1_[] =
    13881395  {
    1389          0,    65,    66,    67,    67,    68,    68,    69,    70,    71,
    1390       71,    72,    72,    72,    73,    73,    73,    73,    74,    74,
    1391       74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
    1392       74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
    1393       74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
    1394       74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
    1395       74,    74,    74,    74,    74,    75,    75,    75,    75,    75,
    1396       75,    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,
    13971404      77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
    1398       86
     1405      87,    87
    13991406  };
    14001407
     
    14081415       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    14091416       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        2
     1417       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
    14151422  };
    14161423
     
    14291436  "T_BENDZX", "T_BENDZY", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE",
    14301437  "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
    14401448  };
    14411449#endif
     
    14461454  EasyMeshParser::yyrhs_[] =
    14471455  {
    1448         66,     0,    -1,    67,     0,    -1,    68,    -1,    68,    67,
    1449       -1,    71,    -1,    69,    67,    70,    -1,    62,    -1,    63,
    1450       -1,    72,    -1,    71,    72,    -1,    73,    -1,    74,    -1,
    1451       75,    -1,     3,    79,    -1,     3,    61,    -1,     4,    79,
    1452       -1,     4,    61,    -1,    45,    76,    -1,     5,    76,    -1,
    1453       15,    76,    -1,    25,    76,    -1,    35,    78,    -1,     6,
    1454       76,    -1,    16,    76,    -1,    26,    76,    -1,     7,    78,
    1455       -1,     7,    79,    -1,    17,    78,    -1,    17,    79,    -1,
    1456       27,    78,    -1,    27,    79,    -1,     8,    77,    -1,    18,
    1457       77,    -1,    28,    77,    -1,     9,    78,    -1,     9,    79,
    1458       -1,    19,    78,    -1,    19,    79,    -1,    29,    78,    -1,
    1459       29,    79,    -1,    10,    78,    -1,    20,    78,    -1,    30,
    1460       78,    -1,    11,    77,    -1,    12,    77,    -1,    21,    77,
    1461       -1,    22,    77,    -1,    31,    77,    -1,    32,    77,    -1,
    1462       13,    76,    -1,    23,    76,    -1,    33,    76,    -1,    36,
    1463       78,    -1,    14,    -1,    24,    -1,    34,    -1,    38,    76,
    1464       -1,    39,    76,    -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       52,    80,    -1,    53,    79,    -1,    54,    78,    -1,    55,
    1469       77,    -1,    56,    77,    -1,    57,    85,    -1,    86,    -1,
    1470       76,    86,    -1,    77,    86,    -1,    78,    86,    -1,    79,
    1471       86,    -1,    80,    86,    -1,    81,    86,    -1,    82,    86,
    1472       -1,    83,    86,    -1,    84,    86,    -1,    60,    -1,    64,
    1473       86,    -1
     1456        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
    14741482  };
    14751483
     
    14851493     110,   113,   116,   119,   122,   125,   128,   131,   134,   137,
    14861494     140,   143,   146,   149,   152,   154,   156,   158,   161,   164,
    1487      166,   168,   170,   172,   174,   176,   179,   182,   185,   188,
     1495     167,   169,   171,   173,   175,   177,   179,   182,   185,   188,
    14881496     191,   194,   197,   200,   203,   206,   209,   212,   215,   218,
    1489      220,   223,   226,   229,   232,   235,   238,   241,   244,   247,
    1490      249
     1497     221,   223,   226,   229,   232,   235,   238,   241,   244,   247,
     1498     250,   252
    14911499  };
    14921500
     
    15011509     142,   143,   144,   145,   146,   147,   148,   149,   150,   151,
    15021510     152,   153,   154,   155,   156,   157,   158,   159,   160,   161,
    1503      162,   163,   164,   165,   166,   170,   173,   176,   177,   179,
    1504      181,   182,   183,   184,   186,   188,   189,   190,   191,   196,
    1505      197,   198,   199,   200,   201,   202,   203,   204,   205,   208,
    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
    15071515  };
    15081516
     
    15481556       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    15491557       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1550        2,     2,     2,     2,     2,    64,     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,    62,     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,
    15561564       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    15571565       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     
    15751583      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
    15761584      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
    15781586    };
    15791587    if ((unsigned int) t <= yyuser_token_number_max_)
     
    15841592
    15851593  const int EasyMeshParser::yyeof_ = 0;
    1586   const int EasyMeshParser::yylast_ = 271;
     1594  const int EasyMeshParser::yylast_ = 276;
    15871595  const int EasyMeshParser::yynnts_ = 22;
    15881596  const int EasyMeshParser::yyempty_ = -2;
    1589   const int EasyMeshParser::yyfinal_ = 135;
     1597  const int EasyMeshParser::yyfinal_ = 137;
    15901598  const int EasyMeshParser::yyterror_ = 1;
    15911599  const int EasyMeshParser::yyerrcode_ = 256;
    1592   const int EasyMeshParser::yyntokens_ = 65;
    1593 
    1594   const unsigned int EasyMeshParser::yyuser_token_number_max_ = 316;
     1600  const int EasyMeshParser::yyntokens_ = 66;
     1601
     1602  const unsigned int EasyMeshParser::yyuser_token_number_max_ = 317;
    15951603  const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2;
    15961604
     
    15991607
    16001608/* Line 1053 of lalr1.cc  */
    1601 #line 1602 "generated/easymesh-parser.cpp"
     1609#line 1610 "generated/easymesh-parser.cpp"
    16021610
    16031611
    16041612/* Line 1055 of lalr1.cc  */
    1605 #line 212 "easymesh/easymesh-parser.y"
     1613#line 213 "easymesh/easymesh-parser.y"
    16061614
    16071615
  • trunk/src/generated/easymesh-parser.h

    r2407 r2410  
    170170     T_RADIALJITTER = 293,
    171171     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
    194195   };
    195196
     
    365366
    366367/* Line 34 of lalr1.cc  */
    367 #line 368 "generated/easymesh-parser.h"
     368#line 369 "generated/easymesh-parser.h"
    368369
    369370
  • trunk/src/generated/easymesh-scanner.cpp

    r2407 r2410  
    331331        (yy_c_buf_p) = yy_cp;
    332332
    333 #define YY_NUM_RULES 68
    334 #define YY_END_OF_BUFFER 69
     333#define YY_NUM_RULES 69
     334#define YY_END_OF_BUFFER 70
    335335/* This struct is not used in this scanner,
    336336   but its presence is necessary. */
     
    340340        flex_int32_t yy_nxt;
    341341        };
    342 static yyconst flex_int16_t yy_accept[109] =
     342static yyconst flex_int16_t yy_accept[112] =
    343343    {   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
    356357    } ;
    357358
     
    396397    } ;
    397398
    398 static yyconst flex_int16_t yy_base[117] =
     399static yyconst flex_int16_t yy_base[120] =
    399400    {   0,
    400         0,    0,  138,  139,  139,  139,    0,   28,   30,  129,
    401        32,  139,  139,   36,  120,   27,   11,   25,   51,   73,
    402         0,  126,   53,   64,   82,  139,   54,  139,  104,  115,
    403       139,   53,  105,   59,  139,  109,  139,  139,  139,  139,
    404       139,  139,  139,  113,   62,  104,   65,  139,  139,  139,
    405        76,   94,   79,  139,  139,  139,    0,  116,  115,   97,
    406       139,  139,  107,  106,   99,  139,   69,   43,   82,  103,
    407       139,  139,  139,  139,   89,  139,  139,  139,  139,  139,
    408       139,  139,  139,  139,  139,    0,  139,  139,  139,  139,
    409       139,  139,  139,  139,  139,  139,  139,   95,  139,  139,
    410 
    411       139,    0,  139,    0,    0,    0,  139,  139,   98,   87,
    412        80,   77,   67,   54,   46,   39
     401        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
    413414    } ;
    414415
    415 static yyconst flex_int16_t yy_def[117] =
     416static yyconst flex_int16_t yy_def[120] =
    416417    {   0,
    417       108,    1,  108,  108,  108,  108,  109,  108,  108,  108,
    418       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    419       110,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    420       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    421       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    422       108,  108,  108,  108,  108,  108,  111,  108,  108,  108,
    423       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    424       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    425       108,  108,  108,  108,  108,  112,  108,  108,  108,  108,
    426       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    427 
    428       108,  113,  108,  114,  115,  116,  108,    0,  108,  108,
    429       108,  108,  108,  108,  108,  108
     418      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
    430431    } ;
    431432
    432 static yyconst flex_int16_t yy_nxt[174] =
     433static yyconst flex_int16_t yy_nxt[177] =
    433434    {   0,
    434435        4,    5,    6,    7,    8,    9,   10,   11,    4,    4,
     
    436437        4,    4,   17,    4,    4,    4,   18,   19,   20,    4,
    437438        4,    4,    4,    4,   22,   23,   22,   23,   22,   23,
    438       107,   25,   37,   38,   39,   40,   35,  106,   25,   26,
    439        27,   28,   29,   30,   36,  105,   41,   42,   43,   22,
    440        23,   31,   25,   32,   33,   44,   60,   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        52,   91,   92,   53,   54,   55,   56,   79,   80,   81,
    446        83,   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       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    450       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    451       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    452       108,  108,  108
     439      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
    453454    } ;
    454455
    455 static yyconst flex_int16_t yy_chk[174] =
     456static yyconst flex_int16_t yy_chk[177] =
    456457    {   0,
    457458        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
     
    459460        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    460461        1,    1,    1,    1,    8,    8,    9,    9,   11,   11,
    461       116,   11,   17,   17,   17,   18,   16,  115,   11,   14,
    462        14,   14,   14,   14,   16,  114,   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        24,  111,   19,   19,   19,   20,   25,   25,  110,   25,
    466        34,   34,   34,   45,   45,   45,   47,   47,   47,  109,
    467 
    468        20,   67,   67,   20,   20,   20,   20,   51,   51,   51,
    469        53,   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       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    474       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
    475       108,  108,  108
     462      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
    476477    } ;
    477478
     
    522523#define YY_NO_UNISTD_H
    523524#define YY_USER_ACTION yylloc->columns(yyleng);
    524 #line 525 "generated/easymesh-scanner.cpp"
     525#line 526 "generated/easymesh-scanner.cpp"
    525526
    526527#define INITIAL 0
     
    635636
    636637
    637 #line 638 "generated/easymesh-scanner.cpp"
     638#line 639 "generated/easymesh-scanner.cpp"
    638639
    639640        if ( !(yy_init) )
     
    688689                                {
    689690                                yy_current_state = (int) yy_def[yy_current_state];
    690                                 if ( yy_current_state >= 109 )
     691                                if ( yy_current_state >= 112 )
    691692                                        yy_c = yy_meta[(unsigned int) yy_c];
    692693                                }
     
    694695                        ++yy_cp;
    695696                        }
    696                 while ( yy_current_state != 108 );
     697                while ( yy_current_state != 111 );
    697698                yy_cp = (yy_last_accepting_cpos);
    698699                yy_current_state = (yy_last_accepting_state);
     
    906907case 39:
    907908YY_RULE_SETUP
    908 #line 91 "easymesh/easymesh-scanner.l"
     909#line 90 "easymesh/easymesh-scanner.l"
     910{ return token::T_SMOOTHMESH; }
     911        YY_BREAK
     912case 40:
     913YY_RULE_SETUP
     914#line 92 "easymesh/easymesh-scanner.l"
    909915{ return token::T_CSGUNION; }
    910916        YY_BREAK
    911 case 40:
    912 YY_RULE_SETUP
    913 #line 92 "easymesh/easymesh-scanner.l"
     917case 41:
     918YY_RULE_SETUP
     919#line 93 "easymesh/easymesh-scanner.l"
    914920{ return token::T_CSGSUBSTRACT; }
    915921        YY_BREAK
    916 case 41:
    917 YY_RULE_SETUP
    918 #line 93 "easymesh/easymesh-scanner.l"
     922case 42:
     923YY_RULE_SETUP
     924#line 94 "easymesh/easymesh-scanner.l"
    919925{ return token::T_CSGSUBSTRACTLOSS; }
    920926        YY_BREAK
    921 case 42:
    922 YY_RULE_SETUP
    923 #line 94 "easymesh/easymesh-scanner.l"
     927case 43:
     928YY_RULE_SETUP
     929#line 95 "easymesh/easymesh-scanner.l"
    924930{ return token::T_CSGAND; }
    925931        YY_BREAK
    926 case 43:
    927 YY_RULE_SETUP
    928 #line 95 "easymesh/easymesh-scanner.l"
     932case 44:
     933YY_RULE_SETUP
     934#line 96 "easymesh/easymesh-scanner.l"
    929935{ return token::T_CSGXOR; }
    930936        YY_BREAK
    931 case 44:
    932 YY_RULE_SETUP
    933 #line 97 "easymesh/easymesh-scanner.l"
     937case 45:
     938YY_RULE_SETUP
     939#line 98 "easymesh/easymesh-scanner.l"
    934940{ return token::T_BOX; }
    935941        YY_BREAK
    936 case 45:
    937 YY_RULE_SETUP
    938 #line 98 "easymesh/easymesh-scanner.l"
     942case 46:
     943YY_RULE_SETUP
     944#line 99 "easymesh/easymesh-scanner.l"
    939945{ return token::T_CYLINDER; }
    940946        YY_BREAK
    941 case 46:
    942 YY_RULE_SETUP
    943 #line 99 "easymesh/easymesh-scanner.l"
     947case 47:
     948YY_RULE_SETUP
     949#line 100 "easymesh/easymesh-scanner.l"
    944950{ return token::T_CAPSULE; }
    945951        YY_BREAK
    946 case 47:
    947 YY_RULE_SETUP
    948 #line 100 "easymesh/easymesh-scanner.l"
     952case 48:
     953YY_RULE_SETUP
     954#line 101 "easymesh/easymesh-scanner.l"
    949955{ return token::T_COG; }
    950956        YY_BREAK
    951 case 48:
    952 YY_RULE_SETUP
    953 #line 101 "easymesh/easymesh-scanner.l"
     957case 49:
     958YY_RULE_SETUP
     959#line 102 "easymesh/easymesh-scanner.l"
    954960{ return token::T_DISC; }
    955961        YY_BREAK
    956 case 49:
    957 YY_RULE_SETUP
    958 #line 102 "easymesh/easymesh-scanner.l"
     962case 50:
     963YY_RULE_SETUP
     964#line 103 "easymesh/easymesh-scanner.l"
    959965{ return token::T_EXPANDEDSTAR; }
    960966        YY_BREAK
    961 case 50:
    962 YY_RULE_SETUP
    963 #line 103 "easymesh/easymesh-scanner.l"
     967case 51:
     968YY_RULE_SETUP
     969#line 104 "easymesh/easymesh-scanner.l"
    964970{ return token::T_FLATCHAMFBOX; }
    965971        YY_BREAK
    966 case 51:
    967 YY_RULE_SETUP
    968 #line 104 "easymesh/easymesh-scanner.l"
     972case 52:
     973YY_RULE_SETUP
     974#line 105 "easymesh/easymesh-scanner.l"
    969975{ return token::T_QUAD; }
    970976        YY_BREAK
    971 case 52:
    972 YY_RULE_SETUP
    973 #line 105 "easymesh/easymesh-scanner.l"
     977case 53:
     978YY_RULE_SETUP
     979#line 106 "easymesh/easymesh-scanner.l"
    974980{ return token::T_STAR; }
    975981        YY_BREAK
    976 case 53:
    977 YY_RULE_SETUP
    978 #line 106 "easymesh/easymesh-scanner.l"
     982case 54:
     983YY_RULE_SETUP
     984#line 107 "easymesh/easymesh-scanner.l"
    979985{ return token::T_SMOOTHCHAMFBOX; }
    980986        YY_BREAK
    981 case 54:
    982 YY_RULE_SETUP
    983 #line 107 "easymesh/easymesh-scanner.l"
     987case 55:
     988YY_RULE_SETUP
     989#line 108 "easymesh/easymesh-scanner.l"
    984990{ return token::T_SPHERE; }
    985991        YY_BREAK
    986 case 55:
    987 YY_RULE_SETUP
    988 #line 108 "easymesh/easymesh-scanner.l"
     992case 56:
     993YY_RULE_SETUP
     994#line 109 "easymesh/easymesh-scanner.l"
    989995{ return token::T_TRIANGLE; }
    990996        YY_BREAK
    991 case 56:
    992 YY_RULE_SETUP
    993 #line 109 "easymesh/easymesh-scanner.l"
     997case 57:
     998YY_RULE_SETUP
     999#line 110 "easymesh/easymesh-scanner.l"
    9941000{ return token::T_TORUS; }
    9951001        YY_BREAK
    996 case 57:
    997 YY_RULE_SETUP
    998 #line 111 "easymesh/easymesh-scanner.l"
     1002case 58:
     1003YY_RULE_SETUP
     1004#line 112 "easymesh/easymesh-scanner.l"
    9991005{
    10001006        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
     
    10051011        return token::COLOR; }
    10061012        YY_BREAK
    1007 case 58:
    1008 YY_RULE_SETUP
    1009 #line 118 "easymesh/easymesh-scanner.l"
     1013case 59:
     1014YY_RULE_SETUP
     1015#line 119 "easymesh/easymesh-scanner.l"
    10101016{
    10111017        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
     
    10161022        return token::COLOR; }
    10171023        YY_BREAK
    1018 case 59:
    1019 YY_RULE_SETUP
    1020 #line 125 "easymesh/easymesh-scanner.l"
     1024case 60:
     1025YY_RULE_SETUP
     1026#line 126 "easymesh/easymesh-scanner.l"
    10211027{
    10221028        yylval->u32val = 0xffu
     
    10241030        return token::COLOR; }
    10251031        YY_BREAK
    1026 case 60:
    1027 YY_RULE_SETUP
    1028 #line 129 "easymesh/easymesh-scanner.l"
     1032case 61:
     1033YY_RULE_SETUP
     1034#line 130 "easymesh/easymesh-scanner.l"
    10291035{
    10301036        yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
    10311037        return token::COLOR; }
    10321038        YY_BREAK
    1033 case 61:
    1034 YY_RULE_SETUP
    1035 #line 132 "easymesh/easymesh-scanner.l"
     1039case 62:
     1040YY_RULE_SETUP
     1041#line 133 "easymesh/easymesh-scanner.l"
    10361042{
    10371043        yylval->fval = std::atof(yytext); return token::NUMBER; }
    10381044        YY_BREAK
    1039 case 62:
    1040 YY_RULE_SETUP
    1041 #line 134 "easymesh/easymesh-scanner.l"
     1045case 63:
     1046YY_RULE_SETUP
     1047#line 135 "easymesh/easymesh-scanner.l"
    10421048{ return token_type('-'); }
    10431049        YY_BREAK
    1044 case 63:
    1045 YY_RULE_SETUP
    1046 #line 135 "easymesh/easymesh-scanner.l"
     1050case 64:
     1051YY_RULE_SETUP
     1052#line 136 "easymesh/easymesh-scanner.l"
    10471053{ return token_type('['); }
    10481054        YY_BREAK
    1049 case 64:
    1050 YY_RULE_SETUP
    1051 #line 136 "easymesh/easymesh-scanner.l"
     1055case 65:
     1056YY_RULE_SETUP
     1057#line 137 "easymesh/easymesh-scanner.l"
    10521058{ return token_type(']'); }
    10531059        YY_BREAK
    1054 case 65:
    1055 YY_RULE_SETUP
    1056 #line 137 "easymesh/easymesh-scanner.l"
    1057 { /* ignore this */ }
    1058         YY_BREAK
    10591060case 66:
    1060 /* rule 66 can match eol */
    10611061YY_RULE_SETUP
    10621062#line 138 "easymesh/easymesh-scanner.l"
     
    10641064        YY_BREAK
    10651065case 67:
     1066/* rule 67 can match eol */
    10661067YY_RULE_SETUP
    10671068#line 139 "easymesh/easymesh-scanner.l"
     1069{ /* ignore this */ }
     1070        YY_BREAK
     1071case 68:
     1072YY_RULE_SETUP
     1073#line 140 "easymesh/easymesh-scanner.l"
    10681074{ return token::T_ERROR; }
    10691075        YY_BREAK
    1070 case 68:
    1071 YY_RULE_SETUP
    1072 #line 141 "easymesh/easymesh-scanner.l"
     1076case 69:
     1077YY_RULE_SETUP
     1078#line 142 "easymesh/easymesh-scanner.l"
    10731079ECHO;
    10741080        YY_BREAK
    1075 #line 1076 "generated/easymesh-scanner.cpp"
     1081#line 1082 "generated/easymesh-scanner.cpp"
    10761082case YY_STATE_EOF(INITIAL):
    10771083        yyterminate();
     
    14551461                        {
    14561462                        yy_current_state = (int) yy_def[yy_current_state];
    1457                         if ( yy_current_state >= 109 )
     1463                        if ( yy_current_state >= 112 )
    14581464                                yy_c = yy_meta[(unsigned int) yy_c];
    14591465                        }
     
    14831489                {
    14841490                yy_current_state = (int) yy_def[yy_current_state];
    1485                 if ( yy_current_state >= 109 )
     1491                if ( yy_current_state >= 112 )
    14861492                        yy_c = yy_meta[(unsigned int) yy_c];
    14871493                }
    14881494        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
    1489         yy_is_jam = (yy_current_state == 108);
     1495        yy_is_jam = (yy_current_state == 111);
    14901496
    14911497        return yy_is_jam ? 0 : yy_current_state;
     
    19741980#define YYTABLES_NAME "yytables"
    19751981
    1976 #line 141 "easymesh/easymesh-scanner.l"
     1982#line 142 "easymesh/easymesh-scanner.l"
    19771983
    19781984
  • 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.  */
    22
    33/* Locations for Bison parsers in C++
    44   
    5       Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
    66   
    77   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.  */
    22
    33/* Skeleton implementation for Bison LALR(1) parsers in C++
    44   
    5       Copyright (C) 2002-2011 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2010 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    3636/* First part of user declarations.  */
    3737
    38 /* Line 293 of lalr1.cc  */
     38/* Line 310 of lalr1.cc  */
    3939#line 1 "gpu/lolfx-parser.y"
    4040
     
    5959
    6060
    61 /* Line 293 of lalr1.cc  */
     61/* Line 310 of lalr1.cc  */
    6262#line 63 "generated/lolfx-parser.cpp"
    6363
     
    6767/* User implementation prologue.  */
    6868
    69 /* Line 299 of lalr1.cc  */
     69/* Line 316 of lalr1.cc  */
    7070#line 241 "gpu/lolfx-parser.y"
    7171
     
    7676
    7777
    78 /* Line 299 of lalr1.cc  */
     78/* Line 316 of lalr1.cc  */
    7979#line 80 "generated/lolfx-parser.cpp"
    8080
     
    9191#endif
    9292
    93 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    94    If N is 0, then set CURRENT to the empty location which ends
    95    the previous symbol: RHS[0] (always defined).  */
    96 
    97 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
    98 #ifndef YYLLOC_DEFAULT
    99 # define YYLLOC_DEFAULT(Current, Rhs, N)                               \
    100  do                                                                    \
    101    if (N)                                                              \
    102      {                                                                 \
    103        (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
    104        (Current).end   = YYRHSLOC (Rhs, N).end;                        \
    105      }                                                                 \
    106    else                                                                \
    107      {                                                                 \
    108        (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
    109      }                                                                 \
    110  while (false)
    111 #endif
    112 
    11393/* Suppress unused-variable warnings by "using" E.  */
    11494#define YYUSE(e) ((void) (e))
     
    162142namespace lol {
    163143
    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
    166147
    167148  /* Return YYSTR after stripping away unnecessary quotes and
     
    202183  }
    203184
     185#endif
    204186
    205187  /// Build a parser object.
     
    302284#endif
    303285
    304   inline bool
    305   LolFxParser::yy_pact_value_is_default_ (int yyvalue)
    306   {
    307     return yyvalue == yypact_ninf_;
    308   }
    309 
    310   inline bool
    311   LolFxParser::yy_table_value_is_error_ (int yyvalue)
    312   {
    313     return yyvalue == yytable_ninf_;
    314   }
    315 
    316286  int
    317287  LolFxParser::parse ()
     
    335305    location_type yylloc;
    336306    /// The locations where the error started and ended.
    337     location_type yyerror_range[3];
     307    location_type yyerror_range[2];
    338308
    339309    /// $$.
     
    373343    /* Try to take a decision without lookahead.  */
    374344    yyn = yypact_[yystate];
    375     if (yy_pact_value_is_default_ (yyn))
     345    if (yyn == yypact_ninf_)
    376346      goto yydefault;
    377347
     
    406376    if (yyn <= 0)
    407377      {
    408         if (yy_table_value_is_error_ (yyn))
    409           goto yyerrlab;
     378        if (yyn == 0 || yyn == yytable_ninf_)
     379        goto yyerrlab;
    410380        yyn = -yyn;
    411381        goto yyreduce;
     
    463433          case 202:
    464434
    465 /* Line 690 of lalr1.cc  */
     435/* Line 677 of lalr1.cc  */
    466436#line 728 "gpu/lolfx-parser.y"
    467437    { std::cout << "New tech " << std::endl; }
     
    470440  case 203:
    471441
    472 /* Line 690 of lalr1.cc  */
     442/* Line 677 of lalr1.cc  */
    473443#line 736 "gpu/lolfx-parser.y"
    474444    { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; }
     
    477447  case 204:
    478448
    479 /* Line 690 of lalr1.cc  */
     449/* Line 677 of lalr1.cc  */
    480450#line 737 "gpu/lolfx-parser.y"
    481451    { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; }
     
    484454  case 207:
    485455
    486 /* Line 690 of lalr1.cc  */
     456/* Line 677 of lalr1.cc  */
    487457#line 750 "gpu/lolfx-parser.y"
    488458    { std::cout << "New pass " << std::endl; }
     
    491461  case 226:
    492462
    493 /* Line 690 of lalr1.cc  */
     463/* Line 677 of lalr1.cc  */
    494464#line 786 "gpu/lolfx-parser.y"
    495465    { std::cout << "new shader" << std::endl; }
     
    498468
    499469
    500 /* Line 690 of lalr1.cc  */
    501 #line 502 "generated/lolfx-parser.cpp"
     470/* Line 677 of lalr1.cc  */
     471#line 472 "generated/lolfx-parser.cpp"
    502472        default:
    503473          break;
    504474      }
    505     /* User semantic actions sometimes alter yychar, and that requires
    506        that yytoken be updated with the new translation.  We take the
    507        approach of translating immediately before every use of yytoken.
    508        One alternative is translating here after every semantic action,
    509        but that translation would be missed if the semantic action
    510        invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
    511        yychar.  In the case of YYABORT or YYACCEPT, an incorrect
    512        destructor might then be invoked immediately.  In the case of
    513        YYERROR, subsequent parser actions might lead to an incorrect
    514        destructor call or verbose syntax error message before the
    515        lookahead is translated.  */
    516475    YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
    517476
     
    537496  `------------------------------------*/
    538497  yyerrlab:
    539     /* Make sure we have latest lookahead translation.  See comments at
    540        user semantic actions for why this is necessary.  */
    541     yytoken = yytranslate_ (yychar);
    542 
    543498    /* If not already recovering from an error, report this error.  */
    544499    if (!yyerrstatus_)
    545500      {
    546501        ++yynerrs_;
    547         if (yychar == yyempty_)
    548           yytoken = yyempty_;
    549502        error (yylloc, yysyntax_error_ (yystate, yytoken));
    550503      }
    551504
    552     yyerror_range[1] = yylloc;
     505    yyerror_range[0] = yylloc;
    553506    if (yyerrstatus_ == 3)
    554507      {
     
    585538      goto yyerrorlab;
    586539
    587     yyerror_range[1] = yylocation_stack_[yylen - 1];
     540    yyerror_range[0] = yylocation_stack_[yylen - 1];
    588541    /* Do not reclaim the symbols of the rule which action triggered
    589542       this YYERROR.  */
     
    602555      {
    603556        yyn = yypact_[yystate];
    604         if (!yy_pact_value_is_default_ (yyn))
     557        if (yyn != yypact_ninf_)
    605558        {
    606559          yyn += yyterror_;
     
    617570        YYABORT;
    618571
    619         yyerror_range[1] = yylocation_stack_[0];
     572        yyerror_range[0] = yylocation_stack_[0];
    620573        yydestruct_ ("Error: popping",
    621574                     yystos_[yystate],
     
    626579      }
    627580
    628     yyerror_range[2] = yylloc;
     581    yyerror_range[1] = yylloc;
    629582    // Using YYLLOC is tempting, but would change the location of
    630583    // the lookahead.  YYLOC is available though.
    631     YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
     584    YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
    632585    yysemantic_stack_.push (yylval);
    633586    yylocation_stack_.push (yyloc);
     
    652605  yyreturn:
    653606    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);
    661608
    662609    /* Do not reclaim the symbols of the rule which action triggered
     
    677624  // Generate an error message.
    678625  std::string
    679   LolFxParser::yysyntax_error_ (int yystate, int yytoken)
     626  LolFxParser::yysyntax_error_ (int yystate, int tok)
    680627  {
    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_)
    716633      {
    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          }
    741666      }
    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;
    770671  }
    771672
     
    846747  };
    847748
    848   /* YYDEFACT[S] -- default reduction number in state S.  Performed when
    849      YYTABLE doesn't specify something else to do.  Zero means the
    850      default is an error.  */
     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.  */
    851752  const unsigned short int
    852753  LolFxParser::yydefact_[] =
     
    955856  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    956857     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.  */
    958859  const short int LolFxParser::yytable_ninf_ = -323;
    959860  const short int
     
    38913792} // lol
    38923793
    3893 /* Line 1136 of lalr1.cc  */
    3894 #line 3895 "generated/lolfx-parser.cpp"
    3895 
    3896 
    3897 /* Line 1138 of lalr1.cc  */
     3794/* Line 1053 of lalr1.cc  */
     3795#line 3796 "generated/lolfx-parser.cpp"
     3796
     3797
     3798/* Line 1055 of lalr1.cc  */
    38983799#line 1298 "gpu/lolfx-parser.y"
    38993800
  • 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.  */
    22
    33/* Skeleton interface for Bison LALR(1) parsers in C++
    44   
    5       Copyright (C) 2002-2011 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2010 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    4141#include <iostream>
    4242#include "stack.hh"
     43
     44
     45namespace 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
    4357#include "location.hh"
    4458
     
    6175#endif
    6276
     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)                \
     83do {                                                    \
     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
    6396
    6497namespace lol {
    6598
    66 /* Line 35 of lalr1.cc  */
    67 #line 68 "generated/lolfx-parser.h"
     99/* Line 34 of lalr1.cc  */
     100#line 101 "generated/lolfx-parser.h"
    68101
    69102  /// A Bison parser.
     
    76109    {
    77110
    78 /* Line 35 of lalr1.cc  */
     111/* Line 34 of lalr1.cc  */
    79112#line 34 "gpu/lolfx-parser.y"
    80113
     
    86119
    87120
    88 /* Line 35 of lalr1.cc  */
    89 #line 90 "generated/lolfx-parser.h"
     121/* Line 34 of lalr1.cc  */
     122#line 123 "generated/lolfx-parser.h"
    90123    };
    91124#else
     
    608641    location_stack_type yylocation_stack_;
    609642
    610     /// Whether the given \c yypact_ value indicates a defaulted state.
    611     /// \param yyvalue   the value to check
    612     static bool yy_pact_value_is_default_ (int yyvalue);
    613 
    614     /// Whether the given \c yytable_ value indicates a syntax error.
    615     /// \param yyvalue   the value to check
    616     static bool yy_table_value_is_error_ (int yyvalue);
    617 
    618643    /// Internal symbol numbers.
    619644    typedef unsigned short int token_number_type;
     
    623648    static const short int yypact_ninf_;
    624649
    625     /// For a state, default reduction number.
     650    /// For a state, default rule to reduce.
    626651    /// Unless\a  yytable_ specifies something else to do.
    627652    /// Zero means the default is an error.
     
    654679#endif
    655680
     681#if YYERROR_VERBOSE
    656682    /// 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
    658685
    659686#if YYDEBUG
     
    713740} // lol
    714741
    715 /* Line 35 of lalr1.cc  */
    716 #line 717 "generated/lolfx-parser.h"
     742/* Line 34 of lalr1.cc  */
     743#line 744 "generated/lolfx-parser.h"
    717744
    718745
  • 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.  */
    22
    33/* Positions for Bison parsers in C++
    44   
    5       Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
    66   
    77   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.  */
    22
    33/* Stack handling for Bison parsers in C++
    44   
    5       Copyright (C) 2002-2011 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2010 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    3939namespace lol {
    4040
    41 /* Line 1149 of lalr1.cc  */
     41/* Line 1066 of lalr1.cc  */
    4242#line 43 "generated/stack.hh"
    4343  template <class T, class S = std::deque<T> >
     
    129129} // lol
    130130
    131 /* Line 1235 of lalr1.cc  */
     131/* Line 1152 of lalr1.cc  */
    132132#line 133 "generated/stack.hh"
    133133
  • trunk/test/MeshViewerBuffer.txt

    r2407 r2410  
    1 [sc#88f ab 4 4 4 splt 5 tz 4 bdxy 90 0]//twy 45 0
     1[sc#88f ab 4 4 4 smth 3 1 1 ]//twy 45 0 bdxy 90 0 splt 5 tz 2
    22//[sc#88f ab 4 4 4 tx 4 ab 4 4 4 tx -2 tax .4 .4 0]
    33//[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.