diff options
Diffstat (limited to 'Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.cc')
-rwxr-xr-x | Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.cc | 1691 |
1 files changed, 1691 insertions, 0 deletions
diff --git a/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.cc b/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.cc new file mode 100755 index 00000000..d63d2217 --- /dev/null +++ b/Solvers/dreal4/bazel-bin/dreal/dr/parser.yy.cc | |||
@@ -0,0 +1,1691 @@ | |||
1 | // A Bison parser, made by GNU Bison 3.5. | ||
2 | |||
3 | // Skeleton implementation 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 | // Undocumented macros, especially those whose name start with YY_, | ||
34 | // are private implementation details. Do not rely on them. | ||
35 | |||
36 | |||
37 | // Take the name prefix into account. | ||
38 | #define yylex dreallex | ||
39 | |||
40 | // First part of user prologue. | ||
41 | #line 1 "dreal/dr/parser.yy" | ||
42 | |||
43 | |||
44 | #include <iostream> | ||
45 | #include <string> | ||
46 | |||
47 | #include "dreal/symbolic/symbolic.h" | ||
48 | |||
49 | #pragma GCC diagnostic push | ||
50 | #pragma GCC diagnostic ignored "-Wold-style-cast" | ||
51 | #pragma GCC diagnostic ignored "-Wdeprecated" | ||
52 | |||
53 | #ifdef __clang__ | ||
54 | #pragma clang diagnostic push | ||
55 | #pragma clang diagnostic ignored "-Wunknown-warning-option" | ||
56 | #pragma clang diagnostic ignored "-Wdtor-name" | ||
57 | #endif | ||
58 | |||
59 | /* void yyerror(SmtPrsr parser, const char *); */ | ||
60 | #define YYMAXDEPTH 1024 * 1024 | ||
61 | #line 89 "dreal/dr/parser.yy" | ||
62 | |||
63 | |||
64 | #include "dreal/dr/driver.h" | ||
65 | #include "dreal/dr/scanner.h" | ||
66 | |||
67 | /* this "connects" the bison parser in the driver to the flex scanner class | ||
68 | * object. it defines the yylex() function call to pull the next token from the | ||
69 | * current lexer object of the driver context. */ | ||
70 | #undef yylex | ||
71 | #define yylex driver.scanner_->lex | ||
72 | |||
73 | |||
74 | #line 75 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
75 | |||
76 | |||
77 | #include "parser.yy.hh" | ||
78 | |||
79 | |||
80 | |||
81 | |||
82 | #ifndef YY_ | ||
83 | # if defined YYENABLE_NLS && YYENABLE_NLS | ||
84 | # if ENABLE_NLS | ||
85 | # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE. | ||
86 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | ||
87 | # endif | ||
88 | # endif | ||
89 | # ifndef YY_ | ||
90 | # define YY_(msgid) msgid | ||
91 | # endif | ||
92 | #endif | ||
93 | |||
94 | // Whether we are compiled with exception support. | ||
95 | #ifndef YY_EXCEPTIONS | ||
96 | # if defined __GNUC__ && !defined __EXCEPTIONS | ||
97 | # define YY_EXCEPTIONS 0 | ||
98 | # else | ||
99 | # define YY_EXCEPTIONS 1 | ||
100 | # endif | ||
101 | #endif | ||
102 | |||
103 | #define YYRHSLOC(Rhs, K) ((Rhs)[K].location) | ||
104 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | ||
105 | If N is 0, then set CURRENT to the empty location which ends | ||
106 | the previous symbol: RHS[0] (always defined). */ | ||
107 | |||
108 | # ifndef YYLLOC_DEFAULT | ||
109 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | ||
110 | do \ | ||
111 | if (N) \ | ||
112 | { \ | ||
113 | (Current).begin = YYRHSLOC (Rhs, 1).begin; \ | ||
114 | (Current).end = YYRHSLOC (Rhs, N).end; \ | ||
115 | } \ | ||
116 | else \ | ||
117 | { \ | ||
118 | (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ | ||
119 | } \ | ||
120 | while (false) | ||
121 | # endif | ||
122 | |||
123 | |||
124 | // Enable debugging if requested. | ||
125 | #if DREALDEBUG | ||
126 | |||
127 | // A pseudo ostream that takes yydebug_ into account. | ||
128 | # define YYCDEBUG if (yydebug_) (*yycdebug_) | ||
129 | |||
130 | # define YY_SYMBOL_PRINT(Title, Symbol) \ | ||
131 | do { \ | ||
132 | if (yydebug_) \ | ||
133 | { \ | ||
134 | *yycdebug_ << Title << ' '; \ | ||
135 | yy_print_ (*yycdebug_, Symbol); \ | ||
136 | *yycdebug_ << '\n'; \ | ||
137 | } \ | ||
138 | } while (false) | ||
139 | |||
140 | # define YY_REDUCE_PRINT(Rule) \ | ||
141 | do { \ | ||
142 | if (yydebug_) \ | ||
143 | yy_reduce_print_ (Rule); \ | ||
144 | } while (false) | ||
145 | |||
146 | # define YY_STACK_PRINT() \ | ||
147 | do { \ | ||
148 | if (yydebug_) \ | ||
149 | yystack_print_ (); \ | ||
150 | } while (false) | ||
151 | |||
152 | #else // !DREALDEBUG | ||
153 | |||
154 | # define YYCDEBUG if (false) std::cerr | ||
155 | # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) | ||
156 | # define YY_REDUCE_PRINT(Rule) static_cast<void> (0) | ||
157 | # define YY_STACK_PRINT() static_cast<void> (0) | ||
158 | |||
159 | #endif // !DREALDEBUG | ||
160 | |||
161 | #define yyerrok (yyerrstatus_ = 0) | ||
162 | #define yyclearin (yyla.clear ()) | ||
163 | |||
164 | #define YYACCEPT goto yyacceptlab | ||
165 | #define YYABORT goto yyabortlab | ||
166 | #define YYERROR goto yyerrorlab | ||
167 | #define YYRECOVERING() (!!yyerrstatus_) | ||
168 | |||
169 | namespace dreal { | ||
170 | #line 171 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
171 | |||
172 | |||
173 | /* Return YYSTR after stripping away unnecessary quotes and | ||
174 | backslashes, so that it's suitable for yyerror. The heuristic is | ||
175 | that double-quoting is unnecessary unless the string contains an | ||
176 | apostrophe, a comma, or backslash (other than backslash-backslash). | ||
177 | YYSTR is taken from yytname. */ | ||
178 | std::string | ||
179 | DrParser::yytnamerr_ (const char *yystr) | ||
180 | { | ||
181 | if (*yystr == '"') | ||
182 | { | ||
183 | std::string yyr; | ||
184 | char const *yyp = yystr; | ||
185 | |||
186 | for (;;) | ||
187 | switch (*++yyp) | ||
188 | { | ||
189 | case '\'': | ||
190 | case ',': | ||
191 | goto do_not_strip_quotes; | ||
192 | |||
193 | case '\\': | ||
194 | if (*++yyp != '\\') | ||
195 | goto do_not_strip_quotes; | ||
196 | else | ||
197 | goto append; | ||
198 | |||
199 | append: | ||
200 | default: | ||
201 | yyr += *yyp; | ||
202 | break; | ||
203 | |||
204 | case '"': | ||
205 | return yyr; | ||
206 | } | ||
207 | do_not_strip_quotes: ; | ||
208 | } | ||
209 | |||
210 | return yystr; | ||
211 | } | ||
212 | |||
213 | |||
214 | /// Build a parser object. | ||
215 | DrParser::DrParser (class DrDriver& driver_yyarg) | ||
216 | #if DREALDEBUG | ||
217 | : yydebug_ (false), | ||
218 | yycdebug_ (&std::cerr), | ||
219 | #else | ||
220 | : | ||
221 | #endif | ||
222 | driver (driver_yyarg) | ||
223 | {} | ||
224 | |||
225 | DrParser::~DrParser () | ||
226 | {} | ||
227 | |||
228 | DrParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW | ||
229 | {} | ||
230 | |||
231 | /*---------------. | ||
232 | | Symbol types. | | ||
233 | `---------------*/ | ||
234 | |||
235 | // basic_symbol. | ||
236 | #if 201103L <= YY_CPLUSPLUS | ||
237 | template <typename Base> | ||
238 | DrParser::basic_symbol<Base>::basic_symbol (basic_symbol&& that) | ||
239 | : Base (std::move (that)) | ||
240 | , value () | ||
241 | , location (std::move (that.location)) | ||
242 | { | ||
243 | switch (this->type_get ()) | ||
244 | { | ||
245 | case 64: // expr | ||
246 | value.move< Expression > (std::move (that.value)); | ||
247 | break; | ||
248 | |||
249 | case 63: // formula | ||
250 | value.move< Formula > (std::move (that.value)); | ||
251 | break; | ||
252 | |||
253 | case 43: // "double" | ||
254 | value.move< double > (std::move (that.value)); | ||
255 | break; | ||
256 | |||
257 | case 44: // "identifier" | ||
258 | value.move< std::string > (std::move (that.value)); | ||
259 | break; | ||
260 | |||
261 | default: | ||
262 | break; | ||
263 | } | ||
264 | |||
265 | } | ||
266 | #endif | ||
267 | |||
268 | template <typename Base> | ||
269 | DrParser::basic_symbol<Base>::basic_symbol (const basic_symbol& that) | ||
270 | : Base (that) | ||
271 | , value () | ||
272 | , location (that.location) | ||
273 | { | ||
274 | switch (this->type_get ()) | ||
275 | { | ||
276 | case 64: // expr | ||
277 | value.copy< Expression > (YY_MOVE (that.value)); | ||
278 | break; | ||
279 | |||
280 | case 63: // formula | ||
281 | value.copy< Formula > (YY_MOVE (that.value)); | ||
282 | break; | ||
283 | |||
284 | case 43: // "double" | ||
285 | value.copy< double > (YY_MOVE (that.value)); | ||
286 | break; | ||
287 | |||
288 | case 44: // "identifier" | ||
289 | value.copy< std::string > (YY_MOVE (that.value)); | ||
290 | break; | ||
291 | |||
292 | default: | ||
293 | break; | ||
294 | } | ||
295 | |||
296 | } | ||
297 | |||
298 | |||
299 | |||
300 | template <typename Base> | ||
301 | bool | ||
302 | DrParser::basic_symbol<Base>::empty () const YY_NOEXCEPT | ||
303 | { | ||
304 | return Base::type_get () == empty_symbol; | ||
305 | } | ||
306 | |||
307 | template <typename Base> | ||
308 | void | ||
309 | DrParser::basic_symbol<Base>::move (basic_symbol& s) | ||
310 | { | ||
311 | super_type::move (s); | ||
312 | switch (this->type_get ()) | ||
313 | { | ||
314 | case 64: // expr | ||
315 | value.move< Expression > (YY_MOVE (s.value)); | ||
316 | break; | ||
317 | |||
318 | case 63: // formula | ||
319 | value.move< Formula > (YY_MOVE (s.value)); | ||
320 | break; | ||
321 | |||
322 | case 43: // "double" | ||
323 | value.move< double > (YY_MOVE (s.value)); | ||
324 | break; | ||
325 | |||
326 | case 44: // "identifier" | ||
327 | value.move< std::string > (YY_MOVE (s.value)); | ||
328 | break; | ||
329 | |||
330 | default: | ||
331 | break; | ||
332 | } | ||
333 | |||
334 | location = YY_MOVE (s.location); | ||
335 | } | ||
336 | |||
337 | // by_type. | ||
338 | DrParser::by_type::by_type () | ||
339 | : type (empty_symbol) | ||
340 | {} | ||
341 | |||
342 | #if 201103L <= YY_CPLUSPLUS | ||
343 | DrParser::by_type::by_type (by_type&& that) | ||
344 | : type (that.type) | ||
345 | { | ||
346 | that.clear (); | ||
347 | } | ||
348 | #endif | ||
349 | |||
350 | DrParser::by_type::by_type (const by_type& that) | ||
351 | : type (that.type) | ||
352 | {} | ||
353 | |||
354 | DrParser::by_type::by_type (token_type t) | ||
355 | : type (yytranslate_ (t)) | ||
356 | {} | ||
357 | |||
358 | void | ||
359 | DrParser::by_type::clear () | ||
360 | { | ||
361 | type = empty_symbol; | ||
362 | } | ||
363 | |||
364 | void | ||
365 | DrParser::by_type::move (by_type& that) | ||
366 | { | ||
367 | type = that.type; | ||
368 | that.clear (); | ||
369 | } | ||
370 | |||
371 | int | ||
372 | DrParser::by_type::type_get () const YY_NOEXCEPT | ||
373 | { | ||
374 | return type; | ||
375 | } | ||
376 | |||
377 | |||
378 | // by_state. | ||
379 | DrParser::by_state::by_state () YY_NOEXCEPT | ||
380 | : state (empty_state) | ||
381 | {} | ||
382 | |||
383 | DrParser::by_state::by_state (const by_state& that) YY_NOEXCEPT | ||
384 | : state (that.state) | ||
385 | {} | ||
386 | |||
387 | void | ||
388 | DrParser::by_state::clear () YY_NOEXCEPT | ||
389 | { | ||
390 | state = empty_state; | ||
391 | } | ||
392 | |||
393 | void | ||
394 | DrParser::by_state::move (by_state& that) | ||
395 | { | ||
396 | state = that.state; | ||
397 | that.clear (); | ||
398 | } | ||
399 | |||
400 | DrParser::by_state::by_state (state_type s) YY_NOEXCEPT | ||
401 | : state (s) | ||
402 | {} | ||
403 | |||
404 | DrParser::symbol_number_type | ||
405 | DrParser::by_state::type_get () const YY_NOEXCEPT | ||
406 | { | ||
407 | if (state == empty_state) | ||
408 | return empty_symbol; | ||
409 | else | ||
410 | return yystos_[state]; | ||
411 | } | ||
412 | |||
413 | DrParser::stack_symbol_type::stack_symbol_type () | ||
414 | {} | ||
415 | |||
416 | DrParser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) | ||
417 | : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) | ||
418 | { | ||
419 | switch (that.type_get ()) | ||
420 | { | ||
421 | case 64: // expr | ||
422 | value.YY_MOVE_OR_COPY< Expression > (YY_MOVE (that.value)); | ||
423 | break; | ||
424 | |||
425 | case 63: // formula | ||
426 | value.YY_MOVE_OR_COPY< Formula > (YY_MOVE (that.value)); | ||
427 | break; | ||
428 | |||
429 | case 43: // "double" | ||
430 | value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value)); | ||
431 | break; | ||
432 | |||
433 | case 44: // "identifier" | ||
434 | value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); | ||
435 | break; | ||
436 | |||
437 | default: | ||
438 | break; | ||
439 | } | ||
440 | |||
441 | #if 201103L <= YY_CPLUSPLUS | ||
442 | // that is emptied. | ||
443 | that.state = empty_state; | ||
444 | #endif | ||
445 | } | ||
446 | |||
447 | DrParser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) | ||
448 | : super_type (s, YY_MOVE (that.location)) | ||
449 | { | ||
450 | switch (that.type_get ()) | ||
451 | { | ||
452 | case 64: // expr | ||
453 | value.move< Expression > (YY_MOVE (that.value)); | ||
454 | break; | ||
455 | |||
456 | case 63: // formula | ||
457 | value.move< Formula > (YY_MOVE (that.value)); | ||
458 | break; | ||
459 | |||
460 | case 43: // "double" | ||
461 | value.move< double > (YY_MOVE (that.value)); | ||
462 | break; | ||
463 | |||
464 | case 44: // "identifier" | ||
465 | value.move< std::string > (YY_MOVE (that.value)); | ||
466 | break; | ||
467 | |||
468 | default: | ||
469 | break; | ||
470 | } | ||
471 | |||
472 | // that is emptied. | ||
473 | that.type = empty_symbol; | ||
474 | } | ||
475 | |||
476 | #if YY_CPLUSPLUS < 201103L | ||
477 | DrParser::stack_symbol_type& | ||
478 | DrParser::stack_symbol_type::operator= (const stack_symbol_type& that) | ||
479 | { | ||
480 | state = that.state; | ||
481 | switch (that.type_get ()) | ||
482 | { | ||
483 | case 64: // expr | ||
484 | value.copy< Expression > (that.value); | ||
485 | break; | ||
486 | |||
487 | case 63: // formula | ||
488 | value.copy< Formula > (that.value); | ||
489 | break; | ||
490 | |||
491 | case 43: // "double" | ||
492 | value.copy< double > (that.value); | ||
493 | break; | ||
494 | |||
495 | case 44: // "identifier" | ||
496 | value.copy< std::string > (that.value); | ||
497 | break; | ||
498 | |||
499 | default: | ||
500 | break; | ||
501 | } | ||
502 | |||
503 | location = that.location; | ||
504 | return *this; | ||
505 | } | ||
506 | |||
507 | DrParser::stack_symbol_type& | ||
508 | DrParser::stack_symbol_type::operator= (stack_symbol_type& that) | ||
509 | { | ||
510 | state = that.state; | ||
511 | switch (that.type_get ()) | ||
512 | { | ||
513 | case 64: // expr | ||
514 | value.move< Expression > (that.value); | ||
515 | break; | ||
516 | |||
517 | case 63: // formula | ||
518 | value.move< Formula > (that.value); | ||
519 | break; | ||
520 | |||
521 | case 43: // "double" | ||
522 | value.move< double > (that.value); | ||
523 | break; | ||
524 | |||
525 | case 44: // "identifier" | ||
526 | value.move< std::string > (that.value); | ||
527 | break; | ||
528 | |||
529 | default: | ||
530 | break; | ||
531 | } | ||
532 | |||
533 | location = that.location; | ||
534 | // that is emptied. | ||
535 | that.state = empty_state; | ||
536 | return *this; | ||
537 | } | ||
538 | #endif | ||
539 | |||
540 | template <typename Base> | ||
541 | void | ||
542 | DrParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const | ||
543 | { | ||
544 | if (yymsg) | ||
545 | YY_SYMBOL_PRINT (yymsg, yysym); | ||
546 | } | ||
547 | |||
548 | #if DREALDEBUG | ||
549 | template <typename Base> | ||
550 | void | ||
551 | DrParser::yy_print_ (std::ostream& yyo, | ||
552 | const basic_symbol<Base>& yysym) const | ||
553 | { | ||
554 | std::ostream& yyoutput = yyo; | ||
555 | YYUSE (yyoutput); | ||
556 | symbol_number_type yytype = yysym.type_get (); | ||
557 | #if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408 | ||
558 | // Avoid a (spurious) G++ 4.8 warning about "array subscript is | ||
559 | // below array bounds". | ||
560 | if (yysym.empty ()) | ||
561 | std::abort (); | ||
562 | #endif | ||
563 | yyo << (yytype < yyntokens_ ? "token" : "nterm") | ||
564 | << ' ' << yytname_[yytype] << " (" | ||
565 | << yysym.location << ": "; | ||
566 | YYUSE (yytype); | ||
567 | yyo << ')'; | ||
568 | } | ||
569 | #endif | ||
570 | |||
571 | void | ||
572 | DrParser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) | ||
573 | { | ||
574 | if (m) | ||
575 | YY_SYMBOL_PRINT (m, sym); | ||
576 | yystack_.push (YY_MOVE (sym)); | ||
577 | } | ||
578 | |||
579 | void | ||
580 | DrParser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) | ||
581 | { | ||
582 | #if 201103L <= YY_CPLUSPLUS | ||
583 | yypush_ (m, stack_symbol_type (s, std::move (sym))); | ||
584 | #else | ||
585 | stack_symbol_type ss (s, sym); | ||
586 | yypush_ (m, ss); | ||
587 | #endif | ||
588 | } | ||
589 | |||
590 | void | ||
591 | DrParser::yypop_ (int n) | ||
592 | { | ||
593 | yystack_.pop (n); | ||
594 | } | ||
595 | |||
596 | #if DREALDEBUG | ||
597 | std::ostream& | ||
598 | DrParser::debug_stream () const | ||
599 | { | ||
600 | return *yycdebug_; | ||
601 | } | ||
602 | |||
603 | void | ||
604 | DrParser::set_debug_stream (std::ostream& o) | ||
605 | { | ||
606 | yycdebug_ = &o; | ||
607 | } | ||
608 | |||
609 | |||
610 | DrParser::debug_level_type | ||
611 | DrParser::debug_level () const | ||
612 | { | ||
613 | return yydebug_; | ||
614 | } | ||
615 | |||
616 | void | ||
617 | DrParser::set_debug_level (debug_level_type l) | ||
618 | { | ||
619 | yydebug_ = l; | ||
620 | } | ||
621 | #endif // DREALDEBUG | ||
622 | |||
623 | DrParser::state_type | ||
624 | DrParser::yy_lr_goto_state_ (state_type yystate, int yysym) | ||
625 | { | ||
626 | int yyr = yypgoto_[yysym - yyntokens_] + yystate; | ||
627 | if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) | ||
628 | return yytable_[yyr]; | ||
629 | else | ||
630 | return yydefgoto_[yysym - yyntokens_]; | ||
631 | } | ||
632 | |||
633 | bool | ||
634 | DrParser::yy_pact_value_is_default_ (int yyvalue) | ||
635 | { | ||
636 | return yyvalue == yypact_ninf_; | ||
637 | } | ||
638 | |||
639 | bool | ||
640 | DrParser::yy_table_value_is_error_ (int yyvalue) | ||
641 | { | ||
642 | return yyvalue == yytable_ninf_; | ||
643 | } | ||
644 | |||
645 | int | ||
646 | DrParser::operator() () | ||
647 | { | ||
648 | return parse (); | ||
649 | } | ||
650 | |||
651 | int | ||
652 | DrParser::parse () | ||
653 | { | ||
654 | int yyn; | ||
655 | /// Length of the RHS of the rule being reduced. | ||
656 | int yylen = 0; | ||
657 | |||
658 | // Error handling. | ||
659 | int yynerrs_ = 0; | ||
660 | int yyerrstatus_ = 0; | ||
661 | |||
662 | /// The lookahead symbol. | ||
663 | symbol_type yyla; | ||
664 | |||
665 | /// The locations where the error started and ended. | ||
666 | stack_symbol_type yyerror_range[3]; | ||
667 | |||
668 | /// The return value of parse (). | ||
669 | int yyresult; | ||
670 | |||
671 | #if YY_EXCEPTIONS | ||
672 | try | ||
673 | #endif // YY_EXCEPTIONS | ||
674 | { | ||
675 | YYCDEBUG << "Starting parse\n"; | ||
676 | |||
677 | |||
678 | // User initialization code. | ||
679 | #line 46 "dreal/dr/parser.yy" | ||
680 | { | ||
681 | // initialize the initial location object | ||
682 | yyla.location.begin.filename = yyla.location.end.filename = &driver.streamname_; | ||
683 | } | ||
684 | |||
685 | #line 686 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
686 | |||
687 | |||
688 | /* Initialize the stack. The initial state will be set in | ||
689 | yynewstate, since the latter expects the semantical and the | ||
690 | location values to have been already stored, initialize these | ||
691 | stacks with a primary value. */ | ||
692 | yystack_.clear (); | ||
693 | yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); | ||
694 | |||
695 | /*-----------------------------------------------. | ||
696 | | yynewstate -- push a new symbol on the stack. | | ||
697 | `-----------------------------------------------*/ | ||
698 | yynewstate: | ||
699 | YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; | ||
700 | |||
701 | // Accept? | ||
702 | if (yystack_[0].state == yyfinal_) | ||
703 | YYACCEPT; | ||
704 | |||
705 | goto yybackup; | ||
706 | |||
707 | |||
708 | /*-----------. | ||
709 | | yybackup. | | ||
710 | `-----------*/ | ||
711 | yybackup: | ||
712 | // Try to take a decision without lookahead. | ||
713 | yyn = yypact_[yystack_[0].state]; | ||
714 | if (yy_pact_value_is_default_ (yyn)) | ||
715 | goto yydefault; | ||
716 | |||
717 | // Read a lookahead token. | ||
718 | if (yyla.empty ()) | ||
719 | { | ||
720 | YYCDEBUG << "Reading a token: "; | ||
721 | #if YY_EXCEPTIONS | ||
722 | try | ||
723 | #endif // YY_EXCEPTIONS | ||
724 | { | ||
725 | yyla.type = yytranslate_ (yylex (&yyla.value, &yyla.location)); | ||
726 | } | ||
727 | #if YY_EXCEPTIONS | ||
728 | catch (const syntax_error& yyexc) | ||
729 | { | ||
730 | YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; | ||
731 | error (yyexc); | ||
732 | goto yyerrlab1; | ||
733 | } | ||
734 | #endif // YY_EXCEPTIONS | ||
735 | } | ||
736 | YY_SYMBOL_PRINT ("Next token is", yyla); | ||
737 | |||
738 | /* If the proper action on seeing token YYLA.TYPE is to reduce or | ||
739 | to detect an error, take that action. */ | ||
740 | yyn += yyla.type_get (); | ||
741 | if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ()) | ||
742 | { | ||
743 | goto yydefault; | ||
744 | } | ||
745 | |||
746 | // Reduce or error. | ||
747 | yyn = yytable_[yyn]; | ||
748 | if (yyn <= 0) | ||
749 | { | ||
750 | if (yy_table_value_is_error_ (yyn)) | ||
751 | goto yyerrlab; | ||
752 | yyn = -yyn; | ||
753 | goto yyreduce; | ||
754 | } | ||
755 | |||
756 | // Count tokens shifted since error; after three, turn off error status. | ||
757 | if (yyerrstatus_) | ||
758 | --yyerrstatus_; | ||
759 | |||
760 | // Shift the lookahead token. | ||
761 | yypush_ ("Shifting", static_cast<state_type> (yyn), YY_MOVE (yyla)); | ||
762 | goto yynewstate; | ||
763 | |||
764 | |||
765 | /*-----------------------------------------------------------. | ||
766 | | yydefault -- do the default action for the current state. | | ||
767 | `-----------------------------------------------------------*/ | ||
768 | yydefault: | ||
769 | yyn = yydefact_[yystack_[0].state]; | ||
770 | if (yyn == 0) | ||
771 | goto yyerrlab; | ||
772 | goto yyreduce; | ||
773 | |||
774 | |||
775 | /*-----------------------------. | ||
776 | | yyreduce -- do a reduction. | | ||
777 | `-----------------------------*/ | ||
778 | yyreduce: | ||
779 | yylen = yyr2_[yyn]; | ||
780 | { | ||
781 | stack_symbol_type yylhs; | ||
782 | yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); | ||
783 | /* Variants are always initialized to an empty instance of the | ||
784 | correct type. The default '$$ = $1' action is NOT applied | ||
785 | when using variants. */ | ||
786 | switch (yyr1_[yyn]) | ||
787 | { | ||
788 | case 64: // expr | ||
789 | yylhs.value.emplace< Expression > (); | ||
790 | break; | ||
791 | |||
792 | case 63: // formula | ||
793 | yylhs.value.emplace< Formula > (); | ||
794 | break; | ||
795 | |||
796 | case 43: // "double" | ||
797 | yylhs.value.emplace< double > (); | ||
798 | break; | ||
799 | |||
800 | case 44: // "identifier" | ||
801 | yylhs.value.emplace< std::string > (); | ||
802 | break; | ||
803 | |||
804 | default: | ||
805 | break; | ||
806 | } | ||
807 | |||
808 | |||
809 | // Default location. | ||
810 | { | ||
811 | stack_type::slice range (yystack_, yylen); | ||
812 | YYLLOC_DEFAULT (yylhs.location, range, yylen); | ||
813 | yyerror_range[1].location = yylhs.location; | ||
814 | } | ||
815 | |||
816 | // Perform the reduction. | ||
817 | YY_REDUCE_PRINT (yyn); | ||
818 | #if YY_EXCEPTIONS | ||
819 | try | ||
820 | #endif // YY_EXCEPTIONS | ||
821 | { | ||
822 | switch (yyn) | ||
823 | { | ||
824 | case 2: | ||
825 | #line 107 "dreal/dr/parser.yy" | ||
826 | { | ||
827 | driver.Solve(); | ||
828 | } | ||
829 | #line 830 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
830 | break; | ||
831 | |||
832 | case 6: | ||
833 | #line 122 "dreal/dr/parser.yy" | ||
834 | { | ||
835 | driver.DeclareVariable(Variable{yystack_[1].value.as < std::string > (), Variable::Type::CONTINUOUS}, yystack_[5].value.as < Expression > ().Evaluate(), yystack_[3].value.as < Expression > ().Evaluate()); | ||
836 | } | ||
837 | #line 838 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
838 | break; | ||
839 | |||
840 | case 7: | ||
841 | #line 125 "dreal/dr/parser.yy" | ||
842 | { | ||
843 | driver.DeclareVariable(Variable{yystack_[1].value.as < std::string > (), Variable::Type::CONTINUOUS}, yystack_[2].value.as < Expression > ().Evaluate(), yystack_[2].value.as < Expression > ().Evaluate()); | ||
844 | } | ||
845 | #line 846 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
846 | break; | ||
847 | |||
848 | case 13: | ||
849 | #line 144 "dreal/dr/parser.yy" | ||
850 | { | ||
851 | driver.Assert(yystack_[1].value.as < Formula > ()); | ||
852 | } | ||
853 | #line 854 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
854 | break; | ||
855 | |||
856 | case 18: | ||
857 | #line 160 "dreal/dr/parser.yy" | ||
858 | { | ||
859 | driver.Minimize(yystack_[1].value.as < Expression > ()); | ||
860 | } | ||
861 | #line 862 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
862 | break; | ||
863 | |||
864 | case 19: | ||
865 | #line 169 "dreal/dr/parser.yy" | ||
866 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Expression > () == yystack_[0].value.as < Expression > (); } | ||
867 | #line 868 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
868 | break; | ||
869 | |||
870 | case 20: | ||
871 | #line 170 "dreal/dr/parser.yy" | ||
872 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Expression > () < yystack_[0].value.as < Expression > (); } | ||
873 | #line 874 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
874 | break; | ||
875 | |||
876 | case 21: | ||
877 | #line 171 "dreal/dr/parser.yy" | ||
878 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Expression > () <= yystack_[0].value.as < Expression > (); } | ||
879 | #line 880 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
880 | break; | ||
881 | |||
882 | case 22: | ||
883 | #line 172 "dreal/dr/parser.yy" | ||
884 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Expression > () > yystack_[0].value.as < Expression > (); } | ||
885 | #line 886 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
886 | break; | ||
887 | |||
888 | case 23: | ||
889 | #line 173 "dreal/dr/parser.yy" | ||
890 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Expression > () >= yystack_[0].value.as < Expression > (); } | ||
891 | #line 892 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
892 | break; | ||
893 | |||
894 | case 24: | ||
895 | #line 174 "dreal/dr/parser.yy" | ||
896 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Formula > () && yystack_[0].value.as < Formula > (); } | ||
897 | #line 898 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
898 | break; | ||
899 | |||
900 | case 25: | ||
901 | #line 175 "dreal/dr/parser.yy" | ||
902 | { yylhs.value.as < Formula > () = yystack_[2].value.as < Formula > () || yystack_[0].value.as < Formula > (); } | ||
903 | #line 904 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
904 | break; | ||
905 | |||
906 | case 26: | ||
907 | #line 176 "dreal/dr/parser.yy" | ||
908 | { yylhs.value.as < Formula > () = !yystack_[2].value.as < Formula > () || yystack_[0].value.as < Formula > (); } | ||
909 | #line 910 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
910 | break; | ||
911 | |||
912 | case 27: | ||
913 | #line 177 "dreal/dr/parser.yy" | ||
914 | { yylhs.value.as < Formula > () = !yystack_[0].value.as < Formula > (); } | ||
915 | #line 916 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
916 | break; | ||
917 | |||
918 | case 28: | ||
919 | #line 178 "dreal/dr/parser.yy" | ||
920 | { yylhs.value.as < Formula > () = yystack_[1].value.as < Formula > (); } | ||
921 | #line 922 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
922 | break; | ||
923 | |||
924 | case 29: | ||
925 | #line 184 "dreal/dr/parser.yy" | ||
926 | { yylhs.value.as < Expression > () = yystack_[0].value.as < double > (); } | ||
927 | #line 928 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
928 | break; | ||
929 | |||
930 | case 30: | ||
931 | #line 185 "dreal/dr/parser.yy" | ||
932 | { | ||
933 | try { | ||
934 | const Variable& var = driver.lookup_variable(yystack_[0].value.as < std::string > ()); | ||
935 | yylhs.value.as < Expression > () = var; | ||
936 | } catch (std::runtime_error& e) { | ||
937 | std::cerr << yystack_[0].location << " : " << e.what() << std::endl; | ||
938 | YYABORT; | ||
939 | } | ||
940 | } | ||
941 | #line 942 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
942 | break; | ||
943 | |||
944 | case 31: | ||
945 | #line 194 "dreal/dr/parser.yy" | ||
946 | { yylhs.value.as < Expression > () = yystack_[2].value.as < Expression > () + yystack_[0].value.as < Expression > (); } | ||
947 | #line 948 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
948 | break; | ||
949 | |||
950 | case 32: | ||
951 | #line 195 "dreal/dr/parser.yy" | ||
952 | { yylhs.value.as < Expression > () = -yystack_[0].value.as < Expression > (); } | ||
953 | #line 954 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
954 | break; | ||
955 | |||
956 | case 33: | ||
957 | #line 196 "dreal/dr/parser.yy" | ||
958 | { yylhs.value.as < Expression > () = yystack_[2].value.as < Expression > () - yystack_[0].value.as < Expression > (); } | ||
959 | #line 960 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
960 | break; | ||
961 | |||
962 | case 34: | ||
963 | #line 197 "dreal/dr/parser.yy" | ||
964 | { yylhs.value.as < Expression > () = yystack_[2].value.as < Expression > () * yystack_[0].value.as < Expression > (); } | ||
965 | #line 966 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
966 | break; | ||
967 | |||
968 | case 35: | ||
969 | #line 198 "dreal/dr/parser.yy" | ||
970 | { yylhs.value.as < Expression > () = yystack_[2].value.as < Expression > () / yystack_[0].value.as < Expression > (); } | ||
971 | #line 972 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
972 | break; | ||
973 | |||
974 | case 36: | ||
975 | #line 199 "dreal/dr/parser.yy" | ||
976 | { yylhs.value.as < Expression > () = exp(yystack_[1].value.as < Expression > ()); } | ||
977 | #line 978 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
978 | break; | ||
979 | |||
980 | case 37: | ||
981 | #line 200 "dreal/dr/parser.yy" | ||
982 | { yylhs.value.as < Expression > () = log(yystack_[1].value.as < Expression > ()); } | ||
983 | #line 984 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
984 | break; | ||
985 | |||
986 | case 38: | ||
987 | #line 201 "dreal/dr/parser.yy" | ||
988 | { yylhs.value.as < Expression > () = abs(yystack_[1].value.as < Expression > ()); } | ||
989 | #line 990 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
990 | break; | ||
991 | |||
992 | case 39: | ||
993 | #line 202 "dreal/dr/parser.yy" | ||
994 | { yylhs.value.as < Expression > () = sin(yystack_[1].value.as < Expression > ()); } | ||
995 | #line 996 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
996 | break; | ||
997 | |||
998 | case 40: | ||
999 | #line 203 "dreal/dr/parser.yy" | ||
1000 | { yylhs.value.as < Expression > () = cos(yystack_[1].value.as < Expression > ()); } | ||
1001 | #line 1002 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1002 | break; | ||
1003 | |||
1004 | case 41: | ||
1005 | #line 204 "dreal/dr/parser.yy" | ||
1006 | { yylhs.value.as < Expression > () = tan(yystack_[1].value.as < Expression > ()); } | ||
1007 | #line 1008 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1008 | break; | ||
1009 | |||
1010 | case 42: | ||
1011 | #line 205 "dreal/dr/parser.yy" | ||
1012 | { yylhs.value.as < Expression > () = asin(yystack_[1].value.as < Expression > ()); } | ||
1013 | #line 1014 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1014 | break; | ||
1015 | |||
1016 | case 43: | ||
1017 | #line 206 "dreal/dr/parser.yy" | ||
1018 | { yylhs.value.as < Expression > () = acos(yystack_[1].value.as < Expression > ()); } | ||
1019 | #line 1020 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1020 | break; | ||
1021 | |||
1022 | case 44: | ||
1023 | #line 207 "dreal/dr/parser.yy" | ||
1024 | { yylhs.value.as < Expression > () = atan(yystack_[1].value.as < Expression > ()); } | ||
1025 | #line 1026 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1026 | break; | ||
1027 | |||
1028 | case 45: | ||
1029 | #line 208 "dreal/dr/parser.yy" | ||
1030 | { yylhs.value.as < Expression > () = atan2(yystack_[3].value.as < Expression > (), yystack_[1].value.as < Expression > ()); } | ||
1031 | #line 1032 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1032 | break; | ||
1033 | |||
1034 | case 46: | ||
1035 | #line 209 "dreal/dr/parser.yy" | ||
1036 | { yylhs.value.as < Expression > () = sinh(yystack_[1].value.as < Expression > ()); } | ||
1037 | #line 1038 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1038 | break; | ||
1039 | |||
1040 | case 47: | ||
1041 | #line 210 "dreal/dr/parser.yy" | ||
1042 | { yylhs.value.as < Expression > () = cosh(yystack_[1].value.as < Expression > ()); } | ||
1043 | #line 1044 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1044 | break; | ||
1045 | |||
1046 | case 48: | ||
1047 | #line 211 "dreal/dr/parser.yy" | ||
1048 | { yylhs.value.as < Expression > () = tanh(yystack_[1].value.as < Expression > ()); } | ||
1049 | #line 1050 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1050 | break; | ||
1051 | |||
1052 | case 49: | ||
1053 | #line 212 "dreal/dr/parser.yy" | ||
1054 | { yylhs.value.as < Expression > () = min(yystack_[3].value.as < Expression > (), yystack_[1].value.as < Expression > ()); } | ||
1055 | #line 1056 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1056 | break; | ||
1057 | |||
1058 | case 50: | ||
1059 | #line 213 "dreal/dr/parser.yy" | ||
1060 | { yylhs.value.as < Expression > () = max(yystack_[3].value.as < Expression > (), yystack_[1].value.as < Expression > ()); } | ||
1061 | #line 1062 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1062 | break; | ||
1063 | |||
1064 | case 51: | ||
1065 | #line 214 "dreal/dr/parser.yy" | ||
1066 | { yylhs.value.as < Expression > () = sqrt(yystack_[1].value.as < Expression > ()); } | ||
1067 | #line 1068 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1068 | break; | ||
1069 | |||
1070 | case 52: | ||
1071 | #line 215 "dreal/dr/parser.yy" | ||
1072 | { yylhs.value.as < Expression > () = pow(yystack_[3].value.as < Expression > (), yystack_[1].value.as < Expression > ()); } | ||
1073 | #line 1074 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1074 | break; | ||
1075 | |||
1076 | case 53: | ||
1077 | #line 216 "dreal/dr/parser.yy" | ||
1078 | { yylhs.value.as < Expression > () = pow(yystack_[2].value.as < Expression > (), yystack_[0].value.as < Expression > ()); } | ||
1079 | #line 1080 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1080 | break; | ||
1081 | |||
1082 | case 54: | ||
1083 | #line 217 "dreal/dr/parser.yy" | ||
1084 | { yylhs.value.as < Expression > () = yystack_[1].value.as < Expression > (); } | ||
1085 | #line 1086 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1086 | break; | ||
1087 | |||
1088 | |||
1089 | #line 1090 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1090 | |||
1091 | default: | ||
1092 | break; | ||
1093 | } | ||
1094 | } | ||
1095 | #if YY_EXCEPTIONS | ||
1096 | catch (const syntax_error& yyexc) | ||
1097 | { | ||
1098 | YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; | ||
1099 | error (yyexc); | ||
1100 | YYERROR; | ||
1101 | } | ||
1102 | #endif // YY_EXCEPTIONS | ||
1103 | YY_SYMBOL_PRINT ("-> $$ =", yylhs); | ||
1104 | yypop_ (yylen); | ||
1105 | yylen = 0; | ||
1106 | YY_STACK_PRINT (); | ||
1107 | |||
1108 | // Shift the result of the reduction. | ||
1109 | yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); | ||
1110 | } | ||
1111 | goto yynewstate; | ||
1112 | |||
1113 | |||
1114 | /*--------------------------------------. | ||
1115 | | yyerrlab -- here on detecting error. | | ||
1116 | `--------------------------------------*/ | ||
1117 | yyerrlab: | ||
1118 | // If not already recovering from an error, report this error. | ||
1119 | if (!yyerrstatus_) | ||
1120 | { | ||
1121 | ++yynerrs_; | ||
1122 | error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla)); | ||
1123 | } | ||
1124 | |||
1125 | |||
1126 | yyerror_range[1].location = yyla.location; | ||
1127 | if (yyerrstatus_ == 3) | ||
1128 | { | ||
1129 | /* If just tried and failed to reuse lookahead token after an | ||
1130 | error, discard it. */ | ||
1131 | |||
1132 | // Return failure if at end of input. | ||
1133 | if (yyla.type_get () == yyeof_) | ||
1134 | YYABORT; | ||
1135 | else if (!yyla.empty ()) | ||
1136 | { | ||
1137 | yy_destroy_ ("Error: discarding", yyla); | ||
1138 | yyla.clear (); | ||
1139 | } | ||
1140 | } | ||
1141 | |||
1142 | // Else will try to reuse lookahead token after shifting the error token. | ||
1143 | goto yyerrlab1; | ||
1144 | |||
1145 | |||
1146 | /*---------------------------------------------------. | ||
1147 | | yyerrorlab -- error raised explicitly by YYERROR. | | ||
1148 | `---------------------------------------------------*/ | ||
1149 | yyerrorlab: | ||
1150 | /* Pacify compilers when the user code never invokes YYERROR and | ||
1151 | the label yyerrorlab therefore never appears in user code. */ | ||
1152 | if (false) | ||
1153 | YYERROR; | ||
1154 | |||
1155 | /* Do not reclaim the symbols of the rule whose action triggered | ||
1156 | this YYERROR. */ | ||
1157 | yypop_ (yylen); | ||
1158 | yylen = 0; | ||
1159 | goto yyerrlab1; | ||
1160 | |||
1161 | |||
1162 | /*-------------------------------------------------------------. | ||
1163 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | ||
1164 | `-------------------------------------------------------------*/ | ||
1165 | yyerrlab1: | ||
1166 | yyerrstatus_ = 3; // Each real token shifted decrements this. | ||
1167 | { | ||
1168 | stack_symbol_type error_token; | ||
1169 | for (;;) | ||
1170 | { | ||
1171 | yyn = yypact_[yystack_[0].state]; | ||
1172 | if (!yy_pact_value_is_default_ (yyn)) | ||
1173 | { | ||
1174 | yyn += yy_error_token_; | ||
1175 | if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_) | ||
1176 | { | ||
1177 | yyn = yytable_[yyn]; | ||
1178 | if (0 < yyn) | ||
1179 | break; | ||
1180 | } | ||
1181 | } | ||
1182 | |||
1183 | // Pop the current state because it cannot handle the error token. | ||
1184 | if (yystack_.size () == 1) | ||
1185 | YYABORT; | ||
1186 | |||
1187 | yyerror_range[1].location = yystack_[0].location; | ||
1188 | yy_destroy_ ("Error: popping", yystack_[0]); | ||
1189 | yypop_ (); | ||
1190 | YY_STACK_PRINT (); | ||
1191 | } | ||
1192 | |||
1193 | yyerror_range[2].location = yyla.location; | ||
1194 | YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); | ||
1195 | |||
1196 | // Shift the error token. | ||
1197 | error_token.state = static_cast<state_type> (yyn); | ||
1198 | yypush_ ("Shifting", YY_MOVE (error_token)); | ||
1199 | } | ||
1200 | goto yynewstate; | ||
1201 | |||
1202 | |||
1203 | /*-------------------------------------. | ||
1204 | | yyacceptlab -- YYACCEPT comes here. | | ||
1205 | `-------------------------------------*/ | ||
1206 | yyacceptlab: | ||
1207 | yyresult = 0; | ||
1208 | goto yyreturn; | ||
1209 | |||
1210 | |||
1211 | /*-----------------------------------. | ||
1212 | | yyabortlab -- YYABORT comes here. | | ||
1213 | `-----------------------------------*/ | ||
1214 | yyabortlab: | ||
1215 | yyresult = 1; | ||
1216 | goto yyreturn; | ||
1217 | |||
1218 | |||
1219 | /*-----------------------------------------------------. | ||
1220 | | yyreturn -- parsing is finished, return the result. | | ||
1221 | `-----------------------------------------------------*/ | ||
1222 | yyreturn: | ||
1223 | if (!yyla.empty ()) | ||
1224 | yy_destroy_ ("Cleanup: discarding lookahead", yyla); | ||
1225 | |||
1226 | /* Do not reclaim the symbols of the rule whose action triggered | ||
1227 | this YYABORT or YYACCEPT. */ | ||
1228 | yypop_ (yylen); | ||
1229 | while (1 < yystack_.size ()) | ||
1230 | { | ||
1231 | yy_destroy_ ("Cleanup: popping", yystack_[0]); | ||
1232 | yypop_ (); | ||
1233 | } | ||
1234 | |||
1235 | return yyresult; | ||
1236 | } | ||
1237 | #if YY_EXCEPTIONS | ||
1238 | catch (...) | ||
1239 | { | ||
1240 | YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; | ||
1241 | // Do not try to display the values of the reclaimed symbols, | ||
1242 | // as their printers might throw an exception. | ||
1243 | if (!yyla.empty ()) | ||
1244 | yy_destroy_ (YY_NULLPTR, yyla); | ||
1245 | |||
1246 | while (1 < yystack_.size ()) | ||
1247 | { | ||
1248 | yy_destroy_ (YY_NULLPTR, yystack_[0]); | ||
1249 | yypop_ (); | ||
1250 | } | ||
1251 | throw; | ||
1252 | } | ||
1253 | #endif // YY_EXCEPTIONS | ||
1254 | } | ||
1255 | |||
1256 | void | ||
1257 | DrParser::error (const syntax_error& yyexc) | ||
1258 | { | ||
1259 | error (yyexc.location, yyexc.what ()); | ||
1260 | } | ||
1261 | |||
1262 | // Generate an error message. | ||
1263 | std::string | ||
1264 | DrParser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const | ||
1265 | { | ||
1266 | // Number of reported tokens (one for the "unexpected", one per | ||
1267 | // "expected"). | ||
1268 | std::ptrdiff_t yycount = 0; | ||
1269 | // Its maximum. | ||
1270 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | ||
1271 | // Arguments of yyformat. | ||
1272 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | ||
1273 | |||
1274 | /* There are many possibilities here to consider: | ||
1275 | - If this state is a consistent state with a default action, then | ||
1276 | the only way this function was invoked is if the default action | ||
1277 | is an error action. In that case, don't check for expected | ||
1278 | tokens because there are none. | ||
1279 | - The only way there can be no lookahead present (in yyla) is | ||
1280 | if this state is a consistent state with a default action. | ||
1281 | Thus, detecting the absence of a lookahead is sufficient to | ||
1282 | determine that there is no unexpected or expected token to | ||
1283 | report. In that case, just report a simple "syntax error". | ||
1284 | - Don't assume there isn't a lookahead just because this state is | ||
1285 | a consistent state with a default action. There might have | ||
1286 | been a previous inconsistent state, consistent state with a | ||
1287 | non-default action, or user semantic action that manipulated | ||
1288 | yyla. (However, yyla is currently not documented for users.) | ||
1289 | - Of course, the expected token list depends on states to have | ||
1290 | correct lookahead information, and it depends on the parser not | ||
1291 | to perform extra reductions after fetching a lookahead from the | ||
1292 | scanner and before detecting a syntax error. Thus, state merging | ||
1293 | (from LALR or IELR) and default reductions corrupt the expected | ||
1294 | token list. However, the list is correct for canonical LR with | ||
1295 | one exception: it will still contain any token that will not be | ||
1296 | accepted due to an error action in a later state. | ||
1297 | */ | ||
1298 | if (!yyla.empty ()) | ||
1299 | { | ||
1300 | symbol_number_type yytoken = yyla.type_get (); | ||
1301 | yyarg[yycount++] = yytname_[yytoken]; | ||
1302 | |||
1303 | int yyn = yypact_[yystate]; | ||
1304 | if (!yy_pact_value_is_default_ (yyn)) | ||
1305 | { | ||
1306 | /* Start YYX at -YYN if negative to avoid negative indexes in | ||
1307 | YYCHECK. In other words, skip the first -YYN actions for | ||
1308 | this state because they are default actions. */ | ||
1309 | int yyxbegin = yyn < 0 ? -yyn : 0; | ||
1310 | // Stay within bounds of both yycheck and yytname. | ||
1311 | int yychecklim = yylast_ - yyn + 1; | ||
1312 | int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; | ||
1313 | for (int yyx = yyxbegin; yyx < yyxend; ++yyx) | ||
1314 | if (yycheck_[yyx + yyn] == yyx && yyx != yy_error_token_ | ||
1315 | && !yy_table_value_is_error_ (yytable_[yyx + yyn])) | ||
1316 | { | ||
1317 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | ||
1318 | { | ||
1319 | yycount = 1; | ||
1320 | break; | ||
1321 | } | ||
1322 | else | ||
1323 | yyarg[yycount++] = yytname_[yyx]; | ||
1324 | } | ||
1325 | } | ||
1326 | } | ||
1327 | |||
1328 | char const* yyformat = YY_NULLPTR; | ||
1329 | switch (yycount) | ||
1330 | { | ||
1331 | #define YYCASE_(N, S) \ | ||
1332 | case N: \ | ||
1333 | yyformat = S; \ | ||
1334 | break | ||
1335 | default: // Avoid compiler warnings. | ||
1336 | YYCASE_ (0, YY_("syntax error")); | ||
1337 | YYCASE_ (1, YY_("syntax error, unexpected %s")); | ||
1338 | YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); | ||
1339 | YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); | ||
1340 | YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | ||
1341 | YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | ||
1342 | #undef YYCASE_ | ||
1343 | } | ||
1344 | |||
1345 | std::string yyres; | ||
1346 | // Argument number. | ||
1347 | std::ptrdiff_t yyi = 0; | ||
1348 | for (char const* yyp = yyformat; *yyp; ++yyp) | ||
1349 | if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) | ||
1350 | { | ||
1351 | yyres += yytnamerr_ (yyarg[yyi++]); | ||
1352 | ++yyp; | ||
1353 | } | ||
1354 | else | ||
1355 | yyres += *yyp; | ||
1356 | return yyres; | ||
1357 | } | ||
1358 | |||
1359 | |||
1360 | const signed char DrParser::yypact_ninf_ = -50; | ||
1361 | |||
1362 | const signed char DrParser::yytable_ninf_ = -1; | ||
1363 | |||
1364 | const short | ||
1365 | DrParser::yypact_[] = | ||
1366 | { | ||
1367 | 16, -11, 30, 25, 281, -50, 36, 73, -50, 349, | ||
1368 | 29, 31, 32, 33, 37, 38, 49, 58, 59, 62, | ||
1369 | 63, 69, 70, 74, 81, 93, 107, 349, -50, -50, | ||
1370 | 349, -50, 281, 250, 315, 39, -50, 52, 349, 349, | ||
1371 | 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, | ||
1372 | 349, 349, 349, 349, 349, 375, 55, -50, 349, 349, | ||
1373 | 349, 349, 349, 57, 315, 315, -50, 315, -17, -1, | ||
1374 | 349, 82, 87, 118, 126, 131, 136, 140, 145, 175, | ||
1375 | 379, 184, 189, 193, 392, 396, 197, 414, 349, -50, | ||
1376 | 50, 50, 52, 52, 52, -50, -50, 79, 60, -50, | ||
1377 | 315, 315, 315, -50, 349, 349, 349, 349, 349, -50, | ||
1378 | 349, 319, -50, -50, -50, -50, -50, -50, -50, -50, | ||
1379 | -50, 349, -50, -50, -50, 349, 349, -50, 349, -6, | ||
1380 | -50, -50, 75, -13, 255, 255, 255, 255, 255, -50, | ||
1381 | -50, 202, 211, 241, 246, 113, -50, -50, -50, -50, | ||
1382 | 89, -50 | ||
1383 | }; | ||
1384 | |||
1385 | const signed char | ||
1386 | DrParser::yydefact_[] = | ||
1387 | { | ||
1388 | 0, 0, 0, 8, 0, 1, 0, 14, 9, 0, | ||
1389 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1390 | 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, | ||
1391 | 0, 3, 4, 0, 0, 0, 2, 32, 0, 0, | ||
1392 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1393 | 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, | ||
1394 | 0, 0, 0, 0, 0, 0, 10, 11, 0, 0, | ||
1395 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
1396 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, | ||
1397 | 31, 33, 34, 35, 53, 7, 27, 0, 0, 12, | ||
1398 | 0, 0, 0, 13, 0, 0, 0, 0, 0, 15, | ||
1399 | 16, 0, 36, 37, 38, 39, 40, 41, 42, 43, | ||
1400 | 44, 0, 46, 47, 48, 0, 0, 51, 0, 0, | ||
1401 | 28, 24, 25, 26, 19, 21, 23, 20, 22, 17, | ||
1402 | 18, 0, 0, 0, 0, 0, 45, 49, 50, 52, | ||
1403 | 0, 6 | ||
1404 | }; | ||
1405 | |||
1406 | const short | ||
1407 | DrParser::yypgoto_[] = | ||
1408 | { | ||
1409 | -50, -50, -50, 128, -50, -50, -50, 91, -50, -50, | ||
1410 | 51, -50, -49, -4 | ||
1411 | }; | ||
1412 | |||
1413 | const signed char | ||
1414 | DrParser::yydefgoto_[] = | ||
1415 | { | ||
1416 | -1, 2, 3, 31, 32, 7, 8, 66, 67, 36, | ||
1417 | 109, 110, 68, 69 | ||
1418 | }; | ||
1419 | |||
1420 | const unsigned char | ||
1421 | DrParser::yytable_[] = | ||
1422 | { | ||
1423 | 33, 58, 59, 60, 61, 37, 58, 59, 60, 61, | ||
1424 | 104, 105, 106, 107, 108, 96, 97, 100, 101, 1, | ||
1425 | 102, 100, 101, 55, 102, 103, 56, 62, 33, 4, | ||
1426 | 5, 6, 62, 145, 71, 72, 73, 74, 75, 76, | ||
1427 | 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, | ||
1428 | 87, 131, 132, 133, 90, 91, 92, 93, 94, 60, | ||
1429 | 61, 98, 58, 59, 60, 61, 111, 58, 59, 60, | ||
1430 | 61, 104, 105, 106, 107, 108, 34, 35, 38, 70, | ||
1431 | 39, 40, 41, 62, 129, 62, 42, 43, 62, 58, | ||
1432 | 59, 60, 61, 62, 58, 59, 60, 61, 44, 95, | ||
1433 | 134, 135, 136, 137, 138, 89, 111, 45, 46, 100, | ||
1434 | 89, 47, 48, 100, 101, 62, 102, 141, 49, 50, | ||
1435 | 62, 142, 143, 51, 144, 58, 59, 60, 61, 130, | ||
1436 | 52, 151, 112, 58, 59, 60, 61, 113, 58, 59, | ||
1437 | 60, 61, 53, 58, 59, 60, 61, 58, 59, 60, | ||
1438 | 61, 62, 58, 59, 60, 61, 54, 150, 99, 62, | ||
1439 | 57, 139, 0, 0, 62, 0, 0, 0, 114, 62, | ||
1440 | 0, 0, 0, 62, 0, 0, 115, 0, 62, 0, | ||
1441 | 0, 116, 58, 59, 60, 61, 117, 0, 0, 0, | ||
1442 | 118, 58, 59, 60, 61, 119, 58, 59, 60, 61, | ||
1443 | 58, 59, 60, 61, 58, 59, 60, 61, 62, 58, | ||
1444 | 59, 60, 61, 0, 0, 0, 0, 62, 58, 59, | ||
1445 | 60, 61, 62, 0, 0, 120, 62, 0, 0, 0, | ||
1446 | 62, 0, 0, 0, 122, 62, 0, 0, 0, 123, | ||
1447 | 0, 0, 0, 124, 62, 0, 0, 127, 58, 59, | ||
1448 | 60, 61, 146, 58, 59, 60, 61, 58, 59, 60, | ||
1449 | 61, 147, 58, 59, 60, 61, 0, 0, 0, 0, | ||
1450 | 0, 0, 0, 0, 62, 0, 0, 0, 0, 62, | ||
1451 | 0, 0, 0, 62, 0, 0, 0, 0, 62, 9, | ||
1452 | 0, 148, 0, 0, 63, 0, 149, 10, 11, 12, | ||
1453 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, | ||
1454 | 23, 24, 25, 26, 0, 0, 0, 0, 0, 27, | ||
1455 | 0, 0, 0, 9, 28, 29, 58, 59, 60, 61, | ||
1456 | 30, 10, 11, 12, 13, 14, 15, 16, 17, 18, | ||
1457 | 19, 20, 21, 22, 23, 24, 25, 26, 0, 0, | ||
1458 | 0, 64, 62, 0, 0, 0, 0, 9, 28, 29, | ||
1459 | 0, 140, 0, 0, 65, 10, 11, 12, 13, 14, | ||
1460 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | ||
1461 | 25, 26, 58, 59, 60, 61, 58, 59, 60, 61, | ||
1462 | 0, 0, 28, 29, 0, 0, 0, 0, 30, 58, | ||
1463 | 59, 60, 61, 58, 59, 60, 61, 0, 62, 0, | ||
1464 | 0, 0, 62, 0, 0, 0, 88, 0, 0, 0, | ||
1465 | 121, 58, 59, 60, 61, 62, 0, 0, 0, 62, | ||
1466 | 0, 0, 0, 125, 0, 0, 0, 126, 0, 0, | ||
1467 | 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, | ||
1468 | 0, 0, 0, 0, 0, 128 | ||
1469 | }; | ||
1470 | |||
1471 | const short | ||
1472 | DrParser::yycheck_[] = | ||
1473 | { | ||
1474 | 4, 7, 8, 9, 10, 9, 7, 8, 9, 10, | ||
1475 | 11, 12, 13, 14, 15, 64, 65, 34, 35, 3, | ||
1476 | 37, 34, 35, 27, 37, 42, 30, 33, 32, 40, | ||
1477 | 0, 6, 33, 39, 38, 39, 40, 41, 42, 43, | ||
1478 | 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, | ||
1479 | 54, 100, 101, 102, 58, 59, 60, 61, 62, 9, | ||
1480 | 10, 65, 7, 8, 9, 10, 70, 7, 8, 9, | ||
1481 | 10, 11, 12, 13, 14, 15, 40, 4, 49, 40, | ||
1482 | 49, 49, 49, 33, 88, 33, 49, 49, 33, 7, | ||
1483 | 8, 9, 10, 33, 7, 8, 9, 10, 49, 42, | ||
1484 | 104, 105, 106, 107, 108, 50, 110, 49, 49, 34, | ||
1485 | 50, 49, 49, 34, 35, 33, 37, 121, 49, 49, | ||
1486 | 33, 125, 126, 49, 128, 7, 8, 9, 10, 50, | ||
1487 | 49, 42, 50, 7, 8, 9, 10, 50, 7, 8, | ||
1488 | 9, 10, 49, 7, 8, 9, 10, 7, 8, 9, | ||
1489 | 10, 33, 7, 8, 9, 10, 49, 44, 67, 33, | ||
1490 | 32, 110, -1, -1, 33, -1, -1, -1, 50, 33, | ||
1491 | -1, -1, -1, 33, -1, -1, 50, -1, 33, -1, | ||
1492 | -1, 50, 7, 8, 9, 10, 50, -1, -1, -1, | ||
1493 | 50, 7, 8, 9, 10, 50, 7, 8, 9, 10, | ||
1494 | 7, 8, 9, 10, 7, 8, 9, 10, 33, 7, | ||
1495 | 8, 9, 10, -1, -1, -1, -1, 33, 7, 8, | ||
1496 | 9, 10, 33, -1, -1, 50, 33, -1, -1, -1, | ||
1497 | 33, -1, -1, -1, 50, 33, -1, -1, -1, 50, | ||
1498 | -1, -1, -1, 50, 33, -1, -1, 50, 7, 8, | ||
1499 | 9, 10, 50, 7, 8, 9, 10, 7, 8, 9, | ||
1500 | 10, 50, 7, 8, 9, 10, -1, -1, -1, -1, | ||
1501 | -1, -1, -1, -1, 33, -1, -1, -1, -1, 33, | ||
1502 | -1, -1, -1, 33, -1, -1, -1, -1, 33, 8, | ||
1503 | -1, 50, -1, -1, 44, -1, 50, 16, 17, 18, | ||
1504 | 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, | ||
1505 | 29, 30, 31, 32, -1, -1, -1, -1, -1, 38, | ||
1506 | -1, -1, -1, 8, 43, 44, 7, 8, 9, 10, | ||
1507 | 49, 16, 17, 18, 19, 20, 21, 22, 23, 24, | ||
1508 | 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, | ||
1509 | -1, 36, 33, -1, -1, -1, -1, 8, 43, 44, | ||
1510 | -1, 42, -1, -1, 49, 16, 17, 18, 19, 20, | ||
1511 | 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, | ||
1512 | 31, 32, 7, 8, 9, 10, 7, 8, 9, 10, | ||
1513 | -1, -1, 43, 44, -1, -1, -1, -1, 49, 7, | ||
1514 | 8, 9, 10, 7, 8, 9, 10, -1, 33, -1, | ||
1515 | -1, -1, 33, -1, -1, -1, 41, -1, -1, -1, | ||
1516 | 41, 7, 8, 9, 10, 33, -1, -1, -1, 33, | ||
1517 | -1, -1, -1, 41, -1, -1, -1, 41, -1, -1, | ||
1518 | -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, | ||
1519 | -1, -1, -1, -1, -1, 41 | ||
1520 | }; | ||
1521 | |||
1522 | const signed char | ||
1523 | DrParser::yystos_[] = | ||
1524 | { | ||
1525 | 0, 3, 52, 53, 40, 0, 6, 56, 57, 8, | ||
1526 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, | ||
1527 | 26, 27, 28, 29, 30, 31, 32, 38, 43, 44, | ||
1528 | 49, 54, 55, 64, 40, 4, 60, 64, 49, 49, | ||
1529 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | ||
1530 | 49, 49, 49, 49, 49, 64, 64, 54, 7, 8, | ||
1531 | 9, 10, 33, 44, 36, 49, 58, 59, 63, 64, | ||
1532 | 40, 64, 64, 64, 64, 64, 64, 64, 64, 64, | ||
1533 | 64, 64, 64, 64, 64, 64, 64, 64, 41, 50, | ||
1534 | 64, 64, 64, 64, 64, 42, 63, 63, 64, 58, | ||
1535 | 34, 35, 37, 42, 11, 12, 13, 14, 15, 61, | ||
1536 | 62, 64, 50, 50, 50, 50, 50, 50, 50, 50, | ||
1537 | 50, 41, 50, 50, 50, 41, 41, 50, 41, 64, | ||
1538 | 50, 63, 63, 63, 64, 64, 64, 64, 64, 61, | ||
1539 | 42, 64, 64, 64, 64, 39, 50, 50, 50, 50, | ||
1540 | 44, 42 | ||
1541 | }; | ||
1542 | |||
1543 | const signed char | ||
1544 | DrParser::yyr1_[] = | ||
1545 | { | ||
1546 | 0, 51, 52, 53, 54, 54, 55, 55, 56, 56, | ||
1547 | 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, | ||
1548 | 63, 63, 63, 63, 63, 63, 63, 63, 63, 64, | ||
1549 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | ||
1550 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | ||
1551 | 64, 64, 64, 64, 64 | ||
1552 | }; | ||
1553 | |||
1554 | const signed char | ||
1555 | DrParser::yyr2_[] = | ||
1556 | { | ||
1557 | 0, 2, 3, 3, 1, 2, 7, 3, 0, 1, | ||
1558 | 3, 1, 2, 2, 0, 3, 1, 2, 2, 3, | ||
1559 | 3, 3, 3, 3, 3, 3, 3, 2, 3, 1, | ||
1560 | 1, 3, 2, 3, 3, 3, 4, 4, 4, 4, | ||
1561 | 4, 4, 4, 4, 4, 6, 4, 4, 4, 6, | ||
1562 | 6, 4, 6, 3, 3 | ||
1563 | }; | ||
1564 | |||
1565 | |||
1566 | |||
1567 | // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | ||
1568 | // First, the terminals, then, starting at \a yyntokens_, nonterminals. | ||
1569 | const char* | ||
1570 | const DrParser::yytname_[] = | ||
1571 | { | ||
1572 | "\"end of file\"", "error", "$undefined", "TK_VAR", "TK_COST", | ||
1573 | "TK_PREC", "TK_CTR", "TK_PLUS", "TK_MINUS", "TK_TIMES", "TK_DIV", | ||
1574 | "TK_EQ", "TK_LTE", "TK_GTE", "TK_LT", "TK_GT", "TK_EXP", "TK_LOG", | ||
1575 | "TK_ABS", "TK_SIN", "TK_COS", "TK_TAN", "TK_ASIN", "TK_ACOS", "TK_ATAN", | ||
1576 | "TK_ATAN2", "TK_SINH", "TK_COSH", "TK_TANH", "TK_MIN", "TK_MAX", | ||
1577 | "TK_SQRT", "TK_POW", "TK_CARET", "TK_AND", "TK_OR", "TK_NOT", | ||
1578 | "TK_IMPLIES", "TK_LB", "TK_RB", "TK_COLON", "TK_COMMA", "TK_SEMICOLON", | ||
1579 | "\"double\"", "\"identifier\"", "TK_NEQ", "TK_LEQ", "TK_GEQ", "UMINUS", | ||
1580 | "'('", "')'", "$accept", "script", "var_decl_sec", "var_decl_list", | ||
1581 | "var_decl", "opt_ctr_decl_sec", "ctr_decl_sec", "ctr_decl_list", | ||
1582 | "ctr_decl", "opt_cost_decl_sec", "cost_decl_list", "cost_decl", | ||
1583 | "formula", "expr", YY_NULLPTR | ||
1584 | }; | ||
1585 | |||
1586 | #if DREALDEBUG | ||
1587 | const unsigned char | ||
1588 | DrParser::yyrline_[] = | ||
1589 | { | ||
1590 | 0, 104, 104, 115, 118, 119, 122, 125, 133, 134, | ||
1591 | 137, 140, 141, 144, 152, 153, 156, 157, 160, 169, | ||
1592 | 170, 171, 172, 173, 174, 175, 176, 177, 178, 184, | ||
1593 | 185, 194, 195, 196, 197, 198, 199, 200, 201, 202, | ||
1594 | 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, | ||
1595 | 213, 214, 215, 216, 217 | ||
1596 | }; | ||
1597 | |||
1598 | // Print the state stack on the debug stream. | ||
1599 | void | ||
1600 | DrParser::yystack_print_ () | ||
1601 | { | ||
1602 | *yycdebug_ << "Stack now"; | ||
1603 | for (stack_type::const_iterator | ||
1604 | i = yystack_.begin (), | ||
1605 | i_end = yystack_.end (); | ||
1606 | i != i_end; ++i) | ||
1607 | *yycdebug_ << ' ' << int (i->state); | ||
1608 | *yycdebug_ << '\n'; | ||
1609 | } | ||
1610 | |||
1611 | // Report on the debug stream that the rule \a yyrule is going to be reduced. | ||
1612 | void | ||
1613 | DrParser::yy_reduce_print_ (int yyrule) | ||
1614 | { | ||
1615 | int yylno = yyrline_[yyrule]; | ||
1616 | int yynrhs = yyr2_[yyrule]; | ||
1617 | // Print the symbols being reduced, and their result. | ||
1618 | *yycdebug_ << "Reducing stack by rule " << yyrule - 1 | ||
1619 | << " (line " << yylno << "):\n"; | ||
1620 | // The symbols being reduced. | ||
1621 | for (int yyi = 0; yyi < yynrhs; yyi++) | ||
1622 | YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", | ||
1623 | yystack_[(yynrhs) - (yyi + 1)]); | ||
1624 | } | ||
1625 | #endif // DREALDEBUG | ||
1626 | |||
1627 | DrParser::token_number_type | ||
1628 | DrParser::yytranslate_ (int t) | ||
1629 | { | ||
1630 | // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to | ||
1631 | // TOKEN-NUM as returned by yylex. | ||
1632 | static | ||
1633 | const token_number_type | ||
1634 | translate_table[] = | ||
1635 | { | ||
1636 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1637 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1638 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1639 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1640 | 49, 50, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1641 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1642 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1643 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1644 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1645 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1646 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1647 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1648 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1649 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1650 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1651 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1652 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1653 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1654 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1655 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1656 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1657 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1658 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1659 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1660 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
1661 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | ||
1662 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | ||
1663 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | ||
1664 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | ||
1665 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, | ||
1666 | 45, 46, 47, 48 | ||
1667 | }; | ||
1668 | const int user_token_number_max_ = 303; | ||
1669 | |||
1670 | if (t <= 0) | ||
1671 | return yyeof_; | ||
1672 | else if (t <= user_token_number_max_) | ||
1673 | return translate_table[t]; | ||
1674 | else | ||
1675 | return yy_undef_token_; | ||
1676 | } | ||
1677 | |||
1678 | } // dreal | ||
1679 | #line 1680 "bazel-out/k8-opt/bin/dreal/dr/parser.yy.cc" | ||
1680 | |||
1681 | #line 220 "dreal/dr/parser.yy" | ||
1682 | /*** Additional Code ***/ | ||
1683 | void dreal::DrParser::error(const DrParser::location_type& l, | ||
1684 | const std::string& m) { | ||
1685 | driver.error(l, m); | ||
1686 | } | ||
1687 | |||
1688 | #ifdef __clang__ | ||
1689 | #pragma clang diagnostic pop | ||
1690 | #endif | ||
1691 | #pragma GCC diagnostic pop | ||