Debian Codegraph @

packages/seacas/libraries/aprepro_lib/apr_parser.cc

raw
1 // A Bison parser, made by GNU Bison 3.8.2.
2
3 // Skeleton implementation for Bison LALR(1) parsers in C++
4
5 // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
6
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <https://www.gnu.org/licenses/>.
19
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton. Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
29
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
32
33 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
34 // especially those whose name start with YY_ or yy_. They are
35 // private implementation details that can be changed or removed.
36
37 // Take the name prefix into account.
38 #define yylex SEAMSlex
39
40 // First part of user prologue.
41
42 #include "apr_array.h"
43 #include "apr_util.h"
44 #include "aprepro.h"
45
46 #include <cerrno>
47 #include <cfenv>
48 #include <cmath>
49 #include <cstdio>
50 #include <cstdlib>
51 #include <cstring>
52 #include <fmt/format.h>
53 #include <fmt/printf.h>
54 #include <iostream>
55
56 namespace {
57 void reset_error()
58 {
59 #if !defined(WIN32) && !defined(__WIN32__) && !defined(_WIN32) && !defined(_MSC_VER) && \
60 !defined(__MINGW32__) && !defined(_WIN64) && !defined(__MINGW64__)
61 #ifndef math_errhandling
62 #define math_errhandling MATH_ERRNO
63 #endif
64
65 if (math_errhandling & MATH_ERREXCEPT) {
66 std::feclearexcept(FE_ALL_EXCEPT);
67 }
68 if (math_errhandling & MATH_ERRNO) {
69 errno = 0;
70 }
71 #endif
72 }
73 } // namespace
74
75 namespace SEAMS {
76 extern bool echo;
77 }
78
79 #include "aprepro_parser.h"
80
81 // Second part of user prologue.
82
83 #include "apr_scanner.h"
84 #include "aprepro.h"
85
86 /* this "connects" the bison parser in aprepro to the flex scanner class
87 * object. it defines the yylex() function call to pull the next token from the
88 * current lexer object of the aprepro context. */
89 #undef yylex
90 #define yylex aprepro.lexer->lex
91
92 #ifndef YY_
93 #if defined YYENABLE_NLS && YYENABLE_NLS
94 #if ENABLE_NLS
95 #include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
96 #define YY_(msgid) dgettext("bison-runtime", msgid)
97 #endif
98 #endif
99 #ifndef YY_
100 #define YY_(msgid) msgid
101 #endif
102 #endif
103
104 // Whether we are compiled with exception support.
105 #ifndef YY_EXCEPTIONS
106 #if defined __GNUC__ && !defined __EXCEPTIONS
107 #define YY_EXCEPTIONS 0
108 #else
109 #define YY_EXCEPTIONS 1
110 #endif
111 #endif
112
113 // Enable debugging if requested.
114 #if SEAMSDEBUG
115
116 // A pseudo ostream that takes yydebug_ into account.
117 #define YYCDEBUG \
118 if (yydebug_) \
119 (*yycdebug_)
120
121 #define YY_SYMBOL_PRINT(Title, Symbol) \
122 do { \
123 if (yydebug_) { \
124 *yycdebug_ << Title << ' '; \
125 yy_print_(*yycdebug_, Symbol); \
126 *yycdebug_ << '\n'; \
127 } \
128 } while (false)
129
130 #define YY_REDUCE_PRINT(Rule) \
131 do { \
132 if (yydebug_) \
133 yy_reduce_print_(Rule); \
134 } while (false)
135
136 #define YY_STACK_PRINT() \
137 do { \
138 if (yydebug_) \
139 yy_stack_print_(); \
140 } while (false)
141
142 #else // !SEAMSDEBUG
143
144 #define YYCDEBUG \
145 if (false) \
146 std::cerr
147 #define YY_SYMBOL_PRINT(Title, Symbol) YY_USE(Symbol)
148 #define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
149 #define YY_STACK_PRINT() static_cast<void>(0)
150
151 #endif // !SEAMSDEBUG
152
153 #define yyerrok (yyerrstatus_ = 0)
154 #define yyclearin (yyla.clear())
155
156 #define YYACCEPT goto yyacceptlab
157 #define YYABORT goto yyabortlab
158 #define YYERROR goto yyerrorlab
159 #define YYRECOVERING() (!!yyerrstatus_)
160
161 namespace SEAMS {
162
163 /// Build a parser object.
164 Parser::Parser(class Aprepro &aprepro_yyarg)
165 #if SEAMSDEBUG
166 : yydebug_(false), yycdebug_(&std::cerr),
167 #else
168 :
169 #endif
170 aprepro(aprepro_yyarg)
171 {
172 }
173
174 Parser::~Parser() {}
175
176 Parser::syntax_error::~syntax_error() YY_NOEXCEPT YY_NOTHROW {}
177
178 /*---------.
179 | symbol. |
180 `---------*/
181
182 // basic_symbol.
183 template <typename Base>
184 Parser::basic_symbol<Base>::basic_symbol(const basic_symbol &that) : Base(that), value(that.value)
185 {
186 }
187
188 /// Constructor for valueless symbols.
189 template <typename Base>
190 Parser::basic_symbol<Base>::basic_symbol(typename Base::kind_type t) : Base(t), value()
191 {
192 }
193
194 template <typename Base>
195 Parser::basic_symbol<Base>::basic_symbol(typename Base::kind_type t, YY_RVREF(value_type) v)
196 : Base(t), value(YY_MOVE(v))
197 {
198 }
199
200 template <typename Base>
201 Parser::symbol_kind_type Parser::basic_symbol<Base>::type_get() const YY_NOEXCEPT
202 {
203 return this->kind();
204 }
205
206 template <typename Base> bool Parser::basic_symbol<Base>::empty() const YY_NOEXCEPT
207 {
208 return this->kind() == symbol_kind::S_YYEMPTY;
209 }
210
211 template <typename Base> void Parser::basic_symbol<Base>::move(basic_symbol &s)
212 {
213 super_type::move(s);
214 value = YY_MOVE(s.value);
215 }
216
217 // by_kind.
218 Parser::by_kind::by_kind() YY_NOEXCEPT : kind_(symbol_kind::S_YYEMPTY) {}
219
220 #if 201103L <= YY_CPLUSPLUS
221 Parser::by_kind::by_kind(by_kind &&that) YY_NOEXCEPT : kind_(that.kind_) { that.clear(); }
222 #endif
223
224 Parser::by_kind::by_kind(const by_kind &that) YY_NOEXCEPT : kind_(that.kind_) {}
225
226 Parser::by_kind::by_kind(token_kind_type t) YY_NOEXCEPT : kind_(yytranslate_(t)) {}
227
228 void Parser::by_kind::clear() YY_NOEXCEPT { kind_ = symbol_kind::S_YYEMPTY; }
229
230 void Parser::by_kind::move(by_kind &that)
231 {
232 kind_ = that.kind_;
233 that.clear();
234 }
235
236 Parser::symbol_kind_type Parser::by_kind::kind() const YY_NOEXCEPT { return kind_; }
237
238 Parser::symbol_kind_type Parser::by_kind::type_get() const YY_NOEXCEPT { return this->kind(); }
239
240 // by_state.
241 Parser::by_state::by_state() YY_NOEXCEPT : state(empty_state) {}
242
243 Parser::by_state::by_state(const by_state &that) YY_NOEXCEPT : state(that.state) {}
244
245 void Parser::by_state::clear() YY_NOEXCEPT { state = empty_state; }
246
247 void Parser::by_state::move(by_state &that)
248 {
249 state = that.state;
250 that.clear();
251 }
252
253 Parser::by_state::by_state(state_type s) YY_NOEXCEPT : state(s) {}
254
255 Parser::symbol_kind_type Parser::by_state::kind() const YY_NOEXCEPT
256 {
257 if (state == empty_state)
258 return symbol_kind::S_YYEMPTY;
259 else
260 return YY_CAST(symbol_kind_type, yystos_[+state]);
261 }
262
263 Parser::stack_symbol_type::stack_symbol_type() {}
264
265 Parser::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_type) that)
266 : super_type(YY_MOVE(that.state), YY_MOVE(that.value))
267 {
268 #if 201103L <= YY_CPLUSPLUS
269 // that is emptied.
270 that.state = empty_state;
271 #endif
272 }
273
274 Parser::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_REF(symbol_type) that)
275 : super_type(s, YY_MOVE(that.value))
276 {
277 // that is emptied.
278 that.kind_ = symbol_kind::S_YYEMPTY;
279 }
280
281 #if YY_CPLUSPLUS < 201103L
282 Parser::stack_symbol_type &Parser::stack_symbol_type::operator=(const stack_symbol_type &that)
283 {
284 state = that.state;
285 value = that.value;
286 return *this;
287 }
288
289 Parser::stack_symbol_type &Parser::stack_symbol_type::operator=(stack_symbol_type &that)
290 {
291 state = that.state;
292 value = that.value;
293 // that is emptied.
294 that.state = empty_state;
295 return *this;
296 }
297 #endif
298
299 template <typename Base>
300 void Parser::yy_destroy_(const char *yymsg, basic_symbol<Base> &yysym) const
301 {
302 if (yymsg)
303 YY_SYMBOL_PRINT(yymsg, yysym);
304
305 // User destructor.
306 YY_USE(yysym.kind());
307 }
308
309 #if SEAMSDEBUG
310 template <typename Base>
311 void Parser::yy_print_(std::ostream &yyo, const basic_symbol<Base> &yysym) const
312 {
313 std::ostream &yyoutput = yyo;
314 YY_USE(yyoutput);
315 if (yysym.empty())
316 yyo << "empty symbol";
317 else {
318 symbol_kind_type yykind = yysym.kind();
319 yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name() << " (";
320 YY_USE(yykind);
321 yyo << ')';
322 }
323 }
324 #endif
325
326 void Parser::yypush_(const char *m, YY_MOVE_REF(stack_symbol_type) sym)
327 {
328 if (m)
329 YY_SYMBOL_PRINT(m, sym);
330 yystack_.push(YY_MOVE(sym));
331 }
332
333 void Parser::yypush_(const char *m, state_type s, YY_MOVE_REF(symbol_type) sym)
334 {
335 #if 201103L <= YY_CPLUSPLUS
336 yypush_(m, stack_symbol_type(s, std::move(sym)));
337 #else
338 stack_symbol_type ss(s, sym);
339 yypush_(m, ss);
340 #endif
341 }
342
343 void Parser::yypop_(int n) YY_NOEXCEPT { yystack_.pop(n); }
344
345 #if SEAMSDEBUG
346 std::ostream &Parser::debug_stream() const { return *yycdebug_; }
347
348 void Parser::set_debug_stream(std::ostream &o) { yycdebug_ = &o; }
349
350 Parser::debug_level_type Parser::debug_level() const { return yydebug_; }
351
352 void Parser::set_debug_level(debug_level_type l) { yydebug_ = l; }
353 #endif // SEAMSDEBUG
354
355 Parser::state_type Parser::yy_lr_goto_state_(state_type yystate, int yysym)
356 {
357 int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
358 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
359 return yytable_[yyr];
360 else
361 return yydefgoto_[yysym - YYNTOKENS];
362 }
363
364 bool Parser::yy_pact_value_is_default_(int yyvalue) YY_NOEXCEPT
365 {
366 return yyvalue == yypact_ninf_;
367 }
368
369 bool Parser::yy_table_value_is_error_(int yyvalue) YY_NOEXCEPT
370 {
371 return yyvalue == yytable_ninf_;
372 }
373
374 int Parser::operator()() { return parse(); }
375
376 int Parser::parse()
377 {
378 int yyn;
379 /// Length of the RHS of the rule being reduced.
380 int yylen = 0;
381
382 // Error handling.
383 int yyerrstatus_ = 0;
384
385 /// The lookahead symbol.
386 symbol_type yyla;
387
388 /// The return value of parse ().
389 int yyresult;
390
391 #if YY_EXCEPTIONS
392 try
393 #endif // YY_EXCEPTIONS
394 {
395 YYCDEBUG << "Starting parse\n";
396
397 /* Initialize the stack. The initial state will be set in
398 yynewstate, since the latter expects the semantical and the
399 location values to have been already stored, initialize these
400 stacks with a primary value. */
401 yystack_.clear();
402 yypush_(YY_NULLPTR, 0, YY_MOVE(yyla));
403
404 /*-----------------------------------------------.
405 | yynewstate -- push a new symbol on the stack. |
406 `-----------------------------------------------*/
407 yynewstate:
408 YYCDEBUG << "Entering state " << int(yystack_[0].state) << '\n';
409 YY_STACK_PRINT();
410
411 // Accept?
412 if (yystack_[0].state == yyfinal_)
413 YYACCEPT;
414
415 goto yybackup;
416
417 /*-----------.
418 | yybackup. |
419 `-----------*/
420 yybackup:
421 // Try to take a decision without lookahead.
422 yyn = yypact_[+yystack_[0].state];
423 if (yy_pact_value_is_default_(yyn))
424 goto yydefault;
425
426 // Read a lookahead token.
427 if (yyla.empty()) {
428 YYCDEBUG << "Reading a token\n";
429 #if YY_EXCEPTIONS
430 try
431 #endif // YY_EXCEPTIONS
432 {
433 yyla.kind_ = yytranslate_(yylex(&yyla.value));
434 }
435 #if YY_EXCEPTIONS
436 catch (const syntax_error &yyexc) {
437 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
438 error(yyexc);
439 goto yyerrlab1;
440 }
441 #endif // YY_EXCEPTIONS
442 }
443 YY_SYMBOL_PRINT("Next token is", yyla);
444
445 if (yyla.kind() == symbol_kind::S_YYerror) {
446 // The scanner already issued an error message, process directly
447 // to error recovery. But do not keep the error token as
448 // lookahead, it is too special and may lead us to an endless
449 // loop in error recovery. */
450 yyla.kind_ = symbol_kind::S_YYUNDEF;
451 goto yyerrlab1;
452 }
453
454 /* If the proper action on seeing token YYLA.TYPE is to reduce or
455 to detect an error, take that action. */
456 yyn += yyla.kind();
457 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind()) {
458 goto yydefault;
459 }
460
461 // Reduce or error.
462 yyn = yytable_[yyn];
463 if (yyn <= 0) {
464 if (yy_table_value_is_error_(yyn))
465 goto yyerrlab;
466 yyn = -yyn;
467 goto yyreduce;
468 }
469
470 // Count tokens shifted since error; after three, turn off error status.
471 if (yyerrstatus_)
472 --yyerrstatus_;
473
474 // Shift the lookahead token.
475 yypush_("Shifting", state_type(yyn), YY_MOVE(yyla));
476 goto yynewstate;
477
478 /*-----------------------------------------------------------.
479 | yydefault -- do the default action for the current state. |
480 `-----------------------------------------------------------*/
481 yydefault:
482 yyn = yydefact_[+yystack_[0].state];
483 if (yyn == 0)
484 goto yyerrlab;
485 goto yyreduce;
486
487 /*-----------------------------.
488 | yyreduce -- do a reduction. |
489 `-----------------------------*/
490 yyreduce:
491 yylen = yyr2_[yyn];
492 {
493 stack_symbol_type yylhs;
494 yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
495 /* If YYLEN is nonzero, implement the default value of the
496 action: '$$ = $1'. Otherwise, use the top of the stack.
497
498 Otherwise, the following line sets YYLHS.VALUE to garbage.
499 This behavior is undocumented and Bison users should not rely
500 upon it. */
501 if (yylen)
502 yylhs.value = yystack_[yylen - 1].value;
503 else
504 yylhs.value = yystack_[0].value;
505
506 // Perform the reduction.
507 YY_REDUCE_PRINT(yyn);
508 #if YY_EXCEPTIONS
509 try
510 #endif // YY_EXCEPTIONS
511 {
512 switch (yyn) {
513 case 4: // line: '\n'
514 {
515 if (echo)
516 aprepro.lexer->LexerOutput("\n", 1);
517 } break;
518
519 case 5: // line: LBRACE exp RBRACE
520 {
521 if (echo) {
522 SEAMS::symrec *format = aprepro.getsym("_FORMAT");
523 if (format->value.svar.empty()) {
524 auto tmpstr = fmt::format("{}", (yystack_[1].value.val));
525 aprepro.lexer->LexerOutput(tmpstr.c_str(), tmpstr.size());
526 }
527 else {
528 static char tmpstr[512];
529 int len =
530 snprintf(tmpstr, 512, format->value.svar.c_str(), (yystack_[1].value.val));
531 aprepro.lexer->LexerOutput(tmpstr, len);
532 }
533 }
534 } break;
535
536 case 6: // line: LBRACE sexp RBRACE
537 {
538 if (echo && (yystack_[1].value.string) != NULL) {
539 aprepro.lexer->LexerOutput((yystack_[1].value.string),
540 strlen((yystack_[1].value.string)));
541 }
542 } break;
543
544 case 7: // line: LBRACE aexp RBRACE
545 {
546 } break;
547
548 case 8: // line: LBRACE RBRACE
549 {
550 } break;
551
552 case 9: // line: error RBRACE
553 {
554 yyerrok;
555 } break;
556
557 case 10: // bool: exp LT exp
558 {
559 (yylhs.value.val) = (yystack_[2].value.val) < (yystack_[0].value.val);
560 } break;
561
562 case 11: // bool: exp GT exp
563 {
564 (yylhs.value.val) = (yystack_[2].value.val) > (yystack_[0].value.val);
565 } break;
566
567 case 12: // bool: NOT exp
568 {
569 (yylhs.value.val) = !((yystack_[0].value.val));
570 } break;
571
572 case 13: // bool: exp LE exp
573 {
574 (yylhs.value.val) = (yystack_[2].value.val) <= (yystack_[0].value.val);
575 } break;
576
577 case 14: // bool: exp GE exp
578 {
579 (yylhs.value.val) = (yystack_[2].value.val) >= (yystack_[0].value.val);
580 } break;
581
582 case 15: // bool: exp EQ exp
583 {
584 (yylhs.value.val) = (yystack_[2].value.val) == (yystack_[0].value.val);
585 } break;
586
587 case 16: // bool: exp NE exp
588 {
589 (yylhs.value.val) = (yystack_[2].value.val) != (yystack_[0].value.val);
590 } break;
591
592 case 17: // bool: exp LOR exp
593 {
594 (yylhs.value.val) = (yystack_[2].value.val) || (yystack_[0].value.val);
595 } break;
596
597 case 18: // bool: exp LAND exp
598 {
599 (yylhs.value.val) = (yystack_[2].value.val) && (yystack_[0].value.val);
600 } break;
601
602 case 19: // bool: bool LOR bool
603 {
604 (yylhs.value.val) = (yystack_[2].value.val) || (yystack_[0].value.val);
605 } break;
606
607 case 20: // bool: bool LAND bool
608 {
609 (yylhs.value.val) = (yystack_[2].value.val) && (yystack_[0].value.val);
610 } break;
611
612 case 21: // bool: bool LOR exp
613 {
614 (yylhs.value.val) = (yystack_[2].value.val) || (yystack_[0].value.val);
615 } break;
616
617 case 22: // bool: bool LAND exp
618 {
619 (yylhs.value.val) = (yystack_[2].value.val) && (yystack_[0].value.val);
620 } break;
621
622 case 23: // bool: exp LOR bool
623 {
624 (yylhs.value.val) = (yystack_[2].value.val) || (yystack_[0].value.val);
625 } break;
626
627 case 24: // bool: exp LAND bool
628 {
629 (yylhs.value.val) = (yystack_[2].value.val) && (yystack_[0].value.val);
630 } break;
631
632 case 25: // bool: LPAR bool RPAR
633 {
634 (yylhs.value.val) = (yystack_[1].value.val);
635 } break;
636
637 case 26: // bool: UNDVAR LOR exp
638 {
639 (yylhs.value.val) = 0 || (yystack_[0].value.val);
640 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
641 } break;
642
643 case 27: // bool: UNDVAR LAND exp
644 {
645 (yylhs.value.val) = 0 && (yystack_[0].value.val);
646 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
647 } break;
648
649 case 28: // bool: exp LOR UNDVAR
650 {
651 (yylhs.value.val) = (yystack_[2].value.val) || 0;
652 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
653 } break;
654
655 case 29: // bool: exp LAND UNDVAR
656 {
657 (yylhs.value.val) = (yystack_[2].value.val) && 0;
658 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
659 } break;
660
661 case 30: // bool: bool LOR UNDVAR
662 {
663 (yylhs.value.val) = (yystack_[2].value.val) || 0;
664 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
665 } break;
666
667 case 31: // bool: bool LAND UNDVAR
668 {
669 (yylhs.value.val) = (yystack_[2].value.val) && 0;
670 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
671 } break;
672
673 case 32: // bool: UNDVAR LOR bool
674 {
675 (yylhs.value.val) = 0 || (yystack_[0].value.val);
676 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
677 } break;
678
679 case 33: // bool: UNDVAR LAND bool
680 {
681 (yylhs.value.val) = 0 && (yystack_[0].value.val);
682 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
683 } break;
684
685 case 34: // bool: sexp LT sexp
686 {
687 (yylhs.value.val) =
688 (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) < 0 ? 1 : 0);
689 } break;
690
691 case 35: // bool: sexp GT sexp
692 {
693 (yylhs.value.val) =
694 (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) > 0 ? 1 : 0);
695 } break;
696
697 case 36: // bool: sexp LE sexp
698 {
699 (yylhs.value.val) =
700 (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) <= 0 ? 1 : 0);
701 } break;
702
703 case 37: // bool: sexp GE sexp
704 {
705 (yylhs.value.val) =
706 (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) >= 0 ? 1 : 0);
707 } break;
708
709 case 38: // bool: sexp EQ sexp
710 {
711 (yylhs.value.val) =
712 (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) == 0 ? 1 : 0);
713 } break;
714
715 case 39: // bool: sexp NE sexp
716 {
717 (yylhs.value.val) =
718 (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) != 0 ? 1 : 0);
719 } break;
720
721 case 40: // bool: exp LT sexp
722 {
723 (yylhs.value.val) = false;
724 yyerror(aprepro, "Comparison of arithmetic with string not defined");
725 yyerrok;
726 } break;
727
728 case 41: // bool: exp GT sexp
729 {
730 (yylhs.value.val) = false;
731 yyerror(aprepro, "Comparison of arithmetic with string not defined");
732 yyerrok;
733 } break;
734
735 case 42: // bool: exp LE sexp
736 {
737 (yylhs.value.val) = false;
738 yyerror(aprepro, "Comparison of arithmetic with string not defined");
739 yyerrok;
740 } break;
741
742 case 43: // bool: exp GE sexp
743 {
744 (yylhs.value.val) = false;
745 yyerror(aprepro, "Comparison of arithmetic with string not defined");
746 yyerrok;
747 } break;
748
749 case 44: // bool: exp EQ sexp
750 {
751 (yylhs.value.val) = false;
752 } break;
753
754 case 45: // bool: exp NE sexp
755 {
756 (yylhs.value.val) = true;
757 } break;
758
759 case 46: // bool: sexp LT exp
760 {
761 (yylhs.value.val) = false;
762 yyerror(aprepro, "Comparison of string with arithmetic not defined");
763 yyerrok;
764 } break;
765
766 case 47: // bool: sexp GT exp
767 {
768 (yylhs.value.val) = false;
769 yyerror(aprepro, "Comparison of string with arithmetic not defined");
770 yyerrok;
771 } break;
772
773 case 48: // bool: sexp LE exp
774 {
775 (yylhs.value.val) = false;
776 yyerror(aprepro, "Comparison of string with arithmetic not defined");
777 yyerrok;
778 } break;
779
780 case 49: // bool: sexp GE exp
781 {
782 (yylhs.value.val) = false;
783 yyerror(aprepro, "Comparison of string with arithmetic not defined");
784 yyerrok;
785 } break;
786
787 case 50: // bool: sexp EQ exp
788 {
789 (yylhs.value.val) = false;
790 } break;
791
792 case 51: // bool: sexp NE exp
793 {
794 (yylhs.value.val) = true;
795 } break;
796
797 case 52: // bool: UNDVAR LT sexp
798 {
799 (yylhs.value.val) = (strcmp("", (yystack_[0].value.string)) < 0 ? 1 : 0);
800 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
801 } break;
802
803 case 53: // bool: UNDVAR GT sexp
804 {
805 (yylhs.value.val) = (strcmp("", (yystack_[0].value.string)) > 0 ? 1 : 0);
806 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
807 } break;
808
809 case 54: // bool: UNDVAR LE sexp
810 {
811 (yylhs.value.val) = (strcmp("", (yystack_[0].value.string)) <= 0 ? 1 : 0);
812 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
813 } break;
814
815 case 55: // bool: UNDVAR GE sexp
816 {
817 (yylhs.value.val) = (strcmp("", (yystack_[0].value.string)) >= 0 ? 1 : 0);
818 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
819 } break;
820
821 case 56: // bool: UNDVAR EQ sexp
822 {
823 (yylhs.value.val) = (strcmp("", (yystack_[0].value.string)) == 0 ? 1 : 0);
824 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
825 } break;
826
827 case 57: // bool: UNDVAR NE sexp
828 {
829 (yylhs.value.val) = (strcmp("", (yystack_[0].value.string)) != 0 ? 1 : 0);
830 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
831 } break;
832
833 case 58: // bool: sexp LT UNDVAR
834 {
835 (yylhs.value.val) = (strcmp((yystack_[2].value.string), "") < 0 ? 1 : 0);
836 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
837 } break;
838
839 case 59: // bool: sexp GT UNDVAR
840 {
841 (yylhs.value.val) = (strcmp((yystack_[2].value.string), "") > 0 ? 1 : 0);
842 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
843 } break;
844
845 case 60: // bool: sexp LE UNDVAR
846 {
847 (yylhs.value.val) = (strcmp((yystack_[2].value.string), "") <= 0 ? 1 : 0);
848 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
849 } break;
850
851 case 61: // bool: sexp GE UNDVAR
852 {
853 (yylhs.value.val) = (strcmp((yystack_[2].value.string), "") >= 0 ? 1 : 0);
854 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
855 } break;
856
857 case 62: // bool: sexp EQ UNDVAR
858 {
859 (yylhs.value.val) = (strcmp((yystack_[2].value.string), "") == 0 ? 1 : 0);
860 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
861 } break;
862
863 case 63: // bool: sexp NE UNDVAR
864 {
865 (yylhs.value.val) = (strcmp((yystack_[2].value.string), "") != 0 ? 1 : 0);
866 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
867 } break;
868
869 case 64: // bool: UNDVAR LT exp
870 {
871 (yylhs.value.val) = 0 < (yystack_[0].value.val);
872 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
873 } break;
874
875 case 65: // bool: UNDVAR GT exp
876 {
877 (yylhs.value.val) = 0 > (yystack_[0].value.val);
878 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
879 } break;
880
881 case 66: // bool: UNDVAR LE exp
882 {
883 (yylhs.value.val) = 0 <= (yystack_[0].value.val);
884 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
885 } break;
886
887 case 67: // bool: UNDVAR GE exp
888 {
889 (yylhs.value.val) = 0 >= (yystack_[0].value.val);
890 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
891 } break;
892
893 case 68: // bool: UNDVAR EQ exp
894 {
895 (yylhs.value.val) = 0 == (yystack_[0].value.val);
896 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
897 } break;
898
899 case 69: // bool: UNDVAR NE exp
900 {
901 (yylhs.value.val) = 0 != (yystack_[0].value.val);
902 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
903 } break;
904
905 case 70: // bool: exp LT UNDVAR
906 {
907 (yylhs.value.val) = (yystack_[2].value.val) < 0;
908 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
909 } break;
910
911 case 71: // bool: exp GT UNDVAR
912 {
913 (yylhs.value.val) = (yystack_[2].value.val) > 0;
914 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
915 } break;
916
917 case 72: // bool: exp LE UNDVAR
918 {
919 (yylhs.value.val) = (yystack_[2].value.val) <= 0;
920 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
921 } break;
922
923 case 73: // bool: exp GE UNDVAR
924 {
925 (yylhs.value.val) = (yystack_[2].value.val) >= 0;
926 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
927 } break;
928
929 case 74: // bool: exp EQ UNDVAR
930 {
931 (yylhs.value.val) = (yystack_[2].value.val) == 0;
932 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
933 } break;
934
935 case 75: // bool: exp NE UNDVAR
936 {
937 (yylhs.value.val) = (yystack_[2].value.val) != 0;
938 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
939 } break;
940
941 case 76: // aexp: AVAR
942 {
943 (yylhs.value.arrval) = aprepro.make_array(*((yystack_[0].value.tptr)->value.avar));
944 } break;
945
946 case 77: // aexp: AFNCT LPAR sexp RPAR
947 {
948 if (arg_check((yystack_[3].value.tptr),
949 (yystack_[3].value.tptr)->value.arrfnct_c == NULL))
950 (yylhs.value.arrval) =
951 (*((yystack_[3].value.tptr)->value.arrfnct_c))((yystack_[1].value.string));
952 else
953 yyerrok;
954 } break;
955
956 case 78: // aexp: AFNCT LPAR sexp COMMA exp RPAR
957 {
958 if (arg_check((yystack_[5].value.tptr),
959 (yystack_[5].value.tptr)->value.arrfnct_cd == NULL))
960 (yylhs.value.arrval) = (*((yystack_[5].value.tptr)->value.arrfnct_cd))(
961 (yystack_[3].value.string), (yystack_[1].value.val));
962 else
963 yyerrok;
964 } break;
965
966 case 79: // aexp: AFNCT LPAR sexp COMMA sexp RPAR
967 {
968 if (arg_check((yystack_[5].value.tptr),
969 (yystack_[5].value.tptr)->value.arrfnct_cc == NULL))
970 (yylhs.value.arrval) = (*((yystack_[5].value.tptr)->value.arrfnct_cc))(
971 (yystack_[3].value.string), (yystack_[1].value.string));
972 else
973 yyerrok;
974 } break;
975
976 case 80: // aexp: AFNCT LPAR exp COMMA exp COMMA exp RPAR
977 {
978 if (arg_check((yystack_[7].value.tptr),
979 (yystack_[7].value.tptr)->value.arrfnct_ddd == NULL))
980 (yylhs.value.arrval) = (*((yystack_[7].value.tptr)->value.arrfnct_ddd))(
981 (yystack_[5].value.val), (yystack_[3].value.val), (yystack_[1].value.val));
982 else
983 yyerrok;
984 } break;
985
986 case 81: // aexp: AFNCT LPAR exp COMMA exp RPAR
987 {
988 if (arg_check((yystack_[5].value.tptr),
989 (yystack_[5].value.tptr)->value.arrfnct_dd == NULL))
990 (yylhs.value.arrval) = (*((yystack_[5].value.tptr)->value.arrfnct_dd))(
991 (yystack_[3].value.val), (yystack_[1].value.val));
992 else
993 yyerrok;
994 } break;
995
996 case 82: // aexp: AFNCT LPAR exp RPAR
997 {
998 if (arg_check((yystack_[3].value.tptr),
999 (yystack_[3].value.tptr)->value.arrfnct_d == NULL))
1000 (yylhs.value.arrval) =
1001 (*((yystack_[3].value.tptr)->value.arrfnct_d))((yystack_[1].value.val));
1002 else
1003 yyerrok;
1004 } break;
1005
1006 case 83: // aexp: AFNCT LPAR aexp RPAR
1007 {
1008 if (arg_check((yystack_[3].value.tptr),
1009 (yystack_[3].value.tptr)->value.arrfnct_a == NULL))
1010 (yylhs.value.arrval) =
1011 (*((yystack_[3].value.tptr)->value.arrfnct_a))((yystack_[1].value.arrval));
1012 else
1013 yyerrok;
1014 } break;
1015
1016 case 84: // aexp: SVAR EQUAL aexp
1017 {
1018 (yylhs.value.arrval) = (yystack_[0].value.arrval);
1019 (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval);
1020 redefined_warning(aprepro, (yystack_[2].value.tptr));
1021 set_type(aprepro, (yystack_[2].value.tptr), token::AVAR);
1022 } break;
1023
1024 case 85: // aexp: VAR EQUAL aexp
1025 {
1026 (yylhs.value.arrval) = (yystack_[0].value.arrval);
1027 (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval);
1028 redefined_warning(aprepro, (yystack_[2].value.tptr));
1029 set_type(aprepro, (yystack_[2].value.tptr), token::AVAR);
1030 } break;
1031
1032 case 86: // aexp: AVAR EQUAL aexp
1033 {
1034 (yylhs.value.arrval) = (yystack_[0].value.arrval);
1035 aprepro.redefine_array((yystack_[2].value.tptr)->value.avar);
1036 (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval);
1037 redefined_warning(aprepro, (yystack_[2].value.tptr));
1038 set_type(aprepro, (yystack_[2].value.tptr), token::AVAR);
1039 } break;
1040
1041 case 87: // aexp: UNDVAR EQUAL aexp
1042 {
1043 (yylhs.value.arrval) = (yystack_[0].value.arrval);
1044 (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval);
1045 set_type(aprepro, (yystack_[2].value.tptr), token::AVAR);
1046 } break;
1047
1048 case 88: // aexp: aexp PLU aexp
1049 {
1050 if ((yystack_[2].value.arrval)->cols == (yystack_[0].value.arrval)->cols &&
1051 (yystack_[2].value.arrval)->rows == (yystack_[0].value.arrval)->rows) {
1052 (yylhs.value.arrval) =
1053 array_add((yystack_[2].value.arrval), (yystack_[0].value.arrval));
1054 }
1055 else {
1056 yyerror(aprepro, "Arrays do not have same row and column count");
1057 yyerrok;
1058 }
1059 } break;
1060
1061 case 89: // aexp: SUB aexp
1062 {
1063 (yylhs.value.arrval) = array_scale((yystack_[0].value.arrval), -1.0);
1064 } break;
1065
1066 case 90: // aexp: aexp SUB aexp
1067 {
1068 if ((yystack_[2].value.arrval)->cols == (yystack_[0].value.arrval)->cols &&
1069 (yystack_[2].value.arrval)->rows == (yystack_[0].value.arrval)->rows) {
1070 (yylhs.value.arrval) =
1071 array_sub((yystack_[2].value.arrval), (yystack_[0].value.arrval));
1072 }
1073 else {
1074 yyerror(aprepro, "Arrays do not have same row and column count");
1075 yyerrok;
1076 }
1077 } break;
1078
1079 case 91: // aexp: aexp TIM exp
1080 {
1081 (yylhs.value.arrval) = array_scale((yystack_[2].value.arrval), (yystack_[0].value.val));
1082 } break;
1083
1084 case 92: // aexp: aexp DIV exp
1085 {
1086 (yylhs.value.arrval) =
1087 array_scale((yystack_[2].value.arrval), 1.0 / (yystack_[0].value.val));
1088 } break;
1089
1090 case 93: // aexp: exp TIM aexp
1091 {
1092 (yylhs.value.arrval) = array_scale((yystack_[0].value.arrval), (yystack_[2].value.val));
1093 } break;
1094
1095 case 94: // aexp: aexp TIM aexp
1096 {
1097 if ((yystack_[2].value.arrval)->cols == (yystack_[0].value.arrval)->rows) {
1098 (yylhs.value.arrval) =
1099 array_mult((yystack_[2].value.arrval), (yystack_[0].value.arrval));
1100 }
1101 else {
1102 yyerror(aprepro,
1103 "Column count of first array does not match row count of second array");
1104 yyerrok;
1105 }
1106 } break;
1107
1108 case 95: // sexp: QSTRING
1109 {
1110 (yylhs.value.string) = (yystack_[0].value.string);
1111 } break;
1112
1113 case 96: // sexp: SVAR
1114 {
1115 (yylhs.value.string) = (char *)(yystack_[0].value.tptr)->value.svar.c_str();
1116 } break;
1117
1118 case 97: // sexp: IMMSVAR
1119 {
1120 (yylhs.value.string) = (char *)(yystack_[0].value.tptr)->value.svar.c_str();
1121 } break;
1122
1123 case 98: // sexp: UNDVAR EQUAL sexp
1124 {
1125 (yylhs.value.string) = (yystack_[0].value.string);
1126 (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string);
1127 set_type(aprepro, (yystack_[2].value.tptr), Parser::token::SVAR);
1128 } break;
1129
1130 case 99: // sexp: SVAR EQUAL sexp
1131 {
1132 (yylhs.value.string) = (yystack_[0].value.string);
1133 (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string);
1134 redefined_warning(aprepro, (yystack_[2].value.tptr));
1135 } break;
1136
1137 case 100: // sexp: VAR EQUAL sexp
1138 {
1139 (yylhs.value.string) = (yystack_[0].value.string);
1140 (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string);
1141 redefined_warning(aprepro, (yystack_[2].value.tptr));
1142 set_type(aprepro, (yystack_[2].value.tptr), token::SVAR);
1143 } break;
1144
1145 case 101: // sexp: AVAR EQUAL sexp
1146 {
1147 (yylhs.value.string) = (yystack_[0].value.string);
1148 aprepro.redefine_array((yystack_[2].value.tptr)->value.avar);
1149 (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string);
1150 redefined_warning(aprepro, (yystack_[2].value.tptr));
1151 set_type(aprepro, (yystack_[2].value.tptr), token::SVAR);
1152 } break;
1153
1154 case 102: // sexp: IMMSVAR EQUAL sexp
1155 {
1156 (yylhs.value.string) = (char *)(yystack_[2].value.tptr)->value.svar.c_str();
1157 immutable_modify(aprepro, (yystack_[2].value.tptr));
1158 } break;
1159
1160 case 103: // sexp: IMMVAR EQUAL sexp
1161 {
1162 immutable_modify(aprepro, (yystack_[2].value.tptr));
1163 YYERROR;
1164 } break;
1165
1166 case 104: // sexp: SFNCT LPAR sexp RPAR
1167 {
1168 if (arg_check((yystack_[3].value.tptr),
1169 (yystack_[3].value.tptr)->value.strfnct_c == NULL))
1170 (yylhs.value.string) = (char *)(*((yystack_[3].value.tptr)->value.strfnct_c))(
1171 (yystack_[1].value.string));
1172 else
1173 (yylhs.value.string) = (char *)"";
1174 } break;
1175
1176 case 105: // sexp: SFNCT LPAR RPAR
1177 {
1178 if (arg_check((yystack_[2].value.tptr),
1179 (yystack_[2].value.tptr)->value.strfnct == NULL))
1180 (yylhs.value.string) = (char *)(*((yystack_[2].value.tptr)->value.strfnct))();
1181 else
1182 (yylhs.value.string) = (char *)"";
1183 } break;
1184
1185 case 106: // sexp: SFNCT LPAR exp RPAR
1186 {
1187 if (arg_check((yystack_[3].value.tptr),
1188 (yystack_[3].value.tptr)->value.strfnct_d == NULL))
1189 (yylhs.value.string) =
1190 (char *)(*((yystack_[3].value.tptr)->value.strfnct_d))((yystack_[1].value.val));
1191 else
1192 (yylhs.value.string) = (char *)"";
1193 } break;
1194
1195 case 107: // sexp: SFNCT LPAR aexp RPAR
1196 {
1197 if (arg_check((yystack_[3].value.tptr),
1198 (yystack_[3].value.tptr)->value.strfnct_a == NULL))
1199 (yylhs.value.string) = (char *)(*((yystack_[3].value.tptr)->value.strfnct_a))(
1200 (yystack_[1].value.arrval));
1201 else
1202 (yylhs.value.string) = (char *)"";
1203 } break;
1204
1205 case 108: // sexp: sexp CONCAT sexp
1206 {
1207 concat_string((yystack_[2].value.string), (yystack_[0].value.string),
1208 &(yylhs.value.string));
1209 } break;
1210
1211 case 109: // sexp: sexp PLU sexp
1212 {
1213 concat_string((yystack_[2].value.string), (yystack_[0].value.string),
1214 &(yylhs.value.string));
1215 } break;
1216
1217 case 110: // sexp: SFNCT LPAR exp COMMA exp RPAR
1218 {
1219 if (arg_check((yystack_[5].value.tptr),
1220 (yystack_[5].value.tptr)->value.strfnct_dd == NULL))
1221 (yylhs.value.string) = (char *)(*((yystack_[5].value.tptr)->value.strfnct_dd))(
1222 (yystack_[3].value.val), (yystack_[1].value.val));
1223 else
1224 (yylhs.value.string) = (char *)"";
1225 } break;
1226
1227 case 111: // sexp: SFNCT LPAR exp COMMA sexp COMMA sexp COMMA sexp COMMA sexp RPAR
1228 {
1229 if (arg_check((yystack_[11].value.tptr),
1230 (yystack_[11].value.tptr)->value.strfnct_dcccc == NULL))
1231 (yylhs.value.string) = (char *)(*((yystack_[11].value.tptr)->value.strfnct_dcccc))(
1232 (yystack_[9].value.val), (yystack_[7].value.string), (yystack_[5].value.string),
1233 (yystack_[3].value.string), (yystack_[1].value.string));
1234 else
1235 (yylhs.value.string) = (char *)"";
1236 } break;
1237
1238 case 112: // sexp: SFNCT LPAR exp COMMA sexp COMMA sexp RPAR
1239 {
1240 if (arg_check((yystack_[7].value.tptr),
1241 (yystack_[7].value.tptr)->value.strfnct_dcc == NULL))
1242 (yylhs.value.string) = (char *)(*((yystack_[7].value.tptr)->value.strfnct_dcc))(
1243 (yystack_[5].value.val), (yystack_[3].value.string), (yystack_[1].value.string));
1244 else
1245 (yylhs.value.string) = (char *)"";
1246 } break;
1247
1248 case 113: // sexp: SFNCT LPAR exp COMMA sexp RPAR
1249 {
1250 if (arg_check((yystack_[5].value.tptr),
1251 (yystack_[5].value.tptr)->value.strfnct_dc == NULL))
1252 (yylhs.value.string) = (char *)(*((yystack_[5].value.tptr)->value.strfnct_dc))(
1253 (yystack_[3].value.val), (yystack_[1].value.string));
1254 else
1255 (yylhs.value.string) = (char *)"";
1256 } break;
1257
1258 case 114: // sexp: SFNCT LPAR sexp COMMA exp RPAR
1259 {
1260 if (arg_check((yystack_[5].value.tptr),
1261 (yystack_[5].value.tptr)->value.strfnct_cd == NULL))
1262 (yylhs.value.string) = (char *)(*((yystack_[5].value.tptr)->value.strfnct_cd))(
1263 (yystack_[3].value.string), (yystack_[1].value.val));
1264 else
1265 (yylhs.value.string) = (char *)"";
1266 } break;
1267
1268 case 115: // sexp: SFNCT LPAR sexp COMMA sexp COMMA sexp RPAR
1269 {
1270 if (arg_check((yystack_[7].value.tptr),
1271 (yystack_[7].value.tptr)->value.strfnct_ccc == NULL))
1272 (yylhs.value.string) = (char *)(*((yystack_[7].value.tptr)->value.strfnct_ccc))(
1273 (yystack_[5].value.string), (yystack_[3].value.string),
1274 (yystack_[1].value.string));
1275 else
1276 (yylhs.value.string) = (char *)"";
1277 } break;
1278
1279 case 116: // sexp: SFNCT LPAR sexp COMMA sexp RPAR
1280 {
1281 if (arg_check((yystack_[5].value.tptr),
1282 (yystack_[5].value.tptr)->value.strfnct_cc == NULL))
1283 (yylhs.value.string) = (char *)(*((yystack_[5].value.tptr)->value.strfnct_cc))(
1284 (yystack_[3].value.string), (yystack_[1].value.string));
1285 else
1286 (yylhs.value.string) = (char *)"";
1287 } break;
1288
1289 case 117: // sexp: bool QUEST sexp COLON sexp
1290 {
1291 (yylhs.value.string) = ((yystack_[4].value.val)) ? ((yystack_[2].value.string))
1292 : ((yystack_[0].value.string));
1293 } break;
1294
1295 case 118: // sexp: exp TIM sexp
1296 {
1297 (yylhs.value.string) = (char *)"";
1298 yyerror(aprepro, "Multiplying an arithmetic with a string is not defined");
1299 yyerrok;
1300 } break;
1301
1302 case 119: // sexp: sexp TIM exp
1303 {
1304 (yylhs.value.string) = (char *)"";
1305 yyerror(aprepro, "Multiplying a string with an arithmetic is not defined");
1306 yyerrok;
1307 } break;
1308
1309 case 120: // sexp: sexp TIM sexp
1310 {
1311 (yylhs.value.string) = (char *)"";
1312 yyerror(aprepro, "Multiplying a string with a string is not defined");
1313 yyerrok;
1314 } break;
1315
1316 case 121: // sexp: sexp DIV exp
1317 {
1318 (yylhs.value.string) = (char *)"";
1319 yyerror(aprepro, "Dividing a string by an arithmetic is not defined");
1320 yyerrok;
1321 } break;
1322
1323 case 122: // sexp: exp DIV sexp
1324 {
1325 (yylhs.value.string) = (char *)"";
1326 yyerror(aprepro, "Dividing an arithmetic by a string is not defined");
1327 yyerrok;
1328 } break;
1329
1330 case 123: // sexp: sexp DIV sexp
1331 {
1332 (yylhs.value.string) = (char *)"";
1333 yyerror(aprepro, "Dividing a string by a string is not defined");
1334 yyerrok;
1335 } break;
1336
1337 case 124: // sexp: exp PLU sexp
1338 {
1339 (yylhs.value.string) = (char *)"";
1340 yyerror(aprepro, "Adding an arithmetic and a string is not defined");
1341 yyerrok;
1342 } break;
1343
1344 case 125: // sexp: sexp PLU exp
1345 {
1346 (yylhs.value.string) = (char *)"";
1347 yyerror(aprepro, "Adding a string and an arithmetic is not defined");
1348 yyerrok;
1349 } break;
1350
1351 case 126: // sexp: exp SUB sexp
1352 {
1353 (yylhs.value.string) = (char *)"";
1354 yyerror(aprepro, "Subtracting an arithmetic and a string is not defined");
1355 yyerrok;
1356 } break;
1357
1358 case 127: // sexp: sexp SUB exp
1359 {
1360 (yylhs.value.string) = (char *)"";
1361 yyerror(aprepro, "Subtracting a string and an arithmetic is not defined");
1362 yyerrok;
1363 } break;
1364
1365 case 128: // sexp: sexp SUB sexp
1366 {
1367 (yylhs.value.string) = (char *)"";
1368 yyerror(aprepro, "Subtracting a string from a string is not defined");
1369 yyerrok;
1370 } break;
1371
1372 case 129: // exp: NUM
1373 {
1374 (yylhs.value.val) = (yystack_[0].value.val);
1375 } break;
1376
1377 case 130: // exp: INC NUM
1378 {
1379 (yylhs.value.val) = (yystack_[0].value.val) + 1;
1380 } break;
1381
1382 case 131: // exp: DEC NUM
1383 {
1384 (yylhs.value.val) = (yystack_[0].value.val) - 1;
1385 } break;
1386
1387 case 132: // exp: VAR
1388 {
1389 (yylhs.value.val) = (yystack_[0].value.tptr)->value.var;
1390 } break;
1391
1392 case 133: // exp: IMMVAR
1393 {
1394 (yylhs.value.val) = (yystack_[0].value.tptr)->value.var;
1395 } break;
1396
1397 case 134: // exp: INC VAR
1398 {
1399 (yylhs.value.val) = ++((yystack_[0].value.tptr)->value.var);
1400 } break;
1401
1402 case 135: // exp: DEC VAR
1403 {
1404 (yylhs.value.val) = --((yystack_[0].value.tptr)->value.var);
1405 } break;
1406
1407 case 136: // exp: VAR INC
1408 {
1409 (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)++;
1410 } break;
1411
1412 case 137: // exp: VAR DEC
1413 {
1414 (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)--;
1415 } break;
1416
1417 case 138: // exp: VAR EQUAL exp
1418 {
1419 (yylhs.value.val) = (yystack_[0].value.val);
1420 (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val);
1421 redefined_warning(aprepro, (yystack_[2].value.tptr));
1422 } break;
1423
1424 case 139: // exp: SVAR EQUAL exp
1425 {
1426 (yylhs.value.val) = (yystack_[0].value.val);
1427 (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val);
1428 redefined_warning(aprepro, (yystack_[2].value.tptr));
1429 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1430 } break;
1431
1432 case 140: // exp: AVAR EQUAL exp
1433 {
1434 (yylhs.value.val) = (yystack_[0].value.val);
1435 aprepro.redefine_array((yystack_[2].value.tptr)->value.avar);
1436 (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val);
1437 redefined_warning(aprepro, (yystack_[2].value.tptr));
1438 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1439 } break;
1440
1441 case 141: // exp: VAR EQ_PLUS exp
1442 {
1443 (yystack_[2].value.tptr)->value.var += (yystack_[0].value.val);
1444 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1445 } break;
1446
1447 case 142: // exp: VAR EQ_MINUS exp
1448 {
1449 (yystack_[2].value.tptr)->value.var -= (yystack_[0].value.val);
1450 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1451 } break;
1452
1453 case 143: // exp: VAR EQ_TIME exp
1454 {
1455 (yystack_[2].value.tptr)->value.var *= (yystack_[0].value.val);
1456 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1457 } break;
1458
1459 case 144: // exp: VAR EQ_DIV exp
1460 {
1461 (yystack_[2].value.tptr)->value.var /= (yystack_[0].value.val);
1462 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1463 } break;
1464
1465 case 145: // exp: VAR EQ_POW exp
1466 {
1467 reset_error();
1468 (yystack_[2].value.tptr)->value.var =
1469 std::pow((yystack_[2].value.tptr)->value.var, (yystack_[0].value.val));
1470 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1471 SEAMS::math_error(aprepro, "Power");
1472 } break;
1473
1474 case 146: // exp: INC IMMVAR
1475 {
1476 (yylhs.value.val) = (yystack_[0].value.tptr)->value.var;
1477 immutable_modify(aprepro, (yystack_[0].value.tptr));
1478 } break;
1479
1480 case 147: // exp: DEC IMMVAR
1481 {
1482 (yylhs.value.val) = (yystack_[0].value.tptr)->value.var;
1483 immutable_modify(aprepro, (yystack_[0].value.tptr));
1484 } break;
1485
1486 case 148: // exp: IMMVAR INC
1487 {
1488 (yylhs.value.val) = (yystack_[1].value.tptr)->value.var;
1489 immutable_modify(aprepro, (yystack_[1].value.tptr));
1490 } break;
1491
1492 case 149: // exp: IMMVAR DEC
1493 {
1494 (yylhs.value.val) = (yystack_[1].value.tptr)->value.var;
1495 immutable_modify(aprepro, (yystack_[1].value.tptr));
1496 } break;
1497
1498 case 150: // exp: IMMVAR EQUAL exp
1499 {
1500 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1501 immutable_modify(aprepro, (yystack_[2].value.tptr));
1502 } break;
1503
1504 case 151: // exp: IMMSVAR EQUAL exp
1505 {
1506 immutable_modify(aprepro, (yystack_[2].value.tptr));
1507 YYERROR;
1508 } break;
1509
1510 case 152: // exp: IMMVAR EQ_PLUS exp
1511 {
1512 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1513 immutable_modify(aprepro, (yystack_[2].value.tptr));
1514 } break;
1515
1516 case 153: // exp: IMMVAR EQ_MINUS exp
1517 {
1518 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1519 immutable_modify(aprepro, (yystack_[2].value.tptr));
1520 } break;
1521
1522 case 154: // exp: IMMVAR EQ_TIME exp
1523 {
1524 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1525 immutable_modify(aprepro, (yystack_[2].value.tptr));
1526 } break;
1527
1528 case 155: // exp: IMMVAR EQ_DIV exp
1529 {
1530 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1531 immutable_modify(aprepro, (yystack_[2].value.tptr));
1532 } break;
1533
1534 case 156: // exp: IMMVAR EQ_POW exp
1535 {
1536 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1537 immutable_modify(aprepro, (yystack_[2].value.tptr));
1538 } break;
1539
1540 case 157: // exp: UNDVAR
1541 {
1542 (yylhs.value.val) = (yystack_[0].value.tptr)->value.var;
1543 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
1544 } break;
1545
1546 case 158: // exp: INC UNDVAR
1547 {
1548 (yylhs.value.val) = ++((yystack_[0].value.tptr)->value.var);
1549 set_type(aprepro, (yystack_[0].value.tptr), token::VAR);
1550 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
1551 } break;
1552
1553 case 159: // exp: DEC UNDVAR
1554 {
1555 (yylhs.value.val) = --((yystack_[0].value.tptr)->value.var);
1556 set_type(aprepro, (yystack_[0].value.tptr), token::VAR);
1557 undefined_error(aprepro, (yystack_[0].value.tptr)->name);
1558 } break;
1559
1560 case 160: // exp: UNDVAR INC
1561 {
1562 (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)++;
1563 set_type(aprepro, (yystack_[1].value.tptr), token::VAR);
1564 undefined_error(aprepro, (yystack_[1].value.tptr)->name);
1565 } break;
1566
1567 case 161: // exp: UNDVAR DEC
1568 {
1569 (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)--;
1570 set_type(aprepro, (yystack_[1].value.tptr), token::VAR);
1571 undefined_error(aprepro, (yystack_[1].value.tptr)->name);
1572 } break;
1573
1574 case 162: // exp: UNDVAR EQUAL exp
1575 {
1576 (yylhs.value.val) = (yystack_[0].value.val);
1577 (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val);
1578 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1579 } break;
1580
1581 case 163: // exp: UNDVAR EQ_PLUS exp
1582 {
1583 (yystack_[2].value.tptr)->value.var += (yystack_[0].value.val);
1584 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1585 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1586 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
1587 } break;
1588
1589 case 164: // exp: UNDVAR EQ_MINUS exp
1590 {
1591 (yystack_[2].value.tptr)->value.var -= (yystack_[0].value.val);
1592 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1593 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1594 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
1595 } break;
1596
1597 case 165: // exp: UNDVAR EQ_TIME exp
1598 {
1599 (yystack_[2].value.tptr)->value.var *= (yystack_[0].value.val);
1600 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1601 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1602 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
1603 } break;
1604
1605 case 166: // exp: UNDVAR EQ_DIV exp
1606 {
1607 (yystack_[2].value.tptr)->value.var /= (yystack_[0].value.val);
1608 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1609 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1610 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
1611 } break;
1612
1613 case 167: // exp: UNDVAR EQ_POW exp
1614 {
1615 reset_error();
1616 (yystack_[2].value.tptr)->value.var =
1617 std::pow((yystack_[2].value.tptr)->value.var, (yystack_[0].value.val));
1618 (yylhs.value.val) = (yystack_[2].value.tptr)->value.var;
1619 set_type(aprepro, (yystack_[2].value.tptr), token::VAR);
1620 SEAMS::math_error(aprepro, "Power");
1621 undefined_error(aprepro, (yystack_[2].value.tptr)->name);
1622 } break;
1623
1624 case 168: // exp: FNCT LPAR RPAR
1625 {
1626 if (arg_check((yystack_[2].value.tptr),
1627 (yystack_[2].value.tptr)->value.fnctptr == NULL))
1628 (yylhs.value.val) = (*((yystack_[2].value.tptr)->value.fnctptr))();
1629 else
1630 (yylhs.value.val) = 0.0;
1631 } break;
1632
1633 case 169: // exp: FNCT LPAR exp RPAR
1634 {
1635 if (arg_check((yystack_[3].value.tptr),
1636 (yystack_[3].value.tptr)->value.fnctptr_d == NULL))
1637 (yylhs.value.val) =
1638 (*((yystack_[3].value.tptr)->value.fnctptr_d))((yystack_[1].value.val));
1639 else
1640 (yylhs.value.val) = 0.0;
1641 } break;
1642
1643 case 170: // exp: FNCT LPAR sexp RPAR
1644 {
1645 if (arg_check((yystack_[3].value.tptr),
1646 (yystack_[3].value.tptr)->value.fnctptr_c == NULL))
1647 (yylhs.value.val) =
1648 (*((yystack_[3].value.tptr)->value.fnctptr_c))((yystack_[1].value.string));
1649 else
1650 (yylhs.value.val) = 0.0;
1651 } break;
1652
1653 case 171: // exp: FNCT LPAR aexp RPAR
1654 {
1655 if (arg_check((yystack_[3].value.tptr),
1656 (yystack_[3].value.tptr)->value.fnctptr_a == NULL))
1657 (yylhs.value.val) =
1658 (*((yystack_[3].value.tptr)->value.fnctptr_a))((yystack_[1].value.arrval));
1659 else
1660 (yylhs.value.val) = 0.0;
1661 } break;
1662
1663 case 172: // exp: FNCT LPAR sexp COMMA exp RPAR
1664 {
1665 if (arg_check((yystack_[5].value.tptr),
1666 (yystack_[5].value.tptr)->value.fnctptr_cd == NULL))
1667 (yylhs.value.val) = (*((yystack_[5].value.tptr)->value.fnctptr_cd))(
1668 (yystack_[3].value.string), (yystack_[1].value.val));
1669 else
1670 (yylhs.value.val) = 0.0;
1671 } break;
1672
1673 case 173: // exp: FNCT LPAR exp COMMA sexp RPAR
1674 {
1675 if (arg_check((yystack_[5].value.tptr),
1676 (yystack_[5].value.tptr)->value.fnctptr_dc == NULL))
1677 (yylhs.value.val) = (*((yystack_[5].value.tptr)->value.fnctptr_dc))(
1678 (yystack_[3].value.val), (yystack_[1].value.string));
1679 else
1680 (yylhs.value.val) = 0.0;
1681 } break;
1682
1683 case 174: // exp: FNCT LPAR sexp COMMA sexp RPAR
1684 {
1685 if (arg_check((yystack_[5].value.tptr),
1686 (yystack_[5].value.tptr)->value.fnctptr_cc == NULL))
1687 (yylhs.value.val) = (*((yystack_[5].value.tptr)->value.fnctptr_cc))(
1688 (yystack_[3].value.string), (yystack_[1].value.string));
1689 else
1690 (yylhs.value.val) = 0.0;
1691 } break;
1692
1693 case 175: // exp: FNCT LPAR sexp COMMA sexp COMMA sexp RPAR
1694 {
1695 if (arg_check((yystack_[7].value.tptr),
1696 (yystack_[7].value.tptr)->value.fnctptr_ccc == NULL))
1697 (yylhs.value.val) = (*((yystack_[7].value.tptr)->value.fnctptr_ccc))(
1698 (yystack_[5].value.string), (yystack_[3].value.string),
1699 (yystack_[1].value.string));
1700 else
1701 yyerrok;
1702 } break;
1703
1704 case 176: // exp: FNCT LPAR exp COMMA exp RPAR
1705 {
1706 if (arg_check((yystack_[5].value.tptr),
1707 (yystack_[5].value.tptr)->value.fnctptr_dd == NULL))
1708 (yylhs.value.val) = (*((yystack_[5].value.tptr)->value.fnctptr_dd))(
1709 (yystack_[3].value.val), (yystack_[1].value.val));
1710 else
1711 (yylhs.value.val) = 0.0;
1712 } break;
1713
1714 case 177: // exp: FNCT LPAR exp COMMA exp COMMA exp RPAR
1715 {
1716 if (arg_check((yystack_[7].value.tptr),
1717 (yystack_[7].value.tptr)->value.fnctptr_ddd == NULL))
1718 (yylhs.value.val) = (*((yystack_[7].value.tptr)->value.fnctptr_ddd))(
1719 (yystack_[5].value.val), (yystack_[3].value.val), (yystack_[1].value.val));
1720 else
1721 (yylhs.value.val) = 0.0;
1722 } break;
1723
1724 case 178: // exp: FNCT LPAR sexp COMMA sexp COMMA exp RPAR
1725 {
1726 if (arg_check((yystack_[7].value.tptr),
1727 (yystack_[7].value.tptr)->value.fnctptr_ccd == NULL))
1728 (yylhs.value.val) = (*((yystack_[7].value.tptr)->value.fnctptr_ccd))(
1729 (yystack_[5].value.string), (yystack_[3].value.string), (yystack_[1].value.val));
1730 else
1731 (yylhs.value.val) = 0.0;
1732 } break;
1733
1734 case 179: // exp: FNCT LPAR exp COMMA exp SEMI exp COMMA exp RPAR
1735 {
1736 if (arg_check((yystack_[9].value.tptr),
1737 (yystack_[9].value.tptr)->value.fnctptr_dddd == NULL))
1738 (yylhs.value.val) = (*((yystack_[9].value.tptr)->value.fnctptr_dddd))(
1739 (yystack_[7].value.val), (yystack_[5].value.val), (yystack_[3].value.val),
1740 (yystack_[1].value.val));
1741 else
1742 (yylhs.value.val) = 0.0;
1743 } break;
1744
1745 case 180: // exp: FNCT LPAR exp COMMA exp COMMA exp COMMA exp RPAR
1746 {
1747 if (arg_check((yystack_[9].value.tptr),
1748 (yystack_[9].value.tptr)->value.fnctptr_dddd == NULL))
1749 (yylhs.value.val) = (*((yystack_[9].value.tptr)->value.fnctptr_dddd))(
1750 (yystack_[7].value.val), (yystack_[5].value.val), (yystack_[3].value.val),
1751 (yystack_[1].value.val));
1752 else
1753 (yylhs.value.val) = 0.0;
1754 } break;
1755
1756 case 181: // exp: FNCT LPAR exp COMMA exp COMMA exp COMMA exp COMMA sexp RPAR
1757 {
1758 if (arg_check((yystack_[11].value.tptr),
1759 (yystack_[11].value.tptr)->value.fnctptr_ddddc == NULL))
1760 (yylhs.value.val) = (*((yystack_[11].value.tptr)->value.fnctptr_ddddc))(
1761 (yystack_[9].value.val), (yystack_[7].value.val), (yystack_[5].value.val),
1762 (yystack_[3].value.val), (yystack_[1].value.string));
1763 else
1764 (yylhs.value.val) = 0.0;
1765 } break;
1766
1767 case 182: // exp: FNCT LPAR exp COMMA exp COMMA exp COMMA exp COMMA exp COMMA exp RPAR
1768 {
1769 if (arg_check((yystack_[13].value.tptr),
1770 (yystack_[13].value.tptr)->value.fnctptr_dddddd == NULL))
1771 (yylhs.value.val) = (*((yystack_[13].value.tptr)->value.fnctptr_dddddd))(
1772 (yystack_[11].value.val), (yystack_[9].value.val), (yystack_[7].value.val),
1773 (yystack_[5].value.val), (yystack_[3].value.val), (yystack_[1].value.val));
1774 else
1775 (yylhs.value.val) = 0.0;
1776 } break;
1777
1778 case 183: // exp: exp PLU exp
1779 {
1780 (yylhs.value.val) = (yystack_[2].value.val) + (yystack_[0].value.val);
1781 } break;
1782
1783 case 184: // exp: exp SUB exp
1784 {
1785 (yylhs.value.val) = (yystack_[2].value.val) - (yystack_[0].value.val);
1786 } break;
1787
1788 case 185: // exp: exp TIM exp
1789 {
1790 (yylhs.value.val) = (yystack_[2].value.val) * (yystack_[0].value.val);
1791 } break;
1792
1793 case 186: // exp: exp DIV exp
1794 {
1795 if ((yystack_[0].value.val) == 0.) {
1796 (yylhs.value.val) = std::numeric_limits<double>::infinity();
1797 yyerror(aprepro, "Zero divisor");
1798 yyerrok;
1799 }
1800 else
1801 (yylhs.value.val) = (yystack_[2].value.val) / (yystack_[0].value.val);
1802 } break;
1803
1804 case 187: // exp: exp MOD exp
1805 {
1806 if ((int)(yystack_[0].value.val) == 0.) {
1807 (yylhs.value.val) = (int)(yystack_[2].value.val);
1808 yyerror(aprepro, "Zero divisor");
1809 yyerrok;
1810 }
1811 else
1812 (yylhs.value.val) = (int)(yystack_[2].value.val) % (int)(yystack_[0].value.val);
1813 } break;
1814
1815 case 188: // exp: SUB exp
1816 {
1817 (yylhs.value.val) = -(yystack_[0].value.val);
1818 } break;
1819
1820 case 189: // exp: PLU exp
1821 {
1822 (yylhs.value.val) = (yystack_[0].value.val);
1823 } break;
1824
1825 case 190: // exp: exp POW exp
1826 {
1827 reset_error();
1828 (yylhs.value.val) = std::pow((yystack_[2].value.val), (yystack_[0].value.val));
1829 SEAMS::math_error(aprepro, "Power");
1830 } break;
1831
1832 case 191: // exp: LPAR exp RPAR
1833 {
1834 (yylhs.value.val) = (yystack_[1].value.val);
1835 } break;
1836
1837 case 192: // exp: LBRACK exp RBRACK
1838 {
1839 reset_error();
1840 (yylhs.value.val) =
1841 (double)((yystack_[1].value.val) < 0 ? -floor(-((yystack_[1].value.val)))
1842 : floor((yystack_[1].value.val)));
1843 SEAMS::math_error(aprepro, "floor (int)");
1844 } break;
1845
1846 case 193: // exp: bool
1847 {
1848 (yylhs.value.val) = ((yystack_[0].value.val)) ? 1 : 0;
1849 } break;
1850
1851 case 194: // exp: bool QUEST exp COLON exp
1852 {
1853 (yylhs.value.val) =
1854 ((yystack_[4].value.val)) ? ((yystack_[2].value.val)) : ((yystack_[0].value.val));
1855 } break;
1856
1857 case 195: // exp: AVAR LBRACK exp RBRACK
1858 {
1859 (yylhs.value.val) =
1860 array_value((yystack_[3].value.tptr)->value.avar, (yystack_[1].value.val), 0);
1861 } break;
1862
1863 case 196: // exp: AVAR LBRACK exp COMMA exp RBRACK
1864 {
1865 (yylhs.value.val) = array_value((yystack_[5].value.tptr)->value.avar,
1866 (yystack_[3].value.val), (yystack_[1].value.val));
1867 } break;
1868
1869 case 197: // exp: AVAR LBRACK exp RBRACK EQUAL exp
1870 {
1871 (yylhs.value.val) = (yystack_[0].value.val);
1872 array *arr = (yystack_[5].value.tptr)->value.avar;
1873 int cols = arr->cols;
1874 if (cols > 1) {
1875 yyerror(aprepro, "Cannot use [index] array access with multi-column array");
1876 yyerrok;
1877 }
1878 int rows = arr->rows;
1879 int row = (yystack_[3].value.val);
1880 if (aprepro.ap_options.one_based_index) {
1881 row--;
1882 }
1883 if (row < rows) {
1884 int offset = row * cols;
1885 (yystack_[5].value.tptr)->value.avar->data[offset] = (yystack_[0].value.val);
1886 }
1887 else {
1888 yyerror(aprepro, "Row or Column index out of range");
1889 yyerrok;
1890 }
1891 } break;
1892
1893 case 198: // exp: AVAR LBRACK exp COMMA exp RBRACK EQUAL exp
1894 {
1895 (yylhs.value.val) = (yystack_[0].value.val);
1896 array *arr = (yystack_[7].value.tptr)->value.avar;
1897 int cols = arr->cols;
1898 int rows = arr->rows;
1899 int row = (yystack_[5].value.val);
1900 int col = (yystack_[3].value.val);
1901 if (aprepro.ap_options.one_based_index) {
1902 row--;
1903 col--;
1904 }
1905 if (row < rows && col < cols) {
1906 int offset = row * cols + col;
1907 (yystack_[7].value.tptr)->value.avar->data[offset] = (yystack_[0].value.val);
1908 }
1909 else {
1910 yyerror(aprepro, "Row or Column index out of range");
1911 yyerrok;
1912 }
1913 } break;
1914
1915 default: break;
1916 }
1917 }
1918 #if YY_EXCEPTIONS
1919 catch (const syntax_error &yyexc) {
1920 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
1921 error(yyexc);
1922 YYERROR;
1923 }
1924 #endif // YY_EXCEPTIONS
1925 YY_SYMBOL_PRINT("-> $$ =", yylhs);
1926 yypop_(yylen);
1927 yylen = 0;
1928
1929 // Shift the result of the reduction.
1930 yypush_(YY_NULLPTR, YY_MOVE(yylhs));
1931 }
1932 goto yynewstate;
1933
1934 /*--------------------------------------.
1935 | yyerrlab -- here on detecting error. |
1936 `--------------------------------------*/
1937 yyerrlab:
1938 // If not already recovering from an error, report this error.
1939 if (!yyerrstatus_) {
1940 context yyctx(*this, yyla);
1941 std::string msg = yysyntax_error_(yyctx);
1942 error(YY_MOVE(msg));
1943 }
1944
1945 if (yyerrstatus_ == 3) {
1946 /* If just tried and failed to reuse lookahead token after an
1947 error, discard it. */
1948
1949 // Return failure if at end of input.
1950 if (yyla.kind() == symbol_kind::S_YYEOF)
1951 YYABORT;
1952 else if (!yyla.empty()) {
1953 yy_destroy_("Error: discarding", yyla);
1954 yyla.clear();
1955 }
1956 }
1957
1958 // Else will try to reuse lookahead token after shifting the error token.
1959 goto yyerrlab1;
1960
1961 /*---------------------------------------------------.
1962 | yyerrorlab -- error raised explicitly by YYERROR. |
1963 `---------------------------------------------------*/
1964 yyerrorlab:
1965 /* Pacify compilers when the user code never invokes YYERROR and
1966 the label yyerrorlab therefore never appears in user code. */
1967 if (false)
1968 YYERROR;
1969
1970 /* Do not reclaim the symbols of the rule whose action triggered
1971 this YYERROR. */
1972 yypop_(yylen);
1973 yylen = 0;
1974 YY_STACK_PRINT();
1975 goto yyerrlab1;
1976
1977 /*-------------------------------------------------------------.
1978 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1979 `-------------------------------------------------------------*/
1980 yyerrlab1:
1981 yyerrstatus_ = 3; // Each real token shifted decrements this.
1982 // Pop stack until we find a state that shifts the error token.
1983 for (;;) {
1984 yyn = yypact_[+yystack_[0].state];
1985 if (!yy_pact_value_is_default_(yyn)) {
1986 yyn += symbol_kind::S_YYerror;
1987 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == symbol_kind::S_YYerror) {
1988 yyn = yytable_[yyn];
1989 if (0 < yyn)
1990 break;
1991 }
1992 }
1993
1994 // Pop the current state because it cannot handle the error token.
1995 if (yystack_.size() == 1)
1996 YYABORT;
1997
1998 yy_destroy_("Error: popping", yystack_[0]);
1999 yypop_();
2000 YY_STACK_PRINT();
2001 }
2002 {
2003 stack_symbol_type error_token;
2004
2005 // Shift the error token.
2006 error_token.state = state_type(yyn);
2007 yypush_("Shifting", YY_MOVE(error_token));
2008 }
2009 goto yynewstate;
2010
2011 /*-------------------------------------.
2012 | yyacceptlab -- YYACCEPT comes here. |
2013 `-------------------------------------*/
2014 yyacceptlab:
2015 yyresult = 0;
2016 goto yyreturn;
2017
2018 /*-----------------------------------.
2019 | yyabortlab -- YYABORT comes here. |
2020 `-----------------------------------*/
2021 yyabortlab:
2022 yyresult = 1;
2023 goto yyreturn;
2024
2025 /*-----------------------------------------------------.
2026 | yyreturn -- parsing is finished, return the result. |
2027 `-----------------------------------------------------*/
2028 yyreturn:
2029 if (!yyla.empty())
2030 yy_destroy_("Cleanup: discarding lookahead", yyla);
2031
2032 /* Do not reclaim the symbols of the rule whose action triggered
2033 this YYABORT or YYACCEPT. */
2034 yypop_(yylen);
2035 YY_STACK_PRINT();
2036 while (1 < yystack_.size()) {
2037 yy_destroy_("Cleanup: popping", yystack_[0]);
2038 yypop_();
2039 }
2040
2041 return yyresult;
2042 }
2043 #if YY_EXCEPTIONS
2044 catch (...) {
2045 YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
2046 // Do not try to display the values of the reclaimed symbols,
2047 // as their printers might throw an exception.
2048 if (!yyla.empty())
2049 yy_destroy_(YY_NULLPTR, yyla);
2050
2051 while (1 < yystack_.size()) {
2052 yy_destroy_(YY_NULLPTR, yystack_[0]);
2053 yypop_();
2054 }
2055 throw;
2056 }
2057 #endif // YY_EXCEPTIONS
2058 }
2059
2060 void Parser::error(const syntax_error &yyexc) { error(yyexc.what()); }
2061
2062 /* Return YYSTR after stripping away unnecessary quotes and
2063 backslashes, so that it's suitable for yyerror. The heuristic is
2064 that double-quoting is unnecessary unless the string contains an
2065 apostrophe, a comma, or backslash (other than backslash-backslash).
2066 YYSTR is taken from yytname. */
2067 std::string Parser::yytnamerr_(const char *yystr)
2068 {
2069 if (*yystr == '"') {
2070 std::string yyr;
2071 char const *yyp = yystr;
2072
2073 for (;;)
2074 switch (*++yyp) {
2075 case '\'':
2076 case ',': goto do_not_strip_quotes;
2077
2078 case '\\':
2079 if (*++yyp != '\\')
2080 goto do_not_strip_quotes;
2081 else
2082 goto append;
2083
2084 append:
2085 default: yyr += *yyp; break;
2086
2087 case '"': return yyr;
2088 }
2089 do_not_strip_quotes:;
2090 }
2091
2092 return yystr;
2093 }
2094
2095 std::string Parser::symbol_name(symbol_kind_type yysymbol)
2096 {
2097 return yytnamerr_(yytname_[yysymbol]);
2098 }
2099
2100 // Parser::context.
2101 Parser::context::context(const Parser &yyparser, const symbol_type &yyla)
2102 : yyparser_(yyparser), yyla_(yyla)
2103 {
2104 }
2105
2106 int Parser::context::expected_tokens(symbol_kind_type yyarg[], int yyargn) const
2107 {
2108 // Actual number of expected tokens
2109 int yycount = 0;
2110
2111 const int yyn = yypact_[+yyparser_.yystack_[0].state];
2112 if (!yy_pact_value_is_default_(yyn)) {
2113 /* Start YYX at -YYN if negative to avoid negative indexes in
2114 YYCHECK. In other words, skip the first -YYN actions for
2115 this state because they are default actions. */
2116 const int yyxbegin = yyn < 0 ? -yyn : 0;
2117 // Stay within bounds of both yycheck and yytname.
2118 const int yychecklim = yylast_ - yyn + 1;
2119 const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2120 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
2121 if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror &&
2122 !yy_table_value_is_error_(yytable_[yyx + yyn])) {
2123 if (!yyarg)
2124 ++yycount;
2125 else if (yycount == yyargn)
2126 return 0;
2127 else
2128 yyarg[yycount++] = YY_CAST(symbol_kind_type, yyx);
2129 }
2130 }
2131
2132 if (yyarg && yycount == 0 && 0 < yyargn)
2133 yyarg[0] = symbol_kind::S_YYEMPTY;
2134 return yycount;
2135 }
2136
2137 int Parser::yy_syntax_error_arguments_(const context &yyctx, symbol_kind_type yyarg[],
2138 int yyargn) const
2139 {
2140 /* There are many possibilities here to consider:
2141 - If this state is a consistent state with a default action, then
2142 the only way this function was invoked is if the default action
2143 is an error action. In that case, don't check for expected
2144 tokens because there are none.
2145 - The only way there can be no lookahead present (in yyla) is
2146 if this state is a consistent state with a default action.
2147 Thus, detecting the absence of a lookahead is sufficient to
2148 determine that there is no unexpected or expected token to
2149 report. In that case, just report a simple "syntax error".
2150 - Don't assume there isn't a lookahead just because this state is
2151 a consistent state with a default action. There might have
2152 been a previous inconsistent state, consistent state with a
2153 non-default action, or user semantic action that manipulated
2154 yyla. (However, yyla is currently not documented for users.)
2155 - Of course, the expected token list depends on states to have
2156 correct lookahead information, and it depends on the parser not
2157 to perform extra reductions after fetching a lookahead from the
2158 scanner and before detecting a syntax error. Thus, state merging
2159 (from LALR or IELR) and default reductions corrupt the expected
2160 token list. However, the list is correct for canonical LR with
2161 one exception: it will still contain any token that will not be
2162 accepted due to an error action in a later state.
2163 */
2164
2165 if (!yyctx.lookahead().empty()) {
2166 if (yyarg)
2167 yyarg[0] = yyctx.token();
2168 int yyn = yyctx.expected_tokens(yyarg ? yyarg + 1 : yyarg, yyargn - 1);
2169 return yyn + 1;
2170 }
2171 return 0;
2172 }
2173
2174 // Generate an error message.
2175 std::string Parser::yysyntax_error_(const context &yyctx) const
2176 {
2177 // Its maximum.
2178 enum { YYARGS_MAX = 5 };
2179 // Arguments of yyformat.
2180 symbol_kind_type yyarg[YYARGS_MAX];
2181 int yycount = yy_syntax_error_arguments_(yyctx, yyarg, YYARGS_MAX);
2182
2183 char const *yyformat = YY_NULLPTR;
2184 switch (yycount) {
2185 #define YYCASE_(N, S) \
2186 case N: yyformat = S; break
2187 default: // Avoid compiler warnings.
2188 YYCASE_(0, YY_("syntax error"));
2189 YYCASE_(1, YY_("syntax error, unexpected %s"));
2190 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2191 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2192 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2193 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2194 #undef YYCASE_
2195 }
2196
2197 std::string yyres;
2198 // Argument number.
2199 std::ptrdiff_t yyi = 0;
2200 for (char const *yyp = yyformat; *yyp; ++yyp)
2201 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) {
2202 yyres += symbol_name(yyarg[yyi++]);
2203 ++yyp;
2204 }
2205 else
2206 yyres += *yyp;
2207 return yyres;
2208 }
2209
2210 const signed char Parser::yypact_ninf_ = -32;
2211
2212 const signed char Parser::yytable_ninf_ = -1;
2213
2214 const short Parser::yypact_[] = {
2215 -32, 22, -32, 4, 353, -32, -32, -32, -32, -32, 1894, -21, 20, 178, 28,
2216 140, 44, 51, 54, 121, 121, -32, 121, 496, 121, 251, 334, 162, 293, 115,
2217 1930, 496, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
2218 -32, -32, 496, 121, 121, 121, 121, 121, -32, -32, 496, 121, 121, 121, 121,
2219 121, 121, -32, -32, 121, 121, 496, 421, 481, 496, 1912, 325, 50, 158, 121,
2220 148, 1961, 1604, 1845, 39, -32, 39, 39, -32, -32, -32, -32, -32, -32, -32,
2221 -32, 121, 541, 556, -32, 496, 496, 121, 496, -32, 601, 616, 661, 676, 721,
2222 736, 121, 121, 121, 121, 121, -32, 781, 796, 841, 856, 901, 916, 961, 976,
2223 121, 121, 121, 496, 121, 121, 188, 1961, 1980, 1996, 1996, 1996, 1996, 1996, 55,
2224 2027, -32, 2041, -31, 264, -31, 264, -31, 264, -31, 264, -31, 264, -31, 264,
2225 188, 1961, 1980, 1996, 1996, 1996, 1996, 1996, 188, 1961, 1980, 1961, 1996, 1996, 1996,
2226 1996, 1996, 1996, 1961, 1996, 1339, 188, 1961, 1980, -32, 179, 175, 1369, -32, 245,
2227 995, 1399, 255, 1023, 1429, 121, 121, 121, 121, 39, -32, -32, 121, -32, 345,
2228 1947, 1912, 55, 2027, 1912, -32, 2041, -29, 1980, -29, 2012, -32, 2012, 1912, -31,
2229 264, 1912, -31, 264, 1912, -31, 264, 1912, -31, 264, 1912, -31, 264, 1912, -31,
2230 264, -27, 99, -27, 99, 25, 39, 25, 39, -32, 1996, 1912, 55, 2027, 1912,
2231 -32, 2041, 1912, -31, 264, 1912, -31, 264, 1912, -31, 264, 1912, -31, 264, 1912,
2232 -31, 264, 1912, -31, 264, -27, 99, -27, 99, 25, 39, -32, 25, 39, 39,
2233 39, 121, 63, -32, 121, -32, 121, -32, -32, 121, -32, 121, -32, -32, 121,
2234 -32, 121, -32, 1996, 1996, 1996, 1996, 39, 121, 121, 1870, 121, 1051, 1631, 42,
2235 1310, 1079, 1658, 1107, 1685, 1178, 1712, 1459, 1961, 1996, 73, 1996, 121, -32, -32,
2236 -32, 121, -32, 121, 121, -32, -32, 121, -32, -32, -32, -32, 121, -32, 121,
2237 1204, 1739, 1489, 1548, 1230, 1135, 1766, 1996, -32, -32, 121, -32, 121, -32, 121,
2238 -32, -32, 1519, 1793, 1152, 121, -32, -32, 121, 1256, 1577, 1282, -32, 121, -32,
2239 1820, -32};
2240
2241 const unsigned char Parser::yydefact_[] = {
2242 2, 0, 1, 0, 0, 4, 3, 9, 129, 95, 157, 132, 96, 133, 97, 76, 0, 0, 0,
2243 0, 0, 8, 0, 0, 0, 0, 0, 193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2244 0, 0, 0, 0, 0, 0, 0, 160, 161, 0, 0, 0, 0, 0, 0, 136, 137, 0, 0,
2245 0, 0, 0, 0, 0, 148, 149, 0, 0, 0, 0, 0, 0, 157, 132, 96, 0, 0, 193,
2246 0, 0, 0, 189, 89, 188, 12, 130, 158, 134, 146, 131, 159, 135, 147, 0, 0, 0, 7,
2247 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
2248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 98, 162, 163, 164, 165, 166,
2249 167, 32, 26, 33, 27, 52, 64, 53, 65, 54, 66, 55, 67, 56, 68, 57, 69, 85, 100,
2250 138, 141, 142, 143, 144, 145, 84, 99, 139, 103, 150, 152, 153, 154, 155, 156, 102, 151, 0,
2251 86, 101, 140, 168, 0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188,
2252 25, 191, 0, 192, 0, 0, 30, 19, 21, 31, 20, 22, 88, 0, 90, 92, 94, 91, 58,
2253 34, 46, 59, 35, 47, 60, 36, 48, 61, 37, 49, 62, 38, 50, 63, 39, 51, 109, 125,
2254 128, 127, 123, 121, 120, 119, 108, 0, 28, 23, 17, 29, 24, 18, 70, 40, 10, 71, 41,
2255 11, 72, 42, 13, 73, 43, 14, 74, 44, 15, 75, 45, 16, 124, 183, 126, 184, 122, 186,
2256 93, 118, 185, 187, 190, 0, 195, 171, 0, 170, 0, 169, 107, 0, 104, 0, 106, 83, 0,
2257 77, 0, 82, 162, 138, 139, 140, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2258 0, 0, 0, 0, 117, 194, 196, 197, 0, 174, 172, 173, 0, 176, 0, 0, 116, 114, 0,
2259 113, 110, 79, 78, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 198, 175, 178, 0, 177,
2260 0, 115, 0, 112, 80, 0, 0, 0, 0, 180, 179, 0, 0, 0, 0, 181, 0, 111, 0,
2261 182};
2262
2263 const short Parser::yypgoto_[] = {-32, -32, -32, 30, 232, 130, -4};
2264
2265 const unsigned char Parser::yydefgoto_[] = {0, 1, 6, 27, 28, 76, 235};
2266
2267 const short Parser::yytable_[] = {
2268 30, 47, 48, 49, 50, 51, 52, 106, 107, 108, 109, 97, 98, 108, 109, 77, 78, 110, 79,
2269 81, 82, 110, 2, 3, 7, 53, 54, 128, 129, 130, 131, 132, 133, 135, 137, 139, 141, 143,
2270 145, 147, 149, 4, 55, 152, 153, 154, 155, 156, 157, 75, 64, 160, 162, 163, 164, 165, 166,
2271 167, 315, 67, 169, 170, 173, 177, 181, 184, 68, 134, 136, 69, 189, 5, 187, 110, 100, 101,
2272 102, 103, 104, 105, 106, 107, 108, 109, 125, 296, 93, 195, 198, 201, 110, 203, 203, 205, 207,
2273 329, 210, 213, 216, 219, 222, 225, 227, 229, 231, 233, 0, 0, 238, 241, 244, 247, 250, 253,
2274 256, 259, 261, 263, 265, 268, 269, 270, 197, 200, 8, 9, 70, 71, 72, 13, 14, 73, 16,
2275 17, 29, 99, 19, 0, 20, 122, 192, 124, 237, 240, 125, 0, 0, 100, 101, 102, 103, 104,
2276 105, 106, 107, 108, 109, 65, 0, 22, 74, 127, 66, 110, 190, 24, 0, 25, 26, 138, 140,
2277 142, 144, 146, 148, 65, 91, 151, 92, 93, 188, 288, 289, 290, 291, 159, 161, 0, 292, 274,
2278 91, 275, 92, 93, 168, 273, 172, 176, 180, 183, 56, 57, 58, 59, 60, 61, 0, 100, 101,
2279 102, 103, 104, 105, 106, 107, 108, 109, 95, 96, 97, 98, 194, 0, 110, 62, 63, 95, 96,
2280 97, 98, 209, 212, 215, 218, 221, 224, 226, 228, 230, 232, 234, 0, 0, 0, 243, 246, 249,
2281 252, 255, 258, 260, 262, 264, 267, 83, 80, 84, 85, 0, 86, 0, 278, 0, 126, 0, 0,
2282 0, 295, 0, 0, 298, 283, 300, 0, 0, 302, 0, 304, 0, 150, 306, 0, 307, 95, 96,
2283 97, 98, 158, 0, 0, 309, 0, 311, 95, 96, 97, 98, 0, 171, 175, 179, 182, 120, 121,
2284 122, 192, 124, 0, 331, 125, 0, 0, 332, 94, 333, 127, 151, 159, 172, 0, 0, 0, 267,
2285 336, 0, 337, 0, 202, 204, 0, 206, 95, 96, 97, 98, 0, 347, 87, 348, 88, 89, 0,
2286 90, 0, 0, 0, 355, 186, 48, 49, 50, 51, 52, 0, 360, 266, 8, 9, 10, 11, 12,
2287 13, 14, 15, 16, 17, 18, 0, 19, 0, 20, 53, 54, 21, 293, 0, 0, 100, 101, 102,
2288 103, 104, 105, 106, 107, 108, 109, 0, 0, 0, 0, 22, 23, 110, 0, 0, 0, 24, 0,
2289 25, 26, 0, 0, 0, 297, 0, 299, 0, 0, 301, 0, 303, 0, 0, 305, 0, 0, 0,
2290 0, 0, 0, 0, 0, 308, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19,
2291 174, 20, 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, 334, 0, 0, 335, 0, 0, 0,
2292 0, 0, 0, 22, 23, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0, 0, 0, 349,
2293 0, 0, 0, 0, 0, 354, 0, 0, 356, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
2294 18, 0, 19, 178, 20, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19, 0,
2295 20, 0, 0, 0, 0, 0, 22, 23, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0,
2296 0, 0, 22, 23, 0, 0, 0, 0, 24, 0, 25, 26, 8, 9, 196, 71, 72, 13, 14,
2297 73, 16, 17, 0, 0, 19, 0, 20, 8, 9, 199, 71, 72, 13, 14, 73, 16, 17, 0,
2298 0, 19, 0, 20, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26,
2299 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 8, 9, 208, 71,
2300 72, 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 8, 9, 211, 71, 72, 13, 14, 73,
2301 16, 17, 0, 0, 19, 0, 20, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24,
2302 0, 25, 26, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 8,
2303 9, 214, 71, 72, 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 8, 9, 217, 71, 72,
2304 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 0, 0, 0, 0, 0, 22, 74, 0, 0,
2305 0, 0, 24, 0, 25, 26, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0,
2306 25, 26, 8, 9, 220, 71, 72, 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 8, 9,
2307 223, 71, 72, 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 0, 0, 0, 0, 0, 22,
2308 74, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0,
2309 0, 24, 0, 25, 26, 8, 9, 236, 71, 72, 13, 14, 73, 16, 17, 0, 0, 19, 0,
2310 20, 8, 9, 239, 71, 72, 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 0, 0, 0,
2311 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0, 0, 0, 22, 74,
2312 0, 0, 0, 0, 24, 0, 25, 26, 8, 9, 242, 71, 72, 13, 14, 73, 16, 17, 0,
2313 0, 19, 0, 20, 8, 9, 245, 71, 72, 13, 14, 73, 16, 17, 0, 0, 19, 0, 20,
2314 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0, 0,
2315 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 8, 9, 248, 71, 72, 13, 14, 73,
2316 16, 17, 0, 0, 19, 0, 20, 8, 9, 251, 71, 72, 13, 14, 73, 16, 17, 0, 0,
2317 19, 0, 20, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 0,
2318 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 8, 9, 254, 71, 72,
2319 13, 14, 73, 16, 17, 0, 0, 19, 0, 20, 8, 9, 257, 71, 72, 13, 14, 73, 16,
2320 17, 0, 0, 19, 0, 20, 0, 0, 0, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0,
2321 25, 26, 279, 0, 280, 0, 0, 22, 74, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0,
2322 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 284, 0, 285, 0, 0, 0, 110, 0,
2323 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108,
2324 109, 312, 0, 313, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2325 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 319, 0, 320, 0, 0, 0, 110, 0, 0,
2326 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
2327 322, 0, 323, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100,
2328 101, 102, 103, 104, 105, 106, 107, 108, 109, 344, 0, 345, 0, 0, 0, 110, 0, 0, 0,
2329 0, 0, 0, 0, 0, 0, 0, 353, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 0,
2330 0, 0, 0, 0, 0, 110, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 325, 0, 0,
2331 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105,
2332 106, 107, 108, 109, 338, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0,
2333 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 343, 0, 0, 0, 0, 0, 110, 0,
2334 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 357,
2335 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103,
2336 104, 105, 106, 107, 108, 109, 359, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0,
2337 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 316, 0, 317, 0, 0, 0,
2338 110, 318, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120,
2339 121, 122, 192, 124, 271, 0, 125, 0, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2340 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 0, 276, 125, 277, 0,
2341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118,
2342 119, 120, 121, 122, 123, 124, 0, 281, 125, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2343 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 286,
2344 125, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115,
2345 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 327, 125, 328, 0, 0, 0, 0, 0, 0,
2346 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192,
2347 124, 0, 340, 125, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112,
2348 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 0, 350, 125, 351, 0, 0, 0,
2349 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120,
2350 121, 122, 192, 124, 342, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2351 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 358, 0, 125, 0, 0,
2352 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119,
2353 120, 121, 122, 192, 124, 191, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2354 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 314, 0, 125, 0, 0, 0,
2355 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
2356 192, 124, 321, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114,
2357 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 324, 0, 125, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 326,
2359 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117,
2360 118, 119, 120, 121, 122, 192, 124, 339, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2361 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 346, 0, 125, 0,
2362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120,
2363 121, 122, 192, 124, 352, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112,
2364 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 361, 0, 125, 0, 0, 0, 0,
2365 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192,
2366 124, 193, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 113, 114, 115, 116, 117,
2367 118, 119, 120, 121, 122, 192, 124, 310, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2368 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 0, 0, 125, 31, 32, 33,
2369 34, 35, 36, 0, 0, 37, 38, 39, 40, 41, 42, 43, 44, 0, 0, 185, 32, 33, 34,
2370 35, 36, 45, 46, 37, 38, 39, 40, 41, 42, 43, 44, 111, 0, 0, 0, 0, 0, 0,
2371 0, 45, 46, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 125,
2372 294, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 0, 0, 125, 100, 101,
2373 102, 103, 104, 105, 106, 107, 108, 109, 0, 0, 0, 0, 0, 0, 110, 112, 113, 114, 115,
2374 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 125, 112, 113, 114, 115, 116, 117, 118,
2375 119, 120, 121, 122, 192, 124, 0, 0, 125, 112, 113, 114, 115, 116, 117, 118, 119, 0, 0,
2376 0, 0, 124, 0, 0, 125, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 0,
2377 0, 125, 114, 115, 116, 117, 118, 119, 120, 121, 122, 192, 124, 0, 0, 125};
2378
2379 const short Parser::yycheck_[] = {
2380 4, 22, 23, 24, 25, 26, 27, 38, 39, 40, 41, 40, 41, 40, 41, 19, 20, 48, 22,
2381 23, 24, 48, 0, 1, 20, 46, 47, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
2382 42, 43, 44, 19, 22, 47, 48, 49, 50, 51, 52, 19, 22, 55, 56, 57, 58, 59, 60,
2383 61, 16, 15, 64, 65, 66, 67, 68, 69, 15, 37, 38, 15, 74, 49, 22, 48, 32, 33,
2384 34, 35, 36, 37, 38, 39, 40, 41, 45, 22, 31, 91, 92, 93, 48, 95, 96, 97, 98,
2385 22, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, -1, -1, 112, 113, 114, 115, 116, 117,
2386 118, 119, 120, 121, 122, 123, 124, 125, 92, 93, 3, 4, 5, 6, 7, 8, 9, 10, 11,
2387 12, 4, 20, 15, -1, 17, 40, 41, 42, 112, 113, 45, -1, -1, 32, 33, 34, 35, 36,
2388 37, 38, 39, 40, 41, 17, -1, 38, 39, 31, 22, 48, 16, 44, -1, 46, 47, 39, 40,
2389 41, 42, 43, 44, 17, 28, 47, 30, 31, 22, 185, 186, 187, 188, 55, 56, -1, 192, 14,
2390 28, 16, 30, 31, 64, 16, 66, 67, 68, 69, 22, 23, 24, 25, 26, 27, -1, 32, 33,
2391 34, 35, 36, 37, 38, 39, 40, 41, 38, 39, 40, 41, 91, -1, 48, 46, 47, 38, 39,
2392 40, 41, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, -1, -1, -1, 114, 115, 116,
2393 117, 118, 119, 120, 121, 122, 123, 3, 23, 5, 6, -1, 8, -1, 16, -1, 31, -1, -1,
2394 -1, 271, -1, -1, 274, 16, 276, -1, -1, 279, -1, 281, -1, 47, 284, -1, 286, 38, 39,
2395 40, 41, 55, -1, -1, 294, -1, 296, 38, 39, 40, 41, -1, 66, 67, 68, 69, 38, 39,
2396 40, 41, 42, -1, 312, 45, -1, -1, 316, 20, 318, 185, 186, 187, 188, -1, -1, -1, 192,
2397 327, -1, 329, -1, 95, 96, -1, 98, 38, 39, 40, 41, -1, 340, 3, 342, 5, 6, -1,
2398 8, -1, -1, -1, 350, 22, 23, 24, 25, 26, 27, -1, 358, 123, 3, 4, 5, 6, 7,
2399 8, 9, 10, 11, 12, 13, -1, 15, -1, 17, 46, 47, 20, 29, -1, -1, 32, 33, 34,
2400 35, 36, 37, 38, 39, 40, 41, -1, -1, -1, -1, 38, 39, 48, -1, -1, -1, 44, -1,
2401 46, 47, -1, -1, -1, 274, -1, 276, -1, -1, 279, -1, 281, -1, -1, 284, -1, -1, -1,
2402 -1, -1, -1, -1, -1, 293, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15,
2403 16, 17, -1, -1, -1, 312, -1, -1, -1, -1, -1, -1, 319, -1, -1, 322, -1, -1, -1,
2404 -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1, -1, -1, 344,
2405 -1, -1, -1, -1, -1, 350, -1, -1, 353, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
2406 13, -1, 15, 16, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15, -1,
2407 17, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1,
2408 -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, 3, 4, 5, 6, 7, 8, 9,
2409 10, 11, 12, -1, -1, 15, -1, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
2410 -1, 15, -1, 17, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47,
2411 -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, 3, 4, 5, 6,
2412 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, 3, 4, 5, 6, 7, 8, 9, 10,
2413 11, 12, -1, -1, 15, -1, 17, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44,
2414 -1, 46, 47, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, 3,
2415 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, 3, 4, 5, 6, 7,
2416 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, -1, -1, -1, -1, 38, 39, -1, -1,
2417 -1, -1, 44, -1, 46, 47, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1,
2418 46, 47, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, 3, 4,
2419 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, -1, -1, -1, -1, 38,
2420 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1,
2421 -1, 44, -1, 46, 47, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, -1,
2422 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, -1, -1,
2423 -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1, -1, -1, 38, 39,
2424 -1, -1, -1, -1, 44, -1, 46, 47, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
2425 -1, 15, -1, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, 17,
2426 -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1, -1,
2427 -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, 3, 4, 5, 6, 7, 8, 9, 10,
2428 11, 12, -1, -1, 15, -1, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1,
2429 15, -1, 17, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1,
2430 -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, 3, 4, 5, 6, 7,
2431 8, 9, 10, 11, 12, -1, -1, 15, -1, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11,
2432 12, -1, -1, 15, -1, 17, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1,
2433 46, 47, 14, -1, 16, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1,
2434 -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 14, -1, 16, -1, -1, -1, 48, -1,
2435 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40,
2436 41, 14, -1, 16, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2437 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 14, -1, 16, -1, -1, -1, 48, -1, -1,
2438 -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
2439 14, -1, 16, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32,
2440 33, 34, 35, 36, 37, 38, 39, 40, 41, 14, -1, 16, -1, -1, -1, 48, -1, -1, -1,
2441 -1, -1, -1, -1, -1, -1, -1, 14, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
2442 -1, -1, -1, -1, -1, 48, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 16, -1, -1,
2443 -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37,
2444 38, 39, 40, 41, 16, -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1,
2445 -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 16, -1, -1, -1, -1, -1, 48, -1,
2446 -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 16,
2447 -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35,
2448 36, 37, 38, 39, 40, 41, 16, -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1,
2449 -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 14, -1, 16, -1, -1, -1,
2450 48, 21, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
2451 39, 40, 41, 42, 14, -1, 45, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2452 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1,
2453 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36,
2454 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2455 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14,
2456 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33,
2457 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, -1,
2458 -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
2459 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30,
2460 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, -1,
2461 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
2462 39, 40, 41, 42, 14, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2463 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 14, -1, 45, -1, -1,
2464 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37,
2465 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2466 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1,
2467 -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
2468 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32,
2469 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1,
2470 -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16,
2471 -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
2472 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2473 -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1,
2474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
2475 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30,
2476 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1,
2477 -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
2478 42, 18, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35,
2479 36, 37, 38, 39, 40, 41, 42, 18, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2480 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45, 22, 23, 24,
2481 25, 26, 27, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, -1, -1, 22, 23, 24, 25,
2482 26, 27, 46, 47, 30, 31, 32, 33, 34, 35, 36, 37, 20, -1, -1, -1, -1, -1, -1,
2483 -1, 46, 47, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45,
2484 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45, 32, 33,
2485 34, 35, 36, 37, 38, 39, 40, 41, -1, -1, -1, -1, -1, -1, 48, 30, 31, 32, 33,
2486 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45, 30, 31, 32, 33, 34, 35, 36,
2487 37, 38, 39, 40, 41, 42, -1, -1, 45, 30, 31, 32, 33, 34, 35, 36, 37, -1, -1,
2488 -1, -1, 42, -1, -1, 45, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1,
2489 -1, 45, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45};
2490
2491 const signed char Parser::yystos_[] = {
2492 0, 51, 0, 1, 19, 49, 52, 20, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 20, 38,
2493 39, 44, 46, 47, 53, 54, 55, 56, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 46,
2494 47, 22, 23, 24, 25, 26, 27, 46, 47, 22, 22, 23, 24, 25, 26, 27, 46, 47, 22, 17, 22, 15, 15,
2495 15, 5, 6, 7, 10, 39, 53, 55, 56, 56, 56, 54, 56, 56, 3, 5, 6, 8, 3, 5, 6, 8, 28,
2496 30, 31, 20, 38, 39, 40, 41, 20, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 48, 20, 30, 31, 32,
2497 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 54, 55, 56, 56, 56, 56, 56, 56, 53, 56, 53, 56,
2498 55, 56, 55, 56, 55, 56, 55, 56, 55, 56, 55, 56, 54, 55, 56, 56, 56, 56, 56, 56, 54, 55, 56,
2499 55, 56, 56, 56, 56, 56, 56, 55, 56, 56, 54, 55, 56, 16, 54, 55, 56, 16, 54, 55, 56, 54, 55,
2500 56, 22, 22, 22, 22, 56, 16, 16, 41, 18, 55, 56, 5, 53, 56, 5, 53, 56, 54, 56, 54, 56, 54,
2501 56, 5, 55, 56, 5, 55, 56, 5, 55, 56, 5, 55, 56, 5, 55, 56, 5, 55, 56, 55, 56, 55, 56,
2502 55, 56, 55, 56, 55, 56, 5, 53, 56, 5, 53, 56, 5, 55, 56, 5, 55, 56, 5, 55, 56, 5, 55,
2503 56, 5, 55, 56, 5, 55, 56, 55, 56, 55, 56, 55, 56, 54, 55, 56, 56, 56, 14, 18, 16, 14, 16,
2504 14, 16, 16, 14, 16, 14, 16, 16, 14, 16, 14, 16, 56, 56, 56, 56, 56, 29, 29, 56, 22, 55, 56,
2505 55, 56, 55, 56, 55, 56, 55, 56, 56, 55, 56, 18, 56, 14, 16, 16, 16, 14, 16, 21, 14, 16, 16,
2506 14, 16, 16, 16, 16, 14, 16, 22, 55, 56, 56, 56, 55, 55, 56, 56, 16, 16, 14, 16, 14, 16, 14,
2507 16, 16, 56, 56, 55, 14, 16, 16, 14, 55, 56, 55, 16, 14, 16, 56, 16};
2508
2509 const signed char Parser::yyr1_[] = {
2510 0, 50, 51, 51, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
2511 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
2512 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
2513 53, 53, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
2514 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
2515 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56,
2516 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
2517 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
2518 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56};
2519
2520 const signed char Parser::yyr2_[] = {
2521 0, 2, 0, 2, 1, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2522 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2523 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 4, 6, 6, 8, 6, 4, 4, 3, 3, 3,
2524 3, 3, 2, 3, 3, 3, 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 3, 4, 3, 4, 4, 3, 3, 6, 12, 8, 6, 6, 8,
2525 6, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
2526 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 6, 6,
2527 6, 8, 6, 8, 8, 10, 10, 12, 14, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 1, 5, 4, 6, 6, 8};
2528
2529 #if SEAMSDEBUG || 1
2530 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2531 // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
2532 const char *const Parser::yytname_[] = {"\"end of file\"",
2533 "error",
2534 "\"invalid token\"",
2535 "NUM",
2536 "QSTRING",
2537 "UNDVAR",
2538 "VAR",
2539 "SVAR",
2540 "IMMVAR",
2541 "IMMSVAR",
2542 "AVAR",
2543 "FNCT",
2544 "SFNCT",
2545 "AFNCT",
2546 "COMMA",
2547 "LPAR",
2548 "RPAR",
2549 "LBRACK",
2550 "RBRACK",
2551 "LBRACE",
2552 "RBRACE",
2553 "SEMI",
2554 "EQUAL",
2555 "EQ_PLUS",
2556 "EQ_MINUS",
2557 "EQ_TIME",
2558 "EQ_DIV",
2559 "EQ_POW",
2560 "QUEST",
2561 "COLON",
2562 "LOR",
2563 "LAND",
2564 "LT",
2565 "GT",
2566 "LE",
2567 "GE",
2568 "EQ",
2569 "NE",
2570 "PLU",
2571 "SUB",
2572 "DIV",
2573 "TIM",
2574 "MOD",
2575 "UNARY",
2576 "NOT",
2577 "POW",
2578 "INC",
2579 "DEC",
2580 "CONCAT",
2581 "'\\n'",
2582 "$accept",
2583 "input",
2584 "line",
2585 "bool",
2586 "aexp",
2587 "sexp",
2588 "exp",
2589 YY_NULLPTR};
2590 #endif
2591
2592 #if SEAMSDEBUG
2593 const short Parser::yyrline_[] = {
2594 0, 127, 127, 128, 131, 132, 145, 149, 150, 151, 154, 155, 156, 157, 158, 159, 160, 161, 162,
2595 163, 164, 165, 166, 167, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 181, 182, 183, 184,
2596 185, 186, 188, 189, 190, 191, 192, 193, 195, 196, 197, 198, 199, 200, 202, 203, 204, 205, 206,
2597 207, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228,
2598 230, 231, 237, 243, 249, 255, 261, 267, 273, 277, 281, 284, 286, 294, 296, 304, 305, 306, 307,
2599 316, 317, 318, 319, 321, 324, 328, 333, 334, 335, 341, 347, 353, 359, 360, 361, 367, 373, 379,
2600 385, 391, 397, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 416, 417, 418, 419,
2601 420, 421, 422, 423, 424, 425, 427, 430, 435, 436, 437, 438, 439, 444, 445, 446, 447, 448, 449,
2602 450, 451, 452, 453, 454, 456, 458, 461, 464, 467, 470, 472, 475, 478, 481, 484, 491, 498, 505,
2603 512, 519, 526, 533, 540, 547, 553, 559, 565, 571, 577, 583, 589, 590, 591, 592, 600, 608, 609,
2604 610, 613, 614, 617, 618, 619, 620, 621, 643};
2605
2606 void Parser::yy_stack_print_() const
2607 {
2608 *yycdebug_ << "Stack now";
2609 for (stack_type::const_iterator i = yystack_.begin(), i_end = yystack_.end(); i != i_end; ++i)
2610 *yycdebug_ << ' ' << int(i->state);
2611 *yycdebug_ << '\n';
2612 }
2613
2614 void Parser::yy_reduce_print_(int yyrule) const
2615 {
2616 int yylno = yyrline_[yyrule];
2617 int yynrhs = yyr2_[yyrule];
2618 // Print the symbols being reduced, and their result.
2619 *yycdebug_ << "Reducing stack by rule " << yyrule - 1 << " (line " << yylno << "):\n";
2620 // The symbols being reduced.
2621 for (int yyi = 0; yyi < yynrhs; yyi++)
2622 YY_SYMBOL_PRINT(" $" << yyi + 1 << " =", yystack_[(yynrhs) - (yyi + 1)]);
2623 }
2624 #endif // SEAMSDEBUG
2625
2626 Parser::symbol_kind_type Parser::yytranslate_(int t) YY_NOEXCEPT
2627 {
2628 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2629 // TOKEN-NUM as returned by yylex.
2630 static const signed char translate_table[] = {
2631 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 49, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8,
2643 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
2644 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48};
2645 // Last valid token kind.
2646 const int code_max = 303;
2647
2648 if (t <= 0)
2649 return symbol_kind::S_YYEOF;
2650 else if (t <= code_max)
2651 return static_cast<symbol_kind_type>(translate_table[t]);
2652 else
2653 return symbol_kind::S_YYUNDEF;
2654 }
2655
2656 } // namespace SEAMS
2657
2658 void SEAMS::Parser::error(const std::string &m) { aprepro.error(m); }