ct_common  1.0.1
Common library for combinatorial testing
src/ct_common/file_parse/ct_parser.tab.cpp
Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 2.5.  */
00002 
00003 /* Skeleton implementation for Bison LALR(1) parsers in C++
00004    
00005       Copyright (C) 2002-2011 Free Software Foundation, Inc.
00006    
00007    This program is free software: you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation, either version 3 of the License, or
00010    (at your option) any later version.
00011    
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016    
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 /* As a special exception, you may create a larger work that contains
00021    part or all of the Bison parser skeleton and distribute that work
00022    under terms of your choice, so long as that work isn't itself a
00023    parser generator using the skeleton or a modified version thereof
00024    as a parser skeleton.  Alternatively, if you modify or redistribute
00025    the parser skeleton itself, you may (at your option) remove this
00026    special exception, which will cause the skeleton and the resulting
00027    Bison output files to be licensed under the GNU General Public
00028    License without this special exception.
00029    
00030    This special exception was added by the Free Software Foundation in
00031    version 2.2 of Bison.  */
00032 /* "%code top" blocks.  */
00033 
00034 /* Line 286 of lalr1.cc  */
00035 #line 27 "ct_parser.ypp"
00036 
00037 #include <string>
00038 #include <sstream>
00039 #include <vector>
00040 #include <cstdlib>
00041 #include <ct_common/file_parse/ct_lexer.hpp>
00042 using namespace ct::common;
00043 
00044 
00045 
00046 /* Line 286 of lalr1.cc  */
00047 #line 48 "ct_parser.tab.cpp"
00048 
00049 
00050 /* First part of user declarations.  */
00051 
00052 
00053 /* Line 293 of lalr1.cc  */
00054 #line 55 "ct_parser.tab.cpp"
00055 
00056 
00057 #include "ct_parser.tab.hpp"
00058 
00059 /* User implementation prologue.  */
00060 
00061 
00062 /* Line 299 of lalr1.cc  */
00063 #line 64 "ct_parser.tab.cpp"
00064 /* Unqualified %code blocks.  */
00065 
00066 /* Line 300 of lalr1.cc  */
00067 #line 57 "ct_parser.ypp"
00068 
00069 #define TRY_BEGIN try {
00070 #define TRY_END } catch (std::exception &e) { error(yyloc, e.what()); }
00071 
00072 static yy::ct_parser::token_type
00073   yylex(yy::ct_parser::semantic_type* yylval, 
00074         yy::ct_parser::location_type* yylloc,
00075         ct::lexer &qlex);
00076 
00077 static std::string gen_yylloc_str(const yy::ct_parser::location_type &loc, const std::string &s) {
00078   std::stringstream ss;
00079   ss << loc.begin.line << ":" << loc.begin.column << "-" << loc.end.line << ":" << loc.end.column << ": " << s;
00080   return ss.str();
00081 }
00082 
00083 
00084 
00085 /* Line 300 of lalr1.cc  */
00086 #line 87 "ct_parser.tab.cpp"
00087 
00088 #ifndef YY_
00089 # if defined YYENABLE_NLS && YYENABLE_NLS
00090 #  if ENABLE_NLS
00091 #   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
00092 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00093 #  endif
00094 # endif
00095 # ifndef YY_
00096 #  define YY_(msgid) msgid
00097 # endif
00098 #endif
00099 
00100 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00101    If N is 0, then set CURRENT to the empty location which ends
00102    the previous symbol: RHS[0] (always defined).  */
00103 
00104 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00105 #ifndef YYLLOC_DEFAULT
00106 # define YYLLOC_DEFAULT(Current, Rhs, N)                               \
00107  do                                                                    \
00108    if (N)                                                              \
00109      {                                                                 \
00110        (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
00111        (Current).end   = YYRHSLOC (Rhs, N).end;                        \
00112      }                                                                 \
00113    else                                                                \
00114      {                                                                 \
00115        (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
00116      }                                                                 \
00117  while (false)
00118 #endif
00119 
00120 /* Suppress unused-variable warnings by "using" E.  */
00121 #define YYUSE(e) ((void) (e))
00122 
00123 /* Enable debugging if requested.  */
00124 #if YYDEBUG
00125 
00126 /* A pseudo ostream that takes yydebug_ into account.  */
00127 # define YYCDEBUG if (yydebug_) (*yycdebug_)
00128 
00129 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)  \
00130 do {                                                    \
00131   if (yydebug_)                                         \
00132     {                                                   \
00133       *yycdebug_ << Title << ' ';                       \
00134       yy_symbol_print_ ((Type), (Value), (Location));   \
00135       *yycdebug_ << std::endl;                          \
00136     }                                                   \
00137 } while (false)
00138 
00139 # define YY_REDUCE_PRINT(Rule)          \
00140 do {                                    \
00141   if (yydebug_)                         \
00142     yy_reduce_print_ (Rule);            \
00143 } while (false)
00144 
00145 # define YY_STACK_PRINT()               \
00146 do {                                    \
00147   if (yydebug_)                         \
00148     yystack_print_ ();                  \
00149 } while (false)
00150 
00151 #else /* !YYDEBUG */
00152 
00153 # define YYCDEBUG if (false) std::cerr
00154 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00155 # define YY_REDUCE_PRINT(Rule)
00156 # define YY_STACK_PRINT()
00157 
00158 #endif /* !YYDEBUG */
00159 
00160 #define yyerrok         (yyerrstatus_ = 0)
00161 #define yyclearin       (yychar = yyempty_)
00162 
00163 #define YYACCEPT        goto yyacceptlab
00164 #define YYABORT         goto yyabortlab
00165 #define YYERROR         goto yyerrorlab
00166 #define YYRECOVERING()  (!!yyerrstatus_)
00167 
00168 
00169 namespace yy {
00170 
00171 /* Line 382 of lalr1.cc  */
00172 #line 173 "ct_parser.tab.cpp"
00173 
00174   /* Return YYSTR after stripping away unnecessary quotes and
00175      backslashes, so that it's suitable for yyerror.  The heuristic is
00176      that double-quoting is unnecessary unless the string contains an
00177      apostrophe, a comma, or backslash (other than backslash-backslash).
00178      YYSTR is taken from yytname.  */
00179   std::string
00180   ct_parser::yytnamerr_ (const char *yystr)
00181   {
00182     if (*yystr == '"')
00183       {
00184         std::string yyr = "";
00185         char const *yyp = yystr;
00186 
00187         for (;;)
00188           switch (*++yyp)
00189             {
00190             case '\'':
00191             case ',':
00192               goto do_not_strip_quotes;
00193 
00194             case '\\':
00195               if (*++yyp != '\\')
00196                 goto do_not_strip_quotes;
00197               /* Fall through.  */
00198             default:
00199               yyr += *yyp;
00200               break;
00201 
00202             case '"':
00203               return yyr;
00204             }
00205       do_not_strip_quotes: ;
00206       }
00207 
00208     return yystr;
00209   }
00210 
00211 
00213   ct_parser::ct_parser (ct::lexer  &qlex_yyarg, std::vector<boost::shared_ptr<ct::common::ParamSpec> > &param_specs_yyarg, std::vector<ct::common::Strength> &strengths_yyarg, std::vector<boost::shared_ptr<ct::common::Seed> > &seeds_yyarg, std::vector<boost::shared_ptr<ct::common::Constraint> > &constraints_yyarg, ct::common::Assembler &assembler_yyarg)
00214     :
00215 #if YYDEBUG
00216       yydebug_ (false),
00217       yycdebug_ (&std::cerr),
00218 #endif
00219       qlex (qlex_yyarg),
00220       param_specs (param_specs_yyarg),
00221       strengths (strengths_yyarg),
00222       seeds (seeds_yyarg),
00223       constraints (constraints_yyarg),
00224       assembler (assembler_yyarg)
00225   {
00226   }
00227 
00228   ct_parser::~ct_parser ()
00229   {
00230   }
00231 
00232 #if YYDEBUG
00233   /*--------------------------------.
00234   | Print this symbol on YYOUTPUT.  |
00235   `--------------------------------*/
00236 
00237   inline void
00238   ct_parser::yy_symbol_value_print_ (int yytype,
00239                            const semantic_type* yyvaluep, const location_type* yylocationp)
00240   {
00241     YYUSE (yylocationp);
00242     YYUSE (yyvaluep);
00243     switch (yytype)
00244       {
00245          default:
00246           break;
00247       }
00248   }
00249 
00250 
00251   void
00252   ct_parser::yy_symbol_print_ (int yytype,
00253                            const semantic_type* yyvaluep, const location_type* yylocationp)
00254   {
00255     *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
00256                << ' ' << yytname_[yytype] << " ("
00257                << *yylocationp << ": ";
00258     yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
00259     *yycdebug_ << ')';
00260   }
00261 #endif
00262 
00263   void
00264   ct_parser::yydestruct_ (const char* yymsg,
00265                            int yytype, semantic_type* yyvaluep, location_type* yylocationp)
00266   {
00267     YYUSE (yylocationp);
00268     YYUSE (yymsg);
00269     YYUSE (yyvaluep);
00270 
00271     YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
00272 
00273     switch (yytype)
00274       {
00275   
00276         default:
00277           break;
00278       }
00279   }
00280 
00281   void
00282   ct_parser::yypop_ (unsigned int n)
00283   {
00284     yystate_stack_.pop (n);
00285     yysemantic_stack_.pop (n);
00286     yylocation_stack_.pop (n);
00287   }
00288 
00289 #if YYDEBUG
00290   std::ostream&
00291   ct_parser::debug_stream () const
00292   {
00293     return *yycdebug_;
00294   }
00295 
00296   void
00297   ct_parser::set_debug_stream (std::ostream& o)
00298   {
00299     yycdebug_ = &o;
00300   }
00301 
00302 
00303   ct_parser::debug_level_type
00304   ct_parser::debug_level () const
00305   {
00306     return yydebug_;
00307   }
00308 
00309   void
00310   ct_parser::set_debug_level (debug_level_type l)
00311   {
00312     yydebug_ = l;
00313   }
00314 #endif
00315 
00316   inline bool
00317   ct_parser::yy_pact_value_is_default_ (int yyvalue)
00318   {
00319     return yyvalue == yypact_ninf_;
00320   }
00321 
00322   inline bool
00323   ct_parser::yy_table_value_is_error_ (int yyvalue)
00324   {
00325     return yyvalue == yytable_ninf_;
00326   }
00327 
00328   int
00329   ct_parser::parse ()
00330   {
00332     int yychar = yyempty_;
00333     int yytoken = 0;
00334 
00335     /* State.  */
00336     int yyn;
00337     int yylen = 0;
00338     int yystate = 0;
00339 
00340     /* Error handling.  */
00341     int yynerrs_ = 0;
00342     int yyerrstatus_ = 0;
00343 
00345     semantic_type yylval;
00347     location_type yylloc;
00349     location_type yyerror_range[3];
00350 
00352     semantic_type yyval;
00354     location_type yyloc;
00355 
00356     int yyresult;
00357 
00358     YYCDEBUG << "Starting parse" << std::endl;
00359 
00360 
00361     /* Initialize the stacks.  The initial state will be pushed in
00362        yynewstate, since the latter expects the semantical and the
00363        location values to have been already stored, initialize these
00364        stacks with a primary value.  */
00365     yystate_stack_ = state_stack_type (0);
00366     yysemantic_stack_ = semantic_stack_type (0);
00367     yylocation_stack_ = location_stack_type (0);
00368     yysemantic_stack_.push (yylval);
00369     yylocation_stack_.push (yylloc);
00370 
00371     /* New state.  */
00372   yynewstate:
00373     yystate_stack_.push (yystate);
00374     YYCDEBUG << "Entering state " << yystate << std::endl;
00375 
00376     /* Accept?  */
00377     if (yystate == yyfinal_)
00378       goto yyacceptlab;
00379 
00380     goto yybackup;
00381 
00382     /* Backup.  */
00383   yybackup:
00384 
00385     /* Try to take a decision without lookahead.  */
00386     yyn = yypact_[yystate];
00387     if (yy_pact_value_is_default_ (yyn))
00388       goto yydefault;
00389 
00390     /* Read a lookahead token.  */
00391     if (yychar == yyempty_)
00392       {
00393         YYCDEBUG << "Reading a token: ";
00394         yychar = yylex (&yylval, &yylloc, qlex);
00395       }
00396 
00397 
00398     /* Convert token to internal form.  */
00399     if (yychar <= yyeof_)
00400       {
00401         yychar = yytoken = yyeof_;
00402         YYCDEBUG << "Now at end of input." << std::endl;
00403       }
00404     else
00405       {
00406         yytoken = yytranslate_ (yychar);
00407         YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
00408       }
00409 
00410     /* If the proper action on seeing token YYTOKEN is to reduce or to
00411        detect an error, take that action.  */
00412     yyn += yytoken;
00413     if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
00414       goto yydefault;
00415 
00416     /* Reduce or error.  */
00417     yyn = yytable_[yyn];
00418     if (yyn <= 0)
00419       {
00420         if (yy_table_value_is_error_ (yyn))
00421           goto yyerrlab;
00422         yyn = -yyn;
00423         goto yyreduce;
00424       }
00425 
00426     /* Shift the lookahead token.  */
00427     YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
00428 
00429     /* Discard the token being shifted.  */
00430     yychar = yyempty_;
00431 
00432     yysemantic_stack_.push (yylval);
00433     yylocation_stack_.push (yylloc);
00434 
00435     /* Count tokens shifted since error; after three, turn off error
00436        status.  */
00437     if (yyerrstatus_)
00438       --yyerrstatus_;
00439 
00440     yystate = yyn;
00441     goto yynewstate;
00442 
00443   /*-----------------------------------------------------------.
00444   | yydefault -- do the default action for the current state.  |
00445   `-----------------------------------------------------------*/
00446   yydefault:
00447     yyn = yydefact_[yystate];
00448     if (yyn == 0)
00449       goto yyerrlab;
00450     goto yyreduce;
00451 
00452   /*-----------------------------.
00453   | yyreduce -- Do a reduction.  |
00454   `-----------------------------*/
00455   yyreduce:
00456     yylen = yyr2_[yyn];
00457     /* If YYLEN is nonzero, implement the default value of the action:
00458        `$$ = $1'.  Otherwise, use the top of the stack.
00459 
00460        Otherwise, the following line sets YYVAL to garbage.
00461        This behavior is undocumented and Bison
00462        users should not rely upon it.  */
00463     if (yylen)
00464       yyval = yysemantic_stack_[yylen - 1];
00465     else
00466       yyval = yysemantic_stack_[0];
00467 
00468     {
00469       slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
00470       YYLLOC_DEFAULT (yyloc, slice, yylen);
00471     }
00472     YY_REDUCE_PRINT (yyn);
00473     switch (yyn)
00474       {
00475           case 2:
00476 
00477 /* Line 690 of lalr1.cc  */
00478 #line 141 "ct_parser.ypp"
00479     {
00480   std::vector<boost::shared_ptr<Constraint> > ivld_constrs = assembler.dump_invalidations(param_specs);
00481   constraints.insert(constraints.end(), ivld_constrs.begin(), ivld_constrs.end());
00482 }
00483     break;
00484 
00485   case 11:
00486 
00487 /* Line 690 of lalr1.cc  */
00488 #line 156 "ct_parser.ypp"
00489     {
00490     param_specs.insert(param_specs.end(), (yysemantic_stack_[(2) - (2)].vec_param_spec)->begin(), (yysemantic_stack_[(2) - (2)].vec_param_spec)->end());
00491     delete (yysemantic_stack_[(2) - (2)].vec_param_spec);
00492   }
00493     break;
00494 
00495   case 12:
00496 
00497 /* Line 690 of lalr1.cc  */
00498 #line 164 "ct_parser.ypp"
00499     {
00500     (yyval.vec_param_spec) = new std::vector<boost::shared_ptr<ParamSpec> >();
00501     for (std::size_t i = 0; i < (yysemantic_stack_[(3) - (2)].vec_str)->size(); ++i) {
00502       TRY_BEGIN
00503       if (find_param_id(param_specs, (*(yysemantic_stack_[(3) - (2)].vec_str))[i]) != PID_BOUND) {
00504         assembler.reportWarning(gen_yylloc_str(yylloc, (std::string("parameter redefinition of ") + (*(yysemantic_stack_[(3) - (2)].vec_str))[i]).c_str()));
00505         continue;
00506       }
00507       ParamSpec *param_spec = assembler.asm_paramspec(*(yysemantic_stack_[(3) - (1)].str), (*(yysemantic_stack_[(3) - (2)].vec_str))[i], std::vector<boost::shared_ptr<TreeNode> >());
00508       if (param_spec == 0) {
00509         assembler.reportWarning(gen_yylloc_str(yylloc, (std::string("cannot assemble parameter ") + (*(yysemantic_stack_[(3) - (2)].vec_str))[i]).c_str()));
00510         continue;
00511       }
00512       (yyval.vec_param_spec)->push_back(boost::shared_ptr<ParamSpec>(param_spec));
00513       TRY_END
00514     }
00515     delete (yysemantic_stack_[(3) - (1)].str); delete (yysemantic_stack_[(3) - (2)].vec_str);
00516   }
00517     break;
00518 
00519   case 13:
00520 
00521 /* Line 690 of lalr1.cc  */
00522 #line 183 "ct_parser.ypp"
00523     {
00524     (yyval.vec_param_spec) = new std::vector<boost::shared_ptr<ParamSpec> >();
00525     for (std::size_t i = 0; i < (yysemantic_stack_[(5) - (2)].vec_str)->size(); ++i) {
00526       TRY_BEGIN
00527       if (find_param_id(param_specs, (*(yysemantic_stack_[(5) - (2)].vec_str))[i]) != PID_BOUND) {
00528         assembler.reportWarning(gen_yylloc_str(yylloc, (std::string("parameter redefinition of ") + (*(yysemantic_stack_[(5) - (2)].vec_str))[i]).c_str()));
00529         continue;
00530       }
00531       ParamSpec *param_spec = assembler.asm_paramspec(*(yysemantic_stack_[(5) - (1)].str), (*(yysemantic_stack_[(5) - (2)].vec_str))[i], *(yysemantic_stack_[(5) - (4)].vec_exp));
00532       if (param_spec == 0) {
00533         assembler.reportWarning(gen_yylloc_str(yylloc, (std::string("cannot assemble parameter ") + (*(yysemantic_stack_[(5) - (2)].vec_str))[i]).c_str()));
00534         continue;
00535       }
00536       (yyval.vec_param_spec)->push_back(boost::shared_ptr<ParamSpec>(param_spec));
00537       TRY_END
00538     }
00539     delete (yysemantic_stack_[(5) - (1)].str); delete (yysemantic_stack_[(5) - (2)].vec_str); delete (yysemantic_stack_[(5) - (4)].vec_exp);
00540   }
00541     break;
00542 
00543   case 14:
00544 
00545 /* Line 690 of lalr1.cc  */
00546 #line 202 "ct_parser.ypp"
00547     {
00548     (yyval.vec_param_spec) = new std::vector<boost::shared_ptr<ParamSpec> >();
00549     for (std::size_t i = 0; i < (yysemantic_stack_[(6) - (3)].vec_str)->size(); ++i) {
00550       TRY_BEGIN
00551       if (find_param_id(param_specs, (*(yysemantic_stack_[(6) - (3)].vec_str))[i]) != PID_BOUND) {
00552         assembler.reportWarning(gen_yylloc_str(yylloc, (std::string("parameter redefinition of ") + (*(yysemantic_stack_[(6) - (3)].vec_str))[i]).c_str()));
00553         continue;
00554       }
00555       ParamSpec *param_spec = assembler.asm_paramspec(*(yysemantic_stack_[(6) - (2)].str), (*(yysemantic_stack_[(6) - (3)].vec_str))[i], *(yysemantic_stack_[(6) - (5)].vec_exp));
00556       if (param_spec == 0) {
00557         assembler.reportWarning(gen_yylloc_str(yylloc, (std::string("cannot assemble parameter ") + (*(yysemantic_stack_[(6) - (3)].vec_str))[i]).c_str()));
00558         continue;
00559       }
00560       param_spec->set_aux(true);
00561       (yyval.vec_param_spec)->push_back(boost::shared_ptr<ParamSpec>(param_spec));
00562       TRY_END
00563     }
00564     delete (yysemantic_stack_[(6) - (2)].str); delete (yysemantic_stack_[(6) - (3)].vec_str); delete (yysemantic_stack_[(6) - (5)].vec_exp);
00565   }
00566     break;
00567 
00568   case 15:
00569 
00570 /* Line 690 of lalr1.cc  */
00571 #line 222 "ct_parser.ypp"
00572     {
00573     (yyval.vec_param_spec) = new std::vector<boost::shared_ptr<ParamSpec> >();
00574     TRY_BEGIN
00575     std::vector<std::pair<boost::shared_ptr<TreeNode>, boost::shared_ptr<TreeNode> > > auto_value_cases;
00576     Constraint_L_CBool *ctrue = new Constraint_L_CBool();
00577     ctrue->set_value(true);
00578     auto_value_cases.push_back(std::pair<boost::shared_ptr<TreeNode>, boost::shared_ptr<TreeNode> >(boost::shared_ptr<TreeNode>(ctrue), boost::shared_ptr<TreeNode>((yysemantic_stack_[(6) - (5)].tree_node))));
00579     for (std::size_t i = 0; i < (yysemantic_stack_[(6) - (3)].vec_str)->size(); ++i) {
00580       TRY_BEGIN
00581       if (find_param_id(param_specs, (*(yysemantic_stack_[(6) - (3)].vec_str))[i]) != PID_BOUND) {
00582         CT_EXCEPTION((std::string("parameter redefinition of ") + (*(yysemantic_stack_[(6) - (3)].vec_str))[i]).c_str());
00583       }
00584       ParamSpec *param_spec = assembler.asm_paramspec(*(yysemantic_stack_[(6) - (2)].str), (*(yysemantic_stack_[(6) - (3)].vec_str))[i], auto_value_cases);
00585       (yyval.vec_param_spec)->push_back(boost::shared_ptr<ParamSpec>(param_spec));
00586       TRY_END
00587     }
00588     TRY_END
00589     delete (yysemantic_stack_[(6) - (2)].str); delete (yysemantic_stack_[(6) - (3)].vec_str);
00590   }
00591     break;
00592 
00593   case 16:
00594 
00595 /* Line 690 of lalr1.cc  */
00596 #line 242 "ct_parser.ypp"
00597     {
00598     (yyval.vec_param_spec) = new std::vector<boost::shared_ptr<ParamSpec> >();
00599     TRY_BEGIN
00600     for (std::size_t i = 0; i < (yysemantic_stack_[(8) - (3)].vec_str)->size(); ++i) {
00601       TRY_BEGIN
00602       if (find_param_id(param_specs, (*(yysemantic_stack_[(8) - (3)].vec_str))[i]) != PID_BOUND) {
00603         CT_EXCEPTION((std::string("parameter redefinition of ") + (*(yysemantic_stack_[(8) - (3)].vec_str))[i]).c_str());
00604       }
00605       ParamSpec *param_spec = assembler.asm_paramspec(*(yysemantic_stack_[(8) - (2)].str), (*(yysemantic_stack_[(8) - (3)].vec_str))[i], *(yysemantic_stack_[(8) - (6)].vec_auto_value_cases));
00606       (yyval.vec_param_spec)->push_back(boost::shared_ptr<ParamSpec>(param_spec));
00607       TRY_END
00608     }
00609     TRY_END
00610     delete (yysemantic_stack_[(8) - (2)].str); delete (yysemantic_stack_[(8) - (3)].vec_str); delete (yysemantic_stack_[(8) - (6)].vec_auto_value_cases);
00611   }
00612     break;
00613 
00614   case 17:
00615 
00616 /* Line 690 of lalr1.cc  */
00617 #line 259 "ct_parser.ypp"
00618     {
00619     (yyval.vec_auto_value_cases) = new std::vector<std::pair<boost::shared_ptr<TreeNode>, boost::shared_ptr<TreeNode> > >();
00620     if ((yysemantic_stack_[(1) - (1)].auto_value_case)) {
00621       (yyval.vec_auto_value_cases)->push_back(*(yysemantic_stack_[(1) - (1)].auto_value_case));
00622     }
00623     delete (yysemantic_stack_[(1) - (1)].auto_value_case);
00624   }
00625     break;
00626 
00627   case 18:
00628 
00629 /* Line 690 of lalr1.cc  */
00630 #line 267 "ct_parser.ypp"
00631     {
00632     (yyval.vec_auto_value_cases) = (yysemantic_stack_[(3) - (1)].vec_auto_value_cases);
00633     if ((yysemantic_stack_[(3) - (1)].vec_auto_value_cases)) {
00634       (yyval.vec_auto_value_cases)->push_back(*(yysemantic_stack_[(3) - (3)].auto_value_case));
00635     }
00636     delete (yysemantic_stack_[(3) - (3)].auto_value_case);
00637   }
00638     break;
00639 
00640   case 19:
00641 
00642 /* Line 690 of lalr1.cc  */
00643 #line 275 "ct_parser.ypp"
00644     {
00645     (yyval.auto_value_case) = 0;
00646     TRY_BEGIN
00647     // no type check, the second tree_obj can be Exp or Constraint
00648     (yyval.auto_value_case) = new std::pair<boost::shared_ptr<TreeNode>, boost::shared_ptr<TreeNode> >(boost::shared_ptr<TreeNode>((yysemantic_stack_[(3) - (1)].tree_node)), boost::shared_ptr<TreeNode>((yysemantic_stack_[(3) - (3)].tree_node)));
00649     TRY_END
00650   }
00651     break;
00652 
00653   case 20:
00654 
00655 /* Line 690 of lalr1.cc  */
00656 #line 282 "ct_parser.ypp"
00657     {
00658     TRY_BEGIN
00659     boost::shared_ptr<Constraint_L_CBool> c_true(new Constraint_L_CBool());
00660     c_true->set_value(true);
00661     (yyval.auto_value_case) = new std::pair<boost::shared_ptr<TreeNode>, boost::shared_ptr<TreeNode> >(c_true, boost::shared_ptr<TreeNode>((yysemantic_stack_[(3) - (3)].tree_node)));
00662     TRY_END
00663   }
00664     break;
00665 
00666   case 21:
00667 
00668 /* Line 690 of lalr1.cc  */
00669 #line 292 "ct_parser.ypp"
00670     { (yyval.vec_exp) = (yysemantic_stack_[(1) - (1)].vec_exp); }
00671     break;
00672 
00673   case 22:
00674 
00675 /* Line 690 of lalr1.cc  */
00676 #line 293 "ct_parser.ypp"
00677     { (yyval.vec_exp) = (yysemantic_stack_[(3) - (1)].vec_exp); if ((yysemantic_stack_[(3) - (3)].vec_exp)) { (yyval.vec_exp)->insert((yyval.vec_exp)->end(), (yysemantic_stack_[(3) - (3)].vec_exp)->begin(), (yysemantic_stack_[(3) - (3)].vec_exp)->end()); delete (yysemantic_stack_[(3) - (3)].vec_exp); } }
00678     break;
00679 
00680   case 23:
00681 
00682 /* Line 690 of lalr1.cc  */
00683 #line 295 "ct_parser.ypp"
00684     { (yyval.vec_exp) = (yysemantic_stack_[(1) - (1)].vec_exp); }
00685     break;
00686 
00687   case 24:
00688 
00689 /* Line 690 of lalr1.cc  */
00690 #line 296 "ct_parser.ypp"
00691     { (yyval.vec_exp) = new std::vector<boost::shared_ptr<TreeNode> >(); if ((yysemantic_stack_[(1) - (1)].tree_node)) { (yyval.vec_exp)->push_back(boost::shared_ptr<TreeNode>((yysemantic_stack_[(1) - (1)].tree_node))); } }
00692     break;
00693 
00694   case 25:
00695 
00696 /* Line 690 of lalr1.cc  */
00697 #line 298 "ct_parser.ypp"
00698     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00699     break;
00700 
00701   case 26:
00702 
00703 /* Line 690 of lalr1.cc  */
00704 #line 299 "ct_parser.ypp"
00705     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00706     break;
00707 
00708   case 27:
00709 
00710 /* Line 690 of lalr1.cc  */
00711 #line 300 "ct_parser.ypp"
00712     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00713     break;
00714 
00715   case 28:
00716 
00717 /* Line 690 of lalr1.cc  */
00718 #line 301 "ct_parser.ypp"
00719     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00720     break;
00721 
00722   case 29:
00723 
00724 /* Line 690 of lalr1.cc  */
00725 #line 302 "ct_parser.ypp"
00726     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00727     break;
00728 
00729   case 30:
00730 
00731 /* Line 690 of lalr1.cc  */
00732 #line 303 "ct_parser.ypp"
00733     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00734     break;
00735 
00736   case 31:
00737 
00738 /* Line 690 of lalr1.cc  */
00739 #line 305 "ct_parser.ypp"
00740     {
00741     TYPE_ASSERT((yysemantic_stack_[(2) - (2)].tree_node), Exp_A_CInt*);
00742     Exp_A_CInt *exp = dynamic_cast<Exp_A_CInt *>((yysemantic_stack_[(2) - (2)].tree_node));
00743     exp->set_value(-exp->get_value());
00744     exp->set_str_value(std::string("-")+exp->get_str_value());
00745     (yyval.tree_node) = exp;
00746   }
00747     break;
00748 
00749   case 32:
00750 
00751 /* Line 690 of lalr1.cc  */
00752 #line 313 "ct_parser.ypp"
00753     {
00754       TYPE_ASSERT((yysemantic_stack_[(2) - (2)].tree_node), Exp_A_CDouble*);
00755     Exp_A_CDouble *exp = dynamic_cast<Exp_A_CDouble *>((yysemantic_stack_[(2) - (2)].tree_node));
00756     exp->set_value(-exp->get_value());
00757     exp->set_str_value(std::string("-")+exp->get_str_value());
00758     (yyval.tree_node) = exp;
00759   }
00760     break;
00761 
00762   case 33:
00763 
00764 /* Line 690 of lalr1.cc  */
00765 #line 322 "ct_parser.ypp"
00766     {
00767     TRY_BEGIN
00768     TYPE_ASSERT((yysemantic_stack_[(5) - (2)].tree_node), Exp_A_CInt*);
00769     TYPE_ASSERT((yysemantic_stack_[(5) - (4)].tree_node), Exp_A_CInt*);
00770     int val_begin = dynamic_cast<Exp_A_CInt*>((yysemantic_stack_[(5) - (2)].tree_node))->get_value();
00771     int val_end = dynamic_cast<Exp_A_CInt*>((yysemantic_stack_[(5) - (4)].tree_node))->get_value();
00772     int step = (val_begin <= val_end) ? 1 : -1;
00773     (yyval.vec_exp) = new std::vector<boost::shared_ptr<TreeNode> >();
00774     for (int val = val_begin; val <= val_end; val += step) {
00775       Exp_A_CInt *exp = new Exp_A_CInt();
00776       exp->set_value(val);
00777       std::stringstream ss;
00778       ss << val;
00779       exp->set_str_value(ss.str());
00780       exp->set_type(EAT_INT);
00781       (yyval.vec_exp)->push_back(boost::shared_ptr<TreeNode>(exp));
00782     }
00783     TRY_END
00784     delete (yysemantic_stack_[(5) - (2)].tree_node);
00785     delete (yysemantic_stack_[(5) - (4)].tree_node);
00786   }
00787     break;
00788 
00789   case 34:
00790 
00791 /* Line 690 of lalr1.cc  */
00792 #line 344 "ct_parser.ypp"
00793     {
00794     TRY_BEGIN
00795     TYPE_ASSERT((yysemantic_stack_[(7) - (2)].tree_node), Exp_A_CInt*);
00796     TYPE_ASSERT((yysemantic_stack_[(7) - (4)].tree_node), Exp_A_CInt*);
00797     TYPE_ASSERT((yysemantic_stack_[(7) - (6)].tree_node), Exp_A_CInt*);
00798     int val_begin = dynamic_cast<Exp_A_CInt*>((yysemantic_stack_[(7) - (2)].tree_node))->get_value();
00799     int val_end = dynamic_cast<Exp_A_CInt*>((yysemantic_stack_[(7) - (4)].tree_node))->get_value();
00800     int step = dynamic_cast<Exp_A_CInt*>((yysemantic_stack_[(7) - (6)].tree_node))->get_value();
00801     (yyval.vec_exp) = new std::vector<boost::shared_ptr<TreeNode> >();
00802     int sign = (step > 0) ? 1 : -1;
00803     for (int val = val_begin; sign * (val - val_end) <= 0; val += step) {
00804       Exp_A_CInt *exp = new Exp_A_CInt();
00805       exp->set_value(val);
00806       std::stringstream ss;
00807       ss << val;
00808       exp->set_str_value(ss.str());
00809       exp->set_type(EAT_INT);
00810       (yyval.vec_exp)->push_back(boost::shared_ptr<TreeNode>(exp));
00811     }
00812     TRY_END
00813     delete (yysemantic_stack_[(7) - (2)].tree_node);
00814     delete (yysemantic_stack_[(7) - (4)].tree_node);
00815     delete (yysemantic_stack_[(7) - (6)].tree_node);
00816   }
00817     break;
00818 
00819   case 35:
00820 
00821 /* Line 690 of lalr1.cc  */
00822 #line 368 "ct_parser.ypp"
00823     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00824     break;
00825 
00826   case 36:
00827 
00828 /* Line 690 of lalr1.cc  */
00829 #line 369 "ct_parser.ypp"
00830     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00831     break;
00832 
00833   case 37:
00834 
00835 /* Line 690 of lalr1.cc  */
00836 #line 371 "ct_parser.ypp"
00837     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00838     break;
00839 
00840   case 38:
00841 
00842 /* Line 690 of lalr1.cc  */
00843 #line 372 "ct_parser.ypp"
00844     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00845     break;
00846 
00847   case 39:
00848 
00849 /* Line 690 of lalr1.cc  */
00850 #line 373 "ct_parser.ypp"
00851     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00852     break;
00853 
00854   case 40:
00855 
00856 /* Line 690 of lalr1.cc  */
00857 #line 374 "ct_parser.ypp"
00858     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
00859     break;
00860 
00861   case 41:
00862 
00863 /* Line 690 of lalr1.cc  */
00864 #line 377 "ct_parser.ypp"
00865     {
00866     Exp_S_CString *exp = new Exp_S_CString();
00867     exp->set_value(*(yysemantic_stack_[(1) - (1)].str));
00868     (yyval.tree_node) = exp;
00869     delete (yysemantic_stack_[(1) - (1)].str);
00870   }
00871     break;
00872 
00873   case 42:
00874 
00875 /* Line 690 of lalr1.cc  */
00876 #line 385 "ct_parser.ypp"
00877     {
00878     Exp_A_CDouble *tmp = new Exp_A_CDouble();
00879     tmp->set_value(atof((yysemantic_stack_[(1) - (1)].str)->c_str()));
00880     tmp->set_str_value(*(yysemantic_stack_[(1) - (1)].str));
00881     tmp->set_type(EAT_DOUBLE);
00882     (yyval.tree_node) = tmp;
00883     delete (yysemantic_stack_[(1) - (1)].str);
00884   }
00885     break;
00886 
00887   case 43:
00888 
00889 /* Line 690 of lalr1.cc  */
00890 #line 395 "ct_parser.ypp"
00891     {
00892     Exp_A_CInt *tmp = new Exp_A_CInt();
00893     tmp->set_value(atoi((yysemantic_stack_[(1) - (1)].str)->c_str()));
00894     tmp->set_str_value(*(yysemantic_stack_[(1) - (1)].str));
00895     tmp->set_type(EAT_INT);
00896     (yyval.tree_node) = tmp;
00897     delete (yysemantic_stack_[(1) - (1)].str);
00898   }
00899     break;
00900 
00901   case 44:
00902 
00903 /* Line 690 of lalr1.cc  */
00904 #line 404 "ct_parser.ypp"
00905     {
00906     TRY_BEGIN
00907     (yyval.tree_node) = assembler.asm_constraint_l_cbool(*(yysemantic_stack_[(1) - (1)].str));
00908     TRY_END
00909     delete (yysemantic_stack_[(1) - (1)].str);
00910 }
00911     break;
00912 
00913   case 47:
00914 
00915 /* Line 690 of lalr1.cc  */
00916 #line 416 "ct_parser.ypp"
00917     {
00918     TRY_BEGIN assembler.attach_strengths(param_specs, *(yysemantic_stack_[(4) - (1)].vec_str), strengths, atoi((yysemantic_stack_[(4) - (3)].str)->c_str())); TRY_END
00919     delete (yysemantic_stack_[(4) - (1)].vec_str); delete (yysemantic_stack_[(4) - (3)].str);
00920   }
00921     break;
00922 
00923   case 48:
00924 
00925 /* Line 690 of lalr1.cc  */
00926 #line 420 "ct_parser.ypp"
00927     {
00928     TRY_BEGIN assembler.attach_default_strengths(param_specs, strengths, atoi((yysemantic_stack_[(4) - (3)].str)->c_str())); TRY_END
00929     delete (yysemantic_stack_[(4) - (3)].str);
00930   }
00931     break;
00932 
00933   case 49:
00934 
00935 /* Line 690 of lalr1.cc  */
00936 #line 426 "ct_parser.ypp"
00937     { (yyval.vec_str) = (yysemantic_stack_[(1) - (1)].vec_str); }
00938     break;
00939 
00940   case 50:
00941 
00942 /* Line 690 of lalr1.cc  */
00943 #line 427 "ct_parser.ypp"
00944     { (yyval.vec_str) = (yysemantic_stack_[(3) - (1)].vec_str); (yyval.vec_str)->insert((yyval.vec_str)->end(), (yysemantic_stack_[(3) - (3)].vec_str)->begin(), (yysemantic_stack_[(3) - (3)].vec_str)->end()); delete (yysemantic_stack_[(3) - (3)].vec_str); }
00945     break;
00946 
00947   case 51:
00948 
00949 /* Line 690 of lalr1.cc  */
00950 #line 430 "ct_parser.ypp"
00951     { (yyval.vec_str) = new std::vector<std::string>(); (yyval.vec_str)->push_back(*(yysemantic_stack_[(1) - (1)].str)); delete (yysemantic_stack_[(1) - (1)].str); }
00952     break;
00953 
00954   case 52:
00955 
00956 /* Line 690 of lalr1.cc  */
00957 #line 431 "ct_parser.ypp"
00958     {
00959     // only positive integers are allowed in the subscript
00960     (yyval.vec_str) = new std::vector<std::string>();
00961     for (int i = atoi((yysemantic_stack_[(6) - (3)].str)->c_str()); i <= atoi((yysemantic_stack_[(6) - (5)].str)->c_str()); ++i) {
00962       std::ostringstream ss;
00963       ss << *(yysemantic_stack_[(6) - (1)].str) << i;
00964       (yyval.vec_str)->push_back(ss.str());
00965     }
00966   }
00967     break;
00968 
00969   case 55:
00970 
00971 /* Line 690 of lalr1.cc  */
00972 #line 445 "ct_parser.ypp"
00973     {
00974     Seed *seed = assembler.asm_seed(seeds.size(), *(yysemantic_stack_[(2) - (1)].tuple));
00975     seeds.push_back(boost::shared_ptr<Seed>(seed));
00976     delete (yysemantic_stack_[(2) - (1)].tuple); }
00977     break;
00978 
00979   case 56:
00980 
00981 /* Line 690 of lalr1.cc  */
00982 #line 449 "ct_parser.ypp"
00983     {
00984     Seed *seed = assembler.asm_seed(seeds.size(), *(yysemantic_stack_[(3) - (2)].tuple));
00985     seed->set_is_starter(true);
00986     seeds.push_back(boost::shared_ptr<Seed>(seed));
00987     delete (yysemantic_stack_[(3) - (2)].tuple); }
00988     break;
00989 
00990   case 57:
00991 
00992 /* Line 690 of lalr1.cc  */
00993 #line 454 "ct_parser.ypp"
00994     {
00995     TRY_BEGIN
00996     TYPE_ASSERT((yysemantic_stack_[(2) - (1)].tree_node), Constraint*);
00997     Seed *seed = assembler.asm_seed(seeds.size(), (Constraint*)(yysemantic_stack_[(2) - (1)].tree_node));  // $1 is stored in the seed, don't delete!!
00998     seeds.push_back(boost::shared_ptr<Seed>(seed));
00999     TRY_END }
01000     break;
01001 
01002   case 58:
01003 
01004 /* Line 690 of lalr1.cc  */
01005 #line 460 "ct_parser.ypp"
01006     {
01007     TRY_BEGIN
01008     TYPE_ASSERT((yysemantic_stack_[(3) - (2)].tree_node), Constraint*);
01009     Seed *seed = assembler.asm_seed(seeds.size(), (Constraint*)(yysemantic_stack_[(3) - (2)].tree_node));  // $2 is stored in the seed, don't delete!!
01010     seed->set_is_starter(true);
01011     seeds.push_back(boost::shared_ptr<Seed>(seed));
01012     TRY_END }
01013     break;
01014 
01015   case 59:
01016 
01017 /* Line 690 of lalr1.cc  */
01018 #line 468 "ct_parser.ypp"
01019     {
01020     (yyval.tuple) = new Tuple();
01021     if ((yysemantic_stack_[(1) - (1)].pvpair)) {
01022       (yyval.tuple)->push_back(*(yysemantic_stack_[(1) - (1)].pvpair));
01023       delete (yysemantic_stack_[(1) - (1)].pvpair);
01024     } else {
01025       assembler.reportWarning(gen_yylloc_str(yylloc, "neglected bad pvpair"));
01026     }
01027   }
01028     break;
01029 
01030   case 60:
01031 
01032 /* Line 690 of lalr1.cc  */
01033 #line 477 "ct_parser.ypp"
01034     {
01035     (yyval.tuple) = (yysemantic_stack_[(3) - (1)].tuple);
01036     if ((yysemantic_stack_[(3) - (3)].pvpair)) {
01037       (yyval.tuple)->push_back(*(yysemantic_stack_[(3) - (3)].pvpair));
01038       delete (yysemantic_stack_[(3) - (3)].pvpair);
01039     } else {
01040       assembler.reportWarning(gen_yylloc_str(yylloc, "neglected null pvpair"));
01041     }
01042   }
01043     break;
01044 
01045   case 61:
01046 
01047 /* Line 690 of lalr1.cc  */
01048 #line 487 "ct_parser.ypp"
01049     { (yyval.pvpair) = 0; TRY_BEGIN (yyval.pvpair) = assembler.asm_pvpair(param_specs, *(yysemantic_stack_[(3) - (1)].str), (yysemantic_stack_[(3) - (3)].tree_node)); TRY_END delete (yysemantic_stack_[(3) - (1)].str); delete (yysemantic_stack_[(3) - (3)].tree_node); }
01050     break;
01051 
01052   case 64:
01053 
01054 /* Line 690 of lalr1.cc  */
01055 #line 492 "ct_parser.ypp"
01056     { TRY_BEGIN TYPE_ASSERT((yysemantic_stack_[(2) - (1)].tree_node), Constraint*); Constraint *tmp = dynamic_cast<Constraint *>((yysemantic_stack_[(2) - (1)].tree_node)); constraints.push_back(boost::shared_ptr<Constraint>(tmp)); TRY_END }
01057     break;
01058 
01059   case 65:
01060 
01061 /* Line 690 of lalr1.cc  */
01062 #line 493 "ct_parser.ypp"
01063     { TRY_BEGIN assembler.store_invalidation(param_specs, *(yysemantic_stack_[(6) - (4)].vec_str), boost::shared_ptr<TreeNode>((yysemantic_stack_[(6) - (1)].tree_node))); TRY_END }
01064     break;
01065 
01066   case 66:
01067 
01068 /* Line 690 of lalr1.cc  */
01069 #line 497 "ct_parser.ypp"
01070     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_asb((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_EQ, *(yysemantic_stack_[(3) - (2)].str)); TRY_END delete (yysemantic_stack_[(3) - (2)].str); }
01071     break;
01072 
01073   case 67:
01074 
01075 /* Line 690 of lalr1.cc  */
01076 #line 498 "ct_parser.ypp"
01077     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_asb((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_NE, *(yysemantic_stack_[(3) - (2)].str)); TRY_END delete (yysemantic_stack_[(3) - (2)].str); }
01078     break;
01079 
01080   case 68:
01081 
01082 /* Line 690 of lalr1.cc  */
01083 #line 499 "ct_parser.ypp"
01084     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_asb((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_GT, *(yysemantic_stack_[(3) - (2)].str)); TRY_END delete (yysemantic_stack_[(3) - (2)].str); }
01085     break;
01086 
01087   case 69:
01088 
01089 /* Line 690 of lalr1.cc  */
01090 #line 500 "ct_parser.ypp"
01091     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_asb((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_GE, *(yysemantic_stack_[(3) - (2)].str)); TRY_END delete (yysemantic_stack_[(3) - (2)].str); }
01092     break;
01093 
01094   case 70:
01095 
01096 /* Line 690 of lalr1.cc  */
01097 #line 501 "ct_parser.ypp"
01098     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_asb((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_LT, *(yysemantic_stack_[(3) - (2)].str)); TRY_END delete (yysemantic_stack_[(3) - (2)].str); }
01099     break;
01100 
01101   case 71:
01102 
01103 /* Line 690 of lalr1.cc  */
01104 #line 502 "ct_parser.ypp"
01105     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_asb((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_LE, *(yysemantic_stack_[(3) - (2)].str)); TRY_END delete (yysemantic_stack_[(3) - (2)].str); }
01106     break;
01107 
01108   case 72:
01109 
01110 /* Line 690 of lalr1.cc  */
01111 #line 504 "ct_parser.ypp"
01112     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_l((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_AND); TRY_END }
01113     break;
01114 
01115   case 73:
01116 
01117 /* Line 690 of lalr1.cc  */
01118 #line 505 "ct_parser.ypp"
01119     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_l((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_OR); TRY_END }
01120     break;
01121 
01122   case 74:
01123 
01124 /* Line 690 of lalr1.cc  */
01125 #line 506 "ct_parser.ypp"
01126     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_l((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_IMPLY); TRY_END }
01127     break;
01128 
01129   case 75:
01130 
01131 /* Line 690 of lalr1.cc  */
01132 #line 507 "ct_parser.ypp"
01133     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_l((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_IFF); TRY_END }
01134     break;
01135 
01136   case 76:
01137 
01138 /* Line 690 of lalr1.cc  */
01139 #line 508 "ct_parser.ypp"
01140     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_l((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_XOR); TRY_END }
01141     break;
01142 
01143   case 77:
01144 
01145 /* Line 690 of lalr1.cc  */
01146 #line 509 "ct_parser.ypp"
01147     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_l((yysemantic_stack_[(2) - (2)].tree_node), OP_NOT); TRY_END }
01148     break;
01149 
01150   case 78:
01151 
01152 /* Line 690 of lalr1.cc  */
01153 #line 511 "ct_parser.ypp"
01154     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_ADD); TRY_END }
01155     break;
01156 
01157   case 79:
01158 
01159 /* Line 690 of lalr1.cc  */
01160 #line 512 "ct_parser.ypp"
01161     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_SUB); TRY_END }
01162     break;
01163 
01164   case 80:
01165 
01166 /* Line 690 of lalr1.cc  */
01167 #line 513 "ct_parser.ypp"
01168     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_MULT); TRY_END }
01169     break;
01170 
01171   case 81:
01172 
01173 /* Line 690 of lalr1.cc  */
01174 #line 514 "ct_parser.ypp"
01175     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_DIV); TRY_END }
01176     break;
01177 
01178   case 82:
01179 
01180 /* Line 690 of lalr1.cc  */
01181 #line 515 "ct_parser.ypp"
01182     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(3) - (1)].tree_node), (yysemantic_stack_[(3) - (3)].tree_node), OP_MOD); TRY_END }
01183     break;
01184 
01185   case 83:
01186 
01187 /* Line 690 of lalr1.cc  */
01188 #line 516 "ct_parser.ypp"
01189     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(2) - (2)].tree_node), OP_NEG); TRY_END }
01190     break;
01191 
01192   case 84:
01193 
01194 /* Line 690 of lalr1.cc  */
01195 #line 517 "ct_parser.ypp"
01196     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a((yysemantic_stack_[(2) - (2)].tree_node), OP_UPLUS); TRY_END }
01197     break;
01198 
01199   case 85:
01200 
01201 /* Line 690 of lalr1.cc  */
01202 #line 519 "ct_parser.ypp"
01203     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_param(param_specs, *(yysemantic_stack_[(1) - (1)].str)); delete (yysemantic_stack_[(1) - (1)].str); TRY_END }
01204     break;
01205 
01206   case 86:
01207 
01208 /* Line 690 of lalr1.cc  */
01209 #line 520 "ct_parser.ypp"
01210     { (yyval.tree_node) = (yysemantic_stack_[(1) - (1)].tree_node); }
01211     break;
01212 
01213   case 87:
01214 
01215 /* Line 690 of lalr1.cc  */
01216 #line 521 "ct_parser.ypp"
01217     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_exp_a_cast((yysemantic_stack_[(4) - (3)].tree_node), *(yysemantic_stack_[(4) - (1)].str)); TRY_END delete (yysemantic_stack_[(4) - (1)].str); }
01218     break;
01219 
01220   case 88:
01221 
01222 /* Line 690 of lalr1.cc  */
01223 #line 522 "ct_parser.ypp"
01224     { (yyval.tree_node) = (yysemantic_stack_[(3) - (2)].tree_node); }
01225     break;
01226 
01227   case 89:
01228 
01229 /* Line 690 of lalr1.cc  */
01230 #line 523 "ct_parser.ypp"
01231     { (yyval.tree_node) = 0; TRY_BEGIN (yyval.tree_node) = assembler.asm_constraint_invalid(param_specs, *(yysemantic_stack_[(4) - (3)].str)); TRY_END }
01232     break;
01233 
01234   case 92:
01235 
01236 /* Line 690 of lalr1.cc  */
01237 #line 528 "ct_parser.ypp"
01238     { TRY_BEGIN assembler.set_option(*(yysemantic_stack_[(4) - (1)].str),(yysemantic_stack_[(4) - (3)].tree_node)); TRY_END delete (yysemantic_stack_[(4) - (1)].str); delete (yysemantic_stack_[(4) - (3)].tree_node); }
01239     break;
01240 
01241 
01242 
01243 /* Line 690 of lalr1.cc  */
01244 #line 1245 "ct_parser.tab.cpp"
01245         default:
01246           break;
01247       }
01248     /* User semantic actions sometimes alter yychar, and that requires
01249        that yytoken be updated with the new translation.  We take the
01250        approach of translating immediately before every use of yytoken.
01251        One alternative is translating here after every semantic action,
01252        but that translation would be missed if the semantic action
01253        invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
01254        yychar.  In the case of YYABORT or YYACCEPT, an incorrect
01255        destructor might then be invoked immediately.  In the case of
01256        YYERROR, subsequent parser actions might lead to an incorrect
01257        destructor call or verbose syntax error message before the
01258        lookahead is translated.  */
01259     YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
01260 
01261     yypop_ (yylen);
01262     yylen = 0;
01263     YY_STACK_PRINT ();
01264 
01265     yysemantic_stack_.push (yyval);
01266     yylocation_stack_.push (yyloc);
01267 
01268     /* Shift the result of the reduction.  */
01269     yyn = yyr1_[yyn];
01270     yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
01271     if (0 <= yystate && yystate <= yylast_
01272         && yycheck_[yystate] == yystate_stack_[0])
01273       yystate = yytable_[yystate];
01274     else
01275       yystate = yydefgoto_[yyn - yyntokens_];
01276     goto yynewstate;
01277 
01278   /*------------------------------------.
01279   | yyerrlab -- here on detecting error |
01280   `------------------------------------*/
01281   yyerrlab:
01282     /* Make sure we have latest lookahead translation.  See comments at
01283        user semantic actions for why this is necessary.  */
01284     yytoken = yytranslate_ (yychar);
01285 
01286     /* If not already recovering from an error, report this error.  */
01287     if (!yyerrstatus_)
01288       {
01289         ++yynerrs_;
01290         if (yychar == yyempty_)
01291           yytoken = yyempty_;
01292         error (yylloc, yysyntax_error_ (yystate, yytoken));
01293       }
01294 
01295     yyerror_range[1] = yylloc;
01296     if (yyerrstatus_ == 3)
01297       {
01298         /* If just tried and failed to reuse lookahead token after an
01299          error, discard it.  */
01300 
01301         if (yychar <= yyeof_)
01302           {
01303           /* Return failure if at end of input.  */
01304           if (yychar == yyeof_)
01305             YYABORT;
01306           }
01307         else
01308           {
01309             yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
01310             yychar = yyempty_;
01311           }
01312       }
01313 
01314     /* Else will try to reuse lookahead token after shifting the error
01315        token.  */
01316     goto yyerrlab1;
01317 
01318 
01319   /*---------------------------------------------------.
01320   | yyerrorlab -- error raised explicitly by YYERROR.  |
01321   `---------------------------------------------------*/
01322   yyerrorlab:
01323 
01324     /* Pacify compilers like GCC when the user code never invokes
01325        YYERROR and the label yyerrorlab therefore never appears in user
01326        code.  */
01327     if (false)
01328       goto yyerrorlab;
01329 
01330     yyerror_range[1] = yylocation_stack_[yylen - 1];
01331     /* Do not reclaim the symbols of the rule which action triggered
01332        this YYERROR.  */
01333     yypop_ (yylen);
01334     yylen = 0;
01335     yystate = yystate_stack_[0];
01336     goto yyerrlab1;
01337 
01338   /*-------------------------------------------------------------.
01339   | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01340   `-------------------------------------------------------------*/
01341   yyerrlab1:
01342     yyerrstatus_ = 3;   /* Each real token shifted decrements this.  */
01343 
01344     for (;;)
01345       {
01346         yyn = yypact_[yystate];
01347         if (!yy_pact_value_is_default_ (yyn))
01348         {
01349           yyn += yyterror_;
01350           if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
01351             {
01352               yyn = yytable_[yyn];
01353               if (0 < yyn)
01354                 break;
01355             }
01356         }
01357 
01358         /* Pop the current state because it cannot handle the error token.  */
01359         if (yystate_stack_.height () == 1)
01360         YYABORT;
01361 
01362         yyerror_range[1] = yylocation_stack_[0];
01363         yydestruct_ ("Error: popping",
01364                      yystos_[yystate],
01365                      &yysemantic_stack_[0], &yylocation_stack_[0]);
01366         yypop_ ();
01367         yystate = yystate_stack_[0];
01368         YY_STACK_PRINT ();
01369       }
01370 
01371     yyerror_range[2] = yylloc;
01372     // Using YYLLOC is tempting, but would change the location of
01373     // the lookahead.  YYLOC is available though.
01374     YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
01375     yysemantic_stack_.push (yylval);
01376     yylocation_stack_.push (yyloc);
01377 
01378     /* Shift the error token.  */
01379     YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
01380                      &yysemantic_stack_[0], &yylocation_stack_[0]);
01381 
01382     yystate = yyn;
01383     goto yynewstate;
01384 
01385     /* Accept.  */
01386   yyacceptlab:
01387     yyresult = 0;
01388     goto yyreturn;
01389 
01390     /* Abort.  */
01391   yyabortlab:
01392     yyresult = 1;
01393     goto yyreturn;
01394 
01395   yyreturn:
01396     if (yychar != yyempty_)
01397       {
01398         /* Make sure we have latest lookahead translation.  See comments
01399            at user semantic actions for why this is necessary.  */
01400         yytoken = yytranslate_ (yychar);
01401         yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
01402                      &yylloc);
01403       }
01404 
01405     /* Do not reclaim the symbols of the rule which action triggered
01406        this YYABORT or YYACCEPT.  */
01407     yypop_ (yylen);
01408     while (yystate_stack_.height () != 1)
01409       {
01410         yydestruct_ ("Cleanup: popping",
01411                    yystos_[yystate_stack_[0]],
01412                    &yysemantic_stack_[0],
01413                    &yylocation_stack_[0]);
01414         yypop_ ();
01415       }
01416 
01417     return yyresult;
01418   }
01419 
01420   // Generate an error message.
01421   std::string
01422   ct_parser::yysyntax_error_ (int yystate, int yytoken)
01423   {
01424     std::string yyres;
01425     // Number of reported tokens (one for the "unexpected", one per
01426     // "expected").
01427     size_t yycount = 0;
01428     // Its maximum.
01429     enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01430     // Arguments of yyformat.
01431     char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01432 
01433     /* There are many possibilities here to consider:
01434        - If this state is a consistent state with a default action, then
01435          the only way this function was invoked is if the default action
01436          is an error action.  In that case, don't check for expected
01437          tokens because there are none.
01438        - The only way there can be no lookahead present (in yytoken) is
01439          if this state is a consistent state with a default action.
01440          Thus, detecting the absence of a lookahead is sufficient to
01441          determine that there is no unexpected or expected token to
01442          report.  In that case, just report a simple "syntax error".
01443        - Don't assume there isn't a lookahead just because this state is
01444          a consistent state with a default action.  There might have
01445          been a previous inconsistent state, consistent state with a
01446          non-default action, or user semantic action that manipulated
01447          yychar.
01448        - Of course, the expected token list depends on states to have
01449          correct lookahead information, and it depends on the parser not
01450          to perform extra reductions after fetching a lookahead from the
01451          scanner and before detecting a syntax error.  Thus, state
01452          merging (from LALR or IELR) and default reductions corrupt the
01453          expected token list.  However, the list is correct for
01454          canonical LR with one exception: it will still contain any
01455          token that will not be accepted due to an error action in a
01456          later state.
01457     */
01458     if (yytoken != yyempty_)
01459       {
01460         yyarg[yycount++] = yytname_[yytoken];
01461         int yyn = yypact_[yystate];
01462         if (!yy_pact_value_is_default_ (yyn))
01463           {
01464             /* Start YYX at -YYN if negative to avoid negative indexes in
01465                YYCHECK.  In other words, skip the first -YYN actions for
01466                this state because they are default actions.  */
01467             int yyxbegin = yyn < 0 ? -yyn : 0;
01468             /* Stay within bounds of both yycheck and yytname.  */
01469             int yychecklim = yylast_ - yyn + 1;
01470             int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
01471             for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
01472               if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
01473                   && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
01474                 {
01475                   if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01476                     {
01477                       yycount = 1;
01478                       break;
01479                     }
01480                   else
01481                     yyarg[yycount++] = yytname_[yyx];
01482                 }
01483           }
01484       }
01485 
01486     char const* yyformat = 0;
01487     switch (yycount)
01488       {
01489 #define YYCASE_(N, S)                         \
01490         case N:                               \
01491           yyformat = S;                       \
01492         break
01493         YYCASE_(0, YY_("syntax error"));
01494         YYCASE_(1, YY_("syntax error, unexpected %s"));
01495         YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
01496         YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
01497         YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
01498         YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
01499 #undef YYCASE_
01500       }
01501 
01502     // Argument number.
01503     size_t yyi = 0;
01504     for (char const* yyp = yyformat; *yyp; ++yyp)
01505       if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
01506         {
01507           yyres += yytnamerr_ (yyarg[yyi++]);
01508           ++yyp;
01509         }
01510       else
01511         yyres += *yyp;
01512     return yyres;
01513   }
01514 
01515 
01516   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
01517      STATE-NUM.  */
01518   const short int ct_parser::yypact_ninf_ = -143;
01519   const short int
01520   ct_parser::yypact_[] =
01521   {
01522        195,  -143,  -143,  -143,  -143,  -143,    18,   195,  -143,   136,
01523       -1,   119,   160,    22,  -143,  -143,    31,    46,    49,  -143,
01524      -10,    40,  -143,    96,  -143,    73,    74,  -143,  -143,  -143,
01525     -143,   171,    88,   160,   160,   160,   160,  -143,  -143,  -143,
01526     -143,  -143,  -143,   -32,  -143,   215,  -143,  -143,   190,    87,
01527     -143,    58,    31,    31,   134,   141,   149,    31,   160,    16,
01528       41,   240,   157,  -143,  -143,  -143,   316,  -143,   168,   160,
01529      160,   160,   160,   160,   160,   160,   160,   160,   160,   160,
01530      160,   160,   160,   160,   160,  -143,   142,  -143,    65,     0,
01531     -143,   106,   109,   151,   139,   140,  -143,   340,   174,  -143,
01532     -143,  -143,  -143,  -143,  -143,  -143,  -143,  -143,   145,  -143,
01533       74,  -143,    78,    78,     9,     9,     9,     9,   388,   388,
01534      388,   412,   412,    83,    83,  -143,  -143,  -143,    31,   143,
01535       -5,    53,  -143,  -143,  -143,     0,    75,   184,  -143,  -143,
01536     -143,  -143,  -143,  -143,    -2,  -143,   191,  -143,   154,  -143,
01537     -143,     0,   123,   130,   265,   152,   172,    -5,  -143,  -143,
01538      175,   -44,  -143,   290,  -143,  -143,  -143,    42,   160,   130,
01539      177,   160,    -5,  -143,   364,  -143,  -143,   364,   169,  -143
01540   };
01541 
01542   /* YYDEFACT[S] -- default reduction number in state S.  Performed when
01543      YYTABLE doesn't specify something else to do.  Zero means the
01544      default is an error.  */
01545   const unsigned char
01546   ct_parser::yydefact_[] =
01547   {
01548          0,    10,    45,    53,    62,    90,     0,     2,     3,     5,
01549        6,     7,     8,     9,     1,     4,     0,     0,     0,    11,
01550       51,     0,    46,     0,    49,     0,    85,    41,    42,    43,
01551       44,     0,     0,     0,     0,     0,     0,    86,    37,    39,
01552       38,    40,    54,     0,    59,     0,    85,    63,     0,     0,
01553       91,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01554        0,     0,     0,    77,    84,    83,     0,    55,     0,     0,
01555        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
01556        0,     0,     0,     0,     0,    57,     0,    64,     0,     0,
01557       12,     0,     0,     0,     0,     0,    50,     0,     0,    61,
01558       29,    30,    25,    27,    26,    28,    56,    58,     0,    88,
01559        0,    60,    66,    67,    68,    69,    70,    71,    72,    73,
01560       76,    74,    75,    78,    79,    80,    81,    82,     0,     0,
01561        0,     0,    21,    24,    23,     0,     0,     0,    48,    47,
01562       87,    32,    31,    89,     0,    92,     0,    36,     0,    35,
01563       13,     0,     0,     0,     0,     0,     0,     0,    22,    14,
01564        0,     0,    17,     0,    15,    52,    65,     0,     0,     0,
01565        0,     0,     0,    33,    20,    18,    16,    19,     0,    34
01566   };
01567 
01568   /* YYPGOTO[NTERM-NUM].  */
01569   const short int
01570   ct_parser::yypgoto_[] =
01571   {
01572       -143,  -143,  -143,   223,  -143,  -143,  -143,    63,    99,    97,
01573      179,  -116,  -143,  -143,  -142,   161,   -54,   -55,   -56,   -53,
01574     -143,  -143,   -14,   194,  -143,  -143,   222,   187,  -143,  -143,
01575      -11,  -143,  -143
01576   };
01577 
01578   /* YYDEFGOTO[NTERM-NUM].  */
01579   const short int
01580   ct_parser::yydefgoto_[] =
01581   {
01582         -1,     6,     7,     8,     9,    19,   161,   162,   131,   132,
01583      133,   100,   101,   134,   148,    37,    38,    39,    40,    41,
01584       10,    22,    23,    24,    11,    42,    43,    44,    12,    47,
01585      163,    13,    50
01586   };
01587 
01588   /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
01589      positive, shift that token.  If negative, reduce the rule which
01590      number is the opposite.  If YYTABLE_NINF_, syntax error.  */
01591   const signed char ct_parser::yytable_ninf_ = -1;
01592   const unsigned char
01593   ct_parser::yytable_[] =
01594   {
01595         45,    48,    51,   104,   103,   102,   105,    29,    20,   169,
01596       27,    28,    29,    30,   147,   167,    21,   170,    14,    67,
01597       61,    68,    63,    64,    65,    66,    27,    28,    29,    30,
01598      178,    49,   146,   104,   103,   102,   105,    98,    91,    92,
01599       20,   147,   142,   141,    80,   156,    81,    97,    82,    54,
01600       83,    57,    84,    98,    52,   130,   147,    53,   112,   113,
01601      114,   115,   116,   117,   118,   119,   120,   121,   122,   123,
01602      124,   125,   126,   127,   149,    27,    28,    29,    30,   104,
01603      103,   102,   105,    25,    46,    27,    28,    29,    30,    55,
01604      142,   172,   106,    32,    68,   104,   103,   102,   105,   173,
01605       71,   149,    72,    73,   150,    74,   151,    89,    33,    90,
01606       34,    57,    35,    80,   144,    81,   149,    82,    58,    83,
01607       36,    84,    82,    59,    83,   154,    84,    25,    26,    27,
01608       28,    29,    30,    62,   153,    31,    88,    32,    25,    46,
01609       27,    28,    29,    30,    16,    56,    93,   160,    32,    57,
01610       17,    18,    33,    94,    34,   135,    35,   174,   136,    57,
01611      177,    95,    57,    33,    36,    34,   108,    35,    25,    46,
01612       27,    28,    29,    30,   159,    36,   151,   110,    32,    25,
01613       26,    27,    28,    29,    30,    28,    29,   128,   137,    32,
01614      138,   139,   143,    33,   145,    34,   155,    35,     1,     2,
01615        3,     4,     5,    29,    33,    36,    34,   157,    35,    86,
01616       69,    70,    71,   165,    72,    73,    36,    74,    75,    76,
01617       77,    78,    79,   166,   168,    80,   179,    81,   176,    82,
01618       15,    83,   175,    84,   152,    69,    70,    71,    99,    72,
01619       73,    87,    74,    75,    76,    77,    78,    79,   158,   129,
01620       80,    96,    81,    60,    82,   111,    83,     0,    84,     0,
01621       69,    70,    71,     0,    72,    73,    85,    74,    75,    76,
01622       77,    78,    79,     0,     0,    80,     0,    81,     0,    82,
01623        0,    83,     0,    84,     0,    69,    70,    71,     0,    72,
01624       73,   107,    74,    75,    76,    77,    78,    79,     0,     0,
01625       80,     0,    81,     0,    82,     0,    83,     0,    84,     0,
01626       69,    70,    71,     0,    72,    73,   164,    74,    75,    76,
01627       77,    78,    79,     0,     0,    80,     0,    81,     0,    82,
01628        0,    83,     0,    84,     0,     0,    69,    70,    71,   171,
01629       72,    73,     0,    74,    75,    76,    77,    78,    79,     0,
01630        0,    80,     0,    81,     0,    82,     0,    83,     0,    84,
01631       69,    70,    71,   109,    72,    73,     0,    74,    75,    76,
01632       77,    78,    79,     0,     0,    80,     0,    81,     0,    82,
01633        0,    83,     0,    84,    69,    70,    71,   140,    72,    73,
01634        0,    74,    75,    76,    77,    78,    79,     0,     0,    80,
01635        0,    81,     0,    82,     0,    83,     0,    84,    69,    70,
01636       71,     0,    72,    73,     0,    74,     0,     0,     0,    78,
01637       79,     0,     0,    80,     0,    81,     0,    82,     0,    83,
01638        0,    84,    69,    70,    71,     0,    72,    73,     0,    74,
01639        0,     0,     0,     0,     0,     0,     0,    80,     0,    81,
01640        0,    82,     0,    83,     0,    84
01641   };
01642 
01643   /* YYCHECK.  */
01644   const short int
01645   ct_parser::yycheck_[] =
01646   {
01647         11,    12,    16,    59,    59,    59,    59,    12,     9,    53,
01648       10,    11,    12,    13,   130,   157,    17,    61,     0,    51,
01649       31,    53,    33,    34,    35,    36,    10,    11,    12,    13,
01650      172,     9,    37,    89,    89,    89,    89,    37,    52,    53,
01651        9,   157,    98,    98,    35,    47,    37,    58,    39,    59,
01652       41,    53,    43,    37,     8,    55,   172,     8,    69,    70,
01653       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
01654       81,    82,    83,    84,   130,    10,    11,    12,    13,   135,
01655      135,   135,   135,     8,     9,    10,    11,    12,    13,    49,
01656      146,    49,    51,    18,    53,   151,   151,   151,   151,    57,
01657       22,   157,    24,    25,    51,    27,    53,    49,    33,    51,
01658       35,    53,    37,    35,   128,    37,   172,    39,    45,    41,
01659       45,    43,    39,    49,    41,   136,    43,     8,     9,    10,
01660       11,    12,    13,    45,    59,    16,    49,    18,     8,     9,
01661       10,    11,    12,    13,     8,    49,    12,    17,    18,    53,
01662       14,    15,    33,    12,    35,    49,    37,   168,    49,    53,
01663      171,    12,    53,    33,    45,    35,     9,    37,     8,     9,
01664       10,    11,    12,    13,    51,    45,    53,     9,    18,     8,
01665        9,    10,    11,    12,    13,    11,    12,    45,    37,    18,
01666       51,    51,    47,    33,    51,    35,    12,    37,     3,     4,
01667        5,     6,     7,    12,    33,    45,    35,    53,    37,    19,
01668       20,    21,    22,    61,    24,    25,    45,    27,    28,    29,
01669       30,    31,    32,    51,    49,    35,    57,    37,    51,    39,
01670        7,    41,   169,    43,   135,    20,    21,    22,    59,    24,
01671       25,    51,    27,    28,    29,    30,    31,    32,   151,    88,
01672       35,    57,    37,    31,    39,    68,    41,    -1,    43,    -1,
01673       20,    21,    22,    -1,    24,    25,    51,    27,    28,    29,
01674       30,    31,    32,    -1,    -1,    35,    -1,    37,    -1,    39,
01675       -1,    41,    -1,    43,    -1,    20,    21,    22,    -1,    24,
01676       25,    51,    27,    28,    29,    30,    31,    32,    -1,    -1,
01677       35,    -1,    37,    -1,    39,    -1,    41,    -1,    43,    -1,
01678       20,    21,    22,    -1,    24,    25,    51,    27,    28,    29,
01679       30,    31,    32,    -1,    -1,    35,    -1,    37,    -1,    39,
01680       -1,    41,    -1,    43,    -1,    -1,    20,    21,    22,    49,
01681       24,    25,    -1,    27,    28,    29,    30,    31,    32,    -1,
01682       -1,    35,    -1,    37,    -1,    39,    -1,    41,    -1,    43,
01683       20,    21,    22,    47,    24,    25,    -1,    27,    28,    29,
01684       30,    31,    32,    -1,    -1,    35,    -1,    37,    -1,    39,
01685       -1,    41,    -1,    43,    20,    21,    22,    47,    24,    25,
01686       -1,    27,    28,    29,    30,    31,    32,    -1,    -1,    35,
01687       -1,    37,    -1,    39,    -1,    41,    -1,    43,    20,    21,
01688       22,    -1,    24,    25,    -1,    27,    -1,    -1,    -1,    31,
01689       32,    -1,    -1,    35,    -1,    37,    -1,    39,    -1,    41,
01690       -1,    43,    20,    21,    22,    -1,    24,    25,    -1,    27,
01691       -1,    -1,    -1,    -1,    -1,    -1,    -1,    35,    -1,    37,
01692       -1,    39,    -1,    41,    -1,    43
01693   };
01694 
01695   /* STOS_[STATE-NUM] -- The (internal number of the) accessing
01696      symbol of state STATE-NUM.  */
01697   const unsigned char
01698   ct_parser::yystos_[] =
01699   {
01700          0,     3,     4,     5,     6,     7,    66,    67,    68,    69,
01701       85,    89,    93,    96,     0,    68,     8,    14,    15,    70,
01702        9,    17,    86,    87,    88,     8,     9,    10,    11,    12,
01703       13,    16,    18,    33,    35,    37,    45,    80,    81,    82,
01704       83,    84,    90,    91,    92,    95,     9,    94,    95,     9,
01705       97,    87,     8,     8,    59,    49,    49,    53,    45,    49,
01706       91,    95,    45,    95,    95,    95,    95,    51,    53,    20,
01707       21,    22,    24,    25,    27,    28,    29,    30,    31,    32,
01708       35,    37,    39,    41,    43,    51,    19,    51,    49,    49,
01709       51,    87,    87,    12,    12,    12,    88,    95,    37,    75,
01710       76,    77,    81,    82,    83,    84,    51,    51,     9,    47,
01711        9,    92,    95,    95,    95,    95,    95,    95,    95,    95,
01712       95,    95,    95,    95,    95,    95,    95,    95,    45,    80,
01713       55,    73,    74,    75,    78,    49,    49,    37,    51,    51,
01714       47,    82,    83,    47,    87,    51,    37,    76,    79,    83,
01715       51,    53,    73,    59,    95,    12,    47,    53,    74,    51,
01716       17,    71,    72,    95,    51,    61,    51,    79,    49,    53,
01717       61,    49,    49,    57,    95,    72,    51,    95,    79,    57
01718   };
01719 
01720 #if YYDEBUG
01721   /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
01722      to YYLEX-NUM.  */
01723   const unsigned short int
01724   ct_parser::yytoken_number_[] =
01725   {
01726          0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
01727      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
01728      275,   276,   277,    62,   278,   279,    60,   280,   281,   282,
01729      283,   284,   285,   286,    33,   287,    43,   288,    45,   289,
01730       42,   290,    47,   291,    37,   292,    40,   293,    41,   294,
01731       58,   295,    59,   296,    44,   297,    91,   298,    93,   299,
01732      123,   300,   125,   301,   302
01733   };
01734 #endif
01735 
01736   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
01737   const unsigned char
01738   ct_parser::yyr1_[] =
01739   {
01740          0,    65,    66,    67,    67,    68,    68,    68,    68,    68,
01741       69,    69,    70,    70,    70,    70,    70,    71,    71,    72,
01742       72,    73,    73,    74,    74,    75,    75,    75,    75,    75,
01743       75,    76,    77,    78,    78,    79,    79,    80,    80,    80,
01744       80,    81,    82,    83,    84,    85,    85,    86,    86,    87,
01745       87,    88,    88,    89,    89,    90,    90,    90,    90,    91,
01746       91,    92,    93,    93,    94,    94,    95,    95,    95,    95,
01747       95,    95,    95,    95,    95,    95,    95,    95,    95,    95,
01748       95,    95,    95,    95,    95,    95,    95,    95,    95,    95,
01749       96,    96,    97
01750   };
01751 
01752   /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
01753   const unsigned char
01754   ct_parser::yyr2_[] =
01755   {
01756          0,     2,     1,     1,     2,     1,     1,     1,     1,     1,
01757        1,     2,     3,     5,     6,     6,     8,     1,     3,     3,
01758        3,     1,     3,     1,     1,     1,     1,     1,     1,     1,
01759        1,     2,     2,     5,     7,     1,     1,     1,     1,     1,
01760        1,     1,     1,     1,     1,     1,     2,     4,     4,     1,
01761        3,     1,     6,     1,     2,     2,     3,     2,     3,     1,
01762        3,     3,     1,     2,     2,     6,     3,     3,     3,     3,
01763        3,     3,     3,     3,     3,     3,     3,     2,     3,     3,
01764        3,     3,     3,     2,     2,     1,     1,     4,     3,     4,
01765        1,     2,     4
01766   };
01767 
01768 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
01769   /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
01770      First, the terminals, then, starting at \a yyntokens_, nonterminals.  */
01771   const char*
01772   const ct_parser::yytname_[] =
01773   {
01774     "\"end of file\"", "error", "$undefined", "\"[PARAMETERS]\"",
01775   "\"[STRENGTHS]\"", "\"[SEEDS]\"", "\"[CONSTRAINTS]\"", "\"[OPTIONS]\"",
01776   "\"type specifier\"", "\"parameter name\"", "\"string value\"",
01777   "\"double value\"", "\"integer value\"", "\"bool value\"", "\"__aux__\"",
01778   "\"__auto__\"", "\"__starter__\"", "\"default\"", "\"#\"", "\"##\"",
01779   "\"==\"", "\"!=\"", "TKN_GT", "'>'", "\">=\"", "TKN_LT", "'<'", "\"<=\"",
01780   "\"&&\"", "\"||\"", "\"^^\"", "\"->\"", "\"<->\"", "TKN_NOT", "'!'",
01781   "TKN_ADD", "'+'", "TKN_SUB", "'-'", "TKN_MULT", "'*'", "TKN_DIV", "'/'",
01782   "TKN_MOD", "'%'", "TKN_BRACKET_O", "'('", "TKN_BRACKET_C", "')'",
01783   "TKN_COLON", "':'", "TKN_SEMICOLON", "';'", "TKN_COMMA", "','",
01784   "TKN_CORNER_BRACKET_O", "'['", "TKN_CORNER_BRACKET_C", "']'",
01785   "TKN_CURLY_BRACKET_O", "'{'", "TKN_CURLY_BRACKET_C", "'}'", "TKN_UPLUS",
01786   "TKN_NEG", "$accept", "input", "sections", "section",
01787   "parameters_section", "parameters_line", "auto_value_cases",
01788   "auto_value_case", "ps_set", "ps_values", "ps_value", "neg_value_i",
01789   "neg_value_d", "range", "range_int_val", "value", "value_s", "value_d",
01790   "value_i", "value_b", "strengths_section", "strengths_line",
01791   "param_list", "param_list_item", "seeds_section", "seeds_line", "tuple",
01792   "tuple_item", "constraints_section", "constraints_line", "tree_obj",
01793   "options_section", "options_line", 0
01794   };
01795 #endif
01796 
01797 #if YYDEBUG
01798   /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
01799   const ct_parser::rhs_number_type
01800   ct_parser::yyrhs_[] =
01801   {
01802         66,     0,    -1,    67,    -1,    68,    -1,    67,    68,    -1,
01803       69,    -1,    85,    -1,    89,    -1,    93,    -1,    96,    -1,
01804        3,    -1,    69,    70,    -1,     8,    87,    51,    -1,     8,
01805       87,    49,    73,    51,    -1,    14,     8,    87,    49,    73,
01806       51,    -1,    15,     8,    87,    49,    95,    51,    -1,    15,
01807        8,    87,    49,    59,    71,    61,    51,    -1,    72,    -1,
01808       71,    53,    72,    -1,    95,    49,    95,    -1,    17,    49,
01809       95,    -1,    74,    -1,    73,    53,    74,    -1,    78,    -1,
01810       75,    -1,    81,    -1,    83,    -1,    82,    -1,    84,    -1,
01811       76,    -1,    77,    -1,    37,    83,    -1,    37,    82,    -1,
01812       55,    79,    53,    79,    57,    -1,    55,    79,    53,    79,
01813       49,    79,    57,    -1,    83,    -1,    76,    -1,    81,    -1,
01814       83,    -1,    82,    -1,    84,    -1,    10,    -1,    11,    -1,
01815       12,    -1,    13,    -1,     4,    -1,    85,    86,    -1,    87,
01816       49,    12,    51,    -1,    17,    49,    12,    51,    -1,    88,
01817       -1,    87,    53,    88,    -1,     9,    -1,     9,    59,    12,
01818       37,    12,    61,    -1,     5,    -1,    89,    90,    -1,    91,
01819       51,    -1,    16,    91,    51,    -1,    95,    51,    -1,    16,
01820       95,    51,    -1,    92,    -1,    91,    53,    92,    -1,     9,
01821       49,    75,    -1,     6,    -1,    93,    94,    -1,    95,    51,
01822       -1,    95,    19,    45,    87,    47,    51,    -1,    95,    20,
01823       95,    -1,    95,    21,    95,    -1,    95,    22,    95,    -1,
01824       95,    24,    95,    -1,    95,    25,    95,    -1,    95,    27,
01825       95,    -1,    95,    28,    95,    -1,    95,    29,    95,    -1,
01826       95,    31,    95,    -1,    95,    32,    95,    -1,    95,    30,
01827       95,    -1,    33,    95,    -1,    95,    35,    95,    -1,    95,
01828       37,    95,    -1,    95,    39,    95,    -1,    95,    41,    95,
01829       -1,    95,    43,    95,    -1,    37,    95,    -1,    35,    95,
01830       -1,     9,    -1,    80,    -1,     8,    45,    95,    47,    -1,
01831       45,    95,    47,    -1,    18,    45,     9,    47,    -1,     7,
01832       -1,    96,    97,    -1,     9,    49,    80,    51,    -1
01833   };
01834 
01835   /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
01836      YYRHS.  */
01837   const unsigned short int
01838   ct_parser::yyprhs_[] =
01839   {
01840          0,     0,     3,     5,     7,    10,    12,    14,    16,    18,
01841       20,    22,    25,    29,    35,    42,    49,    58,    60,    64,
01842       68,    72,    74,    78,    80,    82,    84,    86,    88,    90,
01843       92,    94,    97,   100,   106,   114,   116,   118,   120,   122,
01844      124,   126,   128,   130,   132,   134,   136,   139,   144,   149,
01845      151,   155,   157,   164,   166,   169,   172,   176,   179,   183,
01846      185,   189,   193,   195,   198,   201,   208,   212,   216,   220,
01847      224,   228,   232,   236,   240,   244,   248,   252,   255,   259,
01848      263,   267,   271,   275,   278,   281,   283,   285,   290,   294,
01849      299,   301,   304
01850   };
01851 
01852   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
01853   const unsigned short int
01854   ct_parser::yyrline_[] =
01855   {
01856          0,   141,   141,   146,   147,   149,   150,   151,   152,   153,
01857      155,   156,   163,   182,   201,   221,   241,   258,   266,   275,
01858      282,   292,   293,   295,   296,   298,   299,   300,   301,   302,
01859      303,   305,   313,   321,   343,   368,   369,   371,   372,   373,
01860      374,   377,   385,   395,   404,   411,   412,   415,   420,   426,
01861      427,   430,   431,   441,   442,   445,   449,   454,   460,   468,
01862      477,   487,   489,   490,   492,   493,   497,   498,   499,   500,
01863      501,   502,   504,   505,   506,   507,   508,   509,   511,   512,
01864      513,   514,   515,   516,   517,   519,   520,   521,   522,   523,
01865      525,   526,   528
01866   };
01867 
01868   // Print the state stack on the debug stream.
01869   void
01870   ct_parser::yystack_print_ ()
01871   {
01872     *yycdebug_ << "Stack now";
01873     for (state_stack_type::const_iterator i = yystate_stack_.begin ();
01874          i != yystate_stack_.end (); ++i)
01875       *yycdebug_ << ' ' << *i;
01876     *yycdebug_ << std::endl;
01877   }
01878 
01879   // Report on the debug stream that the rule \a yyrule is going to be reduced.
01880   void
01881   ct_parser::yy_reduce_print_ (int yyrule)
01882   {
01883     unsigned int yylno = yyrline_[yyrule];
01884     int yynrhs = yyr2_[yyrule];
01885     /* Print the symbols being reduced, and their result.  */
01886     *yycdebug_ << "Reducing stack by rule " << yyrule - 1
01887                << " (line " << yylno << "):" << std::endl;
01888     /* The symbols being reduced.  */
01889     for (int yyi = 0; yyi < yynrhs; yyi++)
01890       YY_SYMBOL_PRINT ("   $" << yyi + 1 << " =",
01891                        yyrhs_[yyprhs_[yyrule] + yyi],
01892                        &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
01893                        &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
01894   }
01895 #endif // YYDEBUG
01896 
01897   /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
01898   ct_parser::token_number_type
01899   ct_parser::yytranslate_ (int t)
01900   {
01901     static
01902     const token_number_type
01903     translate_table[] =
01904     {
01905            0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01906        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01907        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01908        2,     2,     2,    34,     2,     2,     2,    44,     2,     2,
01909       46,    48,    40,    36,    54,    38,     2,    42,     2,     2,
01910        2,     2,     2,     2,     2,     2,     2,     2,    50,    52,
01911       26,     2,    23,     2,     2,     2,     2,     2,     2,     2,
01912        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01913        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01914        2,    56,     2,    58,     2,     2,     2,     2,     2,     2,
01915        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01916        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01917        2,     2,     2,    60,     2,    62,     2,     2,     2,     2,
01918        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01919        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01920        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01921        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01922        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01923        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01924        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01925        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01926        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01927        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01928        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01929        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
01930        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
01931        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
01932       15,    16,    17,    18,    19,    20,    21,    22,    24,    25,
01933       27,    28,    29,    30,    31,    32,    33,    35,    37,    39,
01934       41,    43,    45,    47,    49,    51,    53,    55,    57,    59,
01935       61,    63,    64
01936     };
01937     if ((unsigned int) t <= yyuser_token_number_max_)
01938       return translate_table[t];
01939     else
01940       return yyundef_token_;
01941   }
01942 
01943   const int ct_parser::yyeof_ = 0;
01944   const int ct_parser::yylast_ = 455;
01945   const int ct_parser::yynnts_ = 33;
01946   const int ct_parser::yyempty_ = -2;
01947   const int ct_parser::yyfinal_ = 14;
01948   const int ct_parser::yyterror_ = 1;
01949   const int ct_parser::yyerrcode_ = 256;
01950   const int ct_parser::yyntokens_ = 65;
01951 
01952   const unsigned int ct_parser::yyuser_token_number_max_ = 302;
01953   const ct_parser::token_number_type ct_parser::yyundef_token_ = 2;
01954 
01955 
01956 } // yy
01957 
01958 /* Line 1136 of lalr1.cc  */
01959 #line 1960 "ct_parser.tab.cpp"
01960 
01961 
01962 /* Line 1138 of lalr1.cc  */
01963 #line 530 "ct_parser.ypp"
01964 
01965 
01966 #include <iostream>
01967 yy::ct_parser::token_type
01968 yylex(yy::ct_parser::semantic_type *yylval, yy::ct_parser::location_type *yylloc, ct::lexer &qlex) {
01969   ct::lexer_Token* token;
01970   qlex.receive(&token);
01971   if (token->get_text().length()>0)
01972   {
01973     yylval->str = new std::string((char *)token->get_text().c_str());
01974     yylloc->step();
01975     yylloc->end.line = token->line_number();
01976     yylloc->end.column = token->column_number()+token->get_text().length();
01977   }
01978   return (yy::ct_parser::token_type)token->type_id();
01979 }
01980 
01981 void yy::ct_parser::error(const yy::ct_parser::location_type &loc, const std::string &s) {
01982   std::stringstream ss;
01983   ss << loc.begin.line << ":" << loc.begin.column << "-" << loc.end.line << ":" << loc.end.column << ": " << s;
01984   assembler.reportError(ss.str());
01985 }
01986 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines