1 // A Bison parser, made by GNU Bison 3.7.5.
2 
3 // Skeleton implementation for Bison LALR(1) parsers in C++
4 
5 // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
6 
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 
17 // You should have received a copy of the GNU General Public License
18 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton.  Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
29 
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
32 
33 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
34 // especially those whose name start with YY_ or yy_.  They are
35 // private implementation details that can be changed or removed.
36 
37 
38 
39 
40 
41 #include "parser.tab.hh"
42 
43 
44 // Unqualified %code blocks.
45 #line 22 "parser.yy"
46 
47 #include "symengine/pow.h"
48 #include "symengine/logic.h"
49 #include "symengine/parser/parser.h"
50 
51 using SymEngine::RCP;
52 using SymEngine::Basic;
53 using SymEngine::vec_basic;
54 using SymEngine::rcp_static_cast;
55 using SymEngine::mul;
56 using SymEngine::pow;
57 using SymEngine::add;
58 using SymEngine::sub;
59 using SymEngine::Lt;
60 using SymEngine::Gt;
61 using SymEngine::Le;
62 using SymEngine::Ge;
63 using SymEngine::Ne;
64 using SymEngine::Eq;
65 using SymEngine::set_boolean;
66 using SymEngine::Boolean;
67 using SymEngine::one;
68 using SymEngine::vec_boolean;
69 
70 #include "symengine/parser/tokenizer.h"
71 
72 namespace yy
73 {
74 
yylex(yy::parser::semantic_type * yylval,SymEngine::Parser & p)75 int yylex(yy::parser::semantic_type* yylval, SymEngine::Parser &p)
76 {
77     return p.m_tokenizer->lex(yylval);
78 }
79 
error(const std::string & msg)80 void parser::error(const std::string &msg)
81 {
82     throw SymEngine::ParseError(msg);
83 }
84 
85 }
86 
87 
88 #line 89 "parser.tab.cc"
89 
90 
91 #ifndef YY_
92 # if defined YYENABLE_NLS && YYENABLE_NLS
93 #  if ENABLE_NLS
94 #   include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
95 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
96 #  endif
97 # endif
98 # ifndef YY_
99 #  define YY_(msgid) msgid
100 # endif
101 #endif
102 
103 
104 // Whether we are compiled with exception support.
105 #ifndef YY_EXCEPTIONS
106 # if defined __GNUC__ && !defined __EXCEPTIONS
107 #  define YY_EXCEPTIONS 0
108 # else
109 #  define YY_EXCEPTIONS 1
110 # endif
111 #endif
112 
113 
114 
115 // Enable debugging if requested.
116 #if YYDEBUG
117 
118 // A pseudo ostream that takes yydebug_ into account.
119 # define YYCDEBUG if (yydebug_) (*yycdebug_)
120 
121 # define YY_SYMBOL_PRINT(Title, Symbol)         \
122   do {                                          \
123     if (yydebug_)                               \
124     {                                           \
125       *yycdebug_ << Title << ' ';               \
126       yy_print_ (*yycdebug_, Symbol);           \
127       *yycdebug_ << '\n';                       \
128     }                                           \
129   } while (false)
130 
131 # define YY_REDUCE_PRINT(Rule)          \
132   do {                                  \
133     if (yydebug_)                       \
134       yy_reduce_print_ (Rule);          \
135   } while (false)
136 
137 # define YY_STACK_PRINT()               \
138   do {                                  \
139     if (yydebug_)                       \
140       yy_stack_print_ ();                \
141   } while (false)
142 
143 #else // !YYDEBUG
144 
145 # define YYCDEBUG if (false) std::cerr
146 # define YY_SYMBOL_PRINT(Title, Symbol)  YY_USE (Symbol)
147 # define YY_REDUCE_PRINT(Rule)           static_cast<void> (0)
148 # define YY_STACK_PRINT()                static_cast<void> (0)
149 
150 #endif // !YYDEBUG
151 
152 #define yyerrok         (yyerrstatus_ = 0)
153 #define yyclearin       (yyla.clear ())
154 
155 #define YYACCEPT        goto yyacceptlab
156 #define YYABORT         goto yyabortlab
157 #define YYERROR         goto yyerrorlab
158 #define YYRECOVERING()  (!!yyerrstatus_)
159 
160 namespace yy {
161 #line 162 "parser.tab.cc"
162 
163   /// Build a parser object.
parser(SymEngine::Parser & p_yyarg)164   parser::parser (SymEngine::Parser &p_yyarg)
165 #if YYDEBUG
166     : yydebug_ (false),
167       yycdebug_ (&std::cerr),
168 #else
169     :
170 #endif
171       p (p_yyarg)
172   {}
173 
~parser()174   parser::~parser ()
175   {}
176 
~syntax_error()177   parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
178   {}
179 
180   /*---------------.
181   | symbol kinds.  |
182   `---------------*/
183 
184   // basic_symbol.
185   template <typename Base>
basic_symbol(const basic_symbol & that)186   parser::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
187     : Base (that)
188     , value ()
189   {
190     switch (this->kind ())
191     {
192       case symbol_kind::S_st_expr: // st_expr
193       case symbol_kind::S_expr: // expr
194       case symbol_kind::S_leaf: // leaf
195       case symbol_kind::S_func: // func
196         value.copy< SymEngine::RCP<const SymEngine::Basic> > (YY_MOVE (that.value));
197         break;
198 
199       case symbol_kind::S_expr_list: // expr_list
200         value.copy< SymEngine::vec_basic > (YY_MOVE (that.value));
201         break;
202 
203       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
204       case symbol_kind::S_NUMERIC: // NUMERIC
205       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
206         value.copy< std::string > (YY_MOVE (that.value));
207         break;
208 
209       default:
210         break;
211     }
212 
213   }
214 
215 
216 
217   template <typename Base>
218   parser::symbol_kind_type
type_get() const219   parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
220   {
221     return this->kind ();
222   }
223 
224   template <typename Base>
225   bool
empty() const226   parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
227   {
228     return this->kind () == symbol_kind::S_YYEMPTY;
229   }
230 
231   template <typename Base>
232   void
move(basic_symbol & s)233   parser::basic_symbol<Base>::move (basic_symbol& s)
234   {
235     super_type::move (s);
236     switch (this->kind ())
237     {
238       case symbol_kind::S_st_expr: // st_expr
239       case symbol_kind::S_expr: // expr
240       case symbol_kind::S_leaf: // leaf
241       case symbol_kind::S_func: // func
242         value.move< SymEngine::RCP<const SymEngine::Basic> > (YY_MOVE (s.value));
243         break;
244 
245       case symbol_kind::S_expr_list: // expr_list
246         value.move< SymEngine::vec_basic > (YY_MOVE (s.value));
247         break;
248 
249       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
250       case symbol_kind::S_NUMERIC: // NUMERIC
251       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
252         value.move< std::string > (YY_MOVE (s.value));
253         break;
254 
255       default:
256         break;
257     }
258 
259   }
260 
261   // by_kind.
by_kind()262   parser::by_kind::by_kind ()
263     : kind_ (symbol_kind::S_YYEMPTY)
264   {}
265 
266 #if 201103L <= YY_CPLUSPLUS
by_kind(by_kind && that)267   parser::by_kind::by_kind (by_kind&& that)
268     : kind_ (that.kind_)
269   {
270     that.clear ();
271   }
272 #endif
273 
by_kind(const by_kind & that)274   parser::by_kind::by_kind (const by_kind& that)
275     : kind_ (that.kind_)
276   {}
277 
by_kind(token_kind_type t)278   parser::by_kind::by_kind (token_kind_type t)
279     : kind_ (yytranslate_ (t))
280   {}
281 
282   void
clear()283   parser::by_kind::clear () YY_NOEXCEPT
284   {
285     kind_ = symbol_kind::S_YYEMPTY;
286   }
287 
288   void
move(by_kind & that)289   parser::by_kind::move (by_kind& that)
290   {
291     kind_ = that.kind_;
292     that.clear ();
293   }
294 
295   parser::symbol_kind_type
kind() const296   parser::by_kind::kind () const YY_NOEXCEPT
297   {
298     return kind_;
299   }
300 
301   parser::symbol_kind_type
type_get() const302   parser::by_kind::type_get () const YY_NOEXCEPT
303   {
304     return this->kind ();
305   }
306 
307 
308   // by_state.
by_state()309   parser::by_state::by_state () YY_NOEXCEPT
310     : state (empty_state)
311   {}
312 
by_state(const by_state & that)313   parser::by_state::by_state (const by_state& that) YY_NOEXCEPT
314     : state (that.state)
315   {}
316 
317   void
clear()318   parser::by_state::clear () YY_NOEXCEPT
319   {
320     state = empty_state;
321   }
322 
323   void
move(by_state & that)324   parser::by_state::move (by_state& that)
325   {
326     state = that.state;
327     that.clear ();
328   }
329 
by_state(state_type s)330   parser::by_state::by_state (state_type s) YY_NOEXCEPT
331     : state (s)
332   {}
333 
334   parser::symbol_kind_type
kind() const335   parser::by_state::kind () const YY_NOEXCEPT
336   {
337     if (state == empty_state)
338       return symbol_kind::S_YYEMPTY;
339     else
340       return YY_CAST (symbol_kind_type, yystos_[+state]);
341   }
342 
stack_symbol_type()343   parser::stack_symbol_type::stack_symbol_type ()
344   {}
345 
stack_symbol_type(YY_RVREF (stack_symbol_type)that)346   parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
347     : super_type (YY_MOVE (that.state))
348   {
349     switch (that.kind ())
350     {
351       case symbol_kind::S_st_expr: // st_expr
352       case symbol_kind::S_expr: // expr
353       case symbol_kind::S_leaf: // leaf
354       case symbol_kind::S_func: // func
355         value.YY_MOVE_OR_COPY< SymEngine::RCP<const SymEngine::Basic> > (YY_MOVE (that.value));
356         break;
357 
358       case symbol_kind::S_expr_list: // expr_list
359         value.YY_MOVE_OR_COPY< SymEngine::vec_basic > (YY_MOVE (that.value));
360         break;
361 
362       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
363       case symbol_kind::S_NUMERIC: // NUMERIC
364       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
365         value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
366         break;
367 
368       default:
369         break;
370     }
371 
372 #if 201103L <= YY_CPLUSPLUS
373     // that is emptied.
374     that.state = empty_state;
375 #endif
376   }
377 
stack_symbol_type(state_type s,YY_MOVE_REF (symbol_type)that)378   parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
379     : super_type (s)
380   {
381     switch (that.kind ())
382     {
383       case symbol_kind::S_st_expr: // st_expr
384       case symbol_kind::S_expr: // expr
385       case symbol_kind::S_leaf: // leaf
386       case symbol_kind::S_func: // func
387         value.move< SymEngine::RCP<const SymEngine::Basic> > (YY_MOVE (that.value));
388         break;
389 
390       case symbol_kind::S_expr_list: // expr_list
391         value.move< SymEngine::vec_basic > (YY_MOVE (that.value));
392         break;
393 
394       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
395       case symbol_kind::S_NUMERIC: // NUMERIC
396       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
397         value.move< std::string > (YY_MOVE (that.value));
398         break;
399 
400       default:
401         break;
402     }
403 
404     // that is emptied.
405     that.kind_ = symbol_kind::S_YYEMPTY;
406   }
407 
408 #if YY_CPLUSPLUS < 201103L
409   parser::stack_symbol_type&
operator =(const stack_symbol_type & that)410   parser::stack_symbol_type::operator= (const stack_symbol_type& that)
411   {
412     state = that.state;
413     switch (that.kind ())
414     {
415       case symbol_kind::S_st_expr: // st_expr
416       case symbol_kind::S_expr: // expr
417       case symbol_kind::S_leaf: // leaf
418       case symbol_kind::S_func: // func
419         value.copy< SymEngine::RCP<const SymEngine::Basic> > (that.value);
420         break;
421 
422       case symbol_kind::S_expr_list: // expr_list
423         value.copy< SymEngine::vec_basic > (that.value);
424         break;
425 
426       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
427       case symbol_kind::S_NUMERIC: // NUMERIC
428       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
429         value.copy< std::string > (that.value);
430         break;
431 
432       default:
433         break;
434     }
435 
436     return *this;
437   }
438 
439   parser::stack_symbol_type&
operator =(stack_symbol_type & that)440   parser::stack_symbol_type::operator= (stack_symbol_type& that)
441   {
442     state = that.state;
443     switch (that.kind ())
444     {
445       case symbol_kind::S_st_expr: // st_expr
446       case symbol_kind::S_expr: // expr
447       case symbol_kind::S_leaf: // leaf
448       case symbol_kind::S_func: // func
449         value.move< SymEngine::RCP<const SymEngine::Basic> > (that.value);
450         break;
451 
452       case symbol_kind::S_expr_list: // expr_list
453         value.move< SymEngine::vec_basic > (that.value);
454         break;
455 
456       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
457       case symbol_kind::S_NUMERIC: // NUMERIC
458       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
459         value.move< std::string > (that.value);
460         break;
461 
462       default:
463         break;
464     }
465 
466     // that is emptied.
467     that.state = empty_state;
468     return *this;
469   }
470 #endif
471 
472   template <typename Base>
473   void
yy_destroy_(const char * yymsg,basic_symbol<Base> & yysym) const474   parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
475   {
476     if (yymsg)
477       YY_SYMBOL_PRINT (yymsg, yysym);
478   }
479 
480 #if YYDEBUG
481   template <typename Base>
482   void
yy_print_(std::ostream & yyo,const basic_symbol<Base> & yysym) const483   parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
484   {
485     std::ostream& yyoutput = yyo;
486     YY_USE (yyoutput);
487     if (yysym.empty ())
488       yyo << "empty symbol";
489     else
490       {
491         symbol_kind_type yykind = yysym.kind ();
492         yyo << (yykind < YYNTOKENS ? "token" : "nterm")
493             << ' ' << yysym.name () << " (";
494         YY_USE (yykind);
495         yyo << ')';
496       }
497   }
498 #endif
499 
500   void
yypush_(const char * m,YY_MOVE_REF (stack_symbol_type)sym)501   parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
502   {
503     if (m)
504       YY_SYMBOL_PRINT (m, sym);
505     yystack_.push (YY_MOVE (sym));
506   }
507 
508   void
yypush_(const char * m,state_type s,YY_MOVE_REF (symbol_type)sym)509   parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
510   {
511 #if 201103L <= YY_CPLUSPLUS
512     yypush_ (m, stack_symbol_type (s, std::move (sym)));
513 #else
514     stack_symbol_type ss (s, sym);
515     yypush_ (m, ss);
516 #endif
517   }
518 
519   void
yypop_(int n)520   parser::yypop_ (int n)
521   {
522     yystack_.pop (n);
523   }
524 
525 #if YYDEBUG
526   std::ostream&
debug_stream() const527   parser::debug_stream () const
528   {
529     return *yycdebug_;
530   }
531 
532   void
set_debug_stream(std::ostream & o)533   parser::set_debug_stream (std::ostream& o)
534   {
535     yycdebug_ = &o;
536   }
537 
538 
539   parser::debug_level_type
debug_level() const540   parser::debug_level () const
541   {
542     return yydebug_;
543   }
544 
545   void
set_debug_level(debug_level_type l)546   parser::set_debug_level (debug_level_type l)
547   {
548     yydebug_ = l;
549   }
550 #endif // YYDEBUG
551 
552   parser::state_type
yy_lr_goto_state_(state_type yystate,int yysym)553   parser::yy_lr_goto_state_ (state_type yystate, int yysym)
554   {
555     int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
556     if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
557       return yytable_[yyr];
558     else
559       return yydefgoto_[yysym - YYNTOKENS];
560   }
561 
562   bool
yy_pact_value_is_default_(int yyvalue)563   parser::yy_pact_value_is_default_ (int yyvalue)
564   {
565     return yyvalue == yypact_ninf_;
566   }
567 
568   bool
yy_table_value_is_error_(int yyvalue)569   parser::yy_table_value_is_error_ (int yyvalue)
570   {
571     return yyvalue == yytable_ninf_;
572   }
573 
574   int
operator ()()575   parser::operator() ()
576   {
577     return parse ();
578   }
579 
580   int
parse()581   parser::parse ()
582   {
583     int yyn;
584     /// Length of the RHS of the rule being reduced.
585     int yylen = 0;
586 
587     // Error handling.
588     int yynerrs_ = 0;
589     int yyerrstatus_ = 0;
590 
591     /// The lookahead symbol.
592     symbol_type yyla;
593 
594     /// The return value of parse ().
595     int yyresult;
596 
597 #if YY_EXCEPTIONS
598     try
599 #endif // YY_EXCEPTIONS
600       {
601     YYCDEBUG << "Starting parse\n";
602 
603 
604     /* Initialize the stack.  The initial state will be set in
605        yynewstate, since the latter expects the semantical and the
606        location values to have been already stored, initialize these
607        stacks with a primary value.  */
608     yystack_.clear ();
609     yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
610 
611   /*-----------------------------------------------.
612   | yynewstate -- push a new symbol on the stack.  |
613   `-----------------------------------------------*/
614   yynewstate:
615     YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n';
616     YY_STACK_PRINT ();
617 
618     // Accept?
619     if (yystack_[0].state == yyfinal_)
620       YYACCEPT;
621 
622     goto yybackup;
623 
624 
625   /*-----------.
626   | yybackup.  |
627   `-----------*/
628   yybackup:
629     // Try to take a decision without lookahead.
630     yyn = yypact_[+yystack_[0].state];
631     if (yy_pact_value_is_default_ (yyn))
632       goto yydefault;
633 
634     // Read a lookahead token.
635     if (yyla.empty ())
636       {
637         YYCDEBUG << "Reading a token\n";
638 #if YY_EXCEPTIONS
639         try
640 #endif // YY_EXCEPTIONS
641           {
642             yyla.kind_ = yytranslate_ (yylex (&yyla.value, p));
643           }
644 #if YY_EXCEPTIONS
645         catch (const syntax_error& yyexc)
646           {
647             YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
648             error (yyexc);
649             goto yyerrlab1;
650           }
651 #endif // YY_EXCEPTIONS
652       }
653     YY_SYMBOL_PRINT ("Next token is", yyla);
654 
655     if (yyla.kind () == symbol_kind::S_YYerror)
656     {
657       // The scanner already issued an error message, process directly
658       // to error recovery.  But do not keep the error token as
659       // lookahead, it is too special and may lead us to an endless
660       // loop in error recovery. */
661       yyla.kind_ = symbol_kind::S_YYUNDEF;
662       goto yyerrlab1;
663     }
664 
665     /* If the proper action on seeing token YYLA.TYPE is to reduce or
666        to detect an error, take that action.  */
667     yyn += yyla.kind ();
668     if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ())
669       {
670         goto yydefault;
671       }
672 
673     // Reduce or error.
674     yyn = yytable_[yyn];
675     if (yyn <= 0)
676       {
677         if (yy_table_value_is_error_ (yyn))
678           goto yyerrlab;
679         yyn = -yyn;
680         goto yyreduce;
681       }
682 
683     // Count tokens shifted since error; after three, turn off error status.
684     if (yyerrstatus_)
685       --yyerrstatus_;
686 
687     // Shift the lookahead token.
688     yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));
689     goto yynewstate;
690 
691 
692   /*-----------------------------------------------------------.
693   | yydefault -- do the default action for the current state.  |
694   `-----------------------------------------------------------*/
695   yydefault:
696     yyn = yydefact_[+yystack_[0].state];
697     if (yyn == 0)
698       goto yyerrlab;
699     goto yyreduce;
700 
701 
702   /*-----------------------------.
703   | yyreduce -- do a reduction.  |
704   `-----------------------------*/
705   yyreduce:
706     yylen = yyr2_[yyn];
707     {
708       stack_symbol_type yylhs;
709       yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
710       /* Variants are always initialized to an empty instance of the
711          correct type. The default '$$ = $1' action is NOT applied
712          when using variants.  */
713       switch (yyr1_[yyn])
714     {
715       case symbol_kind::S_st_expr: // st_expr
716       case symbol_kind::S_expr: // expr
717       case symbol_kind::S_leaf: // leaf
718       case symbol_kind::S_func: // func
719         yylhs.value.emplace< SymEngine::RCP<const SymEngine::Basic> > ();
720         break;
721 
722       case symbol_kind::S_expr_list: // expr_list
723         yylhs.value.emplace< SymEngine::vec_basic > ();
724         break;
725 
726       case symbol_kind::S_IDENTIFIER: // IDENTIFIER
727       case symbol_kind::S_NUMERIC: // NUMERIC
728       case symbol_kind::S_IMPLICIT_MUL: // IMPLICIT_MUL
729         yylhs.value.emplace< std::string > ();
730         break;
731 
732       default:
733         break;
734     }
735 
736 
737 
738       // Perform the reduction.
739       YY_REDUCE_PRINT (yyn);
740 #if YY_EXCEPTIONS
741       try
742 #endif // YY_EXCEPTIONS
743         {
744           switch (yyn)
745             {
746   case 2: // st_expr: expr
747 #line 98 "parser.yy"
748     {
749         yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ();
750         p.res = yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > ();
751     }
752 #line 753 "parser.tab.cc"
753     break;
754 
755   case 3: // expr: expr '+' expr
756 #line 106 "parser.yy"
757         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = add(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
758 #line 759 "parser.tab.cc"
759     break;
760 
761   case 4: // expr: expr '-' expr
762 #line 109 "parser.yy"
763         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = sub(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
764 #line 765 "parser.tab.cc"
765     break;
766 
767   case 5: // expr: expr '*' expr
768 #line 112 "parser.yy"
769         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = mul(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
770 #line 771 "parser.tab.cc"
771     break;
772 
773   case 6: // expr: expr '/' expr
774 #line 115 "parser.yy"
775         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = div(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
776 #line 777 "parser.tab.cc"
777     break;
778 
779   case 7: // expr: IMPLICIT_MUL POW expr
780 #line 120 "parser.yy"
781         {
782           auto tup = p.parse_implicit_mul(yystack_[2].value.as < std::string > ());
783           if (neq(*std::get<1>(tup), *one)) {
784             yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = mul(std::get<0>(tup), pow(std::get<1>(tup), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
785           } else {
786             yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = pow(std::get<0>(tup), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ());
787           }
788         }
789 #line 790 "parser.tab.cc"
790     break;
791 
792   case 8: // expr: expr POW expr
793 #line 130 "parser.yy"
794         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = pow(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
795 #line 796 "parser.tab.cc"
796     break;
797 
798   case 9: // expr: expr '<' expr
799 #line 133 "parser.yy"
800         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(Lt(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ())); }
801 #line 802 "parser.tab.cc"
802     break;
803 
804   case 10: // expr: expr '>' expr
805 #line 136 "parser.yy"
806         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(Gt(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ())); }
807 #line 808 "parser.tab.cc"
808     break;
809 
810   case 11: // expr: expr NE expr
811 #line 139 "parser.yy"
812         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(Ne(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ())); }
813 #line 814 "parser.tab.cc"
814     break;
815 
816   case 12: // expr: expr LE expr
817 #line 142 "parser.yy"
818         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(Le(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ())); }
819 #line 820 "parser.tab.cc"
820     break;
821 
822   case 13: // expr: expr GE expr
823 #line 145 "parser.yy"
824         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(Ge(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ())); }
825 #line 826 "parser.tab.cc"
826     break;
827 
828   case 14: // expr: expr EQ expr
829 #line 148 "parser.yy"
830         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(Eq(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > (), yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ())); }
831 #line 832 "parser.tab.cc"
832     break;
833 
834   case 15: // expr: expr '|' expr
835 #line 151 "parser.yy"
836         {
837             set_boolean s;
838             s.insert(rcp_static_cast<const Boolean>(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
839             s.insert(rcp_static_cast<const Boolean>(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
840             yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(logical_or(s));
841         }
842 #line 843 "parser.tab.cc"
843     break;
844 
845   case 16: // expr: expr '&' expr
846 #line 159 "parser.yy"
847         {
848             set_boolean s;
849             s.insert(rcp_static_cast<const Boolean>(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
850             s.insert(rcp_static_cast<const Boolean>(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
851             yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(logical_and(s));
852         }
853 #line 854 "parser.tab.cc"
854     break;
855 
856   case 17: // expr: expr '^' expr
857 #line 167 "parser.yy"
858         {
859             vec_boolean s;
860             s.push_back(rcp_static_cast<const Boolean>(yystack_[2].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
861             s.push_back(rcp_static_cast<const Boolean>(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()));
862             yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(logical_xor(s));
863         }
864 #line 865 "parser.tab.cc"
865     break;
866 
867   case 18: // expr: '(' expr ')'
868 #line 175 "parser.yy"
869         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = yystack_[1].value.as < SymEngine::RCP<const SymEngine::Basic> > (); }
870 #line 871 "parser.tab.cc"
871     break;
872 
873   case 19: // expr: '-' expr
874 #line 178 "parser.yy"
875         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = neg(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
876 #line 877 "parser.tab.cc"
877     break;
878 
879   case 20: // expr: '+' expr
880 #line 181 "parser.yy"
881         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > (); }
882 #line 883 "parser.tab.cc"
883     break;
884 
885   case 21: // expr: '~' expr
886 #line 184 "parser.yy"
887         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(logical_not(rcp_static_cast<const Boolean>(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()))); }
888 #line 889 "parser.tab.cc"
889     break;
890 
891   case 22: // expr: leaf
892 #line 187 "parser.yy"
893         { yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = rcp_static_cast<const Basic>(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ()); }
894 #line 895 "parser.tab.cc"
895     break;
896 
897   case 23: // leaf: IDENTIFIER
898 #line 192 "parser.yy"
899     {
900         yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = p.parse_identifier(yystack_[0].value.as < std::string > ());
901     }
902 #line 903 "parser.tab.cc"
903     break;
904 
905   case 24: // leaf: IMPLICIT_MUL
906 #line 197 "parser.yy"
907     {
908         auto tup = p.parse_implicit_mul(yystack_[0].value.as < std::string > ());
909         yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = mul(std::get<0>(tup), std::get<1>(tup));
910     }
911 #line 912 "parser.tab.cc"
912     break;
913 
914   case 25: // leaf: NUMERIC
915 #line 203 "parser.yy"
916     {
917         yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = p.parse_numeric(yystack_[0].value.as < std::string > ());
918     }
919 #line 920 "parser.tab.cc"
920     break;
921 
922   case 26: // leaf: func
923 #line 208 "parser.yy"
924     {
925         yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ();
926     }
927 #line 928 "parser.tab.cc"
928     break;
929 
930   case 27: // func: IDENTIFIER '(' expr_list ')'
931 #line 215 "parser.yy"
932     {
933         yylhs.value.as < SymEngine::RCP<const SymEngine::Basic> > () = p.functionify(yystack_[3].value.as < std::string > (), yystack_[1].value.as < SymEngine::vec_basic > ());
934     }
935 #line 936 "parser.tab.cc"
936     break;
937 
938   case 28: // expr_list: expr_list ',' expr
939 #line 223 "parser.yy"
940     {
941         yylhs.value.as < SymEngine::vec_basic > () = yystack_[2].value.as < SymEngine::vec_basic > (); // TODO : should make copy?
942         yylhs.value.as < SymEngine::vec_basic > () .push_back(yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ());
943     }
944 #line 945 "parser.tab.cc"
945     break;
946 
947   case 29: // expr_list: expr
948 #line 229 "parser.yy"
949     {
950         yylhs.value.as < SymEngine::vec_basic > () = vec_basic(1, yystack_[0].value.as < SymEngine::RCP<const SymEngine::Basic> > ());
951     }
952 #line 953 "parser.tab.cc"
953     break;
954 
955 
956 #line 957 "parser.tab.cc"
957 
958             default:
959               break;
960             }
961         }
962 #if YY_EXCEPTIONS
963       catch (const syntax_error& yyexc)
964         {
965           YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
966           error (yyexc);
967           YYERROR;
968         }
969 #endif // YY_EXCEPTIONS
970       YY_SYMBOL_PRINT ("-> $$ =", yylhs);
971       yypop_ (yylen);
972       yylen = 0;
973 
974       // Shift the result of the reduction.
975       yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
976     }
977     goto yynewstate;
978 
979 
980   /*--------------------------------------.
981   | yyerrlab -- here on detecting error.  |
982   `--------------------------------------*/
983   yyerrlab:
984     // If not already recovering from an error, report this error.
985     if (!yyerrstatus_)
986       {
987         ++yynerrs_;
988         std::string msg = YY_("syntax error");
989         error (YY_MOVE (msg));
990       }
991 
992 
993     if (yyerrstatus_ == 3)
994       {
995         /* If just tried and failed to reuse lookahead token after an
996            error, discard it.  */
997 
998         // Return failure if at end of input.
999         if (yyla.kind () == symbol_kind::S_YYEOF)
1000           YYABORT;
1001         else if (!yyla.empty ())
1002           {
1003             yy_destroy_ ("Error: discarding", yyla);
1004             yyla.clear ();
1005           }
1006       }
1007 
1008     // Else will try to reuse lookahead token after shifting the error token.
1009     goto yyerrlab1;
1010 
1011 
1012   /*---------------------------------------------------.
1013   | yyerrorlab -- error raised explicitly by YYERROR.  |
1014   `---------------------------------------------------*/
1015   yyerrorlab:
1016     /* Pacify compilers when the user code never invokes YYERROR and
1017        the label yyerrorlab therefore never appears in user code.  */
1018     if (false)
1019       YYERROR;
1020 
1021     /* Do not reclaim the symbols of the rule whose action triggered
1022        this YYERROR.  */
1023     yypop_ (yylen);
1024     yylen = 0;
1025     YY_STACK_PRINT ();
1026     goto yyerrlab1;
1027 
1028 
1029   /*-------------------------------------------------------------.
1030   | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1031   `-------------------------------------------------------------*/
1032   yyerrlab1:
1033     yyerrstatus_ = 3;   // Each real token shifted decrements this.
1034     // Pop stack until we find a state that shifts the error token.
1035     for (;;)
1036       {
1037         yyn = yypact_[+yystack_[0].state];
1038         if (!yy_pact_value_is_default_ (yyn))
1039           {
1040             yyn += symbol_kind::S_YYerror;
1041             if (0 <= yyn && yyn <= yylast_
1042                 && yycheck_[yyn] == symbol_kind::S_YYerror)
1043               {
1044                 yyn = yytable_[yyn];
1045                 if (0 < yyn)
1046                   break;
1047               }
1048           }
1049 
1050         // Pop the current state because it cannot handle the error token.
1051         if (yystack_.size () == 1)
1052           YYABORT;
1053 
1054         yy_destroy_ ("Error: popping", yystack_[0]);
1055         yypop_ ();
1056         YY_STACK_PRINT ();
1057       }
1058     {
1059       stack_symbol_type error_token;
1060 
1061 
1062       // Shift the error token.
1063       error_token.state = state_type (yyn);
1064       yypush_ ("Shifting", YY_MOVE (error_token));
1065     }
1066     goto yynewstate;
1067 
1068 
1069   /*-------------------------------------.
1070   | yyacceptlab -- YYACCEPT comes here.  |
1071   `-------------------------------------*/
1072   yyacceptlab:
1073     yyresult = 0;
1074     goto yyreturn;
1075 
1076 
1077   /*-----------------------------------.
1078   | yyabortlab -- YYABORT comes here.  |
1079   `-----------------------------------*/
1080   yyabortlab:
1081     yyresult = 1;
1082     goto yyreturn;
1083 
1084 
1085   /*-----------------------------------------------------.
1086   | yyreturn -- parsing is finished, return the result.  |
1087   `-----------------------------------------------------*/
1088   yyreturn:
1089     if (!yyla.empty ())
1090       yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1091 
1092     /* Do not reclaim the symbols of the rule whose action triggered
1093        this YYABORT or YYACCEPT.  */
1094     yypop_ (yylen);
1095     YY_STACK_PRINT ();
1096     while (1 < yystack_.size ())
1097       {
1098         yy_destroy_ ("Cleanup: popping", yystack_[0]);
1099         yypop_ ();
1100       }
1101 
1102     return yyresult;
1103   }
1104 #if YY_EXCEPTIONS
1105     catch (...)
1106       {
1107         YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1108         // Do not try to display the values of the reclaimed symbols,
1109         // as their printers might throw an exception.
1110         if (!yyla.empty ())
1111           yy_destroy_ (YY_NULLPTR, yyla);
1112 
1113         while (1 < yystack_.size ())
1114           {
1115             yy_destroy_ (YY_NULLPTR, yystack_[0]);
1116             yypop_ ();
1117           }
1118         throw;
1119       }
1120 #endif // YY_EXCEPTIONS
1121   }
1122 
1123   void
error(const syntax_error & yyexc)1124   parser::error (const syntax_error& yyexc)
1125   {
1126     error (yyexc.what ());
1127   }
1128 
1129 #if YYDEBUG || 0
1130   const char *
symbol_name(symbol_kind_type yysymbol)1131   parser::symbol_name (symbol_kind_type yysymbol)
1132   {
1133     return yytname_[yysymbol];
1134   }
1135 #endif // #if YYDEBUG || 0
1136 
1137 
1138 
1139 
1140 
1141   const signed char parser::yypact_ninf_ = -14;
1142 
1143   const signed char parser::yytable_ninf_ = -1;
1144 
1145   const short
1146   parser::yypact_[] =
1147   {
1148       26,    -9,   -14,    23,    26,    26,    26,    26,    12,    65,
1149      -14,   -14,    26,    26,    24,    24,    46,   -14,   -14,    26,
1150       26,    26,    26,    26,    26,    26,    26,    26,    26,    26,
1151       26,    26,    26,    65,   -13,    24,   -14,    80,    94,   107,
1152       22,   118,   128,   137,   145,   -11,    29,    29,    24,    24,
1153       24,   -14,    26,    65
1154   };
1155 
1156   const signed char
1157   parser::yydefact_[] =
1158   {
1159        0,    23,    25,    24,     0,     0,     0,     0,     0,     2,
1160       22,    26,     0,     0,    19,    20,     0,    21,     1,     0,
1161        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1162        0,     0,     0,    29,     0,     7,    18,    15,    17,    16,
1163       14,    10,     9,    11,    12,    13,     4,     3,     5,     6,
1164        8,    27,     0,    28
1165   };
1166 
1167   const signed char
1168   parser::yypgoto_[] =
1169   {
1170      -14,   -14,    -4,   -14,   -14,   -14
1171   };
1172 
1173   const signed char
1174   parser::yydefgoto_[] =
1175   {
1176        0,     8,     9,    10,    11,    34
1177   };
1178 
1179   const signed char
1180   parser::yytable_[] =
1181   {
1182       14,    15,    16,    17,    28,    29,    30,    31,    33,    35,
1183       32,    51,    18,    52,    12,    37,    38,    39,    40,    41,
1184       42,    43,    44,    45,    46,    47,    48,    49,    50,     1,
1185        2,     3,    23,    24,    25,    26,    27,    28,    29,    30,
1186       31,     4,     5,    32,    13,    32,    30,    31,    53,     6,
1187       32,     7,    19,    20,    21,    22,    23,    24,    25,    26,
1188       27,    28,    29,    30,    31,     0,     0,    32,     0,     0,
1189       36,    19,    20,    21,    22,    23,    24,    25,    26,    27,
1190       28,    29,    30,    31,     0,     0,    32,    20,    21,    22,
1191       23,    24,    25,    26,    27,    28,    29,    30,    31,     0,
1192        0,    32,    21,    22,    23,    24,    25,    26,    27,    28,
1193       29,    30,    31,     0,     0,    32,    22,    23,    24,    25,
1194       26,    27,    28,    29,    30,    31,     0,     0,    32,    24,
1195       25,    26,    27,    28,    29,    30,    31,     0,     0,    32,
1196       25,    26,    27,    28,    29,    30,    31,     0,     0,    32,
1197       26,    27,    28,    29,    30,    31,     0,     0,    32,    27,
1198       28,    29,    30,    31,     0,     0,    32
1199   };
1200 
1201   const signed char
1202   parser::yycheck_[] =
1203   {
1204        4,     5,     6,     7,    15,    16,    17,    18,    12,    13,
1205       21,    24,     0,    26,    23,    19,    20,    21,    22,    23,
1206       24,    25,    26,    27,    28,    29,    30,    31,    32,     3,
1207        4,     5,    10,    11,    12,    13,    14,    15,    16,    17,
1208       18,    15,    16,    21,    21,    21,    17,    18,    52,    23,
1209       21,    25,     6,     7,     8,     9,    10,    11,    12,    13,
1210       14,    15,    16,    17,    18,    -1,    -1,    21,    -1,    -1,
1211       24,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1212       15,    16,    17,    18,    -1,    -1,    21,     7,     8,     9,
1213       10,    11,    12,    13,    14,    15,    16,    17,    18,    -1,
1214       -1,    21,     8,     9,    10,    11,    12,    13,    14,    15,
1215       16,    17,    18,    -1,    -1,    21,     9,    10,    11,    12,
1216       13,    14,    15,    16,    17,    18,    -1,    -1,    21,    11,
1217       12,    13,    14,    15,    16,    17,    18,    -1,    -1,    21,
1218       12,    13,    14,    15,    16,    17,    18,    -1,    -1,    21,
1219       13,    14,    15,    16,    17,    18,    -1,    -1,    21,    14,
1220       15,    16,    17,    18,    -1,    -1,    21
1221   };
1222 
1223   const signed char
1224   parser::yystos_[] =
1225   {
1226        0,     3,     4,     5,    15,    16,    23,    25,    28,    29,
1227       30,    31,    23,    21,    29,    29,    29,    29,     0,     6,
1228        7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
1229       17,    18,    21,    29,    32,    29,    24,    29,    29,    29,
1230       29,    29,    29,    29,    29,    29,    29,    29,    29,    29,
1231       29,    24,    26,    29
1232   };
1233 
1234   const signed char
1235   parser::yyr1_[] =
1236   {
1237        0,    27,    28,    29,    29,    29,    29,    29,    29,    29,
1238       29,    29,    29,    29,    29,    29,    29,    29,    29,    29,
1239       29,    29,    29,    30,    30,    30,    30,    31,    32,    32
1240   };
1241 
1242   const signed char
1243   parser::yyr2_[] =
1244   {
1245        0,     2,     1,     3,     3,     3,     3,     3,     3,     3,
1246        3,     3,     3,     3,     3,     3,     3,     3,     3,     2,
1247        2,     2,     1,     1,     1,     1,     1,     4,     3,     1
1248   };
1249 
1250 
1251 #if YYDEBUG
1252   // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1253   // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
1254   const char*
1255   const parser::yytname_[] =
1256   {
1257   "END_OF_FILE", "error", "\"invalid token\"", "IDENTIFIER", "NUMERIC",
1258   "IMPLICIT_MUL", "'|'", "'^'", "'&'", "EQ", "'>'", "'<'", "NE", "LE",
1259   "GE", "'-'", "'+'", "'*'", "'/'", "UMINUS", "UPLUS", "POW", "NOT", "'('",
1260   "')'", "'~'", "','", "$accept", "st_expr", "expr", "leaf", "func",
1261   "expr_list", YY_NULLPTR
1262   };
1263 #endif
1264 
1265 
1266 #if YYDEBUG
1267   const unsigned char
1268   parser::yyrline_[] =
1269   {
1270        0,    97,    97,   105,   108,   111,   114,   119,   129,   132,
1271      135,   138,   141,   144,   147,   150,   158,   166,   174,   177,
1272      180,   183,   186,   191,   196,   202,   207,   214,   222,   228
1273   };
1274 
1275   void
yy_stack_print_() const1276   parser::yy_stack_print_ () const
1277   {
1278     *yycdebug_ << "Stack now";
1279     for (stack_type::const_iterator
1280            i = yystack_.begin (),
1281            i_end = yystack_.end ();
1282          i != i_end; ++i)
1283       *yycdebug_ << ' ' << int (i->state);
1284     *yycdebug_ << '\n';
1285   }
1286 
1287   void
yy_reduce_print_(int yyrule) const1288   parser::yy_reduce_print_ (int yyrule) const
1289   {
1290     int yylno = yyrline_[yyrule];
1291     int yynrhs = yyr2_[yyrule];
1292     // Print the symbols being reduced, and their result.
1293     *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1294                << " (line " << yylno << "):\n";
1295     // The symbols being reduced.
1296     for (int yyi = 0; yyi < yynrhs; yyi++)
1297       YY_SYMBOL_PRINT ("   $" << yyi + 1 << " =",
1298                        yystack_[(yynrhs) - (yyi + 1)]);
1299   }
1300 #endif // YYDEBUG
1301 
1302   parser::symbol_kind_type
yytranslate_(int t)1303   parser::yytranslate_ (int t)
1304   {
1305     // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
1306     // TOKEN-NUM as returned by yylex.
1307     static
1308     const signed char
1309     translate_table[] =
1310     {
1311        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1312        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1313        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1314        2,     2,     2,     2,     2,     2,     2,     2,     8,     2,
1315       23,    24,    17,    16,    26,    15,     2,    18,     2,     2,
1316        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1317       11,     2,    10,     2,     2,     2,     2,     2,     2,     2,
1318        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1319        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1320        2,     2,     2,     2,     7,     2,     2,     2,     2,     2,
1321        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1322        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1323        2,     2,     2,     2,     6,     2,    25,     2,     2,     2,
1324        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1325        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1326        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1327        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1328        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1329        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1330        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1331        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1332        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1333        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1334        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1335        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1336        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
1337        5,     9,    12,    13,    14,    19,    20,    21,    22
1338     };
1339     // Last valid token kind.
1340     const int code_max = 268;
1341 
1342     if (t <= 0)
1343       return symbol_kind::S_YYEOF;
1344     else if (t <= code_max)
1345       return YY_CAST (symbol_kind_type, translate_table[t]);
1346     else
1347       return symbol_kind::S_YYUNDEF;
1348   }
1349 
1350 } // yy
1351 #line 1352 "parser.tab.cc"
1352 
1353