Changeset 1418


Ignore:
Timestamp:
May 29, 2012, 8:38:02 PM (8 years ago)
Author:
sam
Message:

orbital: other parser tweak attempts.

Location:
trunk/orbital
Files:
5 added
1 deleted
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/orbital/Makefile.am

    r1417 r1418  
    55    orbital.cpp orbital.h \
    66    mesh.cpp mesh.h \
    7     particlesystem.h tank.h player.h gun.h snake.h starfield.h
     7    particlesystem.h tank.h player.h gun.h snake.h starfield.h \
     8    \
     9    mesh-driver.cpp mesh-driver.h \
     10    generated/mesh-scanner.cpp \
     11    generated/mesh-parser.cpp
    812nodist_orbital_SOURCES = \
    913    shiny.lolfx.cpp
     
    1115orbital_LDADD =
    1216orbital_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@
    13 orbital_DEPENDENCIES = $(top_builddir)/src/liblol.a \
    14     generated/mesh-scanner.cpp \
    15     generated/mesh-parser.cpp
     17orbital_DEPENDENCIES = $(top_builddir)/src/liblol.a
    1618
    1719all-local: orbital$(EXEEXT)
     
    2123generated: .FORCE
    2224        $(MKDIR_P) generated
    23         flex -o generated/mesh-scanner.cpp mesh.l
    24         bison -o generated/mesh-parser.cpp -d -b generated/mesh mesh.yy
     25        rm -f generated/[a-zA-Z]*
     26        flex -o generated/mesh-scanner.cpp mesh.ll
     27        bison -o generated/mesh-parser.cpp --defines=generated/mesh-parser.h \
     28              -d -b generated/mesh mesh.yy
    2529.FORCE:
    2630endif
  • trunk/orbital/generated/location.hh

    r1415 r1418  
    3333/**
    3434 ** \file location.hh
    35  ** Define the yy::location class.
     35 ** Define the orbital::location class.
    3636 */
    3737
     
    4444
    4545
    46 namespace yy {
     46namespace orbital {
    4747
    4848/* Line 162 of location.cc  */
     
    157157
    158158
    159 } // yy
     159} // orbital
    160160
    161161/* Line 271 of location.cc  */
  • trunk/orbital/generated/mesh-parser.cpp

    r1415 r1418  
    3131   version 2.2 of Bison.  */
    3232
     33// Take the name prefix into account.
     34#define yylex   orbitallex
    3335
    3436/* First part of user declarations.  */
    3537
    36 
    3738/* Line 293 of lalr1.cc  */
    38 #line 39 "generated/mesh-parser.cpp"
    39 
    40 
    41 #include "mesh-parser.hpp"
     39#line 4 "mesh.yy"
     40 /*** C/C++ Declarations ***/
     41#if defined HAVE_CONFIG_H
     42#   include "config.h"
     43#endif
     44
     45#include "core.h"
     46#include "loldebug.h"
     47
     48using namespace lol;
     49
     50#include "mesh.h"
     51
     52#include <stdio.h>
     53#include <string>
     54#include <vector>
     55
     56
     57
     58/* Line 293 of lalr1.cc  */
     59#line 60 "generated/mesh-parser.cpp"
     60
     61
     62#include "mesh-parser.h"
    4263
    4364/* User implementation prologue.  */
    4465
    45 
    4666/* Line 299 of lalr1.cc  */
    47 #line 48 "generated/mesh-parser.cpp"
    48 /* Unqualified %code blocks.  */
    49 
    50 /* Line 300 of lalr1.cc  */
    51 #line 18 "mesh.yy"
    52 
    53 #define YY_DECL \
    54     yy::MeshParser::token_type \
    55     yylex(yy::MeshParser::semantic_type* yylval, \
    56           yy::MeshParser::location_type* yylloc, \
    57           Mesh& mesh, \
    58           void *yyscanner)
    59 YY_DECL;
    60 
    61 
    62 
    63 /* Line 300 of lalr1.cc  */
    64 #line 65 "generated/mesh-parser.cpp"
     67#line 88 "mesh.yy"
     68
     69
     70#include "mesh-driver.h"
     71#include "mesh-scanner.h"
     72
     73/* this "connects" the bison parser in the driver to the flex scanner class
     74 * object. it defines the yylex() function call to pull the next token from the
     75 * current lexer object of the driver context. */
     76#undef yylex
     77#define yylex driver.lexer->lex
     78
     79
     80
     81/* Line 299 of lalr1.cc  */
     82#line 83 "generated/mesh-parser.cpp"
    6583
    6684#ifndef YY_
     
    145163
    146164
    147 namespace yy {
     165namespace orbital {
    148166
    149167/* Line 382 of lalr1.cc  */
    150 #line 151 "generated/mesh-parser.cpp"
     168#line 169 "generated/mesh-parser.cpp"
     169
     170  /* Return YYSTR after stripping away unnecessary quotes and
     171     backslashes, so that it's suitable for yyerror.  The heuristic is
     172     that double-quoting is unnecessary unless the string contains an
     173     apostrophe, a comma, or backslash (other than backslash-backslash).
     174     YYSTR is taken from yytname.  */
     175  std::string
     176  MeshParser::yytnamerr_ (const char *yystr)
     177  {
     178    if (*yystr == '"')
     179      {
     180        std::string yyr = "";
     181        char const *yyp = yystr;
     182
     183        for (;;)
     184          switch (*++yyp)
     185            {
     186            case '\'':
     187            case ',':
     188              goto do_not_strip_quotes;
     189
     190            case '\\':
     191              if (*++yyp != '\\')
     192                goto do_not_strip_quotes;
     193              /* Fall through.  */
     194            default:
     195              yyr += *yyp;
     196              break;
     197
     198            case '"':
     199              return yyr;
     200            }
     201      do_not_strip_quotes: ;
     202      }
     203
     204    return yystr;
     205  }
     206
    151207
    152208  /// Build a parser object.
    153   MeshParser::MeshParser (Mesh &mesh_yyarg, void *yyscanner_yyarg)
     209  MeshParser::MeshParser (class Driver& driver_yyarg)
    154210    :
    155211#if YYDEBUG
     
    157213      yycdebug_ (&std::cerr),
    158214#endif
    159       mesh (mesh_yyarg),
    160       yyscanner (yyscanner_yyarg)
     215      driver (driver_yyarg)
    161216  {
    162217  }
     
    294349    YYCDEBUG << "Starting parse" << std::endl;
    295350
     351
     352    /* User initialization code.  */
     353   
     354/* Line 565 of lalr1.cc  */
     355#line 49 "mesh.yy"
     356{
     357    // initialize the initial location object
     358    yylloc.begin.filename = yylloc.end.filename = &driver.streamname;
     359}
     360
     361/* Line 565 of lalr1.cc  */
     362#line 363 "generated/mesh-parser.cpp"
    296363
    297364    /* Initialize the stacks.  The initial state will be pushed in
     
    328395      {
    329396        YYCDEBUG << "Reading a token: ";
    330         yychar = yylex (&yylval, &yylloc, mesh, yyscanner);
     397        yychar = yylex (&yylval, &yylloc);
    331398      }
    332399
     
    412479
    413480/* Line 690 of lalr1.cc  */
    414 #line 75 "mesh.yy"
    415     { mesh.Flush(); }
     481#line 120 "mesh.yy"
     482    { driver.mesh.Flush(); }
    416483    break;
    417484
     
    419486
    420487/* Line 690 of lalr1.cc  */
    421 #line 76 "mesh.yy"
    422     { mesh.MeshConvert(); }
     488#line 121 "mesh.yy"
     489    { driver.mesh.MeshConvert(); }
    423490    break;
    424491
     
    426493
    427494/* Line 690 of lalr1.cc  */
    428 #line 77 "mesh.yy"
     495#line 122 "mesh.yy"
    429496    { /* TODO */ }
    430497    break;
     
    433500
    434501/* Line 690 of lalr1.cc  */
    435 #line 81 "mesh.yy"
    436     { 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)); }
     502#line 126 "mesh.yy"
     503    { driver.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)); }
    437504    break;
    438505
     
    440507
    441508/* Line 690 of lalr1.cc  */
    442 #line 82 "mesh.yy"
    443     { 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)); }
     509#line 127 "mesh.yy"
     510    { driver.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)); }
    444511    break;
    445512
     
    447514
    448515/* Line 690 of lalr1.cc  */
    449 #line 86 "mesh.yy"
    450     { mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
     516#line 131 "mesh.yy"
     517    { driver.mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
    451518    break;
    452519
     
    454521
    455522/* Line 690 of lalr1.cc  */
    456 #line 87 "mesh.yy"
    457     { mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
     523#line 132 "mesh.yy"
     524    { driver.mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
    458525    break;
    459526
     
    461528
    462529/* Line 690 of lalr1.cc  */
    463 #line 88 "mesh.yy"
    464     { mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     530#line 133 "mesh.yy"
     531    { driver.mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
    465532    break;
    466533
     
    468535
    469536/* Line 690 of lalr1.cc  */
    470 #line 89 "mesh.yy"
    471     { mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     537#line 134 "mesh.yy"
     538    { driver.mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    472539    break;
    473540
     
    475542
    476543/* Line 690 of lalr1.cc  */
    477 #line 90 "mesh.yy"
    478     { mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
     544#line 135 "mesh.yy"
     545    { driver.mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
    479546    break;
    480547
     
    482549
    483550/* Line 690 of lalr1.cc  */
    484 #line 91 "mesh.yy"
    485     { mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
     551#line 136 "mesh.yy"
     552    { driver.mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
    486553    break;
    487554
     
    489556
    490557/* Line 690 of lalr1.cc  */
    491 #line 92 "mesh.yy"
    492     { mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
     558#line 137 "mesh.yy"
     559    { driver.mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
    493560    break;
    494561
     
    496563
    497564/* Line 690 of lalr1.cc  */
    498 #line 93 "mesh.yy"
    499     { mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     565#line 138 "mesh.yy"
     566    { driver.mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    500567    break;
    501568
     
    503570
    504571/* Line 690 of lalr1.cc  */
    505 #line 94 "mesh.yy"
    506     { mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     572#line 139 "mesh.yy"
     573    { driver.mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    507574    break;
    508575
     
    510577
    511578/* Line 690 of lalr1.cc  */
    512 #line 95 "mesh.yy"
    513     { mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     579#line 140 "mesh.yy"
     580    { driver.mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    514581    break;
    515582
     
    517584
    518585/* Line 690 of lalr1.cc  */
    519 #line 96 "mesh.yy"
    520     { mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
     586#line 141 "mesh.yy"
     587    { driver.mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
    521588    break;
    522589
     
    524591
    525592/* Line 690 of lalr1.cc  */
    526 #line 97 "mesh.yy"
    527     { mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
     593#line 142 "mesh.yy"
     594    { driver.mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
    528595    break;
    529596
     
    531598
    532599/* Line 690 of lalr1.cc  */
    533 #line 98 "mesh.yy"
    534     { mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     600#line 143 "mesh.yy"
     601    { driver.mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
    535602    break;
    536603
     
    538605
    539606/* Line 690 of lalr1.cc  */
    540 #line 99 "mesh.yy"
    541     { mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     607#line 144 "mesh.yy"
     608    { driver.mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    542609    break;
    543610
     
    545612
    546613/* Line 690 of lalr1.cc  */
    547 #line 100 "mesh.yy"
    548     { mesh.MirrorX(); }
     614#line 145 "mesh.yy"
     615    { driver.mesh.MirrorX(); }
    549616    break;
    550617
     
    552619
    553620/* Line 690 of lalr1.cc  */
    554 #line 101 "mesh.yy"
    555     { mesh.MirrorY(); }
     621#line 146 "mesh.yy"
     622    { driver.mesh.MirrorY(); }
    556623    break;
    557624
     
    559626
    560627/* Line 690 of lalr1.cc  */
    561 #line 102 "mesh.yy"
    562     { mesh.MirrorZ(); }
     628#line 147 "mesh.yy"
     629    { driver.mesh.MirrorZ(); }
    563630    break;
    564631
     
    566633
    567634/* Line 690 of lalr1.cc  */
    568 #line 106 "mesh.yy"
    569     { mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     635#line 151 "mesh.yy"
     636    { driver.mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    570637                                                 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
    571638                                                 (int)(yysemantic_stack_[(2) - (2)].args).f4, (int)(yysemantic_stack_[(2) - (2)].args).f5); }
     
    575642
    576643/* Line 690 of lalr1.cc  */
    577 #line 109 "mesh.yy"
    578     { mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     644#line 154 "mesh.yy"
     645    { driver.mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    579646    break;
    580647
     
    582649
    583650/* Line 690 of lalr1.cc  */
    584 #line 110 "mesh.yy"
    585     { mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     651#line 155 "mesh.yy"
     652    { driver.mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    586653                                                            (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    587654    break;
     
    590657
    591658/* Line 690 of lalr1.cc  */
    592 #line 112 "mesh.yy"
    593     { mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     659#line 157 "mesh.yy"
     660    { driver.mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    594661                                                          (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    595662    break;
     
    598665
    599666/* Line 690 of lalr1.cc  */
    600 #line 114 "mesh.yy"
    601     { mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0,
     667#line 159 "mesh.yy"
     668    { driver.mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0,
    602669                                               vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
    603670    break;
     
    606673
    607674/* Line 690 of lalr1.cc  */
    608 #line 116 "mesh.yy"
    609     { mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
     675#line 161 "mesh.yy"
     676    { driver.mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
    610677                                             (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); }
    611678    break;
     
    614681
    615682/* Line 690 of lalr1.cc  */
    616 #line 118 "mesh.yy"
    617     { mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     683#line 163 "mesh.yy"
     684    { driver.mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    618685                                                     (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
    619686    break;
     
    622689
    623690/* Line 690 of lalr1.cc  */
    624 #line 120 "mesh.yy"
    625     { mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
     691#line 165 "mesh.yy"
     692    { driver.mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
    626693    break;
    627694
     
    629696
    630697/* Line 690 of lalr1.cc  */
    631 #line 121 "mesh.yy"
    632     { mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
     698#line 166 "mesh.yy"
     699    { driver.mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    633700    break;
    634701
     
    636703
    637704/* Line 690 of lalr1.cc  */
    638 #line 122 "mesh.yy"
    639     { mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
     705#line 167 "mesh.yy"
     706    { driver.mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    640707    break;
    641708
     
    643710
    644711/* Line 690 of lalr1.cc  */
    645 #line 123 "mesh.yy"
    646     { 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,
     712#line 168 "mesh.yy"
     713    { driver.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,
    647714                                            (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); }
    648715    break;
     
    651718
    652719/* Line 690 of lalr1.cc  */
    653 #line 127 "mesh.yy"
     720#line 172 "mesh.yy"
    654721    { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
    655722    break;
     
    658725
    659726/* Line 690 of lalr1.cc  */
    660 #line 128 "mesh.yy"
     727#line 173 "mesh.yy"
    661728    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(3) - (3)].fval); }
    662729    break;
     
    665732
    666733/* Line 690 of lalr1.cc  */
    667 #line 129 "mesh.yy"
     734#line 174 "mesh.yy"
    668735    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(3) - (3)].fval); }
    669736    break;
     
    672739
    673740/* Line 690 of lalr1.cc  */
    674 #line 130 "mesh.yy"
     741#line 175 "mesh.yy"
    675742    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(3) - (3)].fval); }
    676743    break;
     
    679746
    680747/* Line 690 of lalr1.cc  */
    681 #line 131 "mesh.yy"
     748#line 176 "mesh.yy"
    682749    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(3) - (3)].fval); }
    683750    break;
     
    686753
    687754/* Line 690 of lalr1.cc  */
    688 #line 132 "mesh.yy"
     755#line 177 "mesh.yy"
    689756    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(3) - (3)].fval); }
    690757    break;
     
    693760
    694761/* Line 690 of lalr1.cc  */
    695 #line 133 "mesh.yy"
     762#line 178 "mesh.yy"
    696763    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(3) - (3)].fval); }
    697764    break;
     
    700767
    701768/* Line 690 of lalr1.cc  */
    702 #line 134 "mesh.yy"
     769#line 179 "mesh.yy"
    703770    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(3) - (3)].fval); }
    704771    break;
     
    707774
    708775/* Line 690 of lalr1.cc  */
    709 #line 137 "mesh.yy"
     776#line 182 "mesh.yy"
    710777    { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
    711778    break;
     
    714781
    715782/* Line 690 of lalr1.cc  */
    716 #line 138 "mesh.yy"
     783#line 183 "mesh.yy"
    717784    { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
    718785    break;
     
    721788
    722789/* Line 690 of lalr1.cc  */
    723 #line 724 "generated/mesh-parser.cpp"
     790#line 791 "generated/mesh-parser.cpp"
    724791        default:
    725792          break;
     
    899966  // Generate an error message.
    900967  std::string
    901   MeshParser::yysyntax_error_ (int, int)
    902   {
    903     return YY_("syntax error");
     968  MeshParser::yysyntax_error_ (int yystate, int yytoken)
     969  {
     970    std::string yyres;
     971    // Number of reported tokens (one for the "unexpected", one per
     972    // "expected").
     973    size_t yycount = 0;
     974    // Its maximum.
     975    enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
     976    // Arguments of yyformat.
     977    char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
     978
     979    /* There are many possibilities here to consider:
     980       - If this state is a consistent state with a default action, then
     981         the only way this function was invoked is if the default action
     982         is an error action.  In that case, don't check for expected
     983         tokens because there are none.
     984       - The only way there can be no lookahead present (in yytoken) is
     985         if this state is a consistent state with a default action.
     986         Thus, detecting the absence of a lookahead is sufficient to
     987         determine that there is no unexpected or expected token to
     988         report.  In that case, just report a simple "syntax error".
     989       - Don't assume there isn't a lookahead just because this state is
     990         a consistent state with a default action.  There might have
     991         been a previous inconsistent state, consistent state with a
     992         non-default action, or user semantic action that manipulated
     993         yychar.
     994       - Of course, the expected token list depends on states to have
     995         correct lookahead information, and it depends on the parser not
     996         to perform extra reductions after fetching a lookahead from the
     997         scanner and before detecting a syntax error.  Thus, state
     998         merging (from LALR or IELR) and default reductions corrupt the
     999         expected token list.  However, the list is correct for
     1000         canonical LR with one exception: it will still contain any
     1001         token that will not be accepted due to an error action in a
     1002         later state.
     1003    */
     1004    if (yytoken != yyempty_)
     1005      {
     1006        yyarg[yycount++] = yytname_[yytoken];
     1007        int yyn = yypact_[yystate];
     1008        if (!yy_pact_value_is_default_ (yyn))
     1009          {
     1010            /* Start YYX at -YYN if negative to avoid negative indexes in
     1011               YYCHECK.  In other words, skip the first -YYN actions for
     1012               this state because they are default actions.  */
     1013            int yyxbegin = yyn < 0 ? -yyn : 0;
     1014            /* Stay within bounds of both yycheck and yytname.  */
     1015            int yychecklim = yylast_ - yyn + 1;
     1016            int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
     1017            for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
     1018              if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
     1019                  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
     1020                {
     1021                  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
     1022                    {
     1023                      yycount = 1;
     1024                      break;
     1025                    }
     1026                  else
     1027                    yyarg[yycount++] = yytname_[yyx];
     1028                }
     1029          }
     1030      }
     1031
     1032    char const* yyformat = 0;
     1033    switch (yycount)
     1034      {
     1035#define YYCASE_(N, S)                         \
     1036        case N:                               \
     1037          yyformat = S;                       \
     1038        break
     1039        YYCASE_(0, YY_("syntax error"));
     1040        YYCASE_(1, YY_("syntax error, unexpected %s"));
     1041        YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
     1042        YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
     1043        YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
     1044        YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
     1045#undef YYCASE_
     1046      }
     1047
     1048    // Argument number.
     1049    size_t yyi = 0;
     1050    for (char const* yyp = yyformat; *yyp; ++yyp)
     1051      if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
     1052        {
     1053          yyres += yytnamerr_ (yyarg[yyi++]);
     1054          ++yyp;
     1055        }
     1056      else
     1057        yyres += *yyp;
     1058    return yyres;
    9041059  }
    9051060
     
    10511206  {
    10521207    "T_END", "error", "$undefined", "T_FLUSH", "T_INITRB", "T_FREERB",
    1053   "T_COLOR", "T_COLOR2", "T_TRANSLATEX", "T_ROTATEX", "T_TAPERX",
     1208  "T_COLOR", "T_BGCOLOR", "T_TRANSLATEX", "T_ROTATEX", "T_TAPERX",
    10541209  "T_SCALEX", "T_MIRRORX", "T_TRANSLATEY", "T_ROTATEY", "T_TAPERY",
    10551210  "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ", "T_ROTATEZ", "T_TAPERZ",
     
    11031258  MeshParser::yyrline_[] =
    11041259  {
    1105          0,    59,    59,    63,    64,    68,    69,    70,    71,    75,
    1106       76,    77,    81,    82,    86,    87,    88,    89,    90,    91,
    1107       92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
    1108      102,   106,   109,   110,   112,   114,   116,   118,   120,   121,
    1109      122,   123,   127,   128,   129,   130,   131,   132,   133,   134,
    1110      137,   138
     1260         0,   104,   104,   108,   109,   113,   114,   115,   116,   120,
     1261     121,   122,   126,   127,   131,   132,   133,   134,   135,   136,
     1262     137,   138,   139,   140,   141,   142,   143,   144,   145,   146,
     1263     147,   151,   154,   155,   157,   159,   161,   163,   165,   166,
     1264     167,   168,   172,   173,   174,   175,   176,   177,   178,   179,
     1265     182,   183
    11111266  };
    11121267
     
    11981353
    11991354
    1200 } // yy
     1355} // orbital
    12011356
    12021357/* Line 1136 of lalr1.cc  */
    1203 #line 1204 "generated/mesh-parser.cpp"
     1358#line 1359 "generated/mesh-parser.cpp"
    12041359
    12051360
    12061361/* Line 1138 of lalr1.cc  */
    1207 #line 141 "mesh.yy"
    1208 
    1209 
    1210 void yy::MeshParser::error(const yy::MeshParser::location_type& l, const std::string &m)
     1362#line 186 "mesh.yy"
     1363 /*** Additional Code ***/
     1364
     1365void orbital::MeshParser::error(const MeshParser::location_type& l,
     1366                                const std::string& m)
    12111367{
    1212     /* FIXME: do something */
    1213     std::cerr << "ERROR: " << m << std::endl;
     1368    driver.error(l, m);
    12141369}
    12151370
    1216 
  • trunk/orbital/generated/mesh-parser.h

    r1417 r1418  
    4545/* Enabling traces.  */
    4646#ifndef YYDEBUG
    47 # define YYDEBUG 0
     47# define YYDEBUG 1
    4848#endif
    4949
     
    5353# define YYERROR_VERBOSE 1
    5454#else
    55 # define YYERROR_VERBOSE 0
     55# define YYERROR_VERBOSE 1
    5656#endif
    5757
     
    6262
    6363
    64 namespace yy {
     64namespace orbital {
    6565
    6666/* Line 35 of lalr1.cc  */
    67 #line 68 "generated/mesh-parser.hpp"
     67#line 68 "generated/mesh-parser.h"
    6868
    6969  /// A Bison parser.
     
    7777
    7878/* Line 35 of lalr1.cc  */
    79 #line 29 "mesh.yy"
     79#line 63 "mesh.yy"
    8080
    8181    float fval;
     
    8585
    8686/* Line 35 of lalr1.cc  */
    87 #line 88 "generated/mesh-parser.hpp"
     87#line 88 "generated/mesh-parser.h"
    8888    };
    8989#else
     
    102102     T_FREERB = 260,
    103103     T_COLOR = 261,
    104      T_COLOR2 = 262,
     104     T_BGCOLOR = 262,
    105105     T_TRANSLATEX = 263,
    106106     T_ROTATEX = 264,
     
    139139
    140140    /// Build a parser object.
    141     MeshParser (Mesh &mesh_yyarg, void *yyscanner_yyarg);
     141    MeshParser (class Driver& driver_yyarg);
    142142    virtual ~MeshParser ();
    143143
     
    251251#endif
    252252
     253    /// Convert the symbol name \a n to a form suitable for a diagnostic.
     254    static std::string yytnamerr_ (const char *n);
     255
    253256#if YYDEBUG
    254257    /// A type to store symbol numbers and -1.
     
    302305
    303306    /* User arguments.  */
    304     Mesh &mesh;
    305     void *yyscanner;
     307    class Driver& driver;
    306308  };
    307309
    308 } // yy
     310} // orbital
    309311
    310312/* Line 35 of lalr1.cc  */
    311 #line 312 "generated/mesh-parser.hpp"
     313#line 314 "generated/mesh-parser.h"
    312314
    313315
  • trunk/orbital/generated/mesh-scanner.cpp

    r1415 r1418  
    66
    77/* A lexical scanner generated by flex */
     8
     9/* %not-for-header */
     10
     11/* %if-c-only */
     12/* %if-not-reentrant */
     13/* %endif */
     14/* %endif */
     15/* %ok-for-header */
    816
    917#define FLEX_SCANNER
     
    1523#endif
    1624
     25/* %if-c++-only */
     26    /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
     27     * following macro. This is required in order to pass the c++-multiple-scanners
     28     * test in the regression suite. We get reports that it breaks inheritance.
     29     * We will address this in a future release of flex, or omit the C++ scanner
     30     * altogether.
     31     */
     32    #define yyFlexLexer MeshFlexLexer
     33/* %endif */
     34
     35/* %if-c-only */
     36/* %endif */
     37
     38/* %if-c-only */
     39/* %endif */
     40
    1741/* First, we deal with  platform-specific or compiler-specific issues. */
    1842
    1943/* begin standard C headers. */
    20 #include <stdio.h>
    21 #include <string.h>
    22 #include <errno.h>
    23 #include <stdlib.h>
    24 
     44/* %if-c-only */
     45/* %endif */
     46
     47/* %if-tables-serialization */
     48/* %endif */
    2549/* end standard C headers. */
    2650
     51/* %if-c-or-c++ */
    2752/* flex integer type definitions */
    2853
     
    89114#endif /* ! FLEXINT_H */
    90115
     116/* %endif */
     117
     118/* %if-c++-only */
     119/* begin standard C++ headers. */
     120#include <iostream>
     121#include <errno.h>
     122#include <cstdlib>
     123#include <cstdio>
     124#include <cstring>
     125/* end standard C++ headers. */
     126/* %endif */
     127
    91128#ifdef __cplusplus
    92129
     
    110147#endif
    111148
     149/* %not-for-header */
     150
    112151/* Returned upon end-of-file. */
    113152#define YY_NULL 0
     153/* %ok-for-header */
     154
     155/* %not-for-header */
    114156
    115157/* Promotes a possibly negative, possibly signed char to an unsigned
     
    119161 */
    120162#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
    121 
    122 /* An opaque pointer. */
    123 #ifndef YY_TYPEDEF_YY_SCANNER_T
    124 #define YY_TYPEDEF_YY_SCANNER_T
    125 typedef void* yyscan_t;
    126 #endif
    127 
    128 /* For convenience, these vars (plus the bison vars far below)
    129    are macros in the reentrant scanner. */
    130 #define yyin yyg->yyin_r
    131 #define yyout yyg->yyout_r
    132 #define yyextra yyg->yyextra_r
    133 #define yyleng yyg->yyleng_r
    134 #define yytext yyg->yytext_r
    135 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
    136 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
    137 #define yy_flex_debug yyg->yy_flex_debug_r
     163/* %ok-for-header */
     164
     165/* %if-reentrant */
     166/* %endif */
     167
     168/* %if-not-reentrant */
     169
     170/* %endif */
    138171
    139172/* Enter a start condition.  This macro really ought to take a parameter,
     
    141174 * definition of BEGIN.
    142175 */
    143 #define BEGIN yyg->yy_start = 1 + 2 *
     176#define BEGIN (yy_start) = 1 + 2 *
    144177
    145178/* Translate the current start state into a value that can be later handed
     
    147180 * compatibility.
    148181 */
    149 #define YY_START ((yyg->yy_start - 1) / 2)
     182#define YY_START (((yy_start) - 1) / 2)
    150183#define YYSTATE YY_START
    151184
     
    154187
    155188/* Special action meaning "start processing a new file". */
    156 #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
     189#define YY_NEW_FILE yyrestart( yyin )
    157190
    158191#define YY_END_OF_BUFFER_CHAR 0
     
    179212typedef struct yy_buffer_state *YY_BUFFER_STATE;
    180213#endif
     214
     215/* %if-not-reentrant */
     216extern int yyleng;
     217/* %endif */
     218
     219/* %if-c-only */
     220/* %if-not-reentrant */
     221/* %endif */
     222/* %endif */
    181223
    182224#define EOB_ACT_CONTINUE_SCAN 0
     
    193235        int yyless_macro_arg = (n); \
    194236        YY_LESS_LINENO(yyless_macro_arg);\
    195                 *yy_cp = yyg->yy_hold_char; \
     237                *yy_cp = (yy_hold_char); \
    196238                YY_RESTORE_YY_MORE_OFFSET \
    197                 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
     239                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
    198240                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
    199241                } \
    200242        while ( 0 )
    201243
    202 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
     244#define unput(c) yyunput( c, (yytext_ptr) )
    203245
    204246#ifndef YY_TYPEDEF_YY_SIZE_T
     
    211253struct yy_buffer_state
    212254        {
    213         FILE *yy_input_file;
     255/* %if-c-only */
     256/* %endif */
     257
     258/* %if-c++-only */
     259        std::istream* yy_input_file;
     260/* %endif */
    214261
    215262        char *yy_ch_buf;                /* input buffer */
     
    272319#endif /* !YY_STRUCT_YY_BUFFER_STATE */
    273320
     321/* %if-c-only Standard (non-C++) definition */
     322/* %not-for-header */
     323
     324/* %if-not-reentrant */
     325/* %endif */
     326/* %ok-for-header */
     327
     328/* %endif */
     329
    274330/* We provide macros for accessing buffer states in case in the
    275331 * future we want to put the buffer states in a more general
     
    278334 * Returns the top of the stack, or NULL.
    279335 */
    280 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
    281                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
     336#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
     337                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
    282338                          : NULL)
    283339
     
    285341 * NULL or when we need an lvalue. For internal use only.
    286342 */
    287 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
    288 
    289 void yyrestart (FILE *input_file ,yyscan_t yyscanner );
    290 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
    291 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
    292 void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
    293 void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
    294 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
    295 void yypop_buffer_state (yyscan_t yyscanner );
    296 
    297 static void yyensure_buffer_stack (yyscan_t yyscanner );
    298 static void yy_load_buffer_state (yyscan_t yyscanner );
    299 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
    300 
    301 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
    302 
    303 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
    304 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
    305 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
    306 
    307 void *yyalloc (yy_size_t ,yyscan_t yyscanner );
    308 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
    309 void yyfree (void * ,yyscan_t yyscanner );
     343#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
     344
     345/* %if-c-only Standard (non-C++) definition */
     346/* %if-not-reentrant */
     347/* %not-for-header */
     348
     349/* %ok-for-header */
     350
     351/* %endif */
     352/* %endif */
     353
     354void *Meshalloc (yy_size_t  );
     355void *Meshrealloc (void *,yy_size_t  );
     356void Meshfree (void *  );
    310357
    311358#define yy_new_buffer yy_create_buffer
     
    314361        { \
    315362        if ( ! YY_CURRENT_BUFFER ){ \
    316         yyensure_buffer_stack (yyscanner); \
     363        yyensure_buffer_stack (); \
    317364                YY_CURRENT_BUFFER_LVALUE =    \
    318             yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
     365            yy_create_buffer( yyin, YY_BUF_SIZE ); \
    319366        } \
    320367        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
     
    324371        { \
    325372        if ( ! YY_CURRENT_BUFFER ){\
    326         yyensure_buffer_stack (yyscanner); \
     373        yyensure_buffer_stack (); \
    327374                YY_CURRENT_BUFFER_LVALUE =    \
    328             yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
     375            yy_create_buffer( yyin, YY_BUF_SIZE ); \
    329376        } \
    330377        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
     
    333380#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
    334381
     382/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
    335383/* Begin user sect3 */
    336384
    337 #define yywrap(n) 1
    338 #define YY_SKIP_YYWRAP
     385#define FLEX_DEBUG
    339386
    340387typedef unsigned char YY_CHAR;
    341388
    342 typedef int yy_state_type;
    343 
    344 #define yytext_ptr yytext_r
    345 
    346 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
    347 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
    348 static int yy_get_next_buffer (yyscan_t yyscanner );
    349 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
     389#define yytext_ptr yytext
     390
     391#include <FlexLexer.h>
     392
     393/* %if-c-only Standard (non-C++) definition */
     394/* %endif */
    350395
    351396/* Done after the current pattern has been matched and before the
     
    353398 */
    354399#define YY_DO_BEFORE_ACTION \
    355         yyg->yytext_ptr = yy_bp; \
     400        (yytext_ptr) = yy_bp; \
     401/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
    356402        yyleng = (size_t) (yy_cp - yy_bp); \
    357         yyg->yy_hold_char = *yy_cp; \
     403        (yy_hold_char) = *yy_cp; \
    358404        *yy_cp = '\0'; \
    359         yyg->yy_c_buf_p = yy_cp;
    360 
     405/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
     406        (yy_c_buf_p) = yy_cp;
     407
     408/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
    361409#define YY_NUM_RULES 38
    362410#define YY_END_OF_BUFFER 39
     
    474522    } ;
    475523
     524static yyconst flex_int16_t yy_rule_linenum[38] =
     525    {   0,
     526       61,   62,   63,   65,   66,   68,   69,   70,   71,   72,
     527       73,   74,   75,   76,   77,   78,   79,   80,   81,   82,
     528       83,   84,   86,   87,   88,   89,   90,   91,   92,   93,
     529       94,   95,   96,   98,  100,  101,  102
     530    } ;
     531
    476532/* The intent behind this definition is that it'll catch
    477533 * any uses of REJECT which flex missed.
     
    481537#define YY_MORE_ADJ 0
    482538#define YY_RESTORE_YY_MORE_OFFSET
    483 #line 1 "mesh.l"
    484 /*
    485  * Orbital
    486  *
    487  * Copyright: (c) 2012 Various People
    488  */
    489 /* C++ mode is disabled because upstream isn't sure it'll stay here. Also
    490  * it requires FlexLexer.h which we would have to ship in contrib.
    491  *  %option c++
    492  *  %option yyclass="MeshLexer" */
    493 #line 18 "mesh.l"
    494 #include "generated/mesh-parser.hpp"
    495 
    496 #define yyterminate(yyscanner) return token::T_END
    497 
    498 #undef YY_INPUT
    499 #define YY_INPUT(buf, result, max_size) \
    500     do { \
    501         if ((*yyg->yyextra_r)[0]) \
    502         { \
    503             buf[0] = (*yyg->yyextra_r)[0]; \
    504             (*yyg->yyextra_r)++; \
    505             result = 1; \
    506         } \
    507         else \
    508         { \
    509             result = YY_NULL; \
    510         } \
    511     } while(0)
    512 #line 513 "generated/mesh-scanner.cpp"
     539#line 1 "mesh.ll"
     540/* $Id: scanner.ll 44 2008-10-23 09:03:19Z tb $ -*- mode: c++ -*- */
     541/** \file scanner.ll Define the orbital Flex lexical scanner */
     542#line 5 "mesh.ll"
     543
     544#include <string>
     545
     546#include "mesh-scanner.h"
     547
     548/* import the parser's token type into a local typedef */
     549typedef orbital::MeshParser::token token;
     550typedef orbital::MeshParser::token_type token_type;
     551
     552/* By default yylex returns int, we use token_type. Unfortunately yyterminate
     553 * by default returns 0, which is not of token_type. */
     554#define yyterminate() return token::T_END
     555
     556/* This disables inclusion of unistd.h, which is not available under Visual C++
     557 * on Win32. The C++ scanner uses STL streams instead. */
     558#define YY_NO_UNISTD_H
     559
     560/*** Flex Declarations and Options ***/
     561/* enable c++ scanner class generation */
     562/* change the name of the scanner class. results in "MeshFlexLexer" */
     563/* the manual says "somewhat more optimized" */
     564/* enable scanner to generate debug output. disable this for release
     565 * versions. */
     566/* no support for include files is planned */
     567/* enables the use of start condition stacks */
     568/* The following paragraph suffices to track locations accurately. Each time
     569 * yylex is invoked, the begin position is moved onto the end position. */
     570#line 48 "mesh.ll"
     571#define YY_USER_ACTION  yylloc->columns(yyleng);
     572#line 573 "generated/mesh-scanner.cpp"
    513573
    514574#define INITIAL 0
     
    519579 * The user has a chance to override it with an option.
    520580 */
     581/* %if-c-only */
     582/* %endif */
     583/* %if-c++-only */
    521584#include <unistd.h>
    522 #endif
    523 
    524 #define YY_EXTRA_TYPE char const **
    525 
    526 /* Holds the entire state of the reentrant scanner. */
    527 struct yyguts_t
    528     {
    529 
    530     /* User-defined. Not touched by flex. */
    531     YY_EXTRA_TYPE yyextra_r;
    532 
    533     /* The rest are the same as the globals declared in the non-reentrant scanner. */
    534     FILE *yyin_r, *yyout_r;
    535     size_t yy_buffer_stack_top; /**< index of top of stack. */
    536     size_t yy_buffer_stack_max; /**< capacity of stack. */
    537     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
    538     char yy_hold_char;
    539     int yy_n_chars;
    540     int yyleng_r;
    541     char *yy_c_buf_p;
    542     int yy_init;
    543     int yy_start;
    544     int yy_did_buffer_switch_on_eof;
    545     int yy_start_stack_ptr;
    546     int yy_start_stack_depth;
    547     int *yy_start_stack;
    548     yy_state_type yy_last_accepting_state;
    549     char* yy_last_accepting_cpos;
    550 
    551     int yylineno_r;
    552     int yy_flex_debug_r;
    553 
    554     char *yytext_r;
    555     int yy_more_flag;
    556     int yy_more_len;
    557 
    558     }; /* end struct yyguts_t */
    559 
    560 static int yy_init_globals (yyscan_t yyscanner );
    561 
    562 int yylex_init (yyscan_t* scanner);
    563 
    564 int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
    565 
    566 /* Accessor methods to globals.
    567    These are made visible to non-reentrant scanners for convenience. */
    568 
    569 int yylex_destroy (yyscan_t yyscanner );
    570 
    571 int yyget_debug (yyscan_t yyscanner );
    572 
    573 void yyset_debug (int debug_flag ,yyscan_t yyscanner );
    574 
    575 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
    576 
    577 void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
    578 
    579 FILE *yyget_in (yyscan_t yyscanner );
    580 
    581 void yyset_in  (FILE * in_str ,yyscan_t yyscanner );
    582 
    583 FILE *yyget_out (yyscan_t yyscanner );
    584 
    585 void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
    586 
    587 int yyget_leng (yyscan_t yyscanner );
    588 
    589 char *yyget_text (yyscan_t yyscanner );
    590 
    591 int yyget_lineno (yyscan_t yyscanner );
    592 
    593 void yyset_lineno (int line_number ,yyscan_t yyscanner );
    594 
    595 /* Macros after this point can all be overridden by user definitions in
    596  * section 1.
    597  */
    598 
    599 #ifndef YY_SKIP_YYWRAP
    600 #ifdef __cplusplus
    601 extern "C" int yywrap (yyscan_t yyscanner );
    602 #else
    603 extern int yywrap (yyscan_t yyscanner );
    604 #endif
    605 #endif
     585/* %endif */
     586#endif
     587
     588#ifndef YY_EXTRA_TYPE
     589#define YY_EXTRA_TYPE void *
     590#endif
     591
     592/* %if-c-only Reentrant structure and macros (non-C++). */
     593/* %if-reentrant */
     594/* %if-c-only */
     595/* %endif */
     596/* %if-reentrant */
     597/* %endif */
     598/* %endif End reentrant structures and macros. */
     599/* %if-bison-bridge */
     600/* %endif */
     601/* %not-for-header */
     602
     603/* %ok-for-header */
     604
     605/* %endif */
    606606
    607607#ifndef yytext_ptr
    608 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
     608static void yy_flex_strncpy (char *,yyconst char *,int );
    609609#endif
    610610
    611611#ifdef YY_NEED_STRLEN
    612 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
     612static int yy_flex_strlen (yyconst char * );
    613613#endif
    614614
    615615#ifndef YY_NO_INPUT
    616 
    617 #ifdef __cplusplus
    618 static int yyinput (yyscan_t yyscanner );
    619 #else
    620 static int input (yyscan_t yyscanner );
    621 #endif
    622 
    623 #endif
     616/* %if-c-only Standard (non-C++) definition */
     617/* %not-for-header */
     618
     619/* %ok-for-header */
     620
     621/* %endif */
     622#endif
     623
     624/* %if-c-only */
     625/* %endif */
    624626
    625627/* Amount of stuff to slurp up with each read. */
     
    635637/* Copy whatever the last rule matched to the standard output. */
    636638#ifndef ECHO
    637 /* This used to be an fputs(), but since the string might contain NUL's,
    638  * we now use fwrite().
    639  */
    640 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
     639/* %if-c-only Standard (non-C++) definition */
     640/* %endif */
     641/* %if-c++-only C++ definition */
     642#define ECHO LexerOutput( yytext, yyleng )
     643/* %endif */
    641644#endif
    642645
     
    646649#ifndef YY_INPUT
    647650#define YY_INPUT(buf,result,max_size) \
    648         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
    649                 { \
    650                 int c = '*'; \
    651                 size_t n; \
    652                 for ( n = 0; n < max_size && \
    653                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
    654                         buf[n] = (char) c; \
    655                 if ( c == '\n' ) \
    656                         buf[n++] = (char) c; \
    657                 if ( c == EOF && ferror( yyin ) ) \
    658                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
    659                 result = n; \
    660                 } \
    661         else \
    662                 { \
    663                 errno=0; \
    664                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
    665                         { \
    666                         if( errno != EINTR) \
    667                                 { \
    668                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
    669                                 break; \
    670                                 } \
    671                         errno=0; \
    672                         clearerr(yyin); \
    673                         } \
    674                 }\
     651/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
    675652\
     653/* %if-c++-only C++ definition \ */\
     654        if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
     655                YY_FATAL_ERROR( "input in flex scanner failed" );
     656/* %endif */
    676657
    677658#endif
     
    692673/* Report a fatal error. */
    693674#ifndef YY_FATAL_ERROR
    694 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
    695 #endif
    696 
     675/* %if-c-only */
     676/* %endif */
     677/* %if-c++-only */
     678#define YY_FATAL_ERROR(msg) LexerError( msg )
     679/* %endif */
     680#endif
     681
     682/* %if-tables-serialization structures and prototypes */
     683/* %not-for-header */
     684
     685/* %ok-for-header */
     686
     687/* %not-for-header */
     688
     689/* %tables-yydmap generated elements */
     690/* %endif */
    697691/* end tables serialization structures and prototypes */
     692
     693/* %ok-for-header */
    698694
    699695/* Default declaration of generated scanner - a define so the user can
     
    702698#ifndef YY_DECL
    703699#define YY_DECL_IS_OURS 1
    704 
    705 extern int yylex (yyscan_t yyscanner);
    706 
    707 #define YY_DECL int yylex (yyscan_t yyscanner)
     700/* %if-c-only Standard (non-C++) definition */
     701/* %endif */
     702/* %if-c++-only C++ definition */
     703#define YY_DECL int yyFlexLexer::yylex()
     704/* %endif */
    708705#endif /* !YY_DECL */
    709706
     
    720717#endif
    721718
     719/* %% [6.0] YY_RULE_SETUP definition goes here */
    722720#define YY_RULE_SETUP \
    723721        YY_USER_ACTION
     722
     723/* %not-for-header */
    724724
    725725/** The main scanner function which does all the work.
     
    730730        register char *yy_cp, *yy_bp;
    731731        register int yy_act;
    732     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    733 
    734 #line 38 "mesh.l"
    735 
    736 
    737 
    738     typedef yy::MeshParser::token token;
    739     typedef yy::MeshParser::token_type token_type;
    740 
    741 
    742 #line 743 "generated/mesh-scanner.cpp"
    743 
    744         if ( !yyg->yy_init )
     732   
     733/* %% [7.0] user's declarations go here */
     734#line 51 "mesh.ll"
     735
     736
     737 /* code to place at the beginning of yylex() */
     738
     739    // reset location
     740    yylloc->step();
     741
     742
     743 /*** BEGIN EXAMPLE - Change the orbital lexer rules below ***/
     744
     745#line 746 "generated/mesh-scanner.cpp"
     746
     747        if ( !(yy_init) )
    745748                {
    746                 yyg->yy_init = 1;
     749                (yy_init) = 1;
    747750
    748751#ifdef YY_USER_INIT
     
    750753#endif
    751754
    752                 if ( ! yyg->yy_start )
    753                         yyg->yy_start = 1;      /* first start state */
     755                if ( ! (yy_start) )
     756                        (yy_start) = 1; /* first start state */
    754757
    755758                if ( ! yyin )
    756                         yyin = stdin;
     759/* %if-c-only */
     760/* %endif */
     761/* %if-c++-only */
     762                        yyin = & std::cin;
     763/* %endif */
    757764
    758765                if ( ! yyout )
    759                         yyout = stdout;
     766/* %if-c-only */
     767/* %endif */
     768/* %if-c++-only */
     769                        yyout = & std::cout;
     770/* %endif */
    760771
    761772                if ( ! YY_CURRENT_BUFFER ) {
    762                         yyensure_buffer_stack (yyscanner);
     773                        yyensure_buffer_stack ();
    763774                        YY_CURRENT_BUFFER_LVALUE =
    764                                 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
     775                                yy_create_buffer( yyin, YY_BUF_SIZE );
    765776                }
    766777
    767                 yy_load_buffer_state(yyscanner );
     778                yy_load_buffer_state(  );
    768779                }
    769780
    770781        while ( 1 )             /* loops until end-of-file is reached */
    771782                {
    772                 yy_cp = yyg->yy_c_buf_p;
     783/* %% [8.0] yymore()-related code goes here */
     784                yy_cp = (yy_c_buf_p);
    773785
    774786                /* Support of yytext. */
    775                 *yy_cp = yyg->yy_hold_char;
     787                *yy_cp = (yy_hold_char);
    776788
    777789                /* yy_bp points to the position in yy_ch_buf of the start of
     
    780792                yy_bp = yy_cp;
    781793
    782                 yy_current_state = yyg->yy_start;
     794/* %% [9.0] code to set up and find next match goes here */
     795                yy_current_state = (yy_start);
    783796yy_match:
    784797                do
     
    787800                        if ( yy_accept[yy_current_state] )
    788801                                {
    789                                 yyg->yy_last_accepting_state = yy_current_state;
    790                                 yyg->yy_last_accepting_cpos = yy_cp;
     802                                (yy_last_accepting_state) = yy_current_state;
     803                                (yy_last_accepting_cpos) = yy_cp;
    791804                                }
    792805                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
     
    800813                        }
    801814                while ( yy_current_state != 63 );
    802                 yy_cp = yyg->yy_last_accepting_cpos;
    803                 yy_current_state = yyg->yy_last_accepting_state;
     815                yy_cp = (yy_last_accepting_cpos);
     816                yy_current_state = (yy_last_accepting_state);
    804817
    805818yy_find_action:
     819/* %% [10.0] code to find the action number goes here */
    806820                yy_act = yy_accept[yy_current_state];
    807821
    808822                YY_DO_BEFORE_ACTION;
    809823
     824/* %% [11.0] code for yylineno update goes here */
     825
    810826do_action:      /* This label is used only to access EOF actions. */
     827
     828/* %% [12.0] debug code goes here */
     829                if ( yy_flex_debug )
     830                        {
     831                        if ( yy_act == 0 )
     832                                std::cerr << "--scanner backing up\n";
     833                        else if ( yy_act < 38 )
     834                                std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] <<
     835                                         "(\"" << yytext << "\")\n";
     836                        else if ( yy_act == 38 )
     837                                std::cerr << "--accepting default rule (\"" << yytext << "\")\n";
     838                        else if ( yy_act == 39 )
     839                                std::cerr << "--(end of buffer or a NUL)\n";
     840                        else
     841                                std::cerr << "--EOF (start condition " << YY_START << ")\n";
     842                        }
    811843
    812844                switch ( yy_act )
    813845        { /* beginning of action switch */
     846/* %% [13.0] actions go here */
    814847                        case 0: /* must back up */
    815848                        /* undo the effects of YY_DO_BEFORE_ACTION */
    816                         *yy_cp = yyg->yy_hold_char;
    817                         yy_cp = yyg->yy_last_accepting_cpos;
    818                         yy_current_state = yyg->yy_last_accepting_state;
     849                        *yy_cp = (yy_hold_char);
     850                        yy_cp = (yy_last_accepting_cpos);
     851                        yy_current_state = (yy_last_accepting_state);
    819852                        goto yy_find_action;
    820853
    821854case 1:
    822855YY_RULE_SETUP
    823 #line 45 "mesh.l"
     856#line 61 "mesh.ll"
    824857{ return token::T_FLUSH; }
    825858        YY_BREAK
    826859case 2:
    827860YY_RULE_SETUP
    828 #line 46 "mesh.l"
     861#line 62 "mesh.ll"
    829862{ return token::T_INITRB; }
    830863        YY_BREAK
    831864case 3:
    832865YY_RULE_SETUP
    833 #line 47 "mesh.l"
     866#line 63 "mesh.ll"
    834867{ return token::T_FREERB; }
    835868        YY_BREAK
    836869case 4:
    837870YY_RULE_SETUP
    838 #line 49 "mesh.l"
     871#line 65 "mesh.ll"
    839872{ return token::T_COLOR; }
    840873        YY_BREAK
    841874case 5:
    842875YY_RULE_SETUP
    843 #line 50 "mesh.l"
    844 { return token::T_COLOR2; }
     876#line 66 "mesh.ll"
     877{ return token::T_BGCOLOR; }
    845878        YY_BREAK
    846879case 6:
    847880YY_RULE_SETUP
    848 #line 52 "mesh.l"
     881#line 68 "mesh.ll"
    849882{ return token::T_TRANSLATEX; }
    850883        YY_BREAK
    851884case 7:
    852885YY_RULE_SETUP
    853 #line 53 "mesh.l"
     886#line 69 "mesh.ll"
    854887{ return token::T_TRANSLATEY; }
    855888        YY_BREAK
    856889case 8:
    857890YY_RULE_SETUP
    858 #line 54 "mesh.l"
     891#line 70 "mesh.ll"
    859892{ return token::T_TRANSLATEZ; }
    860893        YY_BREAK
    861894case 9:
    862895YY_RULE_SETUP
    863 #line 55 "mesh.l"
     896#line 71 "mesh.ll"
    864897{ return token::T_TRANSLATE; }
    865898        YY_BREAK
    866899case 10:
    867900YY_RULE_SETUP
    868 #line 56 "mesh.l"
     901#line 72 "mesh.ll"
    869902{ return token::T_ROTATEX; }
    870903        YY_BREAK
    871904case 11:
    872905YY_RULE_SETUP
    873 #line 57 "mesh.l"
     906#line 73 "mesh.ll"
    874907{ return token::T_ROTATEY; }
    875908        YY_BREAK
    876909case 12:
    877910YY_RULE_SETUP
    878 #line 58 "mesh.l"
     911#line 74 "mesh.ll"
    879912{ return token::T_ROTATEZ; }
    880913        YY_BREAK
    881914case 13:
    882915YY_RULE_SETUP
    883 #line 59 "mesh.l"
     916#line 75 "mesh.ll"
    884917{ return token::T_TAPERX; }
    885918        YY_BREAK
    886919case 14:
    887920YY_RULE_SETUP
    888 #line 60 "mesh.l"
     921#line 76 "mesh.ll"
    889922{ return token::T_TAPERY; }
    890923        YY_BREAK
    891924case 15:
    892925YY_RULE_SETUP
    893 #line 61 "mesh.l"
     926#line 77 "mesh.ll"
    894927{ return token::T_TAPERZ; }
    895928        YY_BREAK
    896929case 16:
    897930YY_RULE_SETUP
    898 #line 62 "mesh.l"
     931#line 78 "mesh.ll"
    899932{ return token::T_SCALEX; }
    900933        YY_BREAK
    901934case 17:
    902935YY_RULE_SETUP
    903 #line 63 "mesh.l"
     936#line 79 "mesh.ll"
    904937{ return token::T_SCALEY; }
    905938        YY_BREAK
    906939case 18:
    907940YY_RULE_SETUP
    908 #line 64 "mesh.l"
     941#line 80 "mesh.ll"
    909942{ return token::T_SCALEZ; }
    910943        YY_BREAK
    911944case 19:
    912945YY_RULE_SETUP
    913 #line 65 "mesh.l"
     946#line 81 "mesh.ll"
    914947{ return token::T_SCALE; }
    915948        YY_BREAK
    916949case 20:
    917950YY_RULE_SETUP
    918 #line 66 "mesh.l"
     951#line 82 "mesh.ll"
    919952{ return token::T_MIRRORX; }
    920953        YY_BREAK
    921954case 21:
    922955YY_RULE_SETUP
    923 #line 67 "mesh.l"
     956#line 83 "mesh.ll"
    924957{ return token::T_MIRRORY; }
    925958        YY_BREAK
    926959case 22:
    927960YY_RULE_SETUP
    928 #line 68 "mesh.l"
     961#line 84 "mesh.ll"
    929962{ return token::T_MIRRORZ; }
    930963        YY_BREAK
    931964case 23:
    932965YY_RULE_SETUP
    933 #line 70 "mesh.l"
     966#line 86 "mesh.ll"
    934967{ return token::T_CYLINDER; }
    935968        YY_BREAK
    936969case 24:
    937970YY_RULE_SETUP
    938 #line 71 "mesh.l"
     971#line 87 "mesh.ll"
    939972{ return token::T_BOX; }
    940973        YY_BREAK
    941974case 25:
    942975YY_RULE_SETUP
    943 #line 72 "mesh.l"
     976#line 88 "mesh.ll"
    944977{ return token::T_SMOOTHCHAMFBOX; }
    945978        YY_BREAK
    946979case 26:
    947980YY_RULE_SETUP
    948 #line 73 "mesh.l"
     981#line 89 "mesh.ll"
    949982{ return token::T_FLATCHAMFBOX; }
    950983        YY_BREAK
    951984case 27:
    952985YY_RULE_SETUP
    953 #line 74 "mesh.l"
     986#line 90 "mesh.ll"
    954987{ return token::T_SPHERE; }
    955988        YY_BREAK
    956989case 28:
    957990YY_RULE_SETUP
    958 #line 75 "mesh.l"
     991#line 91 "mesh.ll"
    959992{ return token::T_STAR; }
    960993        YY_BREAK
    961994case 29:
    962995YY_RULE_SETUP
    963 #line 76 "mesh.l"
     996#line 92 "mesh.ll"
    964997{ return token::T_EXPANDEDSTAR; }
    965998        YY_BREAK
    966999case 30:
    9671000YY_RULE_SETUP
    968 #line 77 "mesh.l"
     1001#line 93 "mesh.ll"
    9691002{ return token::T_DISC; }
    9701003        YY_BREAK
    9711004case 31:
    9721005YY_RULE_SETUP
    973 #line 78 "mesh.l"
     1006#line 94 "mesh.ll"
    9741007{ return token::T_TRIANGLE; }
    9751008        YY_BREAK
    9761009case 32:
    9771010YY_RULE_SETUP
    978 #line 79 "mesh.l"
     1011#line 95 "mesh.ll"
    9791012{ return token::T_QUAD; }
    9801013        YY_BREAK
    9811014case 33:
    9821015YY_RULE_SETUP
    983 #line 80 "mesh.l"
     1016#line 96 "mesh.ll"
    9841017{ return token::T_COG; }
    9851018        YY_BREAK
    9861019case 34:
    9871020YY_RULE_SETUP
    988 #line 82 "mesh.l"
     1021#line 98 "mesh.ll"
    9891022{
    9901023               yylval->fval = atof(yytext); return token::NUMBER; }
     
    9921025case 35:
    9931026YY_RULE_SETUP
    994 #line 84 "mesh.l"
     1027#line 100 "mesh.ll"
    9951028{ return token_type('-'); }
    9961029        YY_BREAK
    9971030case 36:
    9981031YY_RULE_SETUP
    999 #line 85 "mesh.l"
     1032#line 101 "mesh.ll"
    10001033{ return token_type(','); }
    10011034        YY_BREAK
     
    10031036/* rule 37 can match eol */
    10041037YY_RULE_SETUP
    1005 #line 86 "mesh.l"
     1038#line 102 "mesh.ll"
    10061039{ /* ignore everything else */ }
    10071040        YY_BREAK
     1041/*** END EXAMPLE - Change the orbital lexer rules above ***/
    10081042case 38:
    10091043YY_RULE_SETUP
    1010 #line 88 "mesh.l"
     1044#line 106 "mesh.ll"
    10111045ECHO;
    10121046        YY_BREAK
    1013 #line 1014 "generated/mesh-scanner.cpp"
     1047#line 1048 "generated/mesh-scanner.cpp"
    10141048case YY_STATE_EOF(INITIAL):
    10151049        yyterminate();
     
    10181052                {
    10191053                /* Amount of text matched not including the EOB char. */
    1020                 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
     1054                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
    10211055
    10221056                /* Undo the effects of YY_DO_BEFORE_ACTION. */
    1023                 *yy_cp = yyg->yy_hold_char;
     1057                *yy_cp = (yy_hold_char);
    10241058                YY_RESTORE_YY_MORE_OFFSET
    10251059
     
    10351069                         * back-up) that will match for the new input source.
    10361070                         */
    1037                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
     1071                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
    10381072                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
    10391073                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
     
    10471081                 * in input().
    10481082                 */
    1049                 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
     1083                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
    10501084                        { /* This was really a NUL. */
    10511085                        yy_state_type yy_next_state;
    10521086
    1053                         yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
    1054 
    1055                         yy_current_state = yy_get_previous_state( yyscanner );
     1087                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
     1088
     1089                        yy_current_state = yy_get_previous_state( );
    10561090
    10571091                        /* Okay, we're now positioned to make the NUL
     
    10641098                         */
    10651099
    1066                         yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
    1067 
    1068                         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
     1100                        yy_next_state = yy_try_NUL_trans( yy_current_state );
     1101
     1102                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
    10691103
    10701104                        if ( yy_next_state )
    10711105                                {
    10721106                                /* Consume the NUL. */
    1073                                 yy_cp = ++yyg->yy_c_buf_p;
     1107                                yy_cp = ++(yy_c_buf_p);
    10741108                                yy_current_state = yy_next_state;
    10751109                                goto yy_match;
     
    10781112                        else
    10791113                                {
    1080                                 yy_cp = yyg->yy_last_accepting_cpos;
    1081                                 yy_current_state = yyg->yy_last_accepting_state;
     1114/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
     1115                                yy_cp = (yy_last_accepting_cpos);
     1116                                yy_current_state = (yy_last_accepting_state);
    10821117                                goto yy_find_action;
    10831118                                }
    10841119                        }
    10851120
    1086                 else switch ( yy_get_next_buffer( yyscanner ) )
     1121                else switch ( yy_get_next_buffer( ) )
    10871122                        {
    10881123                        case EOB_ACT_END_OF_FILE:
    10891124                                {
    1090                                 yyg->yy_did_buffer_switch_on_eof = 0;
    1091 
    1092                                 if ( yywrap(yyscanner ) )
     1125                                (yy_did_buffer_switch_on_eof) = 0;
     1126
     1127                                if ( yywrap(  ) )
    10931128                                        {
    10941129                                        /* Note: because we've taken care in
     
    11011136                                         * YY_NULL will get returned.
    11021137                                         */
    1103                                         yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
     1138                                        (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
    11041139
    11051140                                        yy_act = YY_STATE_EOF(YY_START);
     
    11091144                                else
    11101145                                        {
    1111                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
     1146                                        if ( ! (yy_did_buffer_switch_on_eof) )
    11121147                                                YY_NEW_FILE;
    11131148                                        }
     
    11161151
    11171152                        case EOB_ACT_CONTINUE_SCAN:
    1118                                 yyg->yy_c_buf_p =
    1119                                         yyg->yytext_ptr + yy_amount_of_matched_text;
    1120 
    1121                                 yy_current_state = yy_get_previous_state( yyscanner );
    1122 
    1123                                 yy_cp = yyg->yy_c_buf_p;
    1124                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
     1153                                (yy_c_buf_p) =
     1154                                        (yytext_ptr) + yy_amount_of_matched_text;
     1155
     1156                                yy_current_state = yy_get_previous_state( );
     1157
     1158                                yy_cp = (yy_c_buf_p);
     1159                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
    11251160                                goto yy_match;
    11261161
    11271162                        case EOB_ACT_LAST_MATCH:
    1128                                 yyg->yy_c_buf_p =
    1129                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
    1130 
    1131                                 yy_current_state = yy_get_previous_state( yyscanner );
    1132 
    1133                                 yy_cp = yyg->yy_c_buf_p;
    1134                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
     1163                                (yy_c_buf_p) =
     1164                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
     1165
     1166                                yy_current_state = yy_get_previous_state( );
     1167
     1168                                yy_cp = (yy_c_buf_p);
     1169                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
    11351170                                goto yy_find_action;
    11361171                        }
     
    11441179                } /* end of scanning one token */
    11451180} /* end of yylex */
     1181/* %ok-for-header */
     1182
     1183/* %if-c++-only */
     1184/* %not-for-header */
     1185
     1186/* The contents of this function are C++ specific, so the () macro is not used.
     1187 */
     1188yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
     1189{
     1190        yyin = arg_yyin;
     1191        yyout = arg_yyout;
     1192        yy_c_buf_p = 0;
     1193        yy_init = 0;
     1194        yy_start = 0;
     1195        yy_flex_debug = 0;
     1196        yylineno = 1;   // this will only get updated if %option yylineno
     1197
     1198        yy_did_buffer_switch_on_eof = 0;
     1199
     1200        yy_looking_for_trail_begin = 0;
     1201        yy_more_flag = 0;
     1202        yy_more_len = 0;
     1203        yy_more_offset = yy_prev_more_offset = 0;
     1204
     1205        yy_start_stack_ptr = yy_start_stack_depth = 0;
     1206        yy_start_stack = NULL;
     1207
     1208        yy_buffer_stack = 0;
     1209        yy_buffer_stack_top = 0;
     1210        yy_buffer_stack_max = 0;
     1211
     1212        yy_state_buf = 0;
     1213
     1214}
     1215
     1216/* The contents of this function are C++ specific, so the () macro is not used.
     1217 */
     1218yyFlexLexer::~yyFlexLexer()
     1219{
     1220        delete [] yy_state_buf;
     1221        Meshfree(yy_start_stack  );
     1222        yy_delete_buffer( YY_CURRENT_BUFFER );
     1223        Meshfree(yy_buffer_stack  );
     1224}
     1225
     1226/* The contents of this function are C++ specific, so the () macro is not used.
     1227 */
     1228void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
     1229{
     1230        if ( new_in )
     1231                {
     1232                yy_delete_buffer( YY_CURRENT_BUFFER );
     1233                yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE  ) );
     1234                }
     1235
     1236        if ( new_out )
     1237                yyout = new_out;
     1238}
     1239
     1240#ifdef YY_INTERACTIVE
     1241int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
     1242#else
     1243int yyFlexLexer::LexerInput( char* buf, int max_size )
     1244#endif
     1245{
     1246        if ( yyin->eof() || yyin->fail() )
     1247                return 0;
     1248
     1249#ifdef YY_INTERACTIVE
     1250        yyin->get( buf[0] );
     1251
     1252        if ( yyin->eof() )
     1253                return 0;
     1254
     1255        if ( yyin->bad() )
     1256                return -1;
     1257
     1258        return 1;
     1259
     1260#else
     1261        (void) yyin->read( buf, max_size );
     1262
     1263        if ( yyin->bad() )
     1264                return -1;
     1265        else
     1266                return yyin->gcount();
     1267#endif
     1268}
     1269
     1270void yyFlexLexer::LexerOutput( const char* buf, int size )
     1271{
     1272        (void) yyout->write( buf, size );
     1273}
     1274/* %ok-for-header */
     1275
     1276/* %endif */
    11461277
    11471278/* yy_get_next_buffer - try to read in a new buffer
     
    11521283 *      EOB_ACT_END_OF_FILE - end of file
    11531284 */
    1154 static int yy_get_next_buffer (yyscan_t yyscanner)
    1155 {
    1156     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1157         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
    1158         register char *source = yyg->yytext_ptr;
     1285/* %if-c-only */
     1286/* %endif */
     1287/* %if-c++-only */
     1288int yyFlexLexer::yy_get_next_buffer()
     1289/* %endif */
     1290{
     1291        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
     1292        register char *source = (yytext_ptr);
    11591293        register int number_to_move, i;
    11601294        int ret_val;
    11611295
    1162         if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
     1296        if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
    11631297                YY_FATAL_ERROR(
    11641298                "fatal flex scanner internal error--end of buffer missed" );
     
    11661300        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
    11671301                { /* Don't try to fill the buffer, so this is an EOF. */
    1168                 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
     1302                if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
    11691303                        {
    11701304                        /* We matched a single character, the EOB, so
     
    11861320
    11871321        /* First move last chars to start of buffer. */
    1188         number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
     1322        number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
    11891323
    11901324        for ( i = 0; i < number_to_move; ++i )
     
    11951329                 * just force an EOF
    11961330                 */
    1197                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
     1331                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
    11981332
    11991333        else
     
    12091343
    12101344                        int yy_c_buf_p_offset =
    1211                                 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
     1345                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
    12121346
    12131347                        if ( b->yy_is_our_buffer )
     
    12221356                                b->yy_ch_buf = (char *)
    12231357                                        /* Include room in for 2 EOB chars. */
    1224                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
     1358                                        Meshrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
    12251359                                }
    12261360                        else
     
    12321366                                "fatal error - scanner input buffer overflow" );
    12331367
    1234                         yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
     1368                        (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
    12351369
    12361370                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
     
    12441378                /* Read in more data. */
    12451379                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
    1246                         yyg->yy_n_chars, (size_t) num_to_read );
    1247 
    1248                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
     1380                        (yy_n_chars), (size_t) num_to_read );
     1381
     1382                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
    12491383                }
    12501384
    1251         if ( yyg->yy_n_chars == 0 )
     1385        if ( (yy_n_chars) == 0 )
    12521386                {
    12531387                if ( number_to_move == YY_MORE_ADJ )
    12541388                        {
    12551389                        ret_val = EOB_ACT_END_OF_FILE;
    1256                         yyrestart(yyin  ,yyscanner);
     1390                        yyrestart( yyin  );
    12571391                        }
    12581392
     
    12681402                ret_val = EOB_ACT_CONTINUE_SCAN;
    12691403
    1270         if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
     1404        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
    12711405                /* Extend the array by 50%, plus the number we really need. */
    1272                 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
    1273                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
     1406                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
     1407                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) Meshrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
    12741408                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
    12751409                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
    12761410        }
    12771411
    1278         yyg->yy_n_chars += number_to_move;
    1279         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
    1280         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
    1281 
    1282         yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
     1412        (yy_n_chars) += number_to_move;
     1413        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
     1414        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
     1415
     1416        (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
    12831417
    12841418        return ret_val;
     
    12871421/* yy_get_previous_state - get the state just before the EOB char was reached */
    12881422
    1289     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
     1423/* %if-c-only */
     1424/* %not-for-header */
     1425
     1426/* %endif */
     1427/* %if-c++-only */
     1428    yy_state_type yyFlexLexer::yy_get_previous_state()
     1429/* %endif */
    12901430{
    12911431        register yy_state_type yy_current_state;
    12921432        register char *yy_cp;
    1293     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1294 
    1295         yy_current_state = yyg->yy_start;
    1296 
    1297         for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
     1433   
     1434/* %% [15.0] code to get the start state into yy_current_state goes here */
     1435        yy_current_state = (yy_start);
     1436
     1437        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
    12981438                {
     1439/* %% [16.0] code to find the next state goes here */
    12991440                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
    13001441                if ( yy_accept[yy_current_state] )
    13011442                        {
    1302                         yyg->yy_last_accepting_state = yy_current_state;
    1303                         yyg->yy_last_accepting_cpos = yy_cp;
     1443                        (yy_last_accepting_state) = yy_current_state;
     1444                        (yy_last_accepting_cpos) = yy_cp;
    13041445                        }
    13051446                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
     
    13201461 *      next_state = yy_try_NUL_trans( current_state );
    13211462 */
    1322     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
     1463/* %if-c-only */
     1464/* %endif */
     1465/* %if-c++-only */
     1466    yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
     1467/* %endif */
    13231468{
    13241469        register int yy_is_jam;
    1325     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
    1326         register char *yy_cp = yyg->yy_c_buf_p;
     1470    /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
     1471        register char *yy_cp = (yy_c_buf_p);
    13271472
    13281473        register YY_CHAR yy_c = 1;
    13291474        if ( yy_accept[yy_current_state] )
    13301475                {
    1331                 yyg->yy_last_accepting_state = yy_current_state;
    1332                 yyg->yy_last_accepting_cpos = yy_cp;
     1476                (yy_last_accepting_state) = yy_current_state;
     1477                (yy_last_accepting_cpos) = yy_cp;
    13331478                }
    13341479        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
     
    13441489}
    13451490
    1346 #ifndef YY_NO_INPUT
    1347 #ifdef __cplusplus
    1348     static int yyinput (yyscan_t yyscanner)
    1349 #else
    1350     static int input  (yyscan_t yyscanner)
    1351 #endif
    1352 
     1491/* %if-c-only */
     1492/* %endif */
     1493/* %if-c++-only */
     1494    void yyFlexLexer::yyunput( int c, register char* yy_bp)
     1495/* %endif */
     1496{
     1497        register char *yy_cp;
     1498   
     1499    yy_cp = (yy_c_buf_p);
     1500
     1501        /* undo effects of setting up yytext */
     1502        *yy_cp = (yy_hold_char);
     1503
     1504        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
     1505                { /* need to shift things up to make room */
     1506                /* +2 for EOB chars. */
     1507                register int number_to_move = (yy_n_chars) + 2;
     1508                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
     1509                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
     1510                register char *source =
     1511                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
     1512
     1513                while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
     1514                        *--dest = *--source;
     1515
     1516                yy_cp += (int) (dest - source);
     1517                yy_bp += (int) (dest - source);
     1518                YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
     1519                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
     1520
     1521                if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
     1522                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
     1523                }
     1524
     1525        *--yy_cp = (char) c;
     1526
     1527/* %% [18.0] update yylineno here */
     1528
     1529        (yytext_ptr) = yy_bp;
     1530        (yy_hold_char) = *yy_cp;
     1531        (yy_c_buf_p) = yy_cp;
     1532}
     1533/* %if-c-only */
     1534/* %endif */
     1535
     1536/* %if-c-only */
     1537/* %endif */
     1538/* %if-c++-only */
     1539    int yyFlexLexer::yyinput()
     1540/* %endif */
    13531541{
    13541542        int c;
    1355     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1356 
    1357         *yyg->yy_c_buf_p = yyg->yy_hold_char;
    1358 
    1359         if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
     1543   
     1544        *(yy_c_buf_p) = (yy_hold_char);
     1545
     1546        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
    13601547                {
    13611548                /* yy_c_buf_p now points to the character we want to return.
     
    13631550                 * valid NUL; if not, then we've hit the end of the buffer.
    13641551                 */
    1365                 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
     1552                if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
    13661553                        /* This was really a NUL. */
    1367                         *yyg->yy_c_buf_p = '\0';
     1554                        *(yy_c_buf_p) = '\0';
    13681555
    13691556                else
    13701557                        { /* need more input */
    1371                         int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
    1372                         ++yyg->yy_c_buf_p;
    1373 
    1374                         switch ( yy_get_next_buffer( yyscanner ) )
     1558                        int offset = (yy_c_buf_p) - (yytext_ptr);
     1559                        ++(yy_c_buf_p);
     1560
     1561                        switch ( yy_get_next_buffer( ) )
    13751562                                {
    13761563                                case EOB_ACT_LAST_MATCH:
     
    13861573
    13871574                                        /* Reset buffer status. */
    1388                                         yyrestart(yyin ,yyscanner);
     1575                                        yyrestart( yyin );
    13891576
    13901577                                        /*FALLTHROUGH*/
     
    13921579                                case EOB_ACT_END_OF_FILE:
    13931580                                        {
    1394                                         if ( yywrap(yyscanner ) )
     1581                                        if ( yywrap(  ) )
    13951582                                                return EOF;
    13961583
    1397                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
     1584                                        if ( ! (yy_did_buffer_switch_on_eof) )
    13981585                                                YY_NEW_FILE;
    13991586#ifdef __cplusplus
    1400                                         return yyinput(yyscanner);
     1587                                        return yyinput();
    14011588#else
    1402                                         return input(yyscanner);
     1589                                        return input();
    14031590#endif
    14041591                                        }
    14051592
    14061593                                case EOB_ACT_CONTINUE_SCAN:
    1407                                         yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
     1594                                        (yy_c_buf_p) = (yytext_ptr) + offset;
    14081595                                        break;
    14091596                                }
     
    14111598                }
    14121599
    1413         c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
    1414         *yyg->yy_c_buf_p = '\0';        /* preserve yytext */
    1415         yyg->yy_hold_char = *++yyg->yy_c_buf_p;
     1600        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
     1601        *(yy_c_buf_p) = '\0';   /* preserve yytext */
     1602        (yy_hold_char) = *++(yy_c_buf_p);
     1603
     1604/* %% [19.0] update BOL and yylineno */
    14161605
    14171606        return c;
    14181607}
    1419 #endif  /* ifndef YY_NO_INPUT */
     1608/* %if-c-only */
     1609/* %endif */
    14201610
    14211611/** Immediately switch to a different input stream.
    14221612 * @param input_file A readable stream.
    1423  * @param yyscanner The scanner object.
     1613 *
    14241614 * @note This function does not reset the start condition to @c INITIAL .
    14251615 */
    1426     void yyrestart  (FILE * input_file , yyscan_t yyscanner)
    1427 {
    1428     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1429 
     1616/* %if-c-only */
     1617/* %endif */
     1618/* %if-c++-only */
     1619    void yyFlexLexer::yyrestart( std::istream* input_file )
     1620/* %endif */
     1621{
     1622   
    14301623        if ( ! YY_CURRENT_BUFFER ){
    1431         yyensure_buffer_stack (yyscanner);
     1624        yyensure_buffer_stack ();
    14321625                YY_CURRENT_BUFFER_LVALUE =
    1433             yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
     1626            yy_create_buffer( yyin, YY_BUF_SIZE );
    14341627        }
    14351628
    1436         yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
    1437         yy_load_buffer_state(yyscanner );
     1629        yy_init_buffer( YY_CURRENT_BUFFER, input_file );
     1630        yy_load_buffer_state(  );
    14381631}
    14391632
    14401633/** Switch to a different input buffer.
    14411634 * @param new_buffer The new input buffer.
    1442  * @param yyscanner The scanner object.
    1443  */
    1444     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
    1445 {
    1446     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1447 
     1635 *
     1636 */
     1637/* %if-c-only */
     1638/* %endif */
     1639/* %if-c++-only */
     1640    void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
     1641/* %endif */
     1642{
     1643   
    14481644        /* TODO. We should be able to replace this entire function body
    14491645         * with
     
    14511647         *              yypush_buffer_state(new_buffer);
    14521648     */
    1453         yyensure_buffer_stack (yyscanner);
     1649        yyensure_buffer_stack ();
    14541650        if ( YY_CURRENT_BUFFER == new_buffer )
    14551651                return;
     
    14581654                {
    14591655                /* Flush out information for old buffer. */
    1460                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
    1461                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
    1462                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
     1656                *(yy_c_buf_p) = (yy_hold_char);
     1657                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
     1658                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
    14631659                }
    14641660
    14651661        YY_CURRENT_BUFFER_LVALUE = new_buffer;
    1466         yy_load_buffer_state(yyscanner );
     1662        yy_load_buffer_state(  );
    14671663
    14681664        /* We don't actually know whether we did this switch during
     
    14711667         * to go ahead and always set it.
    14721668         */
    1473         yyg->yy_did_buffer_switch_on_eof = 1;
    1474 }
    1475 
    1476 static void yy_load_buffer_state  (yyscan_t yyscanner)
    1477 {
    1478     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1479         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
    1480         yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
     1669        (yy_did_buffer_switch_on_eof) = 1;
     1670}
     1671
     1672/* %if-c-only */
     1673/* %endif */
     1674/* %if-c++-only */
     1675    void yyFlexLexer::yy_load_buffer_state()
     1676/* %endif */
     1677{
     1678        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
     1679        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
    14811680        yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
    1482         yyg->yy_hold_char = *yyg->yy_c_buf_p;
     1681        (yy_hold_char) = *(yy_c_buf_p);
    14831682}
    14841683
     
    14861685 * @param file A readable stream.
    14871686 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
    1488  * @param yyscanner The scanner object.
     1687 *
    14891688 * @return the allocated buffer state.
    14901689 */
    1491     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
     1690/* %if-c-only */
     1691/* %endif */
     1692/* %if-c++-only */
     1693    YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
     1694/* %endif */
    14921695{
    14931696        YY_BUFFER_STATE b;
    14941697   
    1495         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
     1698        b = (YY_BUFFER_STATE) Meshalloc(sizeof( struct yy_buffer_state ) );
    14961699        if ( ! b )
    14971700                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
     
    15021705         * we need to put in 2 end-of-buffer characters.
    15031706         */
    1504         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
     1707        b->yy_ch_buf = (char *) Meshalloc(b->yy_buf_size + 2 );
    15051708        if ( ! b->yy_ch_buf )
    15061709                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
     
    15081711        b->yy_is_our_buffer = 1;
    15091712
    1510         yy_init_buffer(b,file ,yyscanner);
     1713        yy_init_buffer( b, file );
    15111714
    15121715        return b;
     
    15151718/** Destroy the buffer.
    15161719 * @param b a buffer created with yy_create_buffer()
    1517  * @param yyscanner The scanner object.
    1518  */
    1519     void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
    1520 {
    1521     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1522 
     1720 *
     1721 */
     1722/* %if-c-only */
     1723/* %endif */
     1724/* %if-c++-only */
     1725    void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
     1726/* %endif */
     1727{
     1728   
    15231729        if ( ! b )
    15241730                return;
     
    15281734
    15291735        if ( b->yy_is_our_buffer )
    1530                 yyfree((void *) b->yy_ch_buf ,yyscanner );
    1531 
    1532         yyfree((void *) b ,yyscanner );
    1533 }
    1534 
    1535 #ifndef __cplusplus
    1536 extern int isatty (int );
    1537 #endif /* __cplusplus */
    1538    
     1736                Meshfree((void *) b->yy_ch_buf  );
     1737
     1738        Meshfree((void *) b  );
     1739}
     1740
     1741/* %if-c-only */
     1742/* %endif */
     1743
     1744/* %if-c++-only */
     1745
     1746extern "C" int isatty (int );
     1747
     1748/* %endif */
     1749
    15391750/* Initializes or reinitializes a buffer.
    15401751 * This function is sometimes called more than once on the same buffer,
    15411752 * such as during a yyrestart() or at EOF.
    15421753 */
    1543     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
     1754/* %if-c-only */
     1755/* %endif */
     1756/* %if-c++-only */
     1757    void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
     1758/* %endif */
    15441759
    15451760{
    15461761        int oerrno = errno;
    1547     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1548 
    1549         yy_flush_buffer(b ,yyscanner);
     1762   
     1763        yy_flush_buffer( b );
    15501764
    15511765        b->yy_input_file = file;
     
    15611775    }
    15621776
    1563         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
    1564    
     1777/* %if-c-only */
     1778/* %endif */
     1779/* %if-c++-only */
     1780        b->yy_is_interactive = 0;
     1781/* %endif */
    15651782        errno = oerrno;
    15661783}
     
    15681785/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
    15691786 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
    1570  * @param yyscanner The scanner object.
    1571  */
    1572     void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
    1573 {
    1574     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1575         if ( ! b )
     1787 *
     1788 */
     1789/* %if-c-only */
     1790/* %endif */
     1791/* %if-c++-only */
     1792    void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
     1793/* %endif */
     1794{
     1795        if ( ! b )
    15761796                return;
    15771797
     
    15911811
    15921812        if ( b == YY_CURRENT_BUFFER )
    1593                 yy_load_buffer_state(yyscanner );
    1594 }
    1595 
     1813                yy_load_buffer_state(  );
     1814}
     1815
     1816/* %if-c-or-c++ */
    15961817/** Pushes the new state onto the stack. The new state becomes
    15971818 *  the current state. This function will allocate the stack
    15981819 *  if necessary.
    15991820 *  @param new_buffer The new state.
    1600  *  @param yyscanner The scanner object.
    1601  */
    1602 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
    1603 {
    1604     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1605         if (new_buffer == NULL)
     1821 * 
     1822 */
     1823/* %if-c-only */
     1824/* %endif */
     1825/* %if-c++-only */
     1826void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
     1827/* %endif */
     1828{
     1829        if (new_buffer == NULL)
    16061830                return;
    16071831
    1608         yyensure_buffer_stack(yyscanner);
     1832        yyensure_buffer_stack();
    16091833
    16101834        /* This block is copied from yy_switch_to_buffer. */
     
    16121836                {
    16131837                /* Flush out information for old buffer. */
    1614                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
    1615                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
    1616                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
     1838                *(yy_c_buf_p) = (yy_hold_char);
     1839                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
     1840                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
    16171841                }
    16181842
    16191843        /* Only push if top exists. Otherwise, replace top. */
    16201844        if (YY_CURRENT_BUFFER)
    1621                 yyg->yy_buffer_stack_top++;
     1845                (yy_buffer_stack_top)++;
    16221846        YY_CURRENT_BUFFER_LVALUE = new_buffer;
    16231847
    16241848        /* copied from yy_switch_to_buffer. */
    1625         yy_load_buffer_state(yyscanner );
    1626         yyg->yy_did_buffer_switch_on_eof = 1;
    1627 }
    1628 
     1849        yy_load_buffer_state(  );
     1850        (yy_did_buffer_switch_on_eof) = 1;
     1851}
     1852/* %endif */
     1853
     1854/* %if-c-or-c++ */
    16291855/** Removes and deletes the top of the stack, if present.
    16301856 *  The next element becomes the new top.
    1631  *  @param yyscanner The scanner object.
    1632  */
    1633 void yypop_buffer_state (yyscan_t yyscanner)
    1634 {
    1635     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1636         if (!YY_CURRENT_BUFFER)
     1857 * 
     1858 */
     1859/* %if-c-only */
     1860/* %endif */
     1861/* %if-c++-only */
     1862void yyFlexLexer::yypop_buffer_state (void)
     1863/* %endif */
     1864{
     1865        if (!YY_CURRENT_BUFFER)
    16371866                return;
    16381867
    1639         yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
     1868        yy_delete_buffer(YY_CURRENT_BUFFER );
    16401869        YY_CURRENT_BUFFER_LVALUE = NULL;
    1641         if (yyg->yy_buffer_stack_top > 0)
    1642                 --yyg->yy_buffer_stack_top;
     1870        if ((yy_buffer_stack_top) > 0)
     1871                --(yy_buffer_stack_top);
    16431872
    16441873        if (YY_CURRENT_BUFFER) {
    1645                 yy_load_buffer_state(yyscanner );
    1646                 yyg->yy_did_buffer_switch_on_eof = 1;
     1874                yy_load_buffer_state(  );
     1875                (yy_did_buffer_switch_on_eof) = 1;
    16471876        }
    16481877}
    1649 
     1878/* %endif */
     1879
     1880/* %if-c-or-c++ */
    16501881/* Allocates the stack if it does not exist.
    16511882 *  Guarantees space for at least one push.
    16521883 */
    1653 static void yyensure_buffer_stack (yyscan_t yyscanner)
     1884/* %if-c-only */
     1885/* %endif */
     1886/* %if-c++-only */
     1887void yyFlexLexer::yyensure_buffer_stack(void)
     1888/* %endif */
    16541889{
    16551890        int num_to_alloc;
    1656     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1657 
    1658         if (!yyg->yy_buffer_stack) {
     1891   
     1892        if (!(yy_buffer_stack)) {
    16591893
    16601894                /* First allocation is just for 2 elements, since we don't know if this
     
    16631897         */
    16641898                num_to_alloc = 1;
    1665                 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
     1899                (yy_buffer_stack) = (struct yy_buffer_state**)Meshalloc
    16661900                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
    1667                                                                 , yyscanner);
    1668                 if ( ! yyg->yy_buffer_stack )
     1901                                                                );
     1902                if ( ! (yy_buffer_stack) )
    16691903                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
    16701904                                                                 
    1671                 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
     1905                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
    16721906                               
    1673                 yyg->yy_buffer_stack_max = num_to_alloc;
    1674                 yyg->yy_buffer_stack_top = 0;
     1907                (yy_buffer_stack_max) = num_to_alloc;
     1908                (yy_buffer_stack_top) = 0;
    16751909                return;
    16761910        }
    16771911
    1678         if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
     1912        if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
    16791913
    16801914                /* Increase the buffer to prepare for a possible push. */
    16811915                int grow_size = 8 /* arbitrary grow size */;
    16821916
    1683                 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
    1684                 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
    1685                                                                 (yyg->yy_buffer_stack,
     1917                num_to_alloc = (yy_buffer_stack_max) + grow_size;
     1918                (yy_buffer_stack) = (struct yy_buffer_state**)Meshrealloc
     1919                                                                ((yy_buffer_stack),
    16861920                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
    1687                                                                 , yyscanner);
    1688                 if ( ! yyg->yy_buffer_stack )
     1921                                                                );
     1922                if ( ! (yy_buffer_stack) )
    16891923                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
    16901924
    16911925                /* zero only the new slots.*/
    1692                 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
    1693                 yyg->yy_buffer_stack_max = num_to_alloc;
     1926                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
     1927                (yy_buffer_stack_max) = num_to_alloc;
    16941928        }
    16951929}
    1696 
    1697 /** Setup the input buffer state to scan directly from a user-specified character buffer.
    1698  * @param base the character buffer
    1699  * @param size the size in bytes of the character buffer
    1700  * @param yyscanner The scanner object.
    1701  * @return the newly allocated buffer state object.
    1702  */
    1703 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
    1704 {
    1705         YY_BUFFER_STATE b;
    1706    
    1707         if ( size < 2 ||
    1708              base[size-2] != YY_END_OF_BUFFER_CHAR ||
    1709              base[size-1] != YY_END_OF_BUFFER_CHAR )
    1710                 /* They forgot to leave room for the EOB's. */
    1711                 return 0;
    1712 
    1713         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
    1714         if ( ! b )
    1715                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
    1716 
    1717         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
    1718         b->yy_buf_pos = b->yy_ch_buf = base;
    1719         b->yy_is_our_buffer = 0;
    1720         b->yy_input_file = 0;
    1721         b->yy_n_chars = b->yy_buf_size;
    1722         b->yy_is_interactive = 0;
    1723         b->yy_at_bol = 1;
    1724         b->yy_fill_buffer = 0;
    1725         b->yy_buffer_status = YY_BUFFER_NEW;
    1726 
    1727         yy_switch_to_buffer(b ,yyscanner );
    1728 
    1729         return b;
    1730 }
    1731 
    1732 /** Setup the input buffer state to scan a string. The next call to yylex() will
    1733  * scan from a @e copy of @a str.
    1734  * @param yystr a NUL-terminated string to scan
    1735  * @param yyscanner The scanner object.
    1736  * @return the newly allocated buffer state object.
    1737  * @note If you want to scan bytes that may contain NUL values, then use
    1738  *       yy_scan_bytes() instead.
    1739  */
    1740 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
    1741 {
    1742    
    1743         return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
    1744 }
    1745 
    1746 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
    1747  * scan from a @e copy of @a bytes.
    1748  * @param yybytes the byte buffer to scan
    1749  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
    1750  * @param yyscanner The scanner object.
    1751  * @return the newly allocated buffer state object.
    1752  */
    1753 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
    1754 {
    1755         YY_BUFFER_STATE b;
    1756         char *buf;
    1757         yy_size_t n;
    1758         int i;
    1759    
    1760         /* Get memory for full buffer, including space for trailing EOB's. */
    1761         n = _yybytes_len + 2;
    1762         buf = (char *) yyalloc(n ,yyscanner );
    1763         if ( ! buf )
    1764                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
    1765 
    1766         for ( i = 0; i < _yybytes_len; ++i )
    1767                 buf[i] = yybytes[i];
    1768 
    1769         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
    1770 
    1771         b = yy_scan_buffer(buf,n ,yyscanner);
    1772         if ( ! b )
    1773                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
    1774 
    1775         /* It's okay to grow etc. this buffer, and we should throw it
    1776          * away when we're done.
    1777          */
    1778         b->yy_is_our_buffer = 1;
    1779 
    1780         return b;
     1930/* %endif */
     1931
     1932/* %if-c-only */
     1933/* %endif */
     1934
     1935/* %if-c-only */
     1936/* %endif */
     1937
     1938/* %if-c-only */
     1939/* %endif */
     1940
     1941/* %if-c-only */
     1942/* %endif */
     1943/* %if-c++-only */
     1944    void yyFlexLexer::yy_push_state( int new_state )
     1945/* %endif */
     1946{
     1947        if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
     1948                {
     1949                yy_size_t new_size;
     1950
     1951                (yy_start_stack_depth) += YY_START_STACK_INCR;
     1952                new_size = (yy_start_stack_depth) * sizeof( int );
     1953
     1954                if ( ! (yy_start_stack) )
     1955                        (yy_start_stack) = (int *) Meshalloc(new_size  );
     1956
     1957                else
     1958                        (yy_start_stack) = (int *) Meshrealloc((void *) (yy_start_stack),new_size  );
     1959
     1960                if ( ! (yy_start_stack) )
     1961                        YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
     1962                }
     1963
     1964        (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
     1965
     1966        BEGIN(new_state);
     1967}
     1968
     1969/* %if-c-only */
     1970/* %endif */
     1971/* %if-c++-only */
     1972    void yyFlexLexer::yy_pop_state()
     1973/* %endif */
     1974{
     1975        if ( --(yy_start_stack_ptr) < 0 )
     1976                YY_FATAL_ERROR( "start-condition stack underflow" );
     1977
     1978        BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
     1979}
     1980
     1981/* %if-c-only */
     1982/* %endif */
     1983/* %if-c++-only */
     1984    int yyFlexLexer::yy_top_state()
     1985/* %endif */
     1986{
     1987        return (yy_start_stack)[(yy_start_stack_ptr) - 1];
    17811988}
    17821989
     
    17851992#endif
    17861993
    1787 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
    1788 {
    1789         (void) fprintf( stderr, "%s\n", msg );
     1994/* %if-c-only */
     1995/* %endif */
     1996/* %if-c++-only */
     1997void yyFlexLexer::LexerError( yyconst char msg[] )
     1998{
     1999        std::cerr << msg << std::endl;
    17902000        exit( YY_EXIT_FAILURE );
    17912001}
     2002/* %endif */
    17922003
    17932004/* Redefine yyless() so it works in section 3 code. */
     
    18002011        int yyless_macro_arg = (n); \
    18012012        YY_LESS_LINENO(yyless_macro_arg);\
    1802                 yytext[yyleng] = yyg->yy_hold_char; \
    1803                 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
    1804                 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
    1805                 *yyg->yy_c_buf_p = '\0'; \
     2013                yytext[yyleng] = (yy_hold_char); \
     2014                (yy_c_buf_p) = yytext + yyless_macro_arg; \
     2015                (yy_hold_char) = *(yy_c_buf_p); \
     2016                *(yy_c_buf_p) = '\0'; \
    18062017                yyleng = yyless_macro_arg; \
    18072018                } \
     
    18102021/* Accessor  methods (get/set functions) to struct members. */
    18112022
    1812 /** Get the user-defined data for this scanner.
    1813  * @param yyscanner The scanner object.
    1814  */
    1815 YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
    1816 {
    1817     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1818     return yyextra;
    1819 }
    1820 
    1821 /** Get the current line number.
    1822  * @param yyscanner The scanner object.
    1823  */
    1824 int yyget_lineno  (yyscan_t yyscanner)
    1825 {
    1826     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1827    
    1828         if (! YY_CURRENT_BUFFER)
    1829             return 0;
    1830    
    1831     return yylineno;
    1832 }
    1833 
    1834 /** Get the current column number.
    1835  * @param yyscanner The scanner object.
    1836  */
    1837 int yyget_column  (yyscan_t yyscanner)
    1838 {
    1839     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1840    
    1841         if (! YY_CURRENT_BUFFER)
    1842             return 0;
    1843    
    1844     return yycolumn;
    1845 }
    1846 
    1847 /** Get the input stream.
    1848  * @param yyscanner The scanner object.
    1849  */
    1850 FILE *yyget_in  (yyscan_t yyscanner)
    1851 {
    1852     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1853     return yyin;
    1854 }
    1855 
    1856 /** Get the output stream.
    1857  * @param yyscanner The scanner object.
    1858  */
    1859 FILE *yyget_out  (yyscan_t yyscanner)
    1860 {
    1861     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1862     return yyout;
    1863 }
    1864 
    1865 /** Get the length of the current token.
    1866  * @param yyscanner The scanner object.
    1867  */
    1868 int yyget_leng  (yyscan_t yyscanner)
    1869 {
    1870     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1871     return yyleng;
    1872 }
    1873 
    1874 /** Get the current token.
    1875  * @param yyscanner The scanner object.
    1876  */
    1877 
    1878 char *yyget_text  (yyscan_t yyscanner)
    1879 {
    1880     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1881     return yytext;
    1882 }
    1883 
    1884 /** Set the user-defined data. This data is never touched by the scanner.
    1885  * @param user_defined The data to be associated with this scanner.
    1886  * @param yyscanner The scanner object.
    1887  */
    1888 void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
    1889 {
    1890     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1891     yyextra = user_defined ;
    1892 }
    1893 
    1894 /** Set the current line number.
    1895  * @param line_number
    1896  * @param yyscanner The scanner object.
    1897  */
    1898 void yyset_lineno (int  line_number , yyscan_t yyscanner)
    1899 {
    1900     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1901 
    1902         /* lineno is only valid if an input buffer exists. */
    1903         if (! YY_CURRENT_BUFFER )
    1904            yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner);
    1905    
    1906     yylineno = line_number;
    1907 }
    1908 
    1909 /** Set the current column.
    1910  * @param line_number
    1911  * @param yyscanner The scanner object.
    1912  */
    1913 void yyset_column (int  column_no , yyscan_t yyscanner)
    1914 {
    1915     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1916 
    1917         /* column is only valid if an input buffer exists. */
    1918         if (! YY_CURRENT_BUFFER )
    1919            yy_fatal_error( "yyset_column called with no buffer" , yyscanner);
    1920    
    1921     yycolumn = column_no;
    1922 }
    1923 
    1924 /** Set the input stream. This does not discard the current
    1925  * input buffer.
    1926  * @param in_str A readable stream.
    1927  * @param yyscanner The scanner object.
    1928  * @see yy_switch_to_buffer
    1929  */
    1930 void yyset_in (FILE *  in_str , yyscan_t yyscanner)
    1931 {
    1932     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1933     yyin = in_str ;
    1934 }
    1935 
    1936 void yyset_out (FILE *  out_str , yyscan_t yyscanner)
    1937 {
    1938     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1939     yyout = out_str ;
    1940 }
    1941 
    1942 int yyget_debug  (yyscan_t yyscanner)
    1943 {
    1944     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1945     return yy_flex_debug;
    1946 }
    1947 
    1948 void yyset_debug (int  bdebug , yyscan_t yyscanner)
    1949 {
    1950     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    1951     yy_flex_debug = bdebug ;
    1952 }
    1953 
    1954 /* Accessor methods for yylval and yylloc */
    1955 
    1956 /* User-visible API */
    1957 
    1958 /* yylex_init is special because it creates the scanner itself, so it is
    1959  * the ONLY reentrant function that doesn't take the scanner as the last argument.
    1960  * That's why we explicitly handle the declaration, instead of using our macros.
    1961  */
    1962 
    1963 int yylex_init(yyscan_t* ptr_yy_globals)
    1964 
    1965 {
    1966     if (ptr_yy_globals == NULL){
    1967         errno = EINVAL;
    1968         return 1;
    1969     }
    1970 
    1971     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
    1972 
    1973     if (*ptr_yy_globals == NULL){
    1974         errno = ENOMEM;
    1975         return 1;
    1976     }
    1977 
    1978     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
    1979     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
    1980 
    1981     return yy_init_globals ( *ptr_yy_globals );
    1982 }
    1983 
    1984 /* yylex_init_extra has the same functionality as yylex_init, but follows the
    1985  * convention of taking the scanner as the last argument. Note however, that
    1986  * this is a *pointer* to a scanner, as it will be allocated by this call (and
    1987  * is the reason, too, why this function also must handle its own declaration).
    1988  * The user defined value in the first argument will be available to yyalloc in
    1989  * the yyextra field.
    1990  */
    1991 
    1992 int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
    1993 
    1994 {
    1995     struct yyguts_t dummy_yyguts;
    1996 
    1997     yyset_extra (yy_user_defined, &dummy_yyguts);
    1998 
    1999     if (ptr_yy_globals == NULL){
    2000         errno = EINVAL;
    2001         return 1;
    2002     }
    2003        
    2004     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
    2005        
    2006     if (*ptr_yy_globals == NULL){
    2007         errno = ENOMEM;
    2008         return 1;
    2009     }
    2010    
    2011     /* By setting to 0xAA, we expose bugs in
    2012     yy_init_globals. Leave at 0x00 for releases. */
    2013     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
    2014    
    2015     yyset_extra (yy_user_defined, *ptr_yy_globals);
    2016    
    2017     return yy_init_globals ( *ptr_yy_globals );
    2018 }
    2019 
    2020 static int yy_init_globals (yyscan_t yyscanner)
    2021 {
    2022     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    2023     /* Initialization is the same as for the non-reentrant scanner.
    2024      * This function is called from yylex_destroy(), so don't allocate here.
    2025      */
    2026 
    2027     yyg->yy_buffer_stack = 0;
    2028     yyg->yy_buffer_stack_top = 0;
    2029     yyg->yy_buffer_stack_max = 0;
    2030     yyg->yy_c_buf_p = (char *) 0;
    2031     yyg->yy_init = 0;
    2032     yyg->yy_start = 0;
    2033 
    2034     yyg->yy_start_stack_ptr = 0;
    2035     yyg->yy_start_stack_depth = 0;
    2036     yyg->yy_start_stack =  NULL;
    2037 
    2038 /* Defined in main.c */
    2039 #ifdef YY_STDINIT
    2040     yyin = stdin;
    2041     yyout = stdout;
    2042 #else
    2043     yyin = (FILE *) 0;
    2044     yyout = (FILE *) 0;
    2045 #endif
    2046 
    2047     /* For future reference: Set errno on error, since we are called by
    2048      * yylex_init()
    2049      */
    2050     return 0;
    2051 }
    2052 
    2053 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
    2054 int yylex_destroy  (yyscan_t yyscanner)
    2055 {
    2056     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    2057 
    2058     /* Pop the buffer stack, destroying each element. */
    2059         while(YY_CURRENT_BUFFER){
    2060                 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
    2061                 YY_CURRENT_BUFFER_LVALUE = NULL;
    2062                 yypop_buffer_state(yyscanner);
    2063         }
    2064 
    2065         /* Destroy the stack itself. */
    2066         yyfree(yyg->yy_buffer_stack ,yyscanner);
    2067         yyg->yy_buffer_stack = NULL;
    2068 
    2069     /* Destroy the start condition stack. */
    2070         yyfree(yyg->yy_start_stack ,yyscanner );
    2071         yyg->yy_start_stack = NULL;
    2072 
    2073     /* Reset the globals. This is important in a non-reentrant scanner so the next time
    2074      * yylex() is called, initialization will occur. */
    2075     yy_init_globals( yyscanner);
    2076 
    2077     /* Destroy the main struct (reentrant only). */
    2078     yyfree ( yyscanner , yyscanner );
    2079     yyscanner = NULL;
    2080     return 0;
    2081 }
     2023/* %if-c-only */
     2024/* %if-reentrant */
     2025/* %endif */
     2026/* %if-reentrant */
     2027/* %endif */
     2028/* %endif */
     2029
     2030/* %if-reentrant */
     2031/* %if-bison-bridge */
     2032/* %endif */
     2033/* %endif if-c-only */
     2034
     2035/* %if-c-only */
     2036/* %endif */
     2037
     2038/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
     2039/* %if-reentrant */
     2040/* %endif */
     2041/* %endif */
    20822042
    20832043/*
     
    20862046
    20872047#ifndef yytext_ptr
    2088 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
     2048static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
    20892049{
    20902050        register int i;
     
    20952055
    20962056#ifdef YY_NEED_STRLEN
    2097 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
     2057static int yy_flex_strlen (yyconst char * s )
    20982058{
    20992059        register int n;
     
    21052065#endif
    21062066
    2107 void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
     2067void *Meshalloc (yy_size_t  size )
    21082068{
    21092069        return (void *) malloc( size );
    21102070}
    21112071
    2112 void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
     2072void *Meshrealloc  (void * ptr, yy_size_t  size )
    21132073{
    21142074        /* The cast to (char *) in the following accommodates both
     
    21222082}
    21232083
    2124 void yyfree (void * ptr , yyscan_t yyscanner)
    2125 {
    2126         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
    2127 }
    2128 
     2084void Meshfree (void * ptr )
     2085{
     2086        free( (char *) ptr );   /* see Meshrealloc() for (char *) cast */
     2087}
     2088
     2089/* %if-tables-serialization definitions */
     2090/* %define-yytables   The name for this specific scanner's tables. */
    21292091#define YYTABLES_NAME "yytables"
    2130 
    2131 #line 88 "mesh.l"
    2132 
    2133 
    2134 
    2135 
     2092/* %endif */
     2093
     2094/* %ok-for-header */
     2095
     2096#line 106 "mesh.ll"
     2097
     2098
     2099
     2100namespace orbital {
     2101
     2102Scanner::Scanner(std::istream* in,
     2103                 std::ostream* out)
     2104    : MeshFlexLexer(in, out)
     2105{
     2106}
     2107
     2108Scanner::~Scanner()
     2109{
     2110}
     2111
     2112void Scanner::set_debug(bool b)
     2113{
     2114    yy_flex_debug = b;
     2115}
     2116
     2117}
     2118
     2119/* This implementation of MeshFlexLexer::yylex() is required to fill the
     2120 * vtable of the class MeshFlexLexer. We define the scanner's main yylex
     2121 * function via YY_DECL to reside in the Scanner class instead. */
     2122
     2123#ifdef yylex
     2124#undef yylex
     2125#endif
     2126
     2127int MeshFlexLexer::yylex()
     2128{
     2129    std::cerr << "in MeshFlexLexer::yylex() !" << std::endl;
     2130    return 0;
     2131}
     2132
     2133/* When the scanner receives an end-of-file indication from YY_INPUT, it then
     2134 * checks the yywrap() function. If yywrap() returns false (zero), then it is
     2135 * assumed that the function has gone ahead and set up `yyin' to point to
     2136 * another input file, and scanning continues. If it returns true (non-zero),
     2137 * then the scanner terminates, returning 0 to its caller. */
     2138
     2139int MeshFlexLexer::yywrap()
     2140{
     2141    return 1;
     2142}
     2143
  • trunk/orbital/generated/position.hh

    r1415 r1418  
    3333/**
    3434 ** \file position.hh
    35  ** Define the yy::position class.
     35 ** Define the orbital::position class.
    3636 */
    3737
     
    4444
    4545
    46 namespace yy {
     46namespace orbital {
    4747
    4848/* Line 37 of location.cc  */
     
    155155
    156156
    157 } // yy
     157} // orbital
    158158
    159159/* Line 144 of location.cc  */
  • trunk/orbital/generated/stack.hh

    r1415 r1418  
    3737
    3838
    39 namespace yy {
     39namespace orbital {
    4040
    4141/* Line 1149 of lalr1.cc  */
     
    127127  };
    128128
    129 } // yy
     129} // orbital
    130130
    131131/* Line 1235 of lalr1.cc  */
  • trunk/orbital/mesh.cpp

    r1415 r1418  
    1515
    1616#include "mesh.h"
    17 
    18 /* Compile generated files */
    19 #include "generated/mesh-parser.cpp"
    20 #include "generated/mesh-scanner.cpp"
     17#include "mesh-driver.h"
    2118
    2219void Mesh::SendCommand(char const *command)
    2320{
    24     yyscan_t scanner;
    25     yylex_init(&scanner);
    26     yyset_extra(&command, scanner);
    27     yy::MeshParser parser(*this, scanner);
    28     int res = parser.parse();
    29     (void)res;
    30     yylex_destroy(scanner);
     21    orbital::Driver driver(*this);
     22    driver.parse_string(command);
    3123}
    3224
  • trunk/orbital/mesh.yy

    r1415 r1418  
    1 /*
    2  * Orbital
    3  *
    4  * Copyright: (c) 2012 Various People
    5  */
     1/* $Id: parser.yy 48 2009-09-05 08:07:10Z tb $ -*- mode: c++ -*- */
     2/** \file parser.yy Contains the example Bison parser source */
    63
     4%{ /*** C/C++ Declarations ***/
     5#if defined HAVE_CONFIG_H
     6#   include "config.h"
     7#endif
     8
     9#include "core.h"
     10#include "loldebug.h"
     11
     12using namespace lol;
     13
     14#include "mesh.h"
     15
     16#include <stdio.h>
     17#include <string>
     18#include <vector>
     19
     20%}
     21
     22/*** yacc/bison Declarations ***/
     23
     24/* Require bison 2.3 or later */
     25%require "2.3"
     26
     27/* add debug output code to generated parser. disable this for release
     28 * versions. */
     29%debug
     30
     31/* start symbol */
     32%start mesh_description
     33
     34/* write out a header file containing the token defines */
     35%defines
     36
     37/* use newer C++ skeleton file */
    738%skeleton "lalr1.cc"
    8 %require "2.5"
    9 %defines
     39
     40/* namespace to enclose parser in */
     41%name-prefix="orbital"
     42
     43/* set the parser's class identifier */
    1044%define parser_class_name "MeshParser"
    1145
     46/* keep track of the current position within the input */
    1247%locations
    13 %parse-param { Mesh &mesh }
    14 %lex-param   { Mesh &mesh }
    15 %parse-param { void *yyscanner }
    16 %lex-param   { void *yyscanner }
     48%initial-action
     49{
     50    // initialize the initial location object
     51    @$.begin.filename = @$.end.filename = &driver.streamname;
     52};
    1753
    18 %code {
    19 #define YY_DECL \
    20     yy::MeshParser::token_type \
    21     yylex(yy::MeshParser::semantic_type* yylval, \
    22           yy::MeshParser::location_type* yylloc, \
    23           Mesh& mesh, \
    24           void *yyscanner)
    25 YY_DECL;
    26 }
     54/* The driver is passed by reference to the parser and to the scanner. This
     55 * provides a simple but effective pure interface, not relying on global
     56 * variables. */
     57%parse-param { class Driver& driver }
     58
     59/* verbose error messages */
     60%error-verbose
    2761
    2862%union
     
    3468%token T_FLUSH T_INITRB T_FREERB
    3569
    36 %token T_COLOR T_COLOR2
     70%token T_COLOR T_BGCOLOR
    3771
    3872%token T_TRANSLATEX T_ROTATEX T_TAPERX T_SCALEX T_MIRRORX
     
    5286%type <args> args1 args2 args3 args4 args5 args6 args7 args8
    5387
    54 %%
     88%{
    5589
    56 %start mesh_description ;
     90#include "mesh-driver.h"
     91#include "mesh-scanner.h"
     92
     93/* this "connects" the bison parser in the driver to the flex scanner class
     94 * object. it defines the yylex() function call to pull the next token from the
     95 * current lexer object of the driver context. */
     96#undef yylex
     97#define yylex driver.lexer->lex
     98
     99%}
     100
     101%% /*** Grammar Rules ***/
    57102
    58103mesh_description:
     
    73118
    74119rb_command:
    75     T_FLUSH    { mesh.Flush(); }
    76   | T_INITRB   { mesh.MeshConvert(); }
     120    T_FLUSH    { driver.mesh.Flush(); }
     121  | T_INITRB   { driver.mesh.MeshConvert(); }
    77122  | T_FREERB   { /* TODO */ }
    78123    ;
    79124
    80125color_command:
    81     T_COLOR args4   { mesh.SetCurColor(vec4($2.f0, $2.f1, $2.f2, $2.f3)); }
    82   | T_COLOR2 args4  { mesh.SetCurColor2(vec4($2.f0, $2.f1, $2.f2, $2.f3)); }
     126    T_COLOR args4   { driver.mesh.SetCurColor(vec4($2.f0, $2.f1, $2.f2, $2.f3)); }
     127  | T_BGCOLOR args4 { driver.mesh.SetCurColor2(vec4($2.f0, $2.f1, $2.f2, $2.f3)); }
    83128    ;
    84129
    85130transform_command:
    86     T_TRANSLATEX args1  { mesh.Translate(vec3($2.f0, 0, 0)); }
    87   | T_TRANSLATEY args1  { mesh.Translate(vec3(0, $2.f0, 0)); }
    88   | T_TRANSLATEZ args1  { mesh.Translate(vec3(0, 0, $2.f0)); }
    89   | T_TRANSLATE args3   { mesh.Translate(vec3($2.f0, $2.f1, $2.f2)); }
    90   | T_ROTATEX args1     { mesh.RotateX($2.f0); }
    91   | T_ROTATEY args1     { mesh.RotateY($2.f0); }
    92   | T_ROTATEZ args1     { mesh.RotateZ($2.f0); }
    93   | T_TAPERX args3      { mesh.TaperX($2.f0, $2.f1, $2.f2); }
    94   | T_TAPERY args3      { mesh.TaperY($2.f0, $2.f1, $2.f2); }
    95   | T_TAPERZ args3      { mesh.TaperZ($2.f0, $2.f1, $2.f2); }
    96   | T_SCALEX args1      { mesh.Scale(vec3($2.f0, 0, 0)); }
    97   | T_SCALEY args1      { mesh.Scale(vec3(0, $2.f0, 0)); }
    98   | T_SCALEZ args1      { mesh.Scale(vec3(0, 0, $2.f0)); }
    99   | T_SCALE args3       { mesh.Scale(vec3($2.f0, $2.f1, $2.f2)); }
    100   | T_MIRRORX           { mesh.MirrorX(); }
    101   | T_MIRRORY           { mesh.MirrorY(); }
    102   | T_MIRRORZ           { mesh.MirrorZ(); }
     131    T_TRANSLATEX args1  { driver.mesh.Translate(vec3($2.f0, 0, 0)); }
     132  | T_TRANSLATEY args1  { driver.mesh.Translate(vec3(0, $2.f0, 0)); }
     133  | T_TRANSLATEZ args1  { driver.mesh.Translate(vec3(0, 0, $2.f0)); }
     134  | T_TRANSLATE args3   { driver.mesh.Translate(vec3($2.f0, $2.f1, $2.f2)); }
     135  | T_ROTATEX args1     { driver.mesh.RotateX($2.f0); }
     136  | T_ROTATEY args1     { driver.mesh.RotateY($2.f0); }
     137  | T_ROTATEZ args1     { driver.mesh.RotateZ($2.f0); }
     138  | T_TAPERX args3      { driver.mesh.TaperX($2.f0, $2.f1, $2.f2); }
     139  | T_TAPERY args3      { driver.mesh.TaperY($2.f0, $2.f1, $2.f2); }
     140  | T_TAPERZ args3      { driver.mesh.TaperZ($2.f0, $2.f1, $2.f2); }
     141  | T_SCALEX args1      { driver.mesh.Scale(vec3($2.f0, 0, 0)); }
     142  | T_SCALEY args1      { driver.mesh.Scale(vec3(0, $2.f0, 0)); }
     143  | T_SCALEZ args1      { driver.mesh.Scale(vec3(0, 0, $2.f0)); }
     144  | T_SCALE args3       { driver.mesh.Scale(vec3($2.f0, $2.f1, $2.f2)); }
     145  | T_MIRRORX           { driver.mesh.MirrorX(); }
     146  | T_MIRRORY           { driver.mesh.MirrorY(); }
     147  | T_MIRRORZ           { driver.mesh.MirrorZ(); }
    103148    ;
    104149
    105150primitive_command:
    106     T_CYLINDER args6       { mesh.AppendCylinder((int)$2.f0, $2.f1,
     151    T_CYLINDER args6       { driver.mesh.AppendCylinder((int)$2.f0, $2.f1,
    107152                                                 $2.f2, $2.f3,
    108153                                                 (int)$2.f4, (int)$2.f5); }
    109   | T_BOX args3            { mesh.AppendBox(vec3($2.f0, $2.f1, $2.f2)); }
    110   | T_SMOOTHCHAMFBOX args4 { mesh.AppendSmoothChamfBox(vec3($2.f0, $2.f1,
     154  | T_BOX args3            { driver.mesh.AppendBox(vec3($2.f0, $2.f1, $2.f2)); }
     155  | T_SMOOTHCHAMFBOX args4 { driver.mesh.AppendSmoothChamfBox(vec3($2.f0, $2.f1,
    111156                                                            $2.f2), $2.f3); }
    112   | T_FLATCHAMFBOX args4   { mesh.AppendFlatChamfBox(vec3($2.f0, $2.f1,
     157  | T_FLATCHAMFBOX args4   { driver.mesh.AppendFlatChamfBox(vec3($2.f0, $2.f1,
    113158                                                          $2.f2), $2.f3); }
    114   | T_SPHERE args4         { mesh.AppendSphere($2.f0,
     159  | T_SPHERE args4         { driver.mesh.AppendSphere($2.f0,
    115160                                               vec3($2.f1, $2.f2, $2.f3)); }
    116   | T_STAR args5           { mesh.AppendStar((int)$2.f0, $2.f1, $2.f2,
     161  | T_STAR args5           { driver.mesh.AppendStar((int)$2.f0, $2.f1, $2.f2,
    117162                                             (int)$2.f3, (int)$2.f4); }
    118   | T_EXPANDEDSTAR args4   { mesh.AppendExpandedStar((int)$2.f0, $2.f1,
     163  | T_EXPANDEDSTAR args4   { driver.mesh.AppendExpandedStar((int)$2.f0, $2.f1,
    119164                                                     $2.f2, $2.f3); }
    120   | T_DISC args3           { mesh.AppendDisc((int)$2.f0, $2.f1, (int)$2.f2); }
    121   | T_TRIANGLE args2       { mesh.AppendSimpleTriangle($2.f0, (int)$2.f1); }
    122   | T_QUAD args2           { mesh.AppendSimpleQuad($2.f0, (int)$2.f1); }
    123   | T_COG args8            { mesh.AppendCog((int)$2.f0, $2.f1, $2.f2, $2.f3,
     165  | T_DISC args3           { driver.mesh.AppendDisc((int)$2.f0, $2.f1, (int)$2.f2); }
     166  | T_TRIANGLE args2       { driver.mesh.AppendSimpleTriangle($2.f0, (int)$2.f1); }
     167  | T_QUAD args2           { driver.mesh.AppendSimpleQuad($2.f0, (int)$2.f1); }
     168  | T_COG args8            { driver.mesh.AppendCog((int)$2.f0, $2.f1, $2.f2, $2.f3,
    124169                                            $2.f4, $2.f5, $2.f6, (int)$2.f7); }
    125170    ;
     
    139184    ;
    140185
    141 %%
     186%% /*** Additional Code ***/
    142187
    143 void yy::MeshParser::error(const yy::MeshParser::location_type& l, const std::string &m)
     188void orbital::MeshParser::error(const MeshParser::location_type& l,
     189                                const std::string& m)
    144190{
    145     /* FIXME: do something */
    146     std::cerr << "ERROR: " << m << std::endl;
     191    driver.error(l, m);
    147192}
    148 
Note: See TracChangeset for help on using the changeset viewer.