00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #line 41 "parser.cc"
00041
00042
00043 #include "parser.hh"
00044
00045
00046
00047
00048
00049 #line 50 "parser.cc"
00050
00051
00052
00053 #line 124 "parser.yy"
00054
00055 #include "driver.hh"
00056
00057
00058 #define yylex theDriver.scan
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 template<class T> inline std::vector<T>*
00070 append(std::vector<T>* sequence, T* item) {
00071 std::vector<T>* result = sequence;
00072 if (item) {
00073 result->push_back(T());
00074 std::swap(result->back(), *item);
00075 delete item;
00076 }
00077 return result;
00078 }
00079
00080
00081
00082
00083
00084
00085
00086 template<class T> inline std::vector<T>*
00087 singleton(T* item) {
00088 return append(new std::vector<T>, item);
00089 }
00090
00091
00092
00093
00094
00095 #line 96 "parser.cc"
00096
00097 #ifndef YY_
00098 # if YYENABLE_NLS
00099 # if ENABLE_NLS
00100 # include <libintl.h>
00101 # define YY_(msgid) dgettext ("bison-runtime", msgid)
00102 # endif
00103 # endif
00104 # ifndef YY_
00105 # define YY_(msgid) msgid
00106 # endif
00107 #endif
00108
00109
00110 #define YYUSE(e) ((void) (e))
00111
00112
00113 #if YYDEBUG
00114
00115
00116 # define YYCDEBUG if (yydebug_) (*yycdebug_)
00117
00118 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
00119 do { \
00120 if (yydebug_) \
00121 { \
00122 *yycdebug_ << Title << ' '; \
00123 yy_symbol_print_ ((Type), (Value), (Location)); \
00124 *yycdebug_ << std::endl; \
00125 } \
00126 } while (false)
00127
00128 # define YY_REDUCE_PRINT(Rule) \
00129 do { \
00130 if (yydebug_) \
00131 yy_reduce_print_ (Rule); \
00132 } while (false)
00133
00134 # define YY_STACK_PRINT() \
00135 do { \
00136 if (yydebug_) \
00137 yystack_print_ (); \
00138 } while (false)
00139
00140 #else
00141
00142 # define YYCDEBUG if (false) std::cerr
00143 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00144 # define YY_REDUCE_PRINT(Rule)
00145 # define YY_STACK_PRINT()
00146
00147 #endif
00148
00149 #define yyerrok (yyerrstatus_ = 0)
00150 #define yyclearin (yychar = yyempty_)
00151
00152 #define YYACCEPT goto yyacceptlab
00153 #define YYABORT goto yyabortlab
00154 #define YYERROR goto yyerrorlab
00155 #define YYRECOVERING() (!!yyerrstatus_)
00156
00157
00158
00159 #line 1 "[Bison:b4_percent_define_default]"
00160
00161 namespace yy {
00162
00163
00164 #line 165 "parser.cc"
00165 #if YYERROR_VERBOSE
00166
00167
00168
00169
00170
00171
00172 std::string
00173 parser::yytnamerr_ (const char *yystr)
00174 {
00175 if (*yystr == '"')
00176 {
00177 std::string yyr = "";
00178 char const *yyp = yystr;
00179
00180 for (;;)
00181 switch (*++yyp)
00182 {
00183 case '\'':
00184 case ',':
00185 goto do_not_strip_quotes;
00186
00187 case '\\':
00188 if (*++yyp != '\\')
00189 goto do_not_strip_quotes;
00190
00191 default:
00192 yyr += *yyp;
00193 break;
00194
00195 case '"':
00196 return yyr;
00197 }
00198 do_not_strip_quotes: ;
00199 }
00200
00201 return yystr;
00202 }
00203
00204 #endif
00205
00206
00207 parser::parser (driver& theDriver_yyarg)
00208 :
00209 #if YYDEBUG
00210 yydebug_ (false),
00211 yycdebug_ (&std::cerr),
00212 #endif
00213 theDriver (theDriver_yyarg)
00214 {
00215 }
00216
00217 parser::~parser ()
00218 {
00219 }
00220
00221 #if YYDEBUG
00222
00223
00224
00225
00226 inline void
00227 parser::yy_symbol_value_print_ (int yytype,
00228 const semantic_type* yyvaluep, const location_type* yylocationp)
00229 {
00230 YYUSE (yylocationp);
00231 YYUSE (yyvaluep);
00232 switch (yytype)
00233 {
00234 case 3:
00235
00236
00237 #line 182 "parser.yy"
00238 { debug_stream() << *(yyvaluep->s); };
00239
00240
00241 #line 242 "parser.cc"
00242 break;
00243 case 4:
00244
00245
00246 #line 182 "parser.yy"
00247 { debug_stream() << *(yyvaluep->s); };
00248
00249
00250 #line 251 "parser.cc"
00251 break;
00252 case 5:
00253
00254
00255 #line 183 "parser.yy"
00256 { debug_stream() << (yyvaluep->i); };
00257
00258
00259 #line 260 "parser.cc"
00260 break;
00261 case 16:
00262
00263
00264 #line 182 "parser.yy"
00265 { debug_stream() << *(yyvaluep->s); };
00266
00267
00268 #line 269 "parser.cc"
00269 break;
00270 case 17:
00271
00272
00273 #line 182 "parser.yy"
00274 { debug_stream() << *(yyvaluep->s); };
00275
00276
00277 #line 278 "parser.cc"
00278 break;
00279 case 20:
00280
00281
00282 #line 182 "parser.yy"
00283 { debug_stream() << *(yyvaluep->s); };
00284
00285
00286 #line 287 "parser.cc"
00287 break;
00288 case 28:
00289
00290
00291 #line 182 "parser.yy"
00292 { debug_stream() << *(yyvaluep->r); };
00293
00294
00295 #line 296 "parser.cc"
00296 break;
00297 case 30:
00298
00299
00300 #line 183 "parser.yy"
00301 { debug_stream() << (yyvaluep->i); };
00302
00303
00304 #line 305 "parser.cc"
00305 break;
00306 default:
00307 break;
00308 }
00309 }
00310
00311
00312 void
00313 parser::yy_symbol_print_ (int yytype,
00314 const semantic_type* yyvaluep, const location_type* yylocationp)
00315 {
00316 *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
00317 << ' ' << yytname_[yytype] << " ("
00318 << *yylocationp << ": ";
00319 yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
00320 *yycdebug_ << ')';
00321 }
00322 #endif
00323
00324 void
00325 parser::yydestruct_ (const char* yymsg,
00326 int yytype, semantic_type* yyvaluep, location_type* yylocationp)
00327 {
00328 YYUSE (yylocationp);
00329 YYUSE (yymsg);
00330 YYUSE (yyvaluep);
00331
00332 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
00333
00334 switch (yytype)
00335 {
00336 case 3:
00337
00338
00339 #line 184 "parser.yy"
00340 { delete (yyvaluep->s); };
00341
00342
00343 #line 344 "parser.cc"
00344 break;
00345 case 4:
00346
00347
00348 #line 184 "parser.yy"
00349 { delete (yyvaluep->s); };
00350
00351
00352 #line 353 "parser.cc"
00353 break;
00354 case 16:
00355
00356
00357 #line 184 "parser.yy"
00358 { delete (yyvaluep->s); };
00359
00360
00361 #line 362 "parser.cc"
00362 break;
00363 case 17:
00364
00365
00366 #line 184 "parser.yy"
00367 { delete (yyvaluep->s); };
00368
00369
00370 #line 371 "parser.cc"
00371 break;
00372 case 19:
00373
00374
00375 #line 184 "parser.yy"
00376 { delete (yyvaluep->sl); };
00377
00378
00379 #line 380 "parser.cc"
00380 break;
00381 case 20:
00382
00383
00384 #line 184 "parser.yy"
00385 { delete (yyvaluep->s); };
00386
00387
00388 #line 389 "parser.cc"
00389 break;
00390 case 22:
00391
00392
00393 #line 184 "parser.yy"
00394 { delete (yyvaluep->cl); };
00395
00396
00397 #line 398 "parser.cc"
00398 break;
00399 case 23:
00400
00401
00402 #line 184 "parser.yy"
00403 { delete (yyvaluep->c); };
00404
00405
00406 #line 407 "parser.cc"
00407 break;
00408 case 25:
00409
00410
00411 #line 184 "parser.yy"
00412 { delete (yyvaluep->fl); };
00413
00414
00415 #line 416 "parser.cc"
00416 break;
00417 case 26:
00418
00419
00420 #line 184 "parser.yy"
00421 { delete (yyvaluep->f); };
00422
00423
00424 #line 425 "parser.cc"
00425 break;
00426 case 28:
00427
00428
00429 #line 184 "parser.yy"
00430 { delete (yyvaluep->r); };
00431
00432
00433 #line 434 "parser.cc"
00434 break;
00435
00436 default:
00437 break;
00438 }
00439 }
00440
00441 void
00442 parser::yypop_ (unsigned int n)
00443 {
00444 yystate_stack_.pop (n);
00445 yysemantic_stack_.pop (n);
00446 yylocation_stack_.pop (n);
00447 }
00448
00449 #if YYDEBUG
00450 std::ostream&
00451 parser::debug_stream () const
00452 {
00453 return *yycdebug_;
00454 }
00455
00456 void
00457 parser::set_debug_stream (std::ostream& o)
00458 {
00459 yycdebug_ = &o;
00460 }
00461
00462
00463 parser::debug_level_type
00464 parser::debug_level () const
00465 {
00466 return yydebug_;
00467 }
00468
00469 void
00470 parser::set_debug_level (debug_level_type l)
00471 {
00472 yydebug_ = l;
00473 }
00474 #endif
00475
00476 int
00477 parser::parse ()
00478 {
00479
00480 int yychar = yyempty_;
00481 int yytoken = 0;
00482
00483
00484 int yyn;
00485 int yylen = 0;
00486 int yystate = 0;
00487
00488
00489 int yynerrs_ = 0;
00490 int yyerrstatus_ = 0;
00491
00492
00493 semantic_type yylval;
00494
00495 location_type yylloc;
00496
00497 location_type yyerror_range[2];
00498
00499
00500 semantic_type yyval;
00501
00502 location_type yyloc;
00503
00504 int yyresult;
00505
00506 YYCDEBUG << "Starting parse" << std::endl;
00507
00508
00509
00510
00511
00512 #line 99 "parser.yy"
00513 { yylloc.initialize(&theDriver.file); }
00514
00515
00516 #line 517 "parser.cc"
00517
00518
00519
00520
00521
00522 yystate_stack_ = state_stack_type (0);
00523 yysemantic_stack_ = semantic_stack_type (0);
00524 yylocation_stack_ = location_stack_type (0);
00525 yysemantic_stack_.push (yylval);
00526 yylocation_stack_.push (yylloc);
00527
00528
00529 yynewstate:
00530 yystate_stack_.push (yystate);
00531 YYCDEBUG << "Entering state " << yystate << std::endl;
00532
00533
00534 if (yystate == yyfinal_)
00535 goto yyacceptlab;
00536
00537 goto yybackup;
00538
00539
00540 yybackup:
00541
00542
00543 yyn = yypact_[yystate];
00544 if (yyn == yypact_ninf_)
00545 goto yydefault;
00546
00547
00548 if (yychar == yyempty_)
00549 {
00550 YYCDEBUG << "Reading a token: ";
00551 yychar = yylex (&yylval, &yylloc);
00552 }
00553
00554
00555
00556 if (yychar <= yyeof_)
00557 {
00558 yychar = yytoken = yyeof_;
00559 YYCDEBUG << "Now at end of input." << std::endl;
00560 }
00561 else
00562 {
00563 yytoken = yytranslate_ (yychar);
00564 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
00565 }
00566
00567
00568
00569 yyn += yytoken;
00570 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
00571 goto yydefault;
00572
00573
00574 yyn = yytable_[yyn];
00575 if (yyn <= 0)
00576 {
00577 if (yyn == 0 || yyn == yytable_ninf_)
00578 goto yyerrlab;
00579 yyn = -yyn;
00580 goto yyreduce;
00581 }
00582
00583
00584 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
00585
00586
00587 yychar = yyempty_;
00588
00589 yysemantic_stack_.push (yylval);
00590 yylocation_stack_.push (yylloc);
00591
00592
00593
00594 if (yyerrstatus_)
00595 --yyerrstatus_;
00596
00597 yystate = yyn;
00598 goto yynewstate;
00599
00600
00601
00602
00603 yydefault:
00604 yyn = yydefact_[yystate];
00605 if (yyn == 0)
00606 goto yyerrlab;
00607 goto yyreduce;
00608
00609
00610
00611
00612 yyreduce:
00613 yylen = yyr2_[yyn];
00614
00615
00616
00617
00618
00619
00620 if (yylen)
00621 yyval = yysemantic_stack_[yylen - 1];
00622 else
00623 yyval = yysemantic_stack_[0];
00624
00625 {
00626 slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
00627 YYLLOC_DEFAULT (yyloc, slice, yylen);
00628 }
00629 YY_REDUCE_PRINT (yyn);
00630 switch (yyn)
00631 {
00632 case 2:
00633
00634
00635 #line 192 "parser.yy"
00636 { theDriver.result((yyloc), (yysemantic_stack_[(8) - (1)].s)); }
00637 break;
00638
00639 case 3:
00640
00641
00642 #line 195 "parser.yy"
00643 { (yyval.s) = (yysemantic_stack_[(2) - (1)].s); }
00644 break;
00645
00646 case 4:
00647
00648
00649 #line 196 "parser.yy"
00650 { (yyval.s) = new std::string("unnamed"); }
00651 break;
00652
00653 case 5:
00654
00655
00656 #line 199 "parser.yy"
00657 { (yyval.s) = (yysemantic_stack_[(1) - (1)].s); }
00658 break;
00659
00660 case 6:
00661
00662
00663 #line 200 "parser.yy"
00664 { (yyval.s) = (yysemantic_stack_[(1) - (1)].s); }
00665 break;
00666
00667 case 7:
00668
00669
00670 #line 201 "parser.yy"
00671 { (yyval.s) = new std::string("*"); }
00672 break;
00673
00674 case 8:
00675
00676
00677 #line 206 "parser.yy"
00678 { theDriver.set_names((yyloc), (yysemantic_stack_[(3) - (2)].sl)); }
00679 break;
00680
00681 case 9:
00682
00683
00684 #line 209 "parser.yy"
00685 { (yyval.sl) = append((yysemantic_stack_[(3) - (1)].sl),(yysemantic_stack_[(3) - (3)].s)); }
00686 break;
00687
00688 case 10:
00689
00690
00691 #line 210 "parser.yy"
00692 { (yyval.sl) = singleton((yysemantic_stack_[(1) - (1)].s)); }
00693 break;
00694
00695 case 11:
00696
00697
00698 #line 213 "parser.yy"
00699 { (yyval.s) = (yysemantic_stack_[(1) - (1)].s); }
00700 break;
00701
00702 case 12:
00703
00704
00705 #line 218 "parser.yy"
00706 { theDriver.set_constraints((yyloc), (yysemantic_stack_[(3) - (2)].cl)); }
00707 break;
00708
00709 case 13:
00710
00711
00712 #line 221 "parser.yy"
00713 { (yyval.cl) = append((yysemantic_stack_[(3) - (1)].cl),(yysemantic_stack_[(3) - (3)].c)); }
00714 break;
00715
00716 case 14:
00717
00718
00719 #line 222 "parser.yy"
00720 { (yyval.cl) = singleton((yysemantic_stack_[(1) - (1)].c)); }
00721 break;
00722
00723 case 15:
00724
00725
00726 #line 225 "parser.yy"
00727 {
00728 (yyval.c) = new constraint((yysemantic_stack_[(7) - (2)].s), (yysemantic_stack_[(7) - (4)].r), (yysemantic_stack_[(7) - (6)].i));
00729 }
00730 break;
00731
00732 case 16:
00733
00734
00735 #line 228 "parser.yy"
00736 { (yyval.c) = 0; }
00737 break;
00738
00739 case 17:
00740
00741
00742 #line 233 "parser.yy"
00743 { theDriver.set_fields((yyloc), (yysemantic_stack_[(3) - (2)].fl)); }
00744 break;
00745
00746 case 18:
00747
00748
00749 #line 236 "parser.yy"
00750 { (yyval.fl) = append((yysemantic_stack_[(3) - (1)].fl),(yysemantic_stack_[(3) - (3)].f)); }
00751 break;
00752
00753 case 19:
00754
00755
00756 #line 237 "parser.yy"
00757 { (yyval.fl) = singleton((yysemantic_stack_[(1) - (1)].f)); }
00758 break;
00759
00760 case 20:
00761
00762
00763 #line 240 "parser.yy"
00764 { (yyval.f) = theDriver.checked_field((yyloc), (yysemantic_stack_[(5) - (2)].s), (yysemantic_stack_[(5) - (4)].rl)); }
00765 break;
00766
00767 case 21:
00768
00769
00770 #line 241 "parser.yy"
00771 { (yyval.f) = 0; }
00772 break;
00773
00774 case 22:
00775
00776
00777 #line 246 "parser.yy"
00778 { (yyval.rl) = append((yysemantic_stack_[(3) - (1)].rl),(yysemantic_stack_[(3) - (3)].r)); }
00779 break;
00780
00781 case 23:
00782
00783
00784 #line 247 "parser.yy"
00785 { (yyval.rl) = singleton((yysemantic_stack_[(1) - (1)].r)); }
00786 break;
00787
00788 case 24:
00789
00790
00791 #line 250 "parser.yy"
00792 { (yyval.r) = new rational((yysemantic_stack_[(3) - (1)].i) * (yysemantic_stack_[(3) - (2)].i), (yysemantic_stack_[(3) - (3)].i)); }
00793 break;
00794
00795 case 25:
00796
00797
00798 #line 251 "parser.yy"
00799 { (yyval.r) = new rational(); }
00800 break;
00801
00802 case 26:
00803
00804
00805 #line 254 "parser.yy"
00806 { (yyval.i) = 1; }
00807 break;
00808
00809 case 27:
00810
00811
00812 #line 255 "parser.yy"
00813 { (yyval.i) = -1; }
00814 break;
00815
00816 case 28:
00817
00818
00819 #line 256 "parser.yy"
00820 { (yyval.i) = 1; }
00821 break;
00822
00823 case 29:
00824
00825
00826 #line 259 "parser.yy"
00827 { (yyval.i) = (yysemantic_stack_[(2) - (2)].i); }
00828 break;
00829
00830 case 30:
00831
00832
00833 #line 260 "parser.yy"
00834 { (yyval.i) = 1; }
00835 break;
00836
00837
00838
00839
00840 #line 841 "parser.cc"
00841 default:
00842 break;
00843 }
00844 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
00845
00846 yypop_ (yylen);
00847 yylen = 0;
00848 YY_STACK_PRINT ();
00849
00850 yysemantic_stack_.push (yyval);
00851 yylocation_stack_.push (yyloc);
00852
00853
00854 yyn = yyr1_[yyn];
00855 yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
00856 if (0 <= yystate && yystate <= yylast_
00857 && yycheck_[yystate] == yystate_stack_[0])
00858 yystate = yytable_[yystate];
00859 else
00860 yystate = yydefgoto_[yyn - yyntokens_];
00861 goto yynewstate;
00862
00863
00864
00865
00866 yyerrlab:
00867
00868 if (!yyerrstatus_)
00869 {
00870 ++yynerrs_;
00871 error (yylloc, yysyntax_error_ (yystate, yytoken));
00872 }
00873
00874 yyerror_range[0] = yylloc;
00875 if (yyerrstatus_ == 3)
00876 {
00877
00878
00879
00880 if (yychar <= yyeof_)
00881 {
00882
00883 if (yychar == yyeof_)
00884 YYABORT;
00885 }
00886 else
00887 {
00888 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
00889 yychar = yyempty_;
00890 }
00891 }
00892
00893
00894
00895 goto yyerrlab1;
00896
00897
00898
00899
00900
00901 yyerrorlab:
00902
00903
00904
00905
00906 if (false)
00907 goto yyerrorlab;
00908
00909 yyerror_range[0] = yylocation_stack_[yylen - 1];
00910
00911
00912 yypop_ (yylen);
00913 yylen = 0;
00914 yystate = yystate_stack_[0];
00915 goto yyerrlab1;
00916
00917
00918
00919
00920 yyerrlab1:
00921 yyerrstatus_ = 3;
00922
00923 for (;;)
00924 {
00925 yyn = yypact_[yystate];
00926 if (yyn != yypact_ninf_)
00927 {
00928 yyn += yyterror_;
00929 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
00930 {
00931 yyn = yytable_[yyn];
00932 if (0 < yyn)
00933 break;
00934 }
00935 }
00936
00937
00938 if (yystate_stack_.height () == 1)
00939 YYABORT;
00940
00941 yyerror_range[0] = yylocation_stack_[0];
00942 yydestruct_ ("Error: popping",
00943 yystos_[yystate],
00944 &yysemantic_stack_[0], &yylocation_stack_[0]);
00945 yypop_ ();
00946 yystate = yystate_stack_[0];
00947 YY_STACK_PRINT ();
00948 }
00949
00950 yyerror_range[1] = yylloc;
00951
00952
00953 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
00954 yysemantic_stack_.push (yylval);
00955 yylocation_stack_.push (yyloc);
00956
00957
00958 YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
00959 &yysemantic_stack_[0], &yylocation_stack_[0]);
00960
00961 yystate = yyn;
00962 goto yynewstate;
00963
00964
00965 yyacceptlab:
00966 yyresult = 0;
00967 goto yyreturn;
00968
00969
00970 yyabortlab:
00971 yyresult = 1;
00972 goto yyreturn;
00973
00974 yyreturn:
00975 if (yychar != yyempty_)
00976 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
00977
00978
00979
00980 yypop_ (yylen);
00981 while (yystate_stack_.height () != 1)
00982 {
00983 yydestruct_ ("Cleanup: popping",
00984 yystos_[yystate_stack_[0]],
00985 &yysemantic_stack_[0],
00986 &yylocation_stack_[0]);
00987 yypop_ ();
00988 }
00989
00990 return yyresult;
00991 }
00992
00993
00994 std::string
00995 parser::yysyntax_error_ (int yystate, int tok)
00996 {
00997 std::string res;
00998 YYUSE (yystate);
00999 #if YYERROR_VERBOSE
01000 int yyn = yypact_[yystate];
01001 if (yypact_ninf_ < yyn && yyn <= yylast_)
01002 {
01003
01004
01005 int yyxbegin = yyn < 0 ? -yyn : 0;
01006
01007
01008 int yychecklim = yylast_ - yyn + 1;
01009 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
01010 int count = 0;
01011 for (int x = yyxbegin; x < yyxend; ++x)
01012 if (yycheck_[x + yyn] == x && x != yyterror_)
01013 ++count;
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023 res = "syntax error, unexpected ";
01024 res += yytnamerr_ (yytname_[tok]);
01025 if (count < 5)
01026 {
01027 count = 0;
01028 for (int x = yyxbegin; x < yyxend; ++x)
01029 if (yycheck_[x + yyn] == x && x != yyterror_)
01030 {
01031 res += (!count++) ? ", expecting " : " or ";
01032 res += yytnamerr_ (yytname_[x]);
01033 }
01034 }
01035 }
01036 else
01037 #endif
01038 res = YY_("syntax error");
01039 return res;
01040 }
01041
01042
01043
01044
01045 const signed char parser::yypact_ninf_ = -48;
01046 const signed char
01047 parser::yypact_[] =
01048 {
01049 -1, -48, -48, -48, 8, 17, 15, -48, 19, -48,
01050 -1, 20, -48, -3, -48, 22, -1, -48, 5, 23,
01051 -48, -48, -1, 9, -48, 25, 26, 5, -48, 6,
01052 18, 3, -48, -48, -1, 11, -48, -48, -48, -48,
01053 -48, 28, 24, 29, 6, -48, 27, 30, 3, -48,
01054 31, 32, -48, 13, -48, -48, -48, 3, -48, -48
01055 };
01056
01057
01058
01059
01060 const unsigned char
01061 parser::yydefact_[] =
01062 {
01063 4, 5, 6, 7, 0, 0, 0, 1, 0, 3,
01064 0, 0, 11, 0, 10, 0, 0, 8, 0, 0,
01065 9, 16, 0, 0, 14, 0, 0, 0, 12, 0,
01066 0, 28, 13, 21, 0, 0, 19, 2, 25, 26,
01067 27, 0, 0, 0, 0, 17, 0, 30, 28, 18,
01068 0, 0, 24, 0, 23, 15, 29, 28, 20, 22
01069 };
01070
01071
01072 const signed char
01073 parser::yypgoto_[] =
01074 {
01075 -48, -48, -48, 0, -48, -48, 33, -48, -48, 14,
01076 -48, -48, -6, -48, -47, -48, -48
01077 };
01078
01079
01080 const signed char
01081 parser::yydefgoto_[] =
01082 {
01083 -1, 4, 5, 12, 11, 13, 14, 19, 23, 24,
01084 30, 35, 36, 53, 41, 42, 52
01085 };
01086
01087
01088
01089
01090 const signed char parser::yytable_ninf_ = -1;
01091 const unsigned char
01092 parser::yytable_[] =
01093 {
01094 6, 54, 1, 2, 16, 17, 21, 33, 7, 3,
01095 59, 22, 34, 38, 39, 40, 27, 28, 44, 45,
01096 57, 58, 26, 8, 9, 10, 37, 15, 18, 47,
01097 25, 29, 50, 31, 43, 46, 48, 56, 49, 55,
01098 0, 32, 0, 51, 0, 0, 0, 0, 0, 20
01099 };
01100
01101
01102 const signed char
01103 parser::yycheck_[] =
01104 {
01105 0, 48, 3, 4, 7, 8, 1, 1, 0, 10,
01106 57, 6, 6, 10, 11, 12, 7, 8, 7, 8,
01107 7, 8, 22, 6, 9, 6, 8, 7, 6, 5,
01108 7, 6, 5, 7, 34, 7, 7, 5, 44, 8,
01109 -1, 27, -1, 13, -1, -1, -1, -1, -1, 16
01110 };
01111
01112
01113
01114 const unsigned char
01115 parser::yystos_[] =
01116 {
01117 0, 3, 4, 10, 15, 16, 17, 0, 6, 9,
01118 6, 18, 17, 19, 20, 7, 7, 8, 6, 21,
01119 20, 1, 6, 22, 23, 7, 17, 7, 8, 6,
01120 24, 7, 23, 1, 6, 25, 26, 8, 10, 11,
01121 12, 28, 29, 17, 7, 8, 7, 5, 7, 26,
01122 5, 13, 30, 27, 28, 8, 5, 7, 8, 28
01123 };
01124
01125 #if YYDEBUG
01126
01127
01128 const unsigned short int
01129 parser::yytoken_number_[] =
01130 {
01131 0, 256, 257, 258, 259, 260, 123, 44, 125, 61,
01132 42, 43, 45, 47
01133 };
01134 #endif
01135
01136
01137 const unsigned char
01138 parser::yyr1_[] =
01139 {
01140 0, 14, 15, 16, 16, 17, 17, 17, 18, 19,
01141 19, 20, 21, 22, 22, 23, 23, 24, 25, 25,
01142 26, 26, 27, 27, 28, 28, 29, 29, 29, 30,
01143 30
01144 };
01145
01146
01147 const unsigned char
01148 parser::yyr2_[] =
01149 {
01150 0, 2, 8, 2, 0, 1, 1, 1, 3, 3,
01151 1, 1, 3, 3, 1, 7, 1, 3, 3, 1,
01152 5, 1, 3, 1, 3, 1, 1, 1, 0, 2,
01153 0
01154 };
01155
01156 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
01157
01158
01159 const char*
01160 const parser::yytname_[] =
01161 {
01162 "\"end of file\"", "error", "$undefined", "\"word\"",
01163 "\"quoted string\"", "\"integer\"", "'{'", "','", "'}'", "'='", "'*'",
01164 "'+'", "'-'", "'/'", "$accept", "instance", "name", "string", "qns",
01165 "qnl", "qn", "css", "csl", "cs", "vcs", "vcl", "vc", "rationals",
01166 "rational", "sign", "denom", 0
01167 };
01168 #endif
01169
01170 #if YYDEBUG
01171
01172 const parser::rhs_number_type
01173 parser::yyrhs_[] =
01174 {
01175 15, 0, -1, 16, 6, 18, 7, 21, 7, 24,
01176 8, -1, 17, 9, -1, -1, 3, -1, 4, -1,
01177 10, -1, 6, 19, 8, -1, 19, 7, 20, -1,
01178 20, -1, 17, -1, 6, 22, 8, -1, 22, 7,
01179 23, -1, 23, -1, 6, 17, 7, 28, 7, 5,
01180 8, -1, 1, -1, 6, 25, 8, -1, 25, 7,
01181 26, -1, 26, -1, 6, 17, 7, 27, 8, -1,
01182 1, -1, 27, 7, 28, -1, 28, -1, 29, 5,
01183 30, -1, 10, -1, 11, -1, 12, -1, -1, 13,
01184 5, -1, -1
01185 };
01186
01187
01188
01189 const unsigned char
01190 parser::yyprhs_[] =
01191 {
01192 0, 0, 3, 12, 15, 16, 18, 20, 22, 26,
01193 30, 32, 34, 38, 42, 44, 52, 54, 58, 62,
01194 64, 70, 72, 76, 78, 82, 84, 86, 88, 89,
01195 92
01196 };
01197
01198
01199 const unsigned short int
01200 parser::yyrline_[] =
01201 {
01202 0, 192, 192, 195, 196, 199, 200, 201, 206, 209,
01203 210, 213, 218, 221, 222, 225, 228, 233, 236, 237,
01204 240, 241, 246, 247, 250, 251, 254, 255, 256, 259,
01205 260
01206 };
01207
01208
01209 void
01210 parser::yystack_print_ ()
01211 {
01212 *yycdebug_ << "Stack now";
01213 for (state_stack_type::const_iterator i = yystate_stack_.begin ();
01214 i != yystate_stack_.end (); ++i)
01215 *yycdebug_ << ' ' << *i;
01216 *yycdebug_ << std::endl;
01217 }
01218
01219
01220 void
01221 parser::yy_reduce_print_ (int yyrule)
01222 {
01223 unsigned int yylno = yyrline_[yyrule];
01224 int yynrhs = yyr2_[yyrule];
01225
01226 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
01227 << " (line " << yylno << "):" << std::endl;
01228
01229 for (int yyi = 0; yyi < yynrhs; yyi++)
01230 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
01231 yyrhs_[yyprhs_[yyrule] + yyi],
01232 &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
01233 &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
01234 }
01235 #endif // YYDEBUG
01236
01237
01238 parser::token_number_type
01239 parser::yytranslate_ (int t)
01240 {
01241 static
01242 const token_number_type
01243 translate_table[] =
01244 {
01245 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01246 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01249 2, 2, 10, 11, 7, 12, 2, 13, 2, 2,
01250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01251 2, 9, 2, 2, 2, 2, 2, 2, 2, 2,
01252 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01253 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01254 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01255 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01256 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01257 2, 2, 2, 6, 2, 8, 2, 2, 2, 2,
01258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01260 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01261 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01265 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
01270 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
01271 5
01272 };
01273 if ((unsigned int) t <= yyuser_token_number_max_)
01274 return translate_table[t];
01275 else
01276 return yyundef_token_;
01277 }
01278
01279 const int parser::yyeof_ = 0;
01280 const int parser::yylast_ = 49;
01281 const int parser::yynnts_ = 17;
01282 const int parser::yyempty_ = -2;
01283 const int parser::yyfinal_ = 7;
01284 const int parser::yyterror_ = 1;
01285 const int parser::yyerrcode_ = 256;
01286 const int parser::yyntokens_ = 14;
01287
01288 const unsigned int parser::yyuser_token_number_max_ = 260;
01289 const parser::token_number_type parser::yyundef_token_ = 2;
01290
01291
01292
01293 #line 1 "[Bison:b4_percent_define_default]"
01294
01295 }
01296
01297
01298 #line 1299 "parser.cc"
01299
01300
01301
01302 #line 263 "parser.yy"
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313 void
01314 yy::parser::error (const yy::parser::location_type& location,
01315 const std::string& message) {
01316 theDriver.error(location, message);
01317 }
01318
01319
01320