Ignore:
Timestamp:
May 30, 2012, 9:12:54 AM (8 years ago)
Author:
sam
Message:

orbital: a lot of scanner and parser refactoring to simplify the source
files and allow to build on MSVC soon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/generated/mesh-parser.cpp

    r1418 r1419  
    3737
    3838/* Line 293 of lalr1.cc  */
    39 #line 4 "mesh.yy"
    40  /*** C/C++ Declarations ***/
     39#line 1 "mesh.yy"
     40
     41//
     42// Orbital
     43//
     44// Copyright: (c) 2012 Various People
     45//
     46
    4147#if defined HAVE_CONFIG_H
    4248#   include "config.h"
     
    5561
    5662
    57 
    5863/* Line 293 of lalr1.cc  */
    59 #line 60 "generated/mesh-parser.cpp"
     64#line 65 "generated/mesh-parser.cpp"
    6065
    6166
     
    6570
    6671/* Line 299 of lalr1.cc  */
    67 #line 88 "mesh.yy"
    68 
     72#line 61 "mesh.yy"
    6973
    7074#include "mesh-driver.h"
    7175#include "mesh-scanner.h"
    7276
    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. */
    7677#undef yylex
    77 #define yylex driver.lexer->lex
    78 
     78#define yylex driver.m_lexer->lex
    7979
    8080
     
    350350
    351351
    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"
    363 
    364352    /* Initialize the stacks.  The initial state will be pushed in
    365353       yynewstate, since the latter expects the semantical and the
     
    479467
    480468/* Line 690 of lalr1.cc  */
    481 #line 120 "mesh.yy"
    482     { driver.mesh.Flush(); }
     469#line 88 "mesh.yy"
     470    { driver.m_mesh.Flush(); }
    483471    break;
    484472
     
    486474
    487475/* Line 690 of lalr1.cc  */
    488 #line 121 "mesh.yy"
    489     { driver.mesh.MeshConvert(); }
     476#line 89 "mesh.yy"
     477    { driver.m_mesh.MeshConvert(); }
    490478    break;
    491479
     
    493481
    494482/* Line 690 of lalr1.cc  */
    495 #line 122 "mesh.yy"
     483#line 90 "mesh.yy"
    496484    { /* TODO */ }
    497485    break;
     
    500488
    501489/* Line 690 of lalr1.cc  */
    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)); }
     490#line 94 "mesh.yy"
     491    { driver.m_mesh.SetCurColor(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
    504492    break;
    505493
     
    507495
    508496/* Line 690 of lalr1.cc  */
    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)); }
     497#line 95 "mesh.yy"
     498    { driver.m_mesh.SetCurColor2(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
    511499    break;
    512500
     
    514502
    515503/* Line 690 of lalr1.cc  */
    516 #line 131 "mesh.yy"
    517     { driver.mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
     504#line 99 "mesh.yy"
     505    { driver.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
    518506    break;
    519507
     
    521509
    522510/* Line 690 of lalr1.cc  */
    523 #line 132 "mesh.yy"
    524     { driver.mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
     511#line 100 "mesh.yy"
     512    { driver.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
    525513    break;
    526514
     
    528516
    529517/* Line 690 of lalr1.cc  */
    530 #line 133 "mesh.yy"
    531     { driver.mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     518#line 101 "mesh.yy"
     519    { driver.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
    532520    break;
    533521
     
    535523
    536524/* Line 690 of lalr1.cc  */
    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)); }
     525#line 102 "mesh.yy"
     526    { driver.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    539527    break;
    540528
     
    542530
    543531/* Line 690 of lalr1.cc  */
    544 #line 135 "mesh.yy"
    545     { driver.mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
     532#line 103 "mesh.yy"
     533    { driver.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
    546534    break;
    547535
     
    549537
    550538/* Line 690 of lalr1.cc  */
    551 #line 136 "mesh.yy"
    552     { driver.mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
     539#line 104 "mesh.yy"
     540    { driver.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
    553541    break;
    554542
     
    556544
    557545/* Line 690 of lalr1.cc  */
    558 #line 137 "mesh.yy"
    559     { driver.mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
     546#line 105 "mesh.yy"
     547    { driver.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
    560548    break;
    561549
     
    563551
    564552/* Line 690 of lalr1.cc  */
    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); }
     553#line 106 "mesh.yy"
     554    { driver.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    567555    break;
    568556
     
    570558
    571559/* Line 690 of lalr1.cc  */
    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); }
     560#line 107 "mesh.yy"
     561    { driver.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    574562    break;
    575563
     
    577565
    578566/* Line 690 of lalr1.cc  */
    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); }
     567#line 108 "mesh.yy"
     568    { driver.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
    581569    break;
    582570
     
    584572
    585573/* Line 690 of lalr1.cc  */
    586 #line 141 "mesh.yy"
    587     { driver.mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
     574#line 109 "mesh.yy"
     575    { driver.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
    588576    break;
    589577
     
    591579
    592580/* Line 690 of lalr1.cc  */
    593 #line 142 "mesh.yy"
    594     { driver.mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
     581#line 110 "mesh.yy"
     582    { driver.m_mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
    595583    break;
    596584
     
    598586
    599587/* Line 690 of lalr1.cc  */
    600 #line 143 "mesh.yy"
    601     { driver.mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     588#line 111 "mesh.yy"
     589    { driver.m_mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
    602590    break;
    603591
     
    605593
    606594/* Line 690 of lalr1.cc  */
    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)); }
     595#line 112 "mesh.yy"
     596    { driver.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    609597    break;
    610598
     
    612600
    613601/* Line 690 of lalr1.cc  */
    614 #line 145 "mesh.yy"
    615     { driver.mesh.MirrorX(); }
     602#line 113 "mesh.yy"
     603    { driver.m_mesh.MirrorX(); }
    616604    break;
    617605
     
    619607
    620608/* Line 690 of lalr1.cc  */
    621 #line 146 "mesh.yy"
    622     { driver.mesh.MirrorY(); }
     609#line 114 "mesh.yy"
     610    { driver.m_mesh.MirrorY(); }
    623611    break;
    624612
     
    626614
    627615/* Line 690 of lalr1.cc  */
    628 #line 147 "mesh.yy"
    629     { driver.mesh.MirrorZ(); }
     616#line 115 "mesh.yy"
     617    { driver.m_mesh.MirrorZ(); }
    630618    break;
    631619
     
    633621
    634622/* Line 690 of lalr1.cc  */
    635 #line 151 "mesh.yy"
    636     { driver.mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     623#line 119 "mesh.yy"
     624    { driver.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    637625                                                 (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
    638626                                                 (int)(yysemantic_stack_[(2) - (2)].args).f4, (int)(yysemantic_stack_[(2) - (2)].args).f5); }
     
    642630
    643631/* Line 690 of lalr1.cc  */
    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)); }
     632#line 122 "mesh.yy"
     633    { driver.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
    646634    break;
    647635
     
    649637
    650638/* Line 690 of lalr1.cc  */
    651 #line 155 "mesh.yy"
    652     { driver.mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     639#line 123 "mesh.yy"
     640    { driver.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    653641                                                            (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    654642    break;
     
    657645
    658646/* Line 690 of lalr1.cc  */
    659 #line 157 "mesh.yy"
    660     { driver.mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     647#line 125 "mesh.yy"
     648    { driver.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    661649                                                          (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
    662650    break;
     
    665653
    666654/* Line 690 of lalr1.cc  */
    667 #line 159 "mesh.yy"
    668     { driver.mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0,
     655#line 127 "mesh.yy"
     656    { driver.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0,
    669657                                               vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
    670658    break;
     
    673661
    674662/* Line 690 of lalr1.cc  */
    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,
     663#line 129 "mesh.yy"
     664    { driver.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
    677665                                             (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); }
    678666    break;
     
    681669
    682670/* Line 690 of lalr1.cc  */
    683 #line 163 "mesh.yy"
    684     { driver.mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     671#line 131 "mesh.yy"
     672    { driver.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
    685673                                                     (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
    686674    break;
     
    689677
    690678/* Line 690 of lalr1.cc  */
    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); }
     679#line 133 "mesh.yy"
     680    { driver.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
    693681    break;
    694682
     
    696684
    697685/* Line 690 of lalr1.cc  */
    698 #line 166 "mesh.yy"
    699     { driver.mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
     686#line 134 "mesh.yy"
     687    { driver.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    700688    break;
    701689
     
    703691
    704692/* Line 690 of lalr1.cc  */
    705 #line 167 "mesh.yy"
    706     { driver.mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
     693#line 135 "mesh.yy"
     694    { driver.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
    707695    break;
    708696
     
    710698
    711699/* Line 690 of lalr1.cc  */
    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,
     700#line 136 "mesh.yy"
     701    { driver.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
    714702                                            (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); }
    715703    break;
     
    718706
    719707/* Line 690 of lalr1.cc  */
    720 #line 172 "mesh.yy"
     708#line 140 "mesh.yy"
    721709    { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
    722710    break;
     
    725713
    726714/* Line 690 of lalr1.cc  */
    727 #line 173 "mesh.yy"
     715#line 141 "mesh.yy"
    728716    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(3) - (3)].fval); }
    729717    break;
     
    732720
    733721/* Line 690 of lalr1.cc  */
    734 #line 174 "mesh.yy"
     722#line 142 "mesh.yy"
    735723    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(3) - (3)].fval); }
    736724    break;
     
    739727
    740728/* Line 690 of lalr1.cc  */
    741 #line 175 "mesh.yy"
     729#line 143 "mesh.yy"
    742730    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(3) - (3)].fval); }
    743731    break;
     
    746734
    747735/* Line 690 of lalr1.cc  */
    748 #line 176 "mesh.yy"
     736#line 144 "mesh.yy"
    749737    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(3) - (3)].fval); }
    750738    break;
     
    753741
    754742/* Line 690 of lalr1.cc  */
    755 #line 177 "mesh.yy"
     743#line 145 "mesh.yy"
    756744    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(3) - (3)].fval); }
    757745    break;
     
    760748
    761749/* Line 690 of lalr1.cc  */
    762 #line 178 "mesh.yy"
     750#line 146 "mesh.yy"
    763751    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(3) - (3)].fval); }
    764752    break;
     
    767755
    768756/* Line 690 of lalr1.cc  */
    769 #line 179 "mesh.yy"
     757#line 147 "mesh.yy"
    770758    { (yyval.args) = (yysemantic_stack_[(3) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(3) - (3)].fval); }
    771759    break;
     
    774762
    775763/* Line 690 of lalr1.cc  */
    776 #line 182 "mesh.yy"
     764#line 150 "mesh.yy"
    777765    { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
    778766    break;
     
    781769
    782770/* Line 690 of lalr1.cc  */
    783 #line 183 "mesh.yy"
     771#line 151 "mesh.yy"
    784772    { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
    785773    break;
     
    788776
    789777/* Line 690 of lalr1.cc  */
    790 #line 791 "generated/mesh-parser.cpp"
     778#line 779 "generated/mesh-parser.cpp"
    791779        default:
    792780          break;
     
    12581246  MeshParser::yyrline_[] =
    12591247  {
    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
     1248         0,    72,    72,    76,    77,    81,    82,    83,    84,    88,
     1249      89,    90,    94,    95,    99,   100,   101,   102,   103,   104,
     1250     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     1251     115,   119,   122,   123,   125,   127,   129,   131,   133,   134,
     1252     135,   136,   140,   141,   142,   143,   144,   145,   146,   147,
     1253     150,   151
    12661254  };
    12671255
     
    13561344
    13571345/* Line 1136 of lalr1.cc  */
    1358 #line 1359 "generated/mesh-parser.cpp"
     1346#line 1347 "generated/mesh-parser.cpp"
    13591347
    13601348
    13611349/* Line 1138 of lalr1.cc  */
    1362 #line 186 "mesh.yy"
    1363  /*** Additional Code ***/
     1350#line 154 "mesh.yy"
     1351
    13641352
    13651353void orbital::MeshParser::error(const MeshParser::location_type& l,
    13661354                                const std::string& m)
    13671355{
    1368     driver.error(l, m);
     1356    driver.Error(l, m);
    13691357}
    13701358
     1359
Note: See TracChangeset for help on using the changeset viewer.