Changeset 2116


Ignore:
Timestamp:
Nov 26, 2012, 11:54:01 AM (11 years ago)
Author:
touky
Message:

Added tsw (ToggleScaleWinding) command in EasyMesh Parser to make old-school celShading contour.

Location:
trunk
Files:
13 edited

Legend:

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

    r1875 r2116  
    4848%token T_TRANSLATEY T_ROTATEY T_TAPERY T_SCALEY T_MIRRORY
    4949%token T_TRANSLATEZ T_ROTATEZ T_TAPERZ T_SCALEZ T_MIRRORZ
    50 %token T_TRANSLATE T_SCALE
     50%token T_TRANSLATE T_SCALE T_TOGGLESCALEWINDING
    5151%token T_CHAMFER
    5252
     
    135135  | T_MIRRORY           { mc.m_mesh.MirrorY(); }
    136136  | T_MIRRORZ           { mc.m_mesh.MirrorZ(); }
     137  | T_TOGGLESCALEWINDING { mc.m_mesh.ToggleScaleWinding(); }
    137138    ;
    138139
  • trunk/src/easymesh/easymesh-scanner.l

    r1910 r2116  
    6767sz    { return token::T_SCALEZ; }
    6868s     { return token::T_SCALE; }
     69tsw       { return token::T_TOGGLESCALEWINDING; }
    6970mx    { return token::T_MIRRORX; }
    7071my    { return token::T_MIRRORY; }
  • trunk/src/easymesh/easymesh.cpp

    r2077 r2116  
    4242
    4343EasyMesh::EasyMesh()
    44   : m_color(0), m_color2(0)
     44  : m_color(0), m_color2(0), m_ignore_winding_on_scale(0)
    4545{
    4646    m_cursors.Push(0, 0);
     
    131131}
    132132
     133void EasyMesh::ToggleScaleWinding()
     134{
     135    m_ignore_winding_on_scale = !m_ignore_winding_on_scale;
     136}
     137
    133138void EasyMesh::SetCurColor(vec4 const &color)
    134139{
     
    321326
    322327    /* Flip winding if the scaling involves mirroring */
    323     if (s.x * s.y * s.z < 0)
     328    if (!m_ignore_winding_on_scale && s.x * s.y * s.z < 0)
    324329    {
    325330        for (int i = m_cursors.Last().m2; i < m_indices.Count(); i += 3)
  • trunk/src/easymesh/easymesh.h

    r1875 r2116  
    3636    void CloseBrace();
    3737
     38        void ToggleScaleWinding();
    3839    void SetCurColor(vec4 const &color);
    3940    void SetCurColor2(vec4 const &color);
     
    9495    Array<vec3, vec3, vec4> m_vert;
    9596    Array<int, int> m_cursors;
     97        bool m_ignore_winding_on_scale;
    9698
    9799    /* FIXME: put this in a separate class so that we can copy meshes. */
  • trunk/src/generated/easymesh-parser.cpp

    r1875 r2116  
    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 "easymesh/easymesh-parser.y"
    4040
     
    6262
    6363
    64 /* Line 293 of lalr1.cc  */
     64/* Line 310 of lalr1.cc  */
    6565#line 66 "generated/easymesh-parser.cpp"
    6666
     
    7070/* User implementation prologue.  */
    7171
    72 /* Line 299 of lalr1.cc  */
     72/* Line 316 of lalr1.cc  */
    7373#line 65 "easymesh/easymesh-parser.y"
    7474
     
    7979
    8080
    81 /* Line 299 of lalr1.cc  */
     81/* Line 316 of lalr1.cc  */
    8282#line 83 "generated/easymesh-parser.cpp"
    8383
     
    9494#endif
    9595
    96 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    97    If N is 0, then set CURRENT to the empty location which ends
    98    the previous symbol: RHS[0] (always defined).  */
    99 
    100 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
    101 #ifndef YYLLOC_DEFAULT
    102 # define YYLLOC_DEFAULT(Current, Rhs, N)                               \
    103  do                                                                    \
    104    if (N)                                                              \
    105      {                                                                 \
    106        (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
    107        (Current).end   = YYRHSLOC (Rhs, N).end;                        \
    108      }                                                                 \
    109    else                                                                \
    110      {                                                                 \
    111        (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
    112      }                                                                 \
    113  while (false)
    114 #endif
    115 
    11696/* Suppress unused-variable warnings by "using" E.  */
    11797#define YYUSE(e) ((void) (e))
     
    165145namespace lol {
    166146
    167 /* Line 382 of lalr1.cc  */
    168 #line 169 "generated/easymesh-parser.cpp"
     147/* Line 379 of lalr1.cc  */
     148#line 149 "generated/easymesh-parser.cpp"
     149#if YYERROR_VERBOSE
    169150
    170151  /* Return YYSTR after stripping away unnecessary quotes and
     
    205186  }
    206187
     188#endif
    207189
    208190  /// Build a parser object.
     
    305287#endif
    306288
    307   inline bool
    308   EasyMeshParser::yy_pact_value_is_default_ (int yyvalue)
    309   {
    310     return yyvalue == yypact_ninf_;
    311   }
    312 
    313   inline bool
    314   EasyMeshParser::yy_table_value_is_error_ (int yyvalue)
    315   {
    316     return yyvalue == yytable_ninf_;
    317   }
    318 
    319289  int
    320290  EasyMeshParser::parse ()
     
    338308    location_type yylloc;
    339309    /// The locations where the error started and ended.
    340     location_type yyerror_range[3];
     310    location_type yyerror_range[2];
    341311
    342312    /// $$.
     
    376346    /* Try to take a decision without lookahead.  */
    377347    yyn = yypact_[yystate];
    378     if (yy_pact_value_is_default_ (yyn))
     348    if (yyn == yypact_ninf_)
    379349      goto yydefault;
    380350
     
    409379    if (yyn <= 0)
    410380      {
    411         if (yy_table_value_is_error_ (yyn))
    412           goto yyerrlab;
     381        if (yyn == 0 || yyn == yytable_ninf_)
     382        goto yyerrlab;
    413383        yyn = -yyn;
    414384        goto yyreduce;
     
    466436          case 7:
    467437
    468 /* Line 690 of lalr1.cc  */
     438/* Line 677 of lalr1.cc  */
    469439#line 89 "easymesh/easymesh-parser.y"
    470440    { mc.m_mesh.OpenBrace(); }
     
    473443  case 8:
    474444
    475 /* Line 690 of lalr1.cc  */
     445/* Line 677 of lalr1.cc  */
    476446#line 93 "easymesh/easymesh-parser.y"
    477447    { mc.m_mesh.CloseBrace(); }
     
    480450  case 14:
    481451
    482 /* Line 690 of lalr1.cc  */
     452/* Line 677 of lalr1.cc  */
    483453#line 108 "easymesh/easymesh-parser.y"
    484454    { mc.m_mesh.SetCurColor(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
     
    487457  case 15:
    488458
    489 /* Line 690 of lalr1.cc  */
     459/* Line 677 of lalr1.cc  */
    490460#line 109 "easymesh/easymesh-parser.y"
    491461    { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
     
    496466  case 16:
    497467
    498 /* Line 690 of lalr1.cc  */
     468/* Line 677 of lalr1.cc  */
    499469#line 112 "easymesh/easymesh-parser.y"
    500470    { mc.m_mesh.SetCurColor2(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
     
    503473  case 17:
    504474
    505 /* Line 690 of lalr1.cc  */
     475/* Line 677 of lalr1.cc  */
    506476#line 113 "easymesh/easymesh-parser.y"
    507477    { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
     
    512482  case 18:
    513483
    514 /* Line 690 of lalr1.cc  */
     484/* Line 677 of lalr1.cc  */
    515485#line 119 "easymesh/easymesh-parser.y"
    516486    { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); }
     
    519489  case 19:
    520490
    521 /* Line 690 of lalr1.cc  */
     491/* Line 677 of lalr1.cc  */
    522492#line 120 "easymesh/easymesh-parser.y"
    523493    { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
     
    526496  case 20:
    527497
    528 /* Line 690 of lalr1.cc  */
     498/* Line 677 of lalr1.cc  */
    529499#line 121 "easymesh/easymesh-parser.y"
    530500    { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
     
    533503  case 21:
    534504
    535 /* Line 690 of lalr1.cc  */
     505/* Line 677 of lalr1.cc  */
    536506#line 122 "easymesh/easymesh-parser.y"
    537507    { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     
    540510  case 22:
    541511
    542 /* Line 690 of lalr1.cc  */
     512/* Line 677 of lalr1.cc  */
    543513#line 123 "easymesh/easymesh-parser.y"
    544514    { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     
    547517  case 23:
    548518
    549 /* Line 690 of lalr1.cc  */
     519/* Line 677 of lalr1.cc  */
    550520#line 124 "easymesh/easymesh-parser.y"
    551521    { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
     
    554524  case 24:
    555525
    556 /* Line 690 of lalr1.cc  */
     526/* Line 677 of lalr1.cc  */
    557527#line 125 "easymesh/easymesh-parser.y"
    558528    { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
     
    561531  case 25:
    562532
    563 /* Line 690 of lalr1.cc  */
     533/* Line 677 of lalr1.cc  */
    564534#line 126 "easymesh/easymesh-parser.y"
    565535    { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
     
    568538  case 26:
    569539
    570 /* Line 690 of lalr1.cc  */
     540/* Line 677 of lalr1.cc  */
    571541#line 127 "easymesh/easymesh-parser.y"
    572542    { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    575545  case 27:
    576546
    577 /* Line 690 of lalr1.cc  */
     547/* Line 677 of lalr1.cc  */
    578548#line 128 "easymesh/easymesh-parser.y"
    579549    { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    582552  case 28:
    583553
    584 /* Line 690 of lalr1.cc  */
     554/* Line 677 of lalr1.cc  */
    585555#line 129 "easymesh/easymesh-parser.y"
    586556    { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    589559  case 29:
    590560
    591 /* Line 690 of lalr1.cc  */
     561/* Line 677 of lalr1.cc  */
    592562#line 130 "easymesh/easymesh-parser.y"
    593563    { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); }
     
    596566  case 30:
    597567
    598 /* Line 690 of lalr1.cc  */
     568/* Line 677 of lalr1.cc  */
    599569#line 131 "easymesh/easymesh-parser.y"
    600570    { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); }
     
    603573  case 31:
    604574
    605 /* Line 690 of lalr1.cc  */
     575/* Line 677 of lalr1.cc  */
    606576#line 132 "easymesh/easymesh-parser.y"
    607577    { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     
    610580  case 32:
    611581
    612 /* Line 690 of lalr1.cc  */
     582/* Line 677 of lalr1.cc  */
    613583#line 133 "easymesh/easymesh-parser.y"
    614584    { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     
    617587  case 33:
    618588
    619 /* Line 690 of lalr1.cc  */
     589/* Line 677 of lalr1.cc  */
    620590#line 134 "easymesh/easymesh-parser.y"
    621591    { mc.m_mesh.MirrorX(); }
     
    624594  case 34:
    625595
    626 /* Line 690 of lalr1.cc  */
     596/* Line 677 of lalr1.cc  */
    627597#line 135 "easymesh/easymesh-parser.y"
    628598    { mc.m_mesh.MirrorY(); }
     
    631601  case 35:
    632602
    633 /* Line 690 of lalr1.cc  */
     603/* Line 677 of lalr1.cc  */
    634604#line 136 "easymesh/easymesh-parser.y"
    635605    { mc.m_mesh.MirrorZ(); }
     
    638608  case 36:
    639609
    640 /* Line 690 of lalr1.cc  */
    641 #line 140 "easymesh/easymesh-parser.y"
     610/* Line 677 of lalr1.cc  */
     611#line 137 "easymesh/easymesh-parser.y"
     612    { mc.m_mesh.ToggleScaleWinding(); }
     613    break;
     614
     615  case 37:
     616
     617/* Line 677 of lalr1.cc  */
     618#line 141 "easymesh/easymesh-parser.y"
    642619    { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    643620                                                 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
     
    645622    break;
    646623
    647   case 37:
    648 
    649 /* Line 690 of lalr1.cc  */
    650 #line 143 "easymesh/easymesh-parser.y"
     624  case 38:
     625
     626/* Line 677 of lalr1.cc  */
     627#line 144 "easymesh/easymesh-parser.y"
    651628    { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    652629    break;
    653630
    654   case 38:
    655 
    656 /* Line 690 of lalr1.cc  */
    657 #line 144 "easymesh/easymesh-parser.y"
     631  case 39:
     632
     633/* Line 677 of lalr1.cc  */
     634#line 145 "easymesh/easymesh-parser.y"
    658635    { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    659636                                                            (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    660637    break;
    661638
    662   case 39:
    663 
    664 /* Line 690 of lalr1.cc  */
    665 #line 146 "easymesh/easymesh-parser.y"
     639  case 40:
     640
     641/* Line 677 of lalr1.cc  */
     642#line 147 "easymesh/easymesh-parser.y"
    666643    { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    667644                                                          (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    668645    break;
    669646
    670   case 40:
    671 
    672 /* Line 690 of lalr1.cc  */
    673 #line 148 "easymesh/easymesh-parser.y"
     647  case 41:
     648
     649/* Line 677 of lalr1.cc  */
     650#line 149 "easymesh/easymesh-parser.y"
    674651    { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0,
    675652                                               vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
    676653    break;
    677654
    678   case 41:
    679 
    680 /* Line 690 of lalr1.cc  */
    681 #line 150 "easymesh/easymesh-parser.y"
     655  case 42:
     656
     657/* Line 677 of lalr1.cc  */
     658#line 151 "easymesh/easymesh-parser.y"
    682659    { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    683660    break;
    684661
    685   case 42:
    686 
    687 /* Line 690 of lalr1.cc  */
    688 #line 151 "easymesh/easymesh-parser.y"
     662  case 43:
     663
     664/* Line 677 of lalr1.cc  */
     665#line 152 "easymesh/easymesh-parser.y"
    689666    { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    690667    break;
    691668
    692   case 43:
    693 
    694 /* Line 690 of lalr1.cc  */
    695 #line 152 "easymesh/easymesh-parser.y"
     669  case 44:
     670
     671/* Line 677 of lalr1.cc  */
     672#line 153 "easymesh/easymesh-parser.y"
    696673    { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
    697674                                             (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); }
    698675    break;
    699676
    700   case 44:
    701 
    702 /* Line 690 of lalr1.cc  */
    703 #line 154 "easymesh/easymesh-parser.y"
     677  case 45:
     678
     679/* Line 677 of lalr1.cc  */
     680#line 155 "easymesh/easymesh-parser.y"
    704681    { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    705682                                                     (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
    706683    break;
    707684
    708   case 45:
    709 
    710 /* Line 690 of lalr1.cc  */
    711 #line 156 "easymesh/easymesh-parser.y"
     685  case 46:
     686
     687/* Line 677 of lalr1.cc  */
     688#line 157 "easymesh/easymesh-parser.y"
    712689    { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
    713690    break;
    714691
    715   case 46:
    716 
    717 /* Line 690 of lalr1.cc  */
    718 #line 157 "easymesh/easymesh-parser.y"
     692  case 47:
     693
     694/* Line 677 of lalr1.cc  */
     695#line 158 "easymesh/easymesh-parser.y"
    719696    { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    720697    break;
    721698
    722   case 47:
    723 
    724 /* Line 690 of lalr1.cc  */
    725 #line 158 "easymesh/easymesh-parser.y"
     699  case 48:
     700
     701/* Line 677 of lalr1.cc  */
     702#line 159 "easymesh/easymesh-parser.y"
    726703    { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    727704    break;
    728705
    729   case 48:
    730 
    731 /* Line 690 of lalr1.cc  */
    732 #line 159 "easymesh/easymesh-parser.y"
     706  case 49:
     707
     708/* Line 677 of lalr1.cc  */
     709#line 160 "easymesh/easymesh-parser.y"
    733710    { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
    734711                                            (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6, (int)(yysemantic_stack_[(2) - (2)].args).f7); }
    735712    break;
    736713
    737   case 49:
    738 
    739 /* Line 690 of lalr1.cc  */
    740 #line 163 "easymesh/easymesh-parser.y"
     714  case 50:
     715
     716/* Line 677 of lalr1.cc  */
     717#line 164 "easymesh/easymesh-parser.y"
    741718    { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
    742719    break;
    743720
    744   case 50:
    745 
    746 /* Line 690 of lalr1.cc  */
    747 #line 164 "easymesh/easymesh-parser.y"
     721  case 51:
     722
     723/* Line 677 of lalr1.cc  */
     724#line 165 "easymesh/easymesh-parser.y"
    748725    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); }
    749726    break;
    750727
    751   case 51:
    752 
    753 /* Line 690 of lalr1.cc  */
    754 #line 165 "easymesh/easymesh-parser.y"
     728  case 52:
     729
     730/* Line 677 of lalr1.cc  */
     731#line 166 "easymesh/easymesh-parser.y"
    755732    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); }
    756733    break;
    757734
    758   case 52:
    759 
    760 /* Line 690 of lalr1.cc  */
    761 #line 166 "easymesh/easymesh-parser.y"
     735  case 53:
     736
     737/* Line 677 of lalr1.cc  */
     738#line 167 "easymesh/easymesh-parser.y"
    762739    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); }
    763740    break;
    764741
    765   case 53:
    766 
    767 /* Line 690 of lalr1.cc  */
    768 #line 167 "easymesh/easymesh-parser.y"
     742  case 54:
     743
     744/* Line 677 of lalr1.cc  */
     745#line 168 "easymesh/easymesh-parser.y"
    769746    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); }
    770747    break;
    771748
    772   case 54:
    773 
    774 /* Line 690 of lalr1.cc  */
    775 #line 168 "easymesh/easymesh-parser.y"
     749  case 55:
     750
     751/* Line 677 of lalr1.cc  */
     752#line 169 "easymesh/easymesh-parser.y"
    776753    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); }
    777754    break;
    778755
    779   case 55:
    780 
    781 /* Line 690 of lalr1.cc  */
    782 #line 169 "easymesh/easymesh-parser.y"
     756  case 56:
     757
     758/* Line 677 of lalr1.cc  */
     759#line 170 "easymesh/easymesh-parser.y"
    783760    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); }
    784761    break;
    785762
    786   case 56:
    787 
    788 /* Line 690 of lalr1.cc  */
    789 #line 170 "easymesh/easymesh-parser.y"
     763  case 57:
     764
     765/* Line 677 of lalr1.cc  */
     766#line 171 "easymesh/easymesh-parser.y"
    790767    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); }
    791768    break;
    792769
    793   case 57:
    794 
    795 /* Line 690 of lalr1.cc  */
    796 #line 173 "easymesh/easymesh-parser.y"
     770  case 58:
     771
     772/* Line 677 of lalr1.cc  */
     773#line 174 "easymesh/easymesh-parser.y"
    797774    { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
    798775    break;
    799776
    800   case 58:
    801 
    802 /* Line 690 of lalr1.cc  */
    803 #line 174 "easymesh/easymesh-parser.y"
     777  case 59:
     778
     779/* Line 677 of lalr1.cc  */
     780#line 175 "easymesh/easymesh-parser.y"
    804781    { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
    805782    break;
     
    807784
    808785
    809 /* Line 690 of lalr1.cc  */
    810 #line 811 "generated/easymesh-parser.cpp"
     786/* Line 677 of lalr1.cc  */
     787#line 788 "generated/easymesh-parser.cpp"
    811788        default:
    812789          break;
    813790      }
    814     /* User semantic actions sometimes alter yychar, and that requires
    815        that yytoken be updated with the new translation.  We take the
    816        approach of translating immediately before every use of yytoken.
    817        One alternative is translating here after every semantic action,
    818        but that translation would be missed if the semantic action
    819        invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
    820        yychar.  In the case of YYABORT or YYACCEPT, an incorrect
    821        destructor might then be invoked immediately.  In the case of
    822        YYERROR, subsequent parser actions might lead to an incorrect
    823        destructor call or verbose syntax error message before the
    824        lookahead is translated.  */
    825791    YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
    826792
     
    846812  `------------------------------------*/
    847813  yyerrlab:
    848     /* Make sure we have latest lookahead translation.  See comments at
    849        user semantic actions for why this is necessary.  */
    850     yytoken = yytranslate_ (yychar);
    851 
    852814    /* If not already recovering from an error, report this error.  */
    853815    if (!yyerrstatus_)
    854816      {
    855817        ++yynerrs_;
    856         if (yychar == yyempty_)
    857           yytoken = yyempty_;
    858818        error (yylloc, yysyntax_error_ (yystate, yytoken));
    859819      }
    860820
    861     yyerror_range[1] = yylloc;
     821    yyerror_range[0] = yylloc;
    862822    if (yyerrstatus_ == 3)
    863823      {
     
    894854      goto yyerrorlab;
    895855
    896     yyerror_range[1] = yylocation_stack_[yylen - 1];
     856    yyerror_range[0] = yylocation_stack_[yylen - 1];
    897857    /* Do not reclaim the symbols of the rule which action triggered
    898858       this YYERROR.  */
     
    911871      {
    912872        yyn = yypact_[yystate];
    913         if (!yy_pact_value_is_default_ (yyn))
     873        if (yyn != yypact_ninf_)
    914874        {
    915875          yyn += yyterror_;
     
    926886        YYABORT;
    927887
    928         yyerror_range[1] = yylocation_stack_[0];
     888        yyerror_range[0] = yylocation_stack_[0];
    929889        yydestruct_ ("Error: popping",
    930890                     yystos_[yystate],
     
    935895      }
    936896
    937     yyerror_range[2] = yylloc;
     897    yyerror_range[1] = yylloc;
    938898    // Using YYLLOC is tempting, but would change the location of
    939899    // the lookahead.  YYLOC is available though.
    940     YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
     900    YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
    941901    yysemantic_stack_.push (yylval);
    942902    yylocation_stack_.push (yyloc);
     
    961921  yyreturn:
    962922    if (yychar != yyempty_)
    963       {
    964         /* Make sure we have latest lookahead translation.  See comments
    965            at user semantic actions for why this is necessary.  */
    966         yytoken = yytranslate_ (yychar);
    967         yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
    968                      &yylloc);
    969       }
     923      yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
    970924
    971925    /* Do not reclaim the symbols of the rule which action triggered
     
    986940  // Generate an error message.
    987941  std::string
    988   EasyMeshParser::yysyntax_error_ (int yystate, int yytoken)
    989   {
    990     std::string yyres;
    991     // Number of reported tokens (one for the "unexpected", one per
    992     // "expected").
    993     size_t yycount = 0;
    994     // Its maximum.
    995     enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
    996     // Arguments of yyformat.
    997     char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
    998 
    999     /* There are many possibilities here to consider:
    1000        - If this state is a consistent state with a default action, then
    1001          the only way this function was invoked is if the default action
    1002          is an error action.  In that case, don't check for expected
    1003          tokens because there are none.
    1004        - The only way there can be no lookahead present (in yytoken) is
    1005          if this state is a consistent state with a default action.
    1006          Thus, detecting the absence of a lookahead is sufficient to
    1007          determine that there is no unexpected or expected token to
    1008          report.  In that case, just report a simple "syntax error".
    1009        - Don't assume there isn't a lookahead just because this state is
    1010          a consistent state with a default action.  There might have
    1011          been a previous inconsistent state, consistent state with a
    1012          non-default action, or user semantic action that manipulated
    1013          yychar.
    1014        - Of course, the expected token list depends on states to have
    1015          correct lookahead information, and it depends on the parser not
    1016          to perform extra reductions after fetching a lookahead from the
    1017          scanner and before detecting a syntax error.  Thus, state
    1018          merging (from LALR or IELR) and default reductions corrupt the
    1019          expected token list.  However, the list is correct for
    1020          canonical LR with one exception: it will still contain any
    1021          token that will not be accepted due to an error action in a
    1022          later state.
    1023     */
    1024     if (yytoken != yyempty_)
     942  EasyMeshParser::yysyntax_error_ (int yystate, int tok)
     943  {
     944    std::string res;
     945    YYUSE (yystate);
     946#if YYERROR_VERBOSE
     947    int yyn = yypact_[yystate];
     948    if (yypact_ninf_ < yyn && yyn <= yylast_)
    1025949      {
    1026         yyarg[yycount++] = yytname_[yytoken];
    1027         int yyn = yypact_[yystate];
    1028         if (!yy_pact_value_is_default_ (yyn))
    1029           {
    1030             /* Start YYX at -YYN if negative to avoid negative indexes in
    1031                YYCHECK.  In other words, skip the first -YYN actions for
    1032                this state because they are default actions.  */
    1033             int yyxbegin = yyn < 0 ? -yyn : 0;
    1034             /* Stay within bounds of both yycheck and yytname.  */
    1035             int yychecklim = yylast_ - yyn + 1;
    1036             int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
    1037             for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
    1038               if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
    1039                   && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
    1040                 {
    1041                   if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
    1042                     {
    1043                       yycount = 1;
    1044                       break;
    1045                     }
    1046                   else
    1047                     yyarg[yycount++] = yytname_[yyx];
    1048                 }
    1049           }
     950        /* Start YYX at -YYN if negative to avoid negative indexes in
     951           YYCHECK.  */
     952        int yyxbegin = yyn < 0 ? -yyn : 0;
     953
     954        /* Stay within bounds of both yycheck and yytname.  */
     955        int yychecklim = yylast_ - yyn + 1;
     956        int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
     957        int count = 0;
     958        for (int x = yyxbegin; x < yyxend; ++x)
     959          if (yycheck_[x + yyn] == x && x != yyterror_)
     960            ++count;
     961
     962        // FIXME: This method of building the message is not compatible
     963        // with internationalization.  It should work like yacc.c does it.
     964        // That is, first build a string that looks like this:
     965        // "syntax error, unexpected %s or %s or %s"
     966        // Then, invoke YY_ on this string.
     967        // Finally, use the string as a format to output
     968        // yytname_[tok], etc.
     969        // Until this gets fixed, this message appears in English only.
     970        res = "syntax error, unexpected ";
     971        res += yytnamerr_ (yytname_[tok]);
     972        if (count < 5)
     973          {
     974            count = 0;
     975            for (int x = yyxbegin; x < yyxend; ++x)
     976              if (yycheck_[x + yyn] == x && x != yyterror_)
     977                {
     978                  res += (!count++) ? ", expecting " : " or ";
     979                  res += yytnamerr_ (yytname_[x]);
     980                }
     981          }
    1050982      }
    1051 
    1052     char const* yyformat = 0;
    1053     switch (yycount)
    1054       {
    1055 #define YYCASE_(N, S)                         \
    1056         case N:                               \
    1057           yyformat = S;                       \
    1058         break
    1059         YYCASE_(0, YY_("syntax error"));
    1060         YYCASE_(1, YY_("syntax error, unexpected %s"));
    1061         YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
    1062         YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
    1063         YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
    1064         YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
    1065 #undef YYCASE_
    1066       }
    1067 
    1068     // Argument number.
    1069     size_t yyi = 0;
    1070     for (char const* yyp = yyformat; *yyp; ++yyp)
    1071       if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
    1072         {
    1073           yyres += yytnamerr_ (yyarg[yyi++]);
    1074           ++yyp;
    1075         }
    1076       else
    1077         yyres += *yyp;
    1078     return yyres;
     983    else
     984#endif
     985      res = YY_("syntax error");
     986    return res;
    1079987  }
    1080988
     
    1082990  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    1083991     STATE-NUM.  */
    1084   const signed char EasyMeshParser::yypact_ninf_ = -47;
     992  const signed char EasyMeshParser::yypact_ninf_ = -10;
    1085993  const signed char
    1086994  EasyMeshParser::yypact_[] =
    1087995  {
    1088         35,   -26,    85,   -31,   -31,   -31,   -31,   -47,   -31,   -31,
    1089      -31,   -31,   -47,   -31,   -31,   -31,   -31,   -47,   -31,   -31,
    1090      -31,   -31,   -31,   -31,   -31,   -31,   -31,   -31,   -31,   -31,
    1091      -31,   -31,   -31,   -31,   -47,     5,    13,    35,    35,    72,
    1092      -47,   -47,   -47,   -47,   -47,   -47,   -31,   -31,   -31,   -31,
    1093      -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,
    1094      -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -31,
    1095      -31,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,
    1096      -47,   -47,   -31,   -31,   -47,   -47,   -47,   -47,   -47,   -24,
    1097      -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,   -47,
    1098      -47
     996        -3,    11,    87,     6,     6,     6,     6,   -10,     6,     6,
     997       6,     6,   -10,     6,     6,     6,     6,   -10,     6,     6,
     998     -10,     6,     6,     6,     6,     6,     6,     6,     6,     6,
     999       6,     6,     6,     6,     6,   -10,    36,    43,    -3,    -3,
     1000      73,   -10,   -10,   -10,   -10,   -10,   -10,     6,     6,     6,
     1001       6,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,
     1002     -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,
     1003       6,     6,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,
     1004     -10,   -10,   -10,     6,     6,   -10,   -10,   -10,   -10,   -10,
     1005      10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,
     1006     -10,   -10
    10991007  };
    11001008
    1101   /* YYDEFACT[S] -- default reduction number in state S.  Performed when
    1102      YYTABLE doesn't specify something else to do.  Zero means the
    1103      default is an error.  */
     1009  /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
     1010     doesn't specify something else to do.  Zero means the default is an
     1011     error.  */
    11041012  const unsigned char
    11051013  EasyMeshParser::yydefact_[] =
     
    11071015         0,     0,     0,     0,     0,     0,     0,    33,     0,     0,
    11081016       0,     0,    34,     0,     0,     0,     0,    35,     0,     0,
    1109        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    1110        0,     0,     0,     0,     7,     0,     0,     3,     0,     5,
    1111        9,    11,    12,    13,    57,    15,     0,     0,     0,     0,
    1112       14,    49,    17,    16,    19,    23,    26,    29,    20,    24,
    1113       27,    30,    21,    25,    28,    31,    22,    32,    18,     0,
    1114        0,    36,    37,    38,    39,    40,    41,    43,    44,    45,
    1115       46,    47,     0,     0,    48,    42,     1,     2,     4,     0,
    1116       10,    58,    50,    51,    52,    53,    54,    55,    56,     8,
    1117        6
     1017      36,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     1018       0,     0,     0,     0,     0,     7,     0,     0,     3,     0,
     1019       5,     9,    11,    12,    13,    58,    15,     0,     0,     0,
     1020       0,    14,    50,    17,    16,    19,    23,    26,    29,    20,
     1021      24,    27,    30,    21,    25,    28,    31,    22,    32,    18,
     1022       0,     0,    37,    38,    39,    40,    41,    42,    44,    45,
     1023      46,    47,    48,     0,     0,    49,    43,     1,     2,     4,
     1024       0,    10,    59,    51,    52,    53,    54,    55,    56,    57,
     1025       8,     6
    11181026  };
    11191027
     
    11221030  EasyMeshParser::yypgoto_[] =
    11231031  {
    1124        -47,   -47,   -18,   -47,   -47,   -47,   -47,   -17,   -47,   -47,
    1125      -47,   105,    -4,    -1,     6,     8,     1,   -47,   -47,   -46
     1032       -10,   -10,    -4,   -10,   -10,   -10,   -10,    14,   -10,   -10,
     1033     -10,   107,    26,    37,    44,    31,    30,   -10,   -10,    -9
    11261034  };
    11271035
     
    11301038  EasyMeshParser::yydefgoto_[] =
    11311039  {
    1132         -1,    35,    36,    37,    38,   100,    39,    40,    41,    42,
    1133       43,    47,    48,    49,    69,    70,    71,    83,    84,    51
     1040        -1,    36,    37,    38,    39,   101,    40,    41,    42,    43,
     1041      44,    48,    49,    50,    70,    71,    72,    84,    85,    52
    11341042  };
    11351043
    11361044  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    11371045     positive, shift that token.  If negative, reduce the rule which
    1138      number is the opposite.  If YYTABLE_NINF_, syntax error.  */
     1046     number is the opposite.  If zero, do what YYDEFACT says.  */
    11391047  const signed char EasyMeshParser::yytable_ninf_ = -1;
    11401048  const unsigned char
    11411049  EasyMeshParser::yytable_[] =
    11421050  {
    1143         91,    92,    93,    94,    56,    86,    44,    50,    53,    60,
    1144       46,    44,    45,    87,    64,    46,    99,    66,    67,    88,
    1145       89,    72,    90,    95,    96,    76,    80,    81,    79,    73,
    1146       74,    75,    85,    82,    78,    77,    97,    98,     1,     2,
    1147        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
    1148       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
    1149       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
    1150       33,     0,     0,     0,    34,     1,     2,     3,     4,     5,
    1151        6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
    1152       16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
    1153       26,    27,    28,    29,    30,    31,    32,    33,    54,    55,
    1154        0,    57,     0,    58,    59,     0,    61,     0,    62,    63,
    1155        0,    65,    44,    52,     0,    68,    46
     1051         1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
     1052      11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
     1053      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
     1054      31,    32,    33,    34,    89,    90,    87,    35,    92,    93,
     1055      94,    95,    57,    88,    45,    51,    54,    61,    47,    45,
     1056      46,   100,    65,    47,    91,    67,    68,    81,    82,    78,
     1057      73,    96,    97,    83,    77,     0,     0,    80,    74,    75,
     1058      76,    86,     0,    79,    98,    99,     1,     2,     3,     4,
     1059       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
     1060      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
     1061      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
     1062      55,    56,     0,    58,     0,    59,    60,     0,    62,     0,
     1063      63,    64,     0,    66,     0,    45,    53,     0,    69,    47
    11561064  };
    11571065
     
    11601068  EasyMeshParser::yycheck_[] =
    11611069  {
    1162         46,    47,    48,    49,     5,     0,    37,     1,     2,    10,
    1163       41,    37,    38,     0,    15,    41,    40,    18,    19,    37,
    1164       38,    22,    39,    69,    70,    26,    30,    31,    29,    23,
    1165       24,    25,    33,    32,    28,    27,    82,    83,     3,     4,
    1166        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
    1167       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
    1168       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
    1169       35,    -1,    -1,    -1,    39,     3,     4,     5,     6,     7,
    1170        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
    1171       18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
    1172       28,    29,    30,    31,    32,    33,    34,    35,     3,     4,
    1173       -1,     6,    -1,     8,     9,    -1,    11,    -1,    13,    14,
    1174       -1,    16,    37,    38,    -1,    20,    41
     1070         3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
     1071      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
     1072      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
     1073      33,    34,    35,    36,    38,    39,     0,    40,    47,    48,
     1074      49,    50,     5,     0,    38,     1,     2,    10,    42,    38,
     1075      39,    41,    15,    42,    40,    18,    19,    31,    32,    28,
     1076      23,    70,    71,    33,    27,    -1,    -1,    30,    24,    25,
     1077      26,    34,    -1,    29,    83,    84,     3,     4,     5,     6,
     1078       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
     1079      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
     1080      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
     1081       3,     4,    -1,     6,    -1,     8,     9,    -1,    11,    -1,
     1082      13,    14,    -1,    16,    -1,    38,    39,    -1,    21,    42
    11751083  };
    11761084
     
    11831091      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
    11841092      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
    1185       32,    33,    34,    35,    39,    43,    44,    45,    46,    48,
    1186       49,    50,    51,    52,    37,    38,    41,    53,    54,    55,
    1187       56,    61,    38,    56,    53,    53,    55,    53,    53,    53,
    1188       55,    53,    53,    53,    55,    53,    55,    55,    53,    56,
    1189       57,    58,    55,    56,    56,    56,    55,    57,    56,    55,
    1190       54,    54,    58,    59,    60,    55,     0,     0,    44,    44,
    1191       49,    61,    61,    61,    61,    61,    61,    61,    61,    40,
    1192       47
     1093      32,    33,    34,    35,    36,    40,    44,    45,    46,    47,
     1094      49,    50,    51,    52,    53,    38,    39,    42,    54,    55,
     1095      56,    57,    62,    39,    57,    54,    54,    56,    54,    54,
     1096      54,    56,    54,    54,    54,    56,    54,    56,    56,    54,
     1097      57,    58,    59,    56,    57,    57,    57,    56,    58,    57,
     1098      56,    55,    55,    59,    60,    61,    56,     0,     0,    45,
     1099      45,    50,    62,    62,    62,    62,    62,    62,    62,    62,
     1100      41,    48
    11931101  };
    11941102
     
    12021110     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
    12031111     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
    1204      285,   286,   287,   288,   289,   290,   291,   292,   293,    91,
    1205       93,    45
     1112     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     1113      91,    93,    45
    12061114  };
    12071115#endif
     
    12111119  EasyMeshParser::yyr1_[] =
    12121120  {
    1213          0,    42,    43,    44,    44,    45,    45,    46,    47,    48,
    1214       48,    49,    49,    49,    50,    50,    50,    50,    51,    51,
    1215       51,    51,    51,    51,    51,    51,    51,    51,    51,    51,
    1216       51,    51,    51,    51,    51,    51,    52,    52,    52,    52,
    1217       52,    52,    52,    52,    52,    52,    52,    52,    52,    53,
    1218       54,    55,    56,    57,    58,    59,    60,    61,    61
     1121         0,    43,    44,    45,    45,    46,    46,    47,    48,    49,
     1122      49,    50,    50,    50,    51,    51,    51,    51,    52,    52,
     1123      52,    52,    52,    52,    52,    52,    52,    52,    52,    52,
     1124      52,    52,    52,    52,    52,    52,    52,    53,    53,    53,
     1125      53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
     1126      54,    55,    56,    57,    58,    59,    60,    61,    62,    62
    12191127  };
    12201128
     
    12261134       2,     1,     1,     1,     2,     2,     2,     2,     2,     2,
    12271135       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1228        2,     2,     2,     1,     1,     1,     2,     2,     2,     2,
    1229        2,     2,     2,     2,     2,     2,     2,     2,     2,     1,
    1230        2,     2,     2,     2,     2,     2,     2,     1,     2
     1136       2,     2,     2,     1,     1,     1,     1,     2,     2,     2,
     1137       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     1138       1,     2,     2,     2,     2,     2,     2,     2,     1,     2
    12311139  };
    12321140
     
    12411149  "T_ROTATEY", "T_TAPERY", "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ",
    12421150  "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE",
    1243   "T_SCALE", "T_CHAMFER", "T_CYLINDER", "T_BOX", "T_SMOOTHCHAMFBOX",
    1244   "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR", "T_EXPANDEDSTAR",
    1245   "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS", "T_ERROR",
    1246   "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept", "mesh_description",
    1247   "mesh_expression_list", "mesh_expression", "mesh_open", "mesh_close",
    1248   "mesh_command_list", "mesh_command", "color_command",
    1249   "transform_command", "primitive_command", "args1", "args2", "args3",
    1250   "args4", "args5", "args6", "args7", "args8", "number", 0
     1151  "T_SCALE", "T_TOGGLESCALEWINDING", "T_CHAMFER", "T_CYLINDER", "T_BOX",
     1152  "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR",
     1153  "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS",
     1154  "T_ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept",
     1155  "mesh_description", "mesh_expression_list", "mesh_expression",
     1156  "mesh_open", "mesh_close", "mesh_command_list", "mesh_command",
     1157  "color_command", "transform_command", "primitive_command", "args1",
     1158  "args2", "args3", "args4", "args5", "args6", "args7", "args8", "number", 0
    12511159  };
    12521160#endif
     
    12571165  EasyMeshParser::yyrhs_[] =
    12581166  {
    1259         43,     0,    -1,    44,     0,    -1,    45,    -1,    45,    44,
    1260       -1,    48,    -1,    46,    44,    47,    -1,    39,    -1,    40,
    1261       -1,    49,    -1,    48,    49,    -1,    50,    -1,    51,    -1,
    1262       52,    -1,     3,    56,    -1,     3,    38,    -1,     4,    56,
    1263       -1,     4,    38,    -1,    22,    53,    -1,     5,    53,    -1,
    1264       10,    53,    -1,    15,    53,    -1,    20,    55,    -1,     6,
    1265       53,    -1,    11,    53,    -1,    16,    53,    -1,     7,    55,
    1266       -1,    12,    55,    -1,    17,    55,    -1,     8,    53,    -1,
    1267       13,    53,    -1,    18,    53,    -1,    21,    55,    -1,     9,
    1268       -1,    14,    -1,    19,    -1,    23,    58,    -1,    24,    55,
    1269       -1,    25,    56,    -1,    26,    56,    -1,    27,    56,    -1,
    1270       28,    55,    -1,    35,    55,    -1,    29,    57,    -1,    30,
    1271       56,    -1,    31,    55,    -1,    32,    54,    -1,    33,    54,
    1272       -1,    34,    60,    -1,    61,    -1,    53,    61,    -1,    54,
    1273       61,    -1,    55,    61,    -1,    56,    61,    -1,    57,    61,
    1274       -1,    58,    61,    -1,    59,    61,    -1,    37,    -1,    41,
    1275       61,    -1
     1167        44,     0,    -1,    45,     0,    -1,    46,    -1,    46,    45,
     1168      -1,    49,    -1,    47,    45,    48,    -1,    40,    -1,    41,
     1169      -1,    50,    -1,    49,    50,    -1,    51,    -1,    52,    -1,
     1170      53,    -1,     3,    57,    -1,     3,    39,    -1,     4,    57,
     1171      -1,     4,    39,    -1,    23,    54,    -1,     5,    54,    -1,
     1172      10,    54,    -1,    15,    54,    -1,    20,    56,    -1,     6,
     1173      54,    -1,    11,    54,    -1,    16,    54,    -1,     7,    56,
     1174      -1,    12,    56,    -1,    17,    56,    -1,     8,    54,    -1,
     1175      13,    54,    -1,    18,    54,    -1,    21,    56,    -1,     9,
     1176      -1,    14,    -1,    19,    -1,    22,    -1,    24,    59,    -1,
     1177      25,    56,    -1,    26,    57,    -1,    27,    57,    -1,    28,
     1178      57,    -1,    29,    56,    -1,    36,    56,    -1,    30,    58,
     1179      -1,    31,    57,    -1,    32,    56,    -1,    33,    55,    -1,
     1180      34,    55,    -1,    35,    61,    -1,    62,    -1,    54,    62,
     1181      -1,    55,    62,    -1,    56,    62,    -1,    57,    62,    -1,
     1182      58,    62,    -1,    59,    62,    -1,    60,    62,    -1,    38,
     1183      -1,    42,    62,    -1
    12761184  };
    12771185
     
    12841192      23,    26,    28,    30,    32,    35,    38,    41,    44,    47,
    12851193      50,    53,    56,    59,    62,    65,    68,    71,    74,    77,
    1286       80,    83,    86,    89,    91,    93,    95,    98,   101,   104,
    1287      107,   110,   113,   116,   119,   122,   125,   128,   131,   134,
    1288      136,   139,   142,   145,   148,   151,   154,   157,   159
     1194      80,    83,    86,    89,    91,    93,    95,    97,   100,   103,
     1195     106,   109,   112,   115,   118,   121,   124,   127,   130,   133,
     1196     136,   138,   141,   144,   147,   150,   153,   156,   159,   161
    12891197  };
    12901198
     
    12961204      98,   102,   103,   104,   108,   109,   112,   113,   119,   120,
    12971205     121,   122,   123,   124,   125,   126,   127,   128,   129,   130,
    1298      131,   132,   133,   134,   135,   136,   140,   143,   144,   146,
    1299      148,   150,   151,   152,   154,   156,   157,   158,   159,   163,
    1300      164,   165,   166,   167,   168,   169,   170,   173,   174
     1206     131,   132,   133,   134,   135,   136,   137,   141,   144,   145,
     1207     147,   149,   151,   152,   153,   155,   157,   158,   159,   160,
     1208     164,   165,   166,   167,   168,   169,   170,   171,   174,   175
    13011209  };
    13021210
     
    13421250       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    13431251       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1344        2,     2,     2,     2,     2,    41,     2,     2,     2,     2,
    1345        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1346        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1347        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1348        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    1349        2,    39,     2,    40,     2,     2,     2,     2,     2,     2,
     1252       2,     2,     2,     2,     2,    42,     2,     2,     2,     2,
     1253       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     1254       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     1255       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     1256       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     1257       2,    40,     2,    41,     2,     2,     2,     2,     2,     2,
    13501258       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    13511259       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     
    13671275      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
    13681276      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
    1369       35,    36,    37,    38
     1277      35,    36,    37,    38,    39
    13701278    };
    13711279    if ((unsigned int) t <= yyuser_token_number_max_)
     
    13761284
    13771285  const int EasyMeshParser::yyeof_ = 0;
    1378   const int EasyMeshParser::yylast_ = 126;
     1286  const int EasyMeshParser::yylast_ = 129;
    13791287  const int EasyMeshParser::yynnts_ = 20;
    13801288  const int EasyMeshParser::yyempty_ = -2;
    1381   const int EasyMeshParser::yyfinal_ = 86;
     1289  const int EasyMeshParser::yyfinal_ = 87;
    13821290  const int EasyMeshParser::yyterror_ = 1;
    13831291  const int EasyMeshParser::yyerrcode_ = 256;
    1384   const int EasyMeshParser::yyntokens_ = 42;
    1385 
    1386   const unsigned int EasyMeshParser::yyuser_token_number_max_ = 293;
     1292  const int EasyMeshParser::yyntokens_ = 43;
     1293
     1294  const unsigned int EasyMeshParser::yyuser_token_number_max_ = 294;
    13871295  const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2;
    13881296
     
    13901298} // lol
    13911299
    1392 /* Line 1136 of lalr1.cc  */
    1393 #line 1394 "generated/easymesh-parser.cpp"
    1394 
    1395 
    1396 /* Line 1138 of lalr1.cc  */
    1397 #line 177 "easymesh/easymesh-parser.y"
     1300/* Line 1053 of lalr1.cc  */
     1301#line 1302 "generated/easymesh-parser.cpp"
     1302
     1303
     1304/* Line 1055 of lalr1.cc  */
     1305#line 178 "easymesh/easymesh-parser.y"
    13981306
    13991307
  • trunk/src/generated/easymesh-parser.h

    r1875 r2116  
    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/easymesh-parser.h"
     49  class position;
     50  class location;
     51
     52} // lol
     53
     54/* Line 34 of lalr1.cc  */
     55#line 56 "generated/easymesh-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/easymesh-parser.h"
     99/* Line 34 of lalr1.cc  */
     100#line 101 "generated/easymesh-parser.h"
    68101
    69102  /// A Bison parser.
     
    76109    {
    77110
    78 /* Line 35 of lalr1.cc  */
     111/* Line 34 of lalr1.cc  */
    79112#line 36 "easymesh/easymesh-parser.y"
    80113
     
    86119
    87120
    88 /* Line 35 of lalr1.cc  */
    89 #line 90 "generated/easymesh-parser.h"
     121/* Line 34 of lalr1.cc  */
     122#line 123 "generated/easymesh-parser.h"
    90123    };
    91124#else
     
    119152     T_TRANSLATE = 275,
    120153     T_SCALE = 276,
    121      T_CHAMFER = 277,
    122      T_CYLINDER = 278,
    123      T_BOX = 279,
    124      T_SMOOTHCHAMFBOX = 280,
    125      T_FLATCHAMFBOX = 281,
    126      T_SPHERE = 282,
    127      T_CAPSULE = 283,
    128      T_STAR = 284,
    129      T_EXPANDEDSTAR = 285,
    130      T_DISC = 286,
    131      T_TRIANGLE = 287,
    132      T_QUAD = 288,
    133      T_COG = 289,
    134      T_TORUS = 290,
    135      T_ERROR = 291,
    136      NUMBER = 292,
    137      COLOR = 293
     154     T_TOGGLESCALEWINDING = 277,
     155     T_CHAMFER = 278,
     156     T_CYLINDER = 279,
     157     T_BOX = 280,
     158     T_SMOOTHCHAMFBOX = 281,
     159     T_FLATCHAMFBOX = 282,
     160     T_SPHERE = 283,
     161     T_CAPSULE = 284,
     162     T_STAR = 285,
     163     T_EXPANDEDSTAR = 286,
     164     T_DISC = 287,
     165     T_TRIANGLE = 288,
     166     T_QUAD = 289,
     167     T_COG = 290,
     168     T_TORUS = 291,
     169     T_ERROR = 292,
     170     NUMBER = 293,
     171     COLOR = 294
    138172   };
    139173
     
    209243    location_stack_type yylocation_stack_;
    210244
    211     /// Whether the given \c yypact_ value indicates a defaulted state.
    212     /// \param yyvalue   the value to check
    213     static bool yy_pact_value_is_default_ (int yyvalue);
    214 
    215     /// Whether the given \c yytable_ value indicates a syntax error.
    216     /// \param yyvalue   the value to check
    217     static bool yy_table_value_is_error_ (int yyvalue);
    218 
    219245    /// Internal symbol numbers.
    220246    typedef unsigned char token_number_type;
     
    224250    static const signed char yypact_ninf_;
    225251
    226     /// For a state, default reduction number.
     252    /// For a state, default rule to reduce.
    227253    /// Unless\a  yytable_ specifies something else to do.
    228254    /// Zero means the default is an error.
     
    255281#endif
    256282
     283#if YYERROR_VERBOSE
    257284    /// Convert the symbol name \a n to a form suitable for a diagnostic.
    258     static std::string yytnamerr_ (const char *n);
     285    virtual std::string yytnamerr_ (const char *n);
     286#endif
    259287
    260288#if YYDEBUG
     
    314342} // lol
    315343
    316 /* Line 35 of lalr1.cc  */
    317 #line 318 "generated/easymesh-parser.h"
     344/* Line 34 of lalr1.cc  */
     345#line 346 "generated/easymesh-parser.h"
    318346
    319347
  • trunk/src/generated/easymesh-scanner.cpp

    r1910 r2116  
    331331        (yy_c_buf_p) = yy_cp;
    332332
    333 #define YY_NUM_RULES 45
    334 #define YY_END_OF_BUFFER 46
     333#define YY_NUM_RULES 46
     334#define YY_END_OF_BUFFER 47
    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[73] =
     342static yyconst flex_int16_t yy_accept[75] =
    343343    {   0,
    344         0,    0,   46,   44,   43,   42,   44,   44,   39,   44,
    345        38,   40,   41,   44,   44,   44,   44,   17,    7,    0,
    346         0,   38,   38,    0,   21,   22,   25,    0,    0,   28,
    347        29,   32,    3,   18,   19,   20,    8,    9,   10,    1,
    348        14,   15,   16,    0,    4,    5,    6,    0,    0,   38,
    349         0,   24,   26,    0,    0,    0,   33,    2,   11,   12,
    350        13,   34,   23,   27,   30,   31,   35,    0,   36,    0,
    351        37,    0
     344        0,    0,   47,   45,   44,   43,   45,   45,   40,   45,
     345       39,   41,   42,   45,   45,   45,   45,   17,    7,    0,
     346        0,   39,   39,    0,   22,   23,   26,    0,    0,   29,
     347       30,   33,    3,   19,   20,   21,    8,    9,   10,    1,
     348       14,   15,   16,    0,    0,    4,    5,    6,    0,    0,
     349       39,    0,   25,   27,    0,    0,    0,   34,    2,   11,
     350       12,   13,   18,   35,   24,   28,   31,   32,   36,    0,
     351       37,    0,   38,    0
    352352    } ;
    353353
     
    366366
    367367       17,   18,   19,   20,    1,    1,    1,    1,   21,    1,
    368        22,   23,   24,   25,   26,   27,    1,    1,    1,   28,
    369        29,   30,    1,    1,    1,    1,    1,    1,    1,    1,
     368       22,   23,   24,   25,   26,   27,    1,    1,   28,   29,
     369       30,   31,    1,    1,    1,    1,    1,    1,    1,    1,
    370370        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    371371        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
     
    384384    } ;
    385385
    386 static yyconst flex_int32_t yy_meta[31] =
     386static yyconst flex_int32_t yy_meta[32] =
    387387    {   0,
    388388        1,    1,    1,    1,    1,    1,    1,    2,    2,    2,
    389389        1,    1,    2,    2,    2,    2,    2,    2,    1,    1,
    390         1,    1,    1,    1,    1,    1,    1,    1,    1,    1
     390        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
     391        1
    391392    } ;
    392393
    393 static yyconst flex_int16_t yy_base[81] =
     394static yyconst flex_int16_t yy_base[83] =
    394395    {   0,
    395         0,    0,   99,  100,  100,  100,    0,   24,   26,   90,
    396        28,  100,  100,   32,   77,   11,   14,   36,   24,    0,
    397        88,   53,   59,   66,  100,   49,  100,   69,   79,  100,
    398        58,   71,  100,  100,  100,  100,  100,  100,  100,   78,
    399       100,  100,  100,   49,  100,  100,  100,    0,   83,   82,
    400        66,  100,  100,   74,   73,   66,  100,  100,  100,  100,
    401       100,    0,  100,  100,  100,  100,    0,    0,    0,    0,
    402       100,  100,   83,   82,   81,   80,   78,   73,   55,   53
     396        0,    0,  102,  103,  103,  103,    0,   25,   27,   93,
     397       29,  103,  103,   33,   80,   11,   14,   23,   48,    0,
     398       91,   48,   54,   61,  103,   57,  103,   72,   82,  103,
     399       57,   74,  103,  103,  103,  103,  103,  103,  103,   81,
     400      103,  103,  103,   52,   66,  103,  103,  103,    0,   85,
     401       84,   68,  103,  103,   76,   75,   68,  103,  103,  103,
     402      103,  103,  103,    0,  103,  103,  103,  103,    0,    0,
     403        0,    0,  103,  103,   85,   84,   83,   82,   73,   71,
     404       66,   61
    403405    } ;
    404406
    405 static yyconst flex_int16_t yy_def[81] =
     407static yyconst flex_int16_t yy_def[83] =
    406408    {   0,
    407        72,    1,   72,   72,   72,   72,   73,   72,   72,   72,
    408        72,   72,   72,   72,   72,   72,   72,   72,   72,   74,
    409        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    410        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    411        72,   72,   72,   72,   72,   72,   72,   75,   72,   72,
    412        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    413        72,   76,   72,   72,   72,   72,   77,   78,   79,   80,
    414        72,    0,   72,   72,   72,   72,   72,   72,   72,   72
     409       74,    1,   74,   74,   74,   74,   75,   74,   74,   74,
     410       74,   74,   74,   74,   74,   74,   74,   74,   74,   76,
     411       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     412       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     413       74,   74,   74,   74,   74,   74,   74,   74,   77,   74,
     414       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     415       74,   74,   74,   78,   74,   74,   74,   74,   79,   80,
     416       81,   82,   74,    0,   74,   74,   74,   74,   74,   74,
     417       74,   74
    415418    } ;
    416419
    417 static yyconst flex_int16_t yy_nxt[131] =
     420static yyconst flex_int16_t yy_nxt[135] =
    418421    {   0,
    419422        4,    5,    6,    7,    8,    9,   10,   11,    4,    4,
    420423       12,   13,   14,    4,   15,    4,    4,    4,    4,    4,
    421424       16,    4,    4,    4,   17,   18,   19,    4,    4,    4,
    422        21,   22,   21,   22,   21,   22,   44,   24,   34,   35,
    423        36,   37,   38,   39,   24,   25,   26,   27,   28,   29,
    424        40,   45,   46,   47,   71,   30,   70,   31,   32,   21,
    425        22,   51,   24,   41,   42,   43,   23,   52,   24,   24,
    426        49,   49,   55,   50,   69,   24,   59,   60,   61,   68,
    427        56,   67,   62,   48,   20,   66,   65,   64,   63,   50,
    428        50,   58,   57,   54,   53,   23,   33,   23,   72,    3,
    429 
    430        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    431        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    432        72,   72,   72,   72,   72,   72,   72,   72,   72,   72
     425        4,   21,   22,   21,   22,   21,   22,   40,   24,   34,
     426       35,   36,   37,   38,   39,   24,   25,   26,   27,   28,
     427       29,   41,   42,   43,   21,   22,   30,   24,   31,   32,
     428       44,   23,   73,   24,   24,   50,   50,   72,   51,   52,
     429       24,   56,   71,   45,   70,   53,   46,   47,   48,   57,
     430       60,   61,   62,   69,   64,   49,   20,   68,   67,   66,
     431       65,   51,   51,   63,   59,   58,   55,   54,   23,   33,
     432
     433       23,   74,    3,   74,   74,   74,   74,   74,   74,   74,
     434       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     435       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     436       74,   74,   74,   74
    433437    } ;
    434438
    435 static yyconst flex_int16_t yy_chk[131] =
     439static yyconst flex_int16_t yy_chk[135] =
    436440    {   0,
    437441        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    438442        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    439443        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    440         8,    8,    9,    9,   11,   11,   19,   11,   16,   16,
    441        16,   17,   17,   17,   11,   14,   14,   14,   14,   14,
    442        18,   19,   19,   19,   80,   14,   79,   14,   14,   22,
    443        22,   26,   22,   18,   18,   18,   23,   26,   23,   22,
    444        24,   24,   31,   24,   78,   23,   44,   44,   44,   77,
    445        31,   76,   75,   74,   73,   56,   55,   54,   51,   50,
    446        49,   40,   32,   29,   28,   21,   15,   10,    3,   72,
    447 
    448        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    449        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
    450        72,   72,   72,   72,   72,   72,   72,   72,   72,   72
     444        1,    8,    8,    9,    9,   11,   11,   18,   11,   16,
     445       16,   16,   17,   17,   17,   11,   14,   14,   14,   14,
     446       14,   18,   18,   18,   22,   22,   14,   22,   14,   14,
     447       19,   23,   82,   23,   22,   24,   24,   81,   24,   26,
     448       23,   31,   80,   19,   79,   26,   19,   19,   19,   31,
     449       44,   44,   44,   78,   77,   76,   75,   57,   56,   55,
     450       52,   51,   50,   45,   40,   32,   29,   28,   21,   15,
     451
     452       10,    3,   74,   74,   74,   74,   74,   74,   74,   74,
     453       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     454       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
     455       74,   74,   74,   74
    451456    } ;
    452457
     
    497502#define YY_NO_UNISTD_H
    498503#define YY_USER_ACTION yylloc->columns(yyleng);
    499 #line 500 "generated/easymesh-scanner.cpp"
     504#line 505 "generated/easymesh-scanner.cpp"
    500505
    501506#define INITIAL 0
     
    610615
    611616
    612 #line 613 "generated/easymesh-scanner.cpp"
     617#line 618 "generated/easymesh-scanner.cpp"
    613618
    614619        if ( !(yy_init) )
     
    663668                                {
    664669                                yy_current_state = (int) yy_def[yy_current_state];
    665                                 if ( yy_current_state >= 73 )
     670                                if ( yy_current_state >= 75 )
    666671                                        yy_c = yy_meta[(unsigned int) yy_c];
    667672                                }
     
    669674                        ++yy_cp;
    670675                        }
    671                 while ( yy_current_state != 72 );
     676                while ( yy_current_state != 74 );
    672677                yy_cp = (yy_last_accepting_cpos);
    673678                yy_current_state = (yy_last_accepting_state);
     
    777782YY_RULE_SETUP
    778783#line 69 "easymesh/easymesh-scanner.l"
     784{ return token::T_TOGGLESCALEWINDING; }
     785        YY_BREAK
     786case 19:
     787YY_RULE_SETUP
     788#line 70 "easymesh/easymesh-scanner.l"
    779789{ return token::T_MIRRORX; }
    780790        YY_BREAK
    781 case 19:
    782 YY_RULE_SETUP
    783 #line 70 "easymesh/easymesh-scanner.l"
     791case 20:
     792YY_RULE_SETUP
     793#line 71 "easymesh/easymesh-scanner.l"
    784794{ return token::T_MIRRORY; }
    785795        YY_BREAK
    786 case 20:
    787 YY_RULE_SETUP
    788 #line 71 "easymesh/easymesh-scanner.l"
     796case 21:
     797YY_RULE_SETUP
     798#line 72 "easymesh/easymesh-scanner.l"
    789799{ return token::T_MIRRORZ; }
    790800        YY_BREAK
    791 case 21:
    792 YY_RULE_SETUP
    793 #line 73 "easymesh/easymesh-scanner.l"
     801case 22:
     802YY_RULE_SETUP
     803#line 74 "easymesh/easymesh-scanner.l"
    794804{ return token::T_BOX; }
    795805        YY_BREAK
    796 case 22:
    797 YY_RULE_SETUP
    798 #line 74 "easymesh/easymesh-scanner.l"
     806case 23:
     807YY_RULE_SETUP
     808#line 75 "easymesh/easymesh-scanner.l"
    799809{ return token::T_CYLINDER; }
    800810        YY_BREAK
    801 case 23:
    802 YY_RULE_SETUP
    803 #line 75 "easymesh/easymesh-scanner.l"
     811case 24:
     812YY_RULE_SETUP
     813#line 76 "easymesh/easymesh-scanner.l"
    804814{ return token::T_CAPSULE; }
    805815        YY_BREAK
    806 case 24:
    807 YY_RULE_SETUP
    808 #line 76 "easymesh/easymesh-scanner.l"
     816case 25:
     817YY_RULE_SETUP
     818#line 77 "easymesh/easymesh-scanner.l"
    809819{ return token::T_COG; }
    810820        YY_BREAK
    811 case 25:
    812 YY_RULE_SETUP
    813 #line 77 "easymesh/easymesh-scanner.l"
     821case 26:
     822YY_RULE_SETUP
     823#line 78 "easymesh/easymesh-scanner.l"
    814824{ return token::T_DISC; }
    815825        YY_BREAK
    816 case 26:
    817 YY_RULE_SETUP
    818 #line 78 "easymesh/easymesh-scanner.l"
     826case 27:
     827YY_RULE_SETUP
     828#line 79 "easymesh/easymesh-scanner.l"
    819829{ return token::T_EXPANDEDSTAR; }
    820830        YY_BREAK
    821 case 27:
    822 YY_RULE_SETUP
    823 #line 79 "easymesh/easymesh-scanner.l"
     831case 28:
     832YY_RULE_SETUP
     833#line 80 "easymesh/easymesh-scanner.l"
    824834{ return token::T_FLATCHAMFBOX; }
    825835        YY_BREAK
    826 case 28:
    827 YY_RULE_SETUP
    828 #line 80 "easymesh/easymesh-scanner.l"
     836case 29:
     837YY_RULE_SETUP
     838#line 81 "easymesh/easymesh-scanner.l"
    829839{ return token::T_QUAD; }
    830840        YY_BREAK
    831 case 29:
    832 YY_RULE_SETUP
    833 #line 81 "easymesh/easymesh-scanner.l"
     841case 30:
     842YY_RULE_SETUP
     843#line 82 "easymesh/easymesh-scanner.l"
    834844{ return token::T_STAR; }
    835845        YY_BREAK
    836 case 30:
    837 YY_RULE_SETUP
    838 #line 82 "easymesh/easymesh-scanner.l"
     846case 31:
     847YY_RULE_SETUP
     848#line 83 "easymesh/easymesh-scanner.l"
    839849{ return token::T_SMOOTHCHAMFBOX; }
    840850        YY_BREAK
    841 case 31:
    842 YY_RULE_SETUP
    843 #line 83 "easymesh/easymesh-scanner.l"
     851case 32:
     852YY_RULE_SETUP
     853#line 84 "easymesh/easymesh-scanner.l"
    844854{ return token::T_SPHERE; }
    845855        YY_BREAK
    846 case 32:
    847 YY_RULE_SETUP
    848 #line 84 "easymesh/easymesh-scanner.l"
     856case 33:
     857YY_RULE_SETUP
     858#line 85 "easymesh/easymesh-scanner.l"
    849859{ return token::T_TRIANGLE; }
    850860        YY_BREAK
    851 case 33:
    852 YY_RULE_SETUP
    853 #line 85 "easymesh/easymesh-scanner.l"
     861case 34:
     862YY_RULE_SETUP
     863#line 86 "easymesh/easymesh-scanner.l"
    854864{ return token::T_TORUS; }
    855865        YY_BREAK
    856 case 34:
    857 YY_RULE_SETUP
    858 #line 87 "easymesh/easymesh-scanner.l"
     866case 35:
     867YY_RULE_SETUP
     868#line 88 "easymesh/easymesh-scanner.l"
    859869{
    860870        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
     
    865875        return token::COLOR; }
    866876        YY_BREAK
    867 case 35:
    868 YY_RULE_SETUP
    869 #line 94 "easymesh/easymesh-scanner.l"
     877case 36:
     878YY_RULE_SETUP
     879#line 95 "easymesh/easymesh-scanner.l"
    870880{
    871881        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
     
    876886        return token::COLOR; }
    877887        YY_BREAK
    878 case 36:
    879 YY_RULE_SETUP
    880 #line 101 "easymesh/easymesh-scanner.l"
     888case 37:
     889YY_RULE_SETUP
     890#line 102 "easymesh/easymesh-scanner.l"
    881891{
    882892        yylval->u32val = 0xffu
     
    884894        return token::COLOR; }
    885895        YY_BREAK
    886 case 37:
    887 YY_RULE_SETUP
    888 #line 105 "easymesh/easymesh-scanner.l"
     896case 38:
     897YY_RULE_SETUP
     898#line 106 "easymesh/easymesh-scanner.l"
    889899{
    890900        yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
    891901        return token::COLOR; }
    892902        YY_BREAK
    893 case 38:
    894 YY_RULE_SETUP
    895 #line 108 "easymesh/easymesh-scanner.l"
     903case 39:
     904YY_RULE_SETUP
     905#line 109 "easymesh/easymesh-scanner.l"
    896906{
    897907        yylval->fval = std::atof(yytext); return token::NUMBER; }
    898908        YY_BREAK
    899 case 39:
    900 YY_RULE_SETUP
    901 #line 110 "easymesh/easymesh-scanner.l"
     909case 40:
     910YY_RULE_SETUP
     911#line 111 "easymesh/easymesh-scanner.l"
    902912{ return token_type('-'); }
    903913        YY_BREAK
    904 case 40:
    905 YY_RULE_SETUP
    906 #line 111 "easymesh/easymesh-scanner.l"
     914case 41:
     915YY_RULE_SETUP
     916#line 112 "easymesh/easymesh-scanner.l"
    907917{ return token_type('['); }
    908918        YY_BREAK
    909 case 41:
    910 YY_RULE_SETUP
    911 #line 112 "easymesh/easymesh-scanner.l"
     919case 42:
     920YY_RULE_SETUP
     921#line 113 "easymesh/easymesh-scanner.l"
    912922{ return token_type(']'); }
    913923        YY_BREAK
    914 case 42:
    915 YY_RULE_SETUP
    916 #line 113 "easymesh/easymesh-scanner.l"
    917 { /* ignore this */ }
    918         YY_BREAK
    919924case 43:
    920 /* rule 43 can match eol */
    921925YY_RULE_SETUP
    922926#line 114 "easymesh/easymesh-scanner.l"
     
    924928        YY_BREAK
    925929case 44:
     930/* rule 44 can match eol */
    926931YY_RULE_SETUP
    927932#line 115 "easymesh/easymesh-scanner.l"
     933{ /* ignore this */ }
     934        YY_BREAK
     935case 45:
     936YY_RULE_SETUP
     937#line 116 "easymesh/easymesh-scanner.l"
    928938{ return token::T_ERROR; }
    929939        YY_BREAK
    930 case 45:
    931 YY_RULE_SETUP
    932 #line 117 "easymesh/easymesh-scanner.l"
     940case 46:
     941YY_RULE_SETUP
     942#line 118 "easymesh/easymesh-scanner.l"
    933943ECHO;
    934944        YY_BREAK
    935 #line 936 "generated/easymesh-scanner.cpp"
     945#line 946 "generated/easymesh-scanner.cpp"
    936946case YY_STATE_EOF(INITIAL):
    937947        yyterminate();
     
    13151325                        {
    13161326                        yy_current_state = (int) yy_def[yy_current_state];
    1317                         if ( yy_current_state >= 73 )
     1327                        if ( yy_current_state >= 75 )
    13181328                                yy_c = yy_meta[(unsigned int) yy_c];
    13191329                        }
     
    13431353                {
    13441354                yy_current_state = (int) yy_def[yy_current_state];
    1345                 if ( yy_current_state >= 73 )
     1355                if ( yy_current_state >= 75 )
    13461356                        yy_c = yy_meta[(unsigned int) yy_c];
    13471357                }
    13481358        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
    1349         yy_is_jam = (yy_current_state == 72);
     1359        yy_is_jam = (yy_current_state == 74);
    13501360
    13511361        return yy_is_jam ? 0 : yy_current_state;
     
    18341844#define YYTABLES_NAME "yytables"
    18351845
    1836 #line 117 "easymesh/easymesh-scanner.l"
     1846#line 118 "easymesh/easymesh-scanner.l"
    18371847
    18381848
  • trunk/src/generated/location.hh

    r1510 r2116  
    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

    r1937 r2116  
    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

    r1930 r2116  
    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

    r1510 r2116  
    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

    r1510 r2116  
    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/PhysicObject.h

    r1912 r2116  
    117117        //MeshRand << "[sc#ada afcb2 2 2 -.1]";
    118118        //MeshRand << "[sc#aad afcb2 2 2 -.1]";
    119         MeshRand << "[sc#add afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
    120         MeshRand << "[sc#dad afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
    121         MeshRand << "[sc#dda afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
    122         MeshRand << "[sc#daa afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
    123         MeshRand << "[sc#ada afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
    124         MeshRand << "[sc#aad afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
     119        MeshRand << "[sc#add afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
     120        MeshRand << "[sc#dad afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
     121        MeshRand << "[sc#dda afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
     122        MeshRand << "[sc#daa afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
     123        MeshRand << "[sc#ada afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
     124        MeshRand << "[sc#aad afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]";
    125125
    126126        int SphereLimit = MeshRand.Count();
Note: See TracChangeset for help on using the changeset viewer.