aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.hh')
-rwxr-xr-xSolvers/dreal4/bazel-bin/dreal/dr/parser.yy.hh1793
1 files changed, 1793 insertions, 0 deletions
diff --git a/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.hh b/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.hh
new file mode 100755
index 00000000..45be20ef
--- /dev/null
+++ b/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.hh
@@ -0,0 +1,1793 @@
1// A Bison parser, made by GNU Bison 3.5.
2
3// Skeleton interface for Bison LALR(1) parsers in C++
4
5// Copyright (C) 2002-2015, 2018-2019 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
34/**
35 ** \file bazel-out/k8-opt/bin/dreal/dr/parser.yy.hh
36 ** Define the dreal::parser class.
37 */
38
39// C++ LALR(1) parser skeleton written by Akim Demaille.
40
41// Undocumented macros, especially those whose name start with YY_,
42// are private implementation details. Do not rely on them.
43
44#ifndef YY_DREAL_BAZEL_OUT_K8_OPT_BIN_DREAL_DR_PARSER_YY_HH_INCLUDED
45# define YY_DREAL_BAZEL_OUT_K8_OPT_BIN_DREAL_DR_PARSER_YY_HH_INCLUDED
46
47
48# include <cstdlib> // std::abort
49# include <iostream>
50# include <stdexcept>
51# include <string>
52# include <vector>
53
54#if defined __cplusplus
55# define YY_CPLUSPLUS __cplusplus
56#else
57# define YY_CPLUSPLUS 199711L
58#endif
59
60// Support move semantics when possible.
61#if 201103L <= YY_CPLUSPLUS
62# define YY_MOVE std::move
63# define YY_MOVE_OR_COPY move
64# define YY_MOVE_REF(Type) Type&&
65# define YY_RVREF(Type) Type&&
66# define YY_COPY(Type) Type
67#else
68# define YY_MOVE
69# define YY_MOVE_OR_COPY copy
70# define YY_MOVE_REF(Type) Type&
71# define YY_RVREF(Type) const Type&
72# define YY_COPY(Type) const Type&
73#endif
74
75// Support noexcept when possible.
76#if 201103L <= YY_CPLUSPLUS
77# define YY_NOEXCEPT noexcept
78# define YY_NOTHROW
79#else
80# define YY_NOEXCEPT
81# define YY_NOTHROW throw ()
82#endif
83
84// Support constexpr when possible.
85#if 201703 <= YY_CPLUSPLUS
86# define YY_CONSTEXPR constexpr
87#else
88# define YY_CONSTEXPR
89#endif
90# include "location.hh"
91
92#ifndef YY_ASSERT
93# include <cassert>
94# define YY_ASSERT assert
95#endif
96
97
98#ifndef YY_ATTRIBUTE_PURE
99# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
100# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
101# else
102# define YY_ATTRIBUTE_PURE
103# endif
104#endif
105
106#ifndef YY_ATTRIBUTE_UNUSED
107# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
108# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
109# else
110# define YY_ATTRIBUTE_UNUSED
111# endif
112#endif
113
114/* Suppress unused-variable warnings by "using" E. */
115#if ! defined lint || defined __GNUC__
116# define YYUSE(E) ((void) (E))
117#else
118# define YYUSE(E) /* empty */
119#endif
120
121#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
122/* Suppress an incorrect diagnostic about yylval being uninitialized. */
123# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
124 _Pragma ("GCC diagnostic push") \
125 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
126 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
127# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
128 _Pragma ("GCC diagnostic pop")
129#else
130# define YY_INITIAL_VALUE(Value) Value
131#endif
132#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
133# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
134# define YY_IGNORE_MAYBE_UNINITIALIZED_END
135#endif
136#ifndef YY_INITIAL_VALUE
137# define YY_INITIAL_VALUE(Value) /* Nothing. */
138#endif
139
140#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
141# define YY_IGNORE_USELESS_CAST_BEGIN \
142 _Pragma ("GCC diagnostic push") \
143 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
144# define YY_IGNORE_USELESS_CAST_END \
145 _Pragma ("GCC diagnostic pop")
146#endif
147#ifndef YY_IGNORE_USELESS_CAST_BEGIN
148# define YY_IGNORE_USELESS_CAST_BEGIN
149# define YY_IGNORE_USELESS_CAST_END
150#endif
151
152# ifndef YY_CAST
153# ifdef __cplusplus
154# define YY_CAST(Type, Val) static_cast<Type> (Val)
155# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
156# else
157# define YY_CAST(Type, Val) ((Type) (Val))
158# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
159# endif
160# endif
161# ifndef YY_NULLPTR
162# if defined __cplusplus
163# if 201103L <= __cplusplus
164# define YY_NULLPTR nullptr
165# else
166# define YY_NULLPTR 0
167# endif
168# else
169# define YY_NULLPTR ((void*)0)
170# endif
171# endif
172
173/* Debug traces. */
174#ifndef DREALDEBUG
175# if defined YYDEBUG
176#if YYDEBUG
177# define DREALDEBUG 1
178# else
179# define DREALDEBUG 0
180# endif
181# else /* ! defined YYDEBUG */
182# define DREALDEBUG 1
183# endif /* ! defined YYDEBUG */
184#endif /* ! defined DREALDEBUG */
185
186namespace dreal {
187#line 188 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.hh"
188
189
190
191
192 /// A Bison parser.
193 class DrParser
194 {
195 public:
196#ifndef DREALSTYPE
197 /// A buffer to store and retrieve objects.
198 ///
199 /// Sort of a variant, but does not keep track of the nature
200 /// of the stored data, since that knowledge is available
201 /// via the current parser state.
202 class semantic_type
203 {
204 public:
205 /// Type of *this.
206 typedef semantic_type self_type;
207
208 /// Empty construction.
209 semantic_type () YY_NOEXCEPT
210 : yybuffer_ ()
211 {}
212
213 /// Construct and fill.
214 template <typename T>
215 semantic_type (YY_RVREF (T) t)
216 {
217 YY_ASSERT (sizeof (T) <= size);
218 new (yyas_<T> ()) T (YY_MOVE (t));
219 }
220
221 /// Destruction, allowed only if empty.
222 ~semantic_type () YY_NOEXCEPT
223 {}
224
225# if 201103L <= YY_CPLUSPLUS
226 /// Instantiate a \a T in here from \a t.
227 template <typename T, typename... U>
228 T&
229 emplace (U&&... u)
230 {
231 return *new (yyas_<T> ()) T (std::forward <U>(u)...);
232 }
233# else
234 /// Instantiate an empty \a T in here.
235 template <typename T>
236 T&
237 emplace ()
238 {
239 return *new (yyas_<T> ()) T ();
240 }
241
242 /// Instantiate a \a T in here from \a t.
243 template <typename T>
244 T&
245 emplace (const T& t)
246 {
247 return *new (yyas_<T> ()) T (t);
248 }
249# endif
250
251 /// Instantiate an empty \a T in here.
252 /// Obsolete, use emplace.
253 template <typename T>
254 T&
255 build ()
256 {
257 return emplace<T> ();
258 }
259
260 /// Instantiate a \a T in here from \a t.
261 /// Obsolete, use emplace.
262 template <typename T>
263 T&
264 build (const T& t)
265 {
266 return emplace<T> (t);
267 }
268
269 /// Accessor to a built \a T.
270 template <typename T>
271 T&
272 as () YY_NOEXCEPT
273 {
274 return *yyas_<T> ();
275 }
276
277 /// Const accessor to a built \a T (for %printer).
278 template <typename T>
279 const T&
280 as () const YY_NOEXCEPT
281 {
282 return *yyas_<T> ();
283 }
284
285 /// Swap the content with \a that, of same type.
286 ///
287 /// Both variants must be built beforehand, because swapping the actual
288 /// data requires reading it (with as()), and this is not possible on
289 /// unconstructed variants: it would require some dynamic testing, which
290 /// should not be the variant's responsibility.
291 /// Swapping between built and (possibly) non-built is done with
292 /// self_type::move ().
293 template <typename T>
294 void
295 swap (self_type& that) YY_NOEXCEPT
296 {
297 std::swap (as<T> (), that.as<T> ());
298 }
299
300 /// Move the content of \a that to this.
301 ///
302 /// Destroys \a that.
303 template <typename T>
304 void
305 move (self_type& that)
306 {
307# if 201103L <= YY_CPLUSPLUS
308 emplace<T> (std::move (that.as<T> ()));
309# else
310 emplace<T> ();
311 swap<T> (that);
312# endif
313 that.destroy<T> ();
314 }
315
316# if 201103L <= YY_CPLUSPLUS
317 /// Move the content of \a that to this.
318 template <typename T>
319 void
320 move (self_type&& that)
321 {
322 emplace<T> (std::move (that.as<T> ()));
323 that.destroy<T> ();
324 }
325#endif
326
327 /// Copy the content of \a that to this.
328 template <typename T>
329 void
330 copy (const self_type& that)
331 {
332 emplace<T> (that.as<T> ());
333 }
334
335 /// Destroy the stored \a T.
336 template <typename T>
337 void
338 destroy ()
339 {
340 as<T> ().~T ();
341 }
342
343 private:
344 /// Prohibit blind copies.
345 self_type& operator= (const self_type&);
346 semantic_type (const self_type&);
347
348 /// Accessor to raw memory as \a T.
349 template <typename T>
350 T*
351 yyas_ () YY_NOEXCEPT
352 {
353 void *yyp = yybuffer_.yyraw;
354 return static_cast<T*> (yyp);
355 }
356
357 /// Const accessor to raw memory as \a T.
358 template <typename T>
359 const T*
360 yyas_ () const YY_NOEXCEPT
361 {
362 const void *yyp = yybuffer_.yyraw;
363 return static_cast<const T*> (yyp);
364 }
365
366 /// An auxiliary type to compute the largest semantic type.
367 union union_type
368 {
369 // expr
370 char dummy1[sizeof (Expression)];
371
372 // formula
373 char dummy2[sizeof (Formula)];
374
375 // "double"
376 char dummy3[sizeof (double)];
377
378 // "identifier"
379 char dummy4[sizeof (std::string)];
380 };
381
382 /// The size of the largest semantic type.
383 enum { size = sizeof (union_type) };
384
385 /// A buffer to store semantic values.
386 union
387 {
388 /// Strongest alignment constraints.
389 long double yyalign_me;
390 /// A buffer large enough to store any of the semantic values.
391 char yyraw[size];
392 } yybuffer_;
393 };
394
395#else
396 typedef DREALSTYPE semantic_type;
397#endif
398 /// Symbol locations.
399 typedef location location_type;
400
401 /// Syntax errors thrown from user actions.
402 struct syntax_error : std::runtime_error
403 {
404 syntax_error (const location_type& l, const std::string& m)
405 : std::runtime_error (m)
406 , location (l)
407 {}
408
409 syntax_error (const syntax_error& s)
410 : std::runtime_error (s.what ())
411 , location (s.location)
412 {}
413
414 ~syntax_error () YY_NOEXCEPT YY_NOTHROW;
415
416 location_type location;
417 };
418
419 /// Tokens.
420 struct token
421 {
422 enum yytokentype
423 {
424 END = 0,
425 TK_VAR = 258,
426 TK_COST = 259,
427 TK_PREC = 260,
428 TK_CTR = 261,
429 TK_PLUS = 262,
430 TK_MINUS = 263,
431 TK_TIMES = 264,
432 TK_DIV = 265,
433 TK_EQ = 266,
434 TK_LTE = 267,
435 TK_GTE = 268,
436 TK_LT = 269,
437 TK_GT = 270,
438 TK_EXP = 271,
439 TK_LOG = 272,
440 TK_ABS = 273,
441 TK_SIN = 274,
442 TK_COS = 275,
443 TK_TAN = 276,
444 TK_ASIN = 277,
445 TK_ACOS = 278,
446 TK_ATAN = 279,
447 TK_ATAN2 = 280,
448 TK_SINH = 281,
449 TK_COSH = 282,
450 TK_TANH = 283,
451 TK_MIN = 284,
452 TK_MAX = 285,
453 TK_SQRT = 286,
454 TK_POW = 287,
455 TK_CARET = 288,
456 TK_AND = 289,
457 TK_OR = 290,
458 TK_NOT = 291,
459 TK_IMPLIES = 292,
460 TK_LB = 293,
461 TK_RB = 294,
462 TK_COLON = 295,
463 TK_COMMA = 296,
464 TK_SEMICOLON = 297,
465 DOUBLE = 298,
466 ID = 299,
467 TK_NEQ = 300,
468 TK_LEQ = 301,
469 TK_GEQ = 302,
470 UMINUS = 303
471 };
472 };
473
474 /// (External) token type, as returned by yylex.
475 typedef token::yytokentype token_type;
476
477 /// Symbol type: an internal symbol number.
478 typedef int symbol_number_type;
479
480 /// The symbol type number to denote an empty symbol.
481 enum { empty_symbol = -2 };
482
483 /// Internal symbol number for tokens (subsumed by symbol_number_type).
484 typedef signed char token_number_type;
485
486 /// A complete symbol.
487 ///
488 /// Expects its Base type to provide access to the symbol type
489 /// via type_get ().
490 ///
491 /// Provide access to semantic value and location.
492 template <typename Base>
493 struct basic_symbol : Base
494 {
495 /// Alias to Base.
496 typedef Base super_type;
497
498 /// Default constructor.
499 basic_symbol ()
500 : value ()
501 , location ()
502 {}
503
504#if 201103L <= YY_CPLUSPLUS
505 /// Move constructor.
506 basic_symbol (basic_symbol&& that);
507#endif
508
509 /// Copy constructor.
510 basic_symbol (const basic_symbol& that);
511
512 /// Constructor for valueless symbols, and symbols from each type.
513#if 201103L <= YY_CPLUSPLUS
514 basic_symbol (typename Base::kind_type t, location_type&& l)
515 : Base (t)
516 , location (std::move (l))
517 {}
518#else
519 basic_symbol (typename Base::kind_type t, const location_type& l)
520 : Base (t)
521 , location (l)
522 {}
523#endif
524#if 201103L <= YY_CPLUSPLUS
525 basic_symbol (typename Base::kind_type t, Expression&& v, location_type&& l)
526 : Base (t)
527 , value (std::move (v))
528 , location (std::move (l))
529 {}
530#else
531 basic_symbol (typename Base::kind_type t, const Expression& v, const location_type& l)
532 : Base (t)
533 , value (v)
534 , location (l)
535 {}
536#endif
537#if 201103L <= YY_CPLUSPLUS
538 basic_symbol (typename Base::kind_type t, Formula&& v, location_type&& l)
539 : Base (t)
540 , value (std::move (v))
541 , location (std::move (l))
542 {}
543#else
544 basic_symbol (typename Base::kind_type t, const Formula& v, const location_type& l)
545 : Base (t)
546 , value (v)
547 , location (l)
548 {}
549#endif
550#if 201103L <= YY_CPLUSPLUS
551 basic_symbol (typename Base::kind_type t, double&& v, location_type&& l)
552 : Base (t)
553 , value (std::move (v))
554 , location (std::move (l))
555 {}
556#else
557 basic_symbol (typename Base::kind_type t, const double& v, const location_type& l)
558 : Base (t)
559 , value (v)
560 , location (l)
561 {}
562#endif
563#if 201103L <= YY_CPLUSPLUS
564 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
565 : Base (t)
566 , value (std::move (v))
567 , location (std::move (l))
568 {}
569#else
570 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
571 : Base (t)
572 , value (v)
573 , location (l)
574 {}
575#endif
576
577 /// Destroy the symbol.
578 ~basic_symbol ()
579 {
580 clear ();
581 }
582
583 /// Destroy contents, and record that is empty.
584 void clear ()
585 {
586 // User destructor.
587 symbol_number_type yytype = this->type_get ();
588 basic_symbol<Base>& yysym = *this;
589 (void) yysym;
590 switch (yytype)
591 {
592 default:
593 break;
594 }
595
596 // Type destructor.
597switch (yytype)
598 {
599 case 64: // expr
600 value.template destroy< Expression > ();
601 break;
602
603 case 63: // formula
604 value.template destroy< Formula > ();
605 break;
606
607 case 43: // "double"
608 value.template destroy< double > ();
609 break;
610
611 case 44: // "identifier"
612 value.template destroy< std::string > ();
613 break;
614
615 default:
616 break;
617 }
618
619 Base::clear ();
620 }
621
622 /// Whether empty.
623 bool empty () const YY_NOEXCEPT;
624
625 /// Destructive move, \a s is emptied into this.
626 void move (basic_symbol& s);
627
628 /// The semantic value.
629 semantic_type value;
630
631 /// The location.
632 location_type location;
633
634 private:
635#if YY_CPLUSPLUS < 201103L
636 /// Assignment operator.
637 basic_symbol& operator= (const basic_symbol& that);
638#endif
639 };
640
641 /// Type access provider for token (enum) based symbols.
642 struct by_type
643 {
644 /// Default constructor.
645 by_type ();
646
647#if 201103L <= YY_CPLUSPLUS
648 /// Move constructor.
649 by_type (by_type&& that);
650#endif
651
652 /// Copy constructor.
653 by_type (const by_type& that);
654
655 /// The symbol type as needed by the constructor.
656 typedef token_type kind_type;
657
658 /// Constructor from (external) token numbers.
659 by_type (kind_type t);
660
661 /// Record that this symbol is empty.
662 void clear ();
663
664 /// Steal the symbol type from \a that.
665 void move (by_type& that);
666
667 /// The (internal) type number (corresponding to \a type).
668 /// \a empty when empty.
669 symbol_number_type type_get () const YY_NOEXCEPT;
670
671 /// The symbol type.
672 /// \a empty_symbol when empty.
673 /// An int, not token_number_type, to be able to store empty_symbol.
674 int type;
675 };
676
677 /// "External" symbols: returned by the scanner.
678 struct symbol_type : basic_symbol<by_type>
679 {
680 /// Superclass.
681 typedef basic_symbol<by_type> super_type;
682
683 /// Empty symbol.
684 symbol_type () {}
685
686 /// Constructor for valueless symbols, and symbols from each type.
687#if 201103L <= YY_CPLUSPLUS
688 symbol_type (int tok, location_type l)
689 : super_type(token_type (tok), std::move (l))
690 {
691 YY_ASSERT (tok == token::END || tok == token::TK_VAR || tok == token::TK_COST || tok == token::TK_PREC || tok == token::TK_CTR || tok == token::TK_PLUS || tok == token::TK_MINUS || tok == token::TK_TIMES || tok == token::TK_DIV || tok == token::TK_EQ || tok == token::TK_LTE || tok == token::TK_GTE || tok == token::TK_LT || tok == token::TK_GT || tok == token::TK_EXP || tok == token::TK_LOG || tok == token::TK_ABS || tok == token::TK_SIN || tok == token::TK_COS || tok == token::TK_TAN || tok == token::TK_ASIN || tok == token::TK_ACOS || tok == token::TK_ATAN || tok == token::TK_ATAN2 || tok == token::TK_SINH || tok == token::TK_COSH || tok == token::TK_TANH || tok == token::TK_MIN || tok == token::TK_MAX || tok == token::TK_SQRT || tok == token::TK_POW || tok == token::TK_CARET || tok == token::TK_AND || tok == token::TK_OR || tok == token::TK_NOT || tok == token::TK_IMPLIES || tok == token::TK_LB || tok == token::TK_RB || tok == token::TK_COLON || tok == token::TK_COMMA || tok == token::TK_SEMICOLON || tok == token::TK_NEQ || tok == token::TK_LEQ || tok == token::TK_GEQ || tok == token::UMINUS || tok == 40 || tok == 41);
692 }
693#else
694 symbol_type (int tok, const location_type& l)
695 : super_type(token_type (tok), l)
696 {
697 YY_ASSERT (tok == token::END || tok == token::TK_VAR || tok == token::TK_COST || tok == token::TK_PREC || tok == token::TK_CTR || tok == token::TK_PLUS || tok == token::TK_MINUS || tok == token::TK_TIMES || tok == token::TK_DIV || tok == token::TK_EQ || tok == token::TK_LTE || tok == token::TK_GTE || tok == token::TK_LT || tok == token::TK_GT || tok == token::TK_EXP || tok == token::TK_LOG || tok == token::TK_ABS || tok == token::TK_SIN || tok == token::TK_COS || tok == token::TK_TAN || tok == token::TK_ASIN || tok == token::TK_ACOS || tok == token::TK_ATAN || tok == token::TK_ATAN2 || tok == token::TK_SINH || tok == token::TK_COSH || tok == token::TK_TANH || tok == token::TK_MIN || tok == token::TK_MAX || tok == token::TK_SQRT || tok == token::TK_POW || tok == token::TK_CARET || tok == token::TK_AND || tok == token::TK_OR || tok == token::TK_NOT || tok == token::TK_IMPLIES || tok == token::TK_LB || tok == token::TK_RB || tok == token::TK_COLON || tok == token::TK_COMMA || tok == token::TK_SEMICOLON || tok == token::TK_NEQ || tok == token::TK_LEQ || tok == token::TK_GEQ || tok == token::UMINUS || tok == 40 || tok == 41);
698 }
699#endif
700#if 201103L <= YY_CPLUSPLUS
701 symbol_type (int tok, double v, location_type l)
702 : super_type(token_type (tok), std::move (v), std::move (l))
703 {
704 YY_ASSERT (tok == token::DOUBLE);
705 }
706#else
707 symbol_type (int tok, const double& v, const location_type& l)
708 : super_type(token_type (tok), v, l)
709 {
710 YY_ASSERT (tok == token::DOUBLE);
711 }
712#endif
713#if 201103L <= YY_CPLUSPLUS
714 symbol_type (int tok, std::string v, location_type l)
715 : super_type(token_type (tok), std::move (v), std::move (l))
716 {
717 YY_ASSERT (tok == token::ID);
718 }
719#else
720 symbol_type (int tok, const std::string& v, const location_type& l)
721 : super_type(token_type (tok), v, l)
722 {
723 YY_ASSERT (tok == token::ID);
724 }
725#endif
726 };
727
728 /// Build a parser object.
729 DrParser (class DrDriver& driver_yyarg);
730 virtual ~DrParser ();
731
732 /// Parse. An alias for parse ().
733 /// \returns 0 iff parsing succeeded.
734 int operator() ();
735
736 /// Parse.
737 /// \returns 0 iff parsing succeeded.
738 virtual int parse ();
739
740#if DREALDEBUG
741 /// The current debugging stream.
742 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
743 /// Set the current debugging stream.
744 void set_debug_stream (std::ostream &);
745
746 /// Type for debugging levels.
747 typedef int debug_level_type;
748 /// The current debugging level.
749 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
750 /// Set the current debugging level.
751 void set_debug_level (debug_level_type l);
752#endif
753
754 /// Report a syntax error.
755 /// \param loc where the syntax error is found.
756 /// \param msg a description of the syntax error.
757 virtual void error (const location_type& loc, const std::string& msg);
758
759 /// Report a syntax error.
760 void error (const syntax_error& err);
761
762 // Implementation of make_symbol for each symbol type.
763#if 201103L <= YY_CPLUSPLUS
764 static
765 symbol_type
766 make_END (location_type l)
767 {
768 return symbol_type (token::END, std::move (l));
769 }
770#else
771 static
772 symbol_type
773 make_END (const location_type& l)
774 {
775 return symbol_type (token::END, l);
776 }
777#endif
778#if 201103L <= YY_CPLUSPLUS
779 static
780 symbol_type
781 make_TK_VAR (location_type l)
782 {
783 return symbol_type (token::TK_VAR, std::move (l));
784 }
785#else
786 static
787 symbol_type
788 make_TK_VAR (const location_type& l)
789 {
790 return symbol_type (token::TK_VAR, l);
791 }
792#endif
793#if 201103L <= YY_CPLUSPLUS
794 static
795 symbol_type
796 make_TK_COST (location_type l)
797 {
798 return symbol_type (token::TK_COST, std::move (l));
799 }
800#else
801 static
802 symbol_type
803 make_TK_COST (const location_type& l)
804 {
805 return symbol_type (token::TK_COST, l);
806 }
807#endif
808#if 201103L <= YY_CPLUSPLUS
809 static
810 symbol_type
811 make_TK_PREC (location_type l)
812 {
813 return symbol_type (token::TK_PREC, std::move (l));
814 }
815#else
816 static
817 symbol_type
818 make_TK_PREC (const location_type& l)
819 {
820 return symbol_type (token::TK_PREC, l);
821 }
822#endif
823#if 201103L <= YY_CPLUSPLUS
824 static
825 symbol_type
826 make_TK_CTR (location_type l)
827 {
828 return symbol_type (token::TK_CTR, std::move (l));
829 }
830#else
831 static
832 symbol_type
833 make_TK_CTR (const location_type& l)
834 {
835 return symbol_type (token::TK_CTR, l);
836 }
837#endif
838#if 201103L <= YY_CPLUSPLUS
839 static
840 symbol_type
841 make_TK_PLUS (location_type l)
842 {
843 return symbol_type (token::TK_PLUS, std::move (l));
844 }
845#else
846 static
847 symbol_type
848 make_TK_PLUS (const location_type& l)
849 {
850 return symbol_type (token::TK_PLUS, l);
851 }
852#endif
853#if 201103L <= YY_CPLUSPLUS
854 static
855 symbol_type
856 make_TK_MINUS (location_type l)
857 {
858 return symbol_type (token::TK_MINUS, std::move (l));
859 }
860#else
861 static
862 symbol_type
863 make_TK_MINUS (const location_type& l)
864 {
865 return symbol_type (token::TK_MINUS, l);
866 }
867#endif
868#if 201103L <= YY_CPLUSPLUS
869 static
870 symbol_type
871 make_TK_TIMES (location_type l)
872 {
873 return symbol_type (token::TK_TIMES, std::move (l));
874 }
875#else
876 static
877 symbol_type
878 make_TK_TIMES (const location_type& l)
879 {
880 return symbol_type (token::TK_TIMES, l);
881 }
882#endif
883#if 201103L <= YY_CPLUSPLUS
884 static
885 symbol_type
886 make_TK_DIV (location_type l)
887 {
888 return symbol_type (token::TK_DIV, std::move (l));
889 }
890#else
891 static
892 symbol_type
893 make_TK_DIV (const location_type& l)
894 {
895 return symbol_type (token::TK_DIV, l);
896 }
897#endif
898#if 201103L <= YY_CPLUSPLUS
899 static
900 symbol_type
901 make_TK_EQ (location_type l)
902 {
903 return symbol_type (token::TK_EQ, std::move (l));
904 }
905#else
906 static
907 symbol_type
908 make_TK_EQ (const location_type& l)
909 {
910 return symbol_type (token::TK_EQ, l);
911 }
912#endif
913#if 201103L <= YY_CPLUSPLUS
914 static
915 symbol_type
916 make_TK_LTE (location_type l)
917 {
918 return symbol_type (token::TK_LTE, std::move (l));
919 }
920#else
921 static
922 symbol_type
923 make_TK_LTE (const location_type& l)
924 {
925 return symbol_type (token::TK_LTE, l);
926 }
927#endif
928#if 201103L <= YY_CPLUSPLUS
929 static
930 symbol_type
931 make_TK_GTE (location_type l)
932 {
933 return symbol_type (token::TK_GTE, std::move (l));
934 }
935#else
936 static
937 symbol_type
938 make_TK_GTE (const location_type& l)
939 {
940 return symbol_type (token::TK_GTE, l);
941 }
942#endif
943#if 201103L <= YY_CPLUSPLUS
944 static
945 symbol_type
946 make_TK_LT (location_type l)
947 {
948 return symbol_type (token::TK_LT, std::move (l));
949 }
950#else
951 static
952 symbol_type
953 make_TK_LT (const location_type& l)
954 {
955 return symbol_type (token::TK_LT, l);
956 }
957#endif
958#if 201103L <= YY_CPLUSPLUS
959 static
960 symbol_type
961 make_TK_GT (location_type l)
962 {
963 return symbol_type (token::TK_GT, std::move (l));
964 }
965#else
966 static
967 symbol_type
968 make_TK_GT (const location_type& l)
969 {
970 return symbol_type (token::TK_GT, l);
971 }
972#endif
973#if 201103L <= YY_CPLUSPLUS
974 static
975 symbol_type
976 make_TK_EXP (location_type l)
977 {
978 return symbol_type (token::TK_EXP, std::move (l));
979 }
980#else
981 static
982 symbol_type
983 make_TK_EXP (const location_type& l)
984 {
985 return symbol_type (token::TK_EXP, l);
986 }
987#endif
988#if 201103L <= YY_CPLUSPLUS
989 static
990 symbol_type
991 make_TK_LOG (location_type l)
992 {
993 return symbol_type (token::TK_LOG, std::move (l));
994 }
995#else
996 static
997 symbol_type
998 make_TK_LOG (const location_type& l)
999 {
1000 return symbol_type (token::TK_LOG, l);
1001 }
1002#endif
1003#if 201103L <= YY_CPLUSPLUS
1004 static
1005 symbol_type
1006 make_TK_ABS (location_type l)
1007 {
1008 return symbol_type (token::TK_ABS, std::move (l));
1009 }
1010#else
1011 static
1012 symbol_type
1013 make_TK_ABS (const location_type& l)
1014 {
1015 return symbol_type (token::TK_ABS, l);
1016 }
1017#endif
1018#if 201103L <= YY_CPLUSPLUS
1019 static
1020 symbol_type
1021 make_TK_SIN (location_type l)
1022 {
1023 return symbol_type (token::TK_SIN, std::move (l));
1024 }
1025#else
1026 static
1027 symbol_type
1028 make_TK_SIN (const location_type& l)
1029 {
1030 return symbol_type (token::TK_SIN, l);
1031 }
1032#endif
1033#if 201103L <= YY_CPLUSPLUS
1034 static
1035 symbol_type
1036 make_TK_COS (location_type l)
1037 {
1038 return symbol_type (token::TK_COS, std::move (l));
1039 }
1040#else
1041 static
1042 symbol_type
1043 make_TK_COS (const location_type& l)
1044 {
1045 return symbol_type (token::TK_COS, l);
1046 }
1047#endif
1048#if 201103L <= YY_CPLUSPLUS
1049 static
1050 symbol_type
1051 make_TK_TAN (location_type l)
1052 {
1053 return symbol_type (token::TK_TAN, std::move (l));
1054 }
1055#else
1056 static
1057 symbol_type
1058 make_TK_TAN (const location_type& l)
1059 {
1060 return symbol_type (token::TK_TAN, l);
1061 }
1062#endif
1063#if 201103L <= YY_CPLUSPLUS
1064 static
1065 symbol_type
1066 make_TK_ASIN (location_type l)
1067 {
1068 return symbol_type (token::TK_ASIN, std::move (l));
1069 }
1070#else
1071 static
1072 symbol_type
1073 make_TK_ASIN (const location_type& l)
1074 {
1075 return symbol_type (token::TK_ASIN, l);
1076 }
1077#endif
1078#if 201103L <= YY_CPLUSPLUS
1079 static
1080 symbol_type
1081 make_TK_ACOS (location_type l)
1082 {
1083 return symbol_type (token::TK_ACOS, std::move (l));
1084 }
1085#else
1086 static
1087 symbol_type
1088 make_TK_ACOS (const location_type& l)
1089 {
1090 return symbol_type (token::TK_ACOS, l);
1091 }
1092#endif
1093#if 201103L <= YY_CPLUSPLUS
1094 static
1095 symbol_type
1096 make_TK_ATAN (location_type l)
1097 {
1098 return symbol_type (token::TK_ATAN, std::move (l));
1099 }
1100#else
1101 static
1102 symbol_type
1103 make_TK_ATAN (const location_type& l)
1104 {
1105 return symbol_type (token::TK_ATAN, l);
1106 }
1107#endif
1108#if 201103L <= YY_CPLUSPLUS
1109 static
1110 symbol_type
1111 make_TK_ATAN2 (location_type l)
1112 {
1113 return symbol_type (token::TK_ATAN2, std::move (l));
1114 }
1115#else
1116 static
1117 symbol_type
1118 make_TK_ATAN2 (const location_type& l)
1119 {
1120 return symbol_type (token::TK_ATAN2, l);
1121 }
1122#endif
1123#if 201103L <= YY_CPLUSPLUS
1124 static
1125 symbol_type
1126 make_TK_SINH (location_type l)
1127 {
1128 return symbol_type (token::TK_SINH, std::move (l));
1129 }
1130#else
1131 static
1132 symbol_type
1133 make_TK_SINH (const location_type& l)
1134 {
1135 return symbol_type (token::TK_SINH, l);
1136 }
1137#endif
1138#if 201103L <= YY_CPLUSPLUS
1139 static
1140 symbol_type
1141 make_TK_COSH (location_type l)
1142 {
1143 return symbol_type (token::TK_COSH, std::move (l));
1144 }
1145#else
1146 static
1147 symbol_type
1148 make_TK_COSH (const location_type& l)
1149 {
1150 return symbol_type (token::TK_COSH, l);
1151 }
1152#endif
1153#if 201103L <= YY_CPLUSPLUS
1154 static
1155 symbol_type
1156 make_TK_TANH (location_type l)
1157 {
1158 return symbol_type (token::TK_TANH, std::move (l));
1159 }
1160#else
1161 static
1162 symbol_type
1163 make_TK_TANH (const location_type& l)
1164 {
1165 return symbol_type (token::TK_TANH, l);
1166 }
1167#endif
1168#if 201103L <= YY_CPLUSPLUS
1169 static
1170 symbol_type
1171 make_TK_MIN (location_type l)
1172 {
1173 return symbol_type (token::TK_MIN, std::move (l));
1174 }
1175#else
1176 static
1177 symbol_type
1178 make_TK_MIN (const location_type& l)
1179 {
1180 return symbol_type (token::TK_MIN, l);
1181 }
1182#endif
1183#if 201103L <= YY_CPLUSPLUS
1184 static
1185 symbol_type
1186 make_TK_MAX (location_type l)
1187 {
1188 return symbol_type (token::TK_MAX, std::move (l));
1189 }
1190#else
1191 static
1192 symbol_type
1193 make_TK_MAX (const location_type& l)
1194 {
1195 return symbol_type (token::TK_MAX, l);
1196 }
1197#endif
1198#if 201103L <= YY_CPLUSPLUS
1199 static
1200 symbol_type
1201 make_TK_SQRT (location_type l)
1202 {
1203 return symbol_type (token::TK_SQRT, std::move (l));
1204 }
1205#else
1206 static
1207 symbol_type
1208 make_TK_SQRT (const location_type& l)
1209 {
1210 return symbol_type (token::TK_SQRT, l);
1211 }
1212#endif
1213#if 201103L <= YY_CPLUSPLUS
1214 static
1215 symbol_type
1216 make_TK_POW (location_type l)
1217 {
1218 return symbol_type (token::TK_POW, std::move (l));
1219 }
1220#else
1221 static
1222 symbol_type
1223 make_TK_POW (const location_type& l)
1224 {
1225 return symbol_type (token::TK_POW, l);
1226 }
1227#endif
1228#if 201103L <= YY_CPLUSPLUS
1229 static
1230 symbol_type
1231 make_TK_CARET (location_type l)
1232 {
1233 return symbol_type (token::TK_CARET, std::move (l));
1234 }
1235#else
1236 static
1237 symbol_type
1238 make_TK_CARET (const location_type& l)
1239 {
1240 return symbol_type (token::TK_CARET, l);
1241 }
1242#endif
1243#if 201103L <= YY_CPLUSPLUS
1244 static
1245 symbol_type
1246 make_TK_AND (location_type l)
1247 {
1248 return symbol_type (token::TK_AND, std::move (l));
1249 }
1250#else
1251 static
1252 symbol_type
1253 make_TK_AND (const location_type& l)
1254 {
1255 return symbol_type (token::TK_AND, l);
1256 }
1257#endif
1258#if 201103L <= YY_CPLUSPLUS
1259 static
1260 symbol_type
1261 make_TK_OR (location_type l)
1262 {
1263 return symbol_type (token::TK_OR, std::move (l));
1264 }
1265#else
1266 static
1267 symbol_type
1268 make_TK_OR (const location_type& l)
1269 {
1270 return symbol_type (token::TK_OR, l);
1271 }
1272#endif
1273#if 201103L <= YY_CPLUSPLUS
1274 static
1275 symbol_type
1276 make_TK_NOT (location_type l)
1277 {
1278 return symbol_type (token::TK_NOT, std::move (l));
1279 }
1280#else
1281 static
1282 symbol_type
1283 make_TK_NOT (const location_type& l)
1284 {
1285 return symbol_type (token::TK_NOT, l);
1286 }
1287#endif
1288#if 201103L <= YY_CPLUSPLUS
1289 static
1290 symbol_type
1291 make_TK_IMPLIES (location_type l)
1292 {
1293 return symbol_type (token::TK_IMPLIES, std::move (l));
1294 }
1295#else
1296 static
1297 symbol_type
1298 make_TK_IMPLIES (const location_type& l)
1299 {
1300 return symbol_type (token::TK_IMPLIES, l);
1301 }
1302#endif
1303#if 201103L <= YY_CPLUSPLUS
1304 static
1305 symbol_type
1306 make_TK_LB (location_type l)
1307 {
1308 return symbol_type (token::TK_LB, std::move (l));
1309 }
1310#else
1311 static
1312 symbol_type
1313 make_TK_LB (const location_type& l)
1314 {
1315 return symbol_type (token::TK_LB, l);
1316 }
1317#endif
1318#if 201103L <= YY_CPLUSPLUS
1319 static
1320 symbol_type
1321 make_TK_RB (location_type l)
1322 {
1323 return symbol_type (token::TK_RB, std::move (l));
1324 }
1325#else
1326 static
1327 symbol_type
1328 make_TK_RB (const location_type& l)
1329 {
1330 return symbol_type (token::TK_RB, l);
1331 }
1332#endif
1333#if 201103L <= YY_CPLUSPLUS
1334 static
1335 symbol_type
1336 make_TK_COLON (location_type l)
1337 {
1338 return symbol_type (token::TK_COLON, std::move (l));
1339 }
1340#else
1341 static
1342 symbol_type
1343 make_TK_COLON (const location_type& l)
1344 {
1345 return symbol_type (token::TK_COLON, l);
1346 }
1347#endif
1348#if 201103L <= YY_CPLUSPLUS
1349 static
1350 symbol_type
1351 make_TK_COMMA (location_type l)
1352 {
1353 return symbol_type (token::TK_COMMA, std::move (l));
1354 }
1355#else
1356 static
1357 symbol_type
1358 make_TK_COMMA (const location_type& l)
1359 {
1360 return symbol_type (token::TK_COMMA, l);
1361 }
1362#endif
1363#if 201103L <= YY_CPLUSPLUS
1364 static
1365 symbol_type
1366 make_TK_SEMICOLON (location_type l)
1367 {
1368 return symbol_type (token::TK_SEMICOLON, std::move (l));
1369 }
1370#else
1371 static
1372 symbol_type
1373 make_TK_SEMICOLON (const location_type& l)
1374 {
1375 return symbol_type (token::TK_SEMICOLON, l);
1376 }
1377#endif
1378#if 201103L <= YY_CPLUSPLUS
1379 static
1380 symbol_type
1381 make_DOUBLE (double v, location_type l)
1382 {
1383 return symbol_type (token::DOUBLE, std::move (v), std::move (l));
1384 }
1385#else
1386 static
1387 symbol_type
1388 make_DOUBLE (const double& v, const location_type& l)
1389 {
1390 return symbol_type (token::DOUBLE, v, l);
1391 }
1392#endif
1393#if 201103L <= YY_CPLUSPLUS
1394 static
1395 symbol_type
1396 make_ID (std::string v, location_type l)
1397 {
1398 return symbol_type (token::ID, std::move (v), std::move (l));
1399 }
1400#else
1401 static
1402 symbol_type
1403 make_ID (const std::string& v, const location_type& l)
1404 {
1405 return symbol_type (token::ID, v, l);
1406 }
1407#endif
1408#if 201103L <= YY_CPLUSPLUS
1409 static
1410 symbol_type
1411 make_TK_NEQ (location_type l)
1412 {
1413 return symbol_type (token::TK_NEQ, std::move (l));
1414 }
1415#else
1416 static
1417 symbol_type
1418 make_TK_NEQ (const location_type& l)
1419 {
1420 return symbol_type (token::TK_NEQ, l);
1421 }
1422#endif
1423#if 201103L <= YY_CPLUSPLUS
1424 static
1425 symbol_type
1426 make_TK_LEQ (location_type l)
1427 {
1428 return symbol_type (token::TK_LEQ, std::move (l));
1429 }
1430#else
1431 static
1432 symbol_type
1433 make_TK_LEQ (const location_type& l)
1434 {
1435 return symbol_type (token::TK_LEQ, l);
1436 }
1437#endif
1438#if 201103L <= YY_CPLUSPLUS
1439 static
1440 symbol_type
1441 make_TK_GEQ (location_type l)
1442 {
1443 return symbol_type (token::TK_GEQ, std::move (l));
1444 }
1445#else
1446 static
1447 symbol_type
1448 make_TK_GEQ (const location_type& l)
1449 {
1450 return symbol_type (token::TK_GEQ, l);
1451 }
1452#endif
1453#if 201103L <= YY_CPLUSPLUS
1454 static
1455 symbol_type
1456 make_UMINUS (location_type l)
1457 {
1458 return symbol_type (token::UMINUS, std::move (l));
1459 }
1460#else
1461 static
1462 symbol_type
1463 make_UMINUS (const location_type& l)
1464 {
1465 return symbol_type (token::UMINUS, l);
1466 }
1467#endif
1468
1469
1470 private:
1471 /// This class is not copyable.
1472 DrParser (const DrParser&);
1473 DrParser& operator= (const DrParser&);
1474
1475 /// Stored state numbers (used for stacks).
1476 typedef unsigned char state_type;
1477
1478 /// Generate an error message.
1479 /// \param yystate the state where the error occurred.
1480 /// \param yyla the lookahead token.
1481 virtual std::string yysyntax_error_ (state_type yystate,
1482 const symbol_type& yyla) const;
1483
1484 /// Compute post-reduction state.
1485 /// \param yystate the current state
1486 /// \param yysym the nonterminal to push on the stack
1487 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
1488
1489 /// Whether the given \c yypact_ value indicates a defaulted state.
1490 /// \param yyvalue the value to check
1491 static bool yy_pact_value_is_default_ (int yyvalue);
1492
1493 /// Whether the given \c yytable_ value indicates a syntax error.
1494 /// \param yyvalue the value to check
1495 static bool yy_table_value_is_error_ (int yyvalue);
1496
1497 static const signed char yypact_ninf_;
1498 static const signed char yytable_ninf_;
1499
1500 /// Convert a scanner token number \a t to a symbol number.
1501 /// In theory \a t should be a token_type, but character literals
1502 /// are valid, yet not members of the token_type enum.
1503 static token_number_type yytranslate_ (int t);
1504
1505 // Tables.
1506 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1507 // STATE-NUM.
1508 static const short yypact_[];
1509
1510 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1511 // Performed when YYTABLE does not specify something else to do. Zero
1512 // means the default is an error.
1513 static const signed char yydefact_[];
1514
1515 // YYPGOTO[NTERM-NUM].
1516 static const short yypgoto_[];
1517
1518 // YYDEFGOTO[NTERM-NUM].
1519 static const signed char yydefgoto_[];
1520
1521 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1522 // positive, shift that token. If negative, reduce the rule whose
1523 // number is the opposite. If YYTABLE_NINF, syntax error.
1524 static const unsigned char yytable_[];
1525
1526 static const short yycheck_[];
1527
1528 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1529 // symbol of state STATE-NUM.
1530 static const signed char yystos_[];
1531
1532 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
1533 static const signed char yyr1_[];
1534
1535 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
1536 static const signed char yyr2_[];
1537
1538
1539 /// Convert the symbol name \a n to a form suitable for a diagnostic.
1540 static std::string yytnamerr_ (const char *n);
1541
1542
1543 /// For a symbol, its name in clear.
1544 static const char* const yytname_[];
1545#if DREALDEBUG
1546 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
1547 static const unsigned char yyrline_[];
1548 /// Report on the debug stream that the rule \a r is going to be reduced.
1549 virtual void yy_reduce_print_ (int r);
1550 /// Print the state stack on the debug stream.
1551 virtual void yystack_print_ ();
1552
1553 /// Debugging level.
1554 int yydebug_;
1555 /// Debug stream.
1556 std::ostream* yycdebug_;
1557
1558 /// \brief Display a symbol type, value and location.
1559 /// \param yyo The output stream.
1560 /// \param yysym The symbol.
1561 template <typename Base>
1562 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
1563#endif
1564
1565 /// \brief Reclaim the memory associated to a symbol.
1566 /// \param yymsg Why this token is reclaimed.
1567 /// If null, print nothing.
1568 /// \param yysym The symbol.
1569 template <typename Base>
1570 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
1571
1572 private:
1573 /// Type access provider for state based symbols.
1574 struct by_state
1575 {
1576 /// Default constructor.
1577 by_state () YY_NOEXCEPT;
1578
1579 /// The symbol type as needed by the constructor.
1580 typedef state_type kind_type;
1581
1582 /// Constructor.
1583 by_state (kind_type s) YY_NOEXCEPT;
1584
1585 /// Copy constructor.
1586 by_state (const by_state& that) YY_NOEXCEPT;
1587
1588 /// Record that this symbol is empty.
1589 void clear () YY_NOEXCEPT;
1590
1591 /// Steal the symbol type from \a that.
1592 void move (by_state& that);
1593
1594 /// The (internal) type number (corresponding to \a state).
1595 /// \a empty_symbol when empty.
1596 symbol_number_type type_get () const YY_NOEXCEPT;
1597
1598 /// The state number used to denote an empty symbol.
1599 /// We use the initial state, as it does not have a value.
1600 enum { empty_state = 0 };
1601
1602 /// The state.
1603 /// \a empty when empty.
1604 state_type state;
1605 };
1606
1607 /// "Internal" symbol: element of the stack.
1608 struct stack_symbol_type : basic_symbol<by_state>
1609 {
1610 /// Superclass.
1611 typedef basic_symbol<by_state> super_type;
1612 /// Construct an empty symbol.
1613 stack_symbol_type ();
1614 /// Move or copy construction.
1615 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
1616 /// Steal the contents from \a sym to build this.
1617 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
1618#if YY_CPLUSPLUS < 201103L
1619 /// Assignment, needed by push_back by some old implementations.
1620 /// Moves the contents of that.
1621 stack_symbol_type& operator= (stack_symbol_type& that);
1622
1623 /// Assignment, needed by push_back by other implementations.
1624 /// Needed by some other old implementations.
1625 stack_symbol_type& operator= (const stack_symbol_type& that);
1626#endif
1627 };
1628
1629 /// A stack with random access from its top.
1630 template <typename T, typename S = std::vector<T> >
1631 class stack
1632 {
1633 public:
1634 // Hide our reversed order.
1635 typedef typename S::reverse_iterator iterator;
1636 typedef typename S::const_reverse_iterator const_iterator;
1637 typedef typename S::size_type size_type;
1638 typedef typename std::ptrdiff_t index_type;
1639
1640 stack (size_type n = 200)
1641 : seq_ (n)
1642 {}
1643
1644 /// Random access.
1645 ///
1646 /// Index 0 returns the topmost element.
1647 const T&
1648 operator[] (index_type i) const
1649 {
1650 return seq_[size_type (size () - 1 - i)];
1651 }
1652
1653 /// Random access.
1654 ///
1655 /// Index 0 returns the topmost element.
1656 T&
1657 operator[] (index_type i)
1658 {
1659 return seq_[size_type (size () - 1 - i)];
1660 }
1661
1662 /// Steal the contents of \a t.
1663 ///
1664 /// Close to move-semantics.
1665 void
1666 push (YY_MOVE_REF (T) t)
1667 {
1668 seq_.push_back (T ());
1669 operator[] (0).move (t);
1670 }
1671
1672 /// Pop elements from the stack.
1673 void
1674 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
1675 {
1676 for (; 0 < n; --n)
1677 seq_.pop_back ();
1678 }
1679
1680 /// Pop all elements from the stack.
1681 void
1682 clear () YY_NOEXCEPT
1683 {
1684 seq_.clear ();
1685 }
1686
1687 /// Number of elements on the stack.
1688 index_type
1689 size () const YY_NOEXCEPT
1690 {
1691 return index_type (seq_.size ());
1692 }
1693
1694 std::ptrdiff_t
1695 ssize () const YY_NOEXCEPT
1696 {
1697 return std::ptrdiff_t (size ());
1698 }
1699
1700 /// Iterator on top of the stack (going downwards).
1701 const_iterator
1702 begin () const YY_NOEXCEPT
1703 {
1704 return seq_.rbegin ();
1705 }
1706
1707 /// Bottom of the stack.
1708 const_iterator
1709 end () const YY_NOEXCEPT
1710 {
1711 return seq_.rend ();
1712 }
1713
1714 /// Present a slice of the top of a stack.
1715 class slice
1716 {
1717 public:
1718 slice (const stack& stack, index_type range)
1719 : stack_ (stack)
1720 , range_ (range)
1721 {}
1722
1723 const T&
1724 operator[] (index_type i) const
1725 {
1726 return stack_[range_ - i];
1727 }
1728
1729 private:
1730 const stack& stack_;
1731 index_type range_;
1732 };
1733
1734 private:
1735 stack (const stack&);
1736 stack& operator= (const stack&);
1737 /// The wrapped container.
1738 S seq_;
1739 };
1740
1741
1742 /// Stack type.
1743 typedef stack<stack_symbol_type> stack_type;
1744
1745 /// The stack.
1746 stack_type yystack_;
1747
1748 /// Push a new state on the stack.
1749 /// \param m a debug message to display
1750 /// if null, no trace is output.
1751 /// \param sym the symbol
1752 /// \warning the contents of \a s.value is stolen.
1753 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
1754
1755 /// Push a new look ahead token on the state on the stack.
1756 /// \param m a debug message to display
1757 /// if null, no trace is output.
1758 /// \param s the state
1759 /// \param sym the symbol (for its value and location).
1760 /// \warning the contents of \a sym.value is stolen.
1761 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
1762
1763 /// Pop \a n symbols from the stack.
1764 void yypop_ (int n = 1);
1765
1766 /// Some specific tokens.
1767 static const token_number_type yy_error_token_ = 1;
1768 static const token_number_type yy_undef_token_ = 2;
1769
1770 /// Constants.
1771 enum
1772 {
1773 yyeof_ = 0,
1774 yylast_ = 455, ///< Last index in yytable_.
1775 yynnts_ = 14, ///< Number of nonterminal symbols.
1776 yyfinal_ = 5, ///< Termination state number.
1777 yyntokens_ = 51 ///< Number of tokens.
1778 };
1779
1780
1781 // User arguments.
1782 class DrDriver& driver;
1783 };
1784
1785
1786} // dreal
1787#line 1788 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.hh"
1788
1789
1790
1791
1792
1793#endif // !YY_DREAL_BAZEL_OUT_K8_OPT_BIN_DREAL_DR_PARSER_YY_HH_INCLUDED