1 // A Bison parser, made by GNU Bison 3.3.2. 2 3 // Skeleton interface for Bison LALR(1) parsers in C++ 4 5 // Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. 6 7 // This program is free software: you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation, either version 3 of the License, or 10 // (at your option) any later version. 11 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 17 // You should have received a copy of the GNU General Public License 18 // along with this program. If not, see <http://www.gnu.org/licenses/>. 19 20 // As a special exception, you may create a larger work that contains 21 // part or all of the Bison parser skeleton and distribute that work 22 // under terms of your choice, so long as that work isn't itself a 23 // parser generator using the skeleton or a modified version thereof 24 // as a parser skeleton. Alternatively, if you modify or redistribute 25 // the parser skeleton itself, you may (at your option) remove this 26 // special exception, which will cause the skeleton and the resulting 27 // Bison output files to be licensed under the GNU General Public 28 // License without this special exception. 29 30 // This special exception was added by the Free Software Foundation in 31 // version 2.2 of Bison. 32 33 34 /** 35 ** \file Parser.hh 36 ** Define the Tokenizer::parser class. 37 */ 38 39 // C++ LALR(1) parser skeleton written by Akim Demaille. 40 41 // Undocumented macros, especially those whose name start with YY_, 42 // are private implementation details. Do not rely on them. 43 44 #ifndef YY_YY_PARSER_HH_INCLUDED 45 # define YY_YY_PARSER_HH_INCLUDED 46 // // "%code requires" blocks. 47 #line 30 "Parser.yy" // lalr1.cc:401 48 49 namespace macro { class Driver; } 50 #line 43 "Parser.yy" // lalr1.cc:401 51 52 #include "Directives.hh" 53 using namespace macro; 54 55 #line 56 "Parser.hh" // lalr1.cc:401 56 57 # include <cassert> 58 # include <cstdlib> // std::abort 59 # include <iostream> 60 # include <stdexcept> 61 # include <string> 62 # include <vector> 63 64 #if defined __cplusplus 65 # define YY_CPLUSPLUS __cplusplus 66 #else 67 # define YY_CPLUSPLUS 199711L 68 #endif 69 70 // Support move semantics when possible. 71 #if 201103L <= YY_CPLUSPLUS 72 # define YY_MOVE std::move 73 # define YY_MOVE_OR_COPY move 74 # define YY_MOVE_REF(Type) Type&& 75 # define YY_RVREF(Type) Type&& 76 # define YY_COPY(Type) Type 77 #else 78 # define YY_MOVE 79 # define YY_MOVE_OR_COPY copy 80 # define YY_MOVE_REF(Type) Type& 81 # define YY_RVREF(Type) const Type& 82 # define YY_COPY(Type) const Type& 83 #endif 84 85 // Support noexcept when possible. 86 #if 201103L <= YY_CPLUSPLUS 87 # define YY_NOEXCEPT noexcept 88 # define YY_NOTHROW 89 #else 90 # define YY_NOEXCEPT 91 # define YY_NOTHROW throw () 92 #endif 93 94 // Support constexpr when possible. 95 #if 201703 <= YY_CPLUSPLUS 96 # define YY_CONSTEXPR constexpr 97 #else 98 # define YY_CONSTEXPR 99 #endif 100 # include "location.hh" 101 #include <typeinfo> 102 #ifndef YYASSERT 103 # include <cassert> 104 # define YYASSERT assert 105 #endif 106 107 108 #ifndef YY_ATTRIBUTE 109 # if (defined __GNUC__ \ 110 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 111 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 112 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 113 # else 114 # define YY_ATTRIBUTE(Spec) /* empty */ 115 # endif 116 #endif 117 118 #ifndef YY_ATTRIBUTE_PURE 119 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 120 #endif 121 122 #ifndef YY_ATTRIBUTE_UNUSED 123 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 124 #endif 125 126 /* Suppress unused-variable warnings by "using" E. */ 127 #if ! defined lint || defined __GNUC__ 128 # define YYUSE(E) ((void) (E)) 129 #else 130 # define YYUSE(E) /* empty */ 131 #endif 132 133 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 134 /* Suppress an incorrect diagnostic about yylval being uninitialized. */ 135 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 136 _Pragma ("GCC diagnostic push") \ 137 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 138 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 139 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 140 _Pragma ("GCC diagnostic pop") 141 #else 142 # define YY_INITIAL_VALUE(Value) Value 143 #endif 144 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 145 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 146 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 147 #endif 148 #ifndef YY_INITIAL_VALUE 149 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 150 #endif 151 152 # ifndef YY_NULLPTR 153 # if defined __cplusplus 154 # if 201103L <= __cplusplus 155 # define YY_NULLPTR nullptr 156 # else 157 # define YY_NULLPTR 0 158 # endif 159 # else 160 # define YY_NULLPTR ((void*)0) 161 # endif 162 # endif 163 164 /* Debug traces. */ 165 #ifndef YYDEBUG 166 # define YYDEBUG 1 167 #endif 168 169 #line 25 "Parser.yy" // lalr1.cc:401 170 namespace Tokenizer { 171 #line 172 "Parser.hh" // lalr1.cc:401 172 173 174 175 /// A Bison parser. 176 class parser 177 { 178 public: 179 #ifndef YYSTYPE 180 /// A buffer to store and retrieve objects. 181 /// 182 /// Sort of a variant, but does not keep track of the nature 183 /// of the stored data, since that knowledge is available 184 /// via the current parser state. 185 class semantic_type 186 { 187 public: 188 /// Type of *this. 189 typedef semantic_type self_type; 190 191 /// Empty construction. semantic_type()192 semantic_type () YY_NOEXCEPT 193 : yybuffer_ () 194 , yytypeid_ (YY_NULLPTR) 195 {} 196 197 /// Construct and fill. 198 template <typename T> semantic_type(YY_RVREF (T)t)199 semantic_type (YY_RVREF (T) t) 200 : yytypeid_ (&typeid (T)) 201 { 202 YYASSERT (sizeof (T) <= size); 203 new (yyas_<T> ()) T (YY_MOVE (t)); 204 } 205 206 /// Destruction, allowed only if empty. ~semantic_type()207 ~semantic_type () YY_NOEXCEPT 208 { 209 YYASSERT (!yytypeid_); 210 } 211 212 # if 201103L <= YY_CPLUSPLUS 213 /// Instantiate a \a T in here from \a t. 214 template <typename T, typename... U> 215 T& 216 emplace (U&&... u) 217 { 218 YYASSERT (!yytypeid_); 219 YYASSERT (sizeof (T) <= size); 220 yytypeid_ = & typeid (T); 221 return *new (yyas_<T> ()) T (std::forward <U>(u)...); 222 } 223 # else 224 /// Instantiate an empty \a T in here. 225 template <typename T> 226 T& emplace()227 emplace () 228 { 229 YYASSERT (!yytypeid_); 230 YYASSERT (sizeof (T) <= size); 231 yytypeid_ = & typeid (T); 232 return *new (yyas_<T> ()) T (); 233 } 234 235 /// Instantiate a \a T in here from \a t. 236 template <typename T> 237 T& emplace(const T & t)238 emplace (const T& t) 239 { 240 YYASSERT (!yytypeid_); 241 YYASSERT (sizeof (T) <= size); 242 yytypeid_ = & typeid (T); 243 return *new (yyas_<T> ()) T (t); 244 } 245 # endif 246 247 /// Instantiate an empty \a T in here. 248 /// Obsolete, use emplace. 249 template <typename T> 250 T& build()251 build () 252 { 253 return emplace<T> (); 254 } 255 256 /// Instantiate a \a T in here from \a t. 257 /// Obsolete, use emplace. 258 template <typename T> 259 T& build(const T & t)260 build (const T& t) 261 { 262 return emplace<T> (t); 263 } 264 265 /// Accessor to a built \a T. 266 template <typename T> 267 T& as()268 as () YY_NOEXCEPT 269 { 270 YYASSERT (yytypeid_); 271 YYASSERT (*yytypeid_ == typeid (T)); 272 YYASSERT (sizeof (T) <= size); 273 return *yyas_<T> (); 274 } 275 276 /// Const accessor to a built \a T (for %printer). 277 template <typename T> 278 const T& as() const279 as () const YY_NOEXCEPT 280 { 281 YYASSERT (yytypeid_); 282 YYASSERT (*yytypeid_ == typeid (T)); 283 YYASSERT (sizeof (T) <= size); 284 return *yyas_<T> (); 285 } 286 287 /// Swap the content with \a that, of same type. 288 /// 289 /// Both variants must be built beforehand, because swapping the actual 290 /// data requires reading it (with as()), and this is not possible on 291 /// unconstructed variants: it would require some dynamic testing, which 292 /// should not be the variant's responsibility. 293 /// Swapping between built and (possibly) non-built is done with 294 /// self_type::move (). 295 template <typename T> 296 void swap(self_type & that)297 swap (self_type& that) YY_NOEXCEPT 298 { 299 YYASSERT (yytypeid_); 300 YYASSERT (*yytypeid_ == *that.yytypeid_); 301 std::swap (as<T> (), that.as<T> ()); 302 } 303 304 /// Move the content of \a that to this. 305 /// 306 /// Destroys \a that. 307 template <typename T> 308 void move(self_type & that)309 move (self_type& that) 310 { 311 # if 201103L <= YY_CPLUSPLUS 312 emplace<T> (std::move (that.as<T> ())); 313 # else 314 emplace<T> (); 315 swap<T> (that); 316 # endif 317 that.destroy<T> (); 318 } 319 320 # if 201103L <= YY_CPLUSPLUS 321 /// Move the content of \a that to this. 322 template <typename T> 323 void move(self_type && that)324 move (self_type&& that) 325 { 326 emplace<T> (std::move (that.as<T> ())); 327 that.destroy<T> (); 328 } 329 #endif 330 331 /// Copy the content of \a that to this. 332 template <typename T> 333 void copy(const self_type & that)334 copy (const self_type& that) 335 { 336 emplace<T> (that.as<T> ()); 337 } 338 339 /// Destroy the stored \a T. 340 template <typename T> 341 void destroy()342 destroy () 343 { 344 as<T> ().~T (); 345 yytypeid_ = YY_NULLPTR; 346 } 347 348 private: 349 /// Prohibit blind copies. 350 self_type& operator= (const self_type&); 351 semantic_type (const self_type&); 352 353 /// Accessor to raw memory as \a T. 354 template <typename T> 355 T* yyas_()356 yyas_ () YY_NOEXCEPT 357 { 358 void *yyp = yybuffer_.yyraw; 359 return static_cast<T*> (yyp); 360 } 361 362 /// Const accessor to raw memory as \a T. 363 template <typename T> 364 const T* yyas_() const365 yyas_ () const YY_NOEXCEPT 366 { 367 const void *yyp = yybuffer_.yyraw; 368 return static_cast<const T*> (yyp); 369 } 370 371 /// An auxiliary type to compute the largest semantic type. 372 union union_type 373 { 374 // statement 375 // directive 376 // directive_one_line 377 // directive_multiline 378 // for 379 // if 380 // ifdef 381 // ifndef 382 // text 383 // eval 384 char dummy1[sizeof (DirectivePtr)]; 385 386 // for_when 387 // primary_expr 388 // oper_expr 389 // colon_expr 390 // expr 391 char dummy2[sizeof (ExpressionPtr)]; 392 393 // function 394 char dummy3[sizeof (FunctionPtr)]; 395 396 // symbol 397 char dummy4[sizeof (VariablePtr)]; 398 399 // elseif 400 // else 401 char dummy5[sizeof (pair<ExpressionPtr, vector<DirectivePtr>>)]; 402 403 // NAME 404 // TEXT 405 // QUOTED_STRING 406 // NUMBER 407 // EOL 408 char dummy6[sizeof (string)]; 409 410 // function_args 411 // comma_expr 412 // tuple_comma_expr 413 char dummy7[sizeof (vector<ExpressionPtr>)]; 414 415 // if_list 416 // if_list1 417 char dummy8[sizeof (vector<pair<ExpressionPtr, vector<DirectivePtr>>>)]; 418 419 // name_list 420 char dummy9[sizeof (vector<string>)]; 421 }; 422 423 /// The size of the largest semantic type. 424 enum { size = sizeof (union_type) }; 425 426 /// A buffer to store semantic values. 427 union 428 { 429 /// Strongest alignment constraints. 430 long double yyalign_me; 431 /// A buffer large enough to store any of the semantic values. 432 char yyraw[size]; 433 } yybuffer_; 434 435 /// Whether the content is built: if defined, the name of the stored type. 436 const std::type_info *yytypeid_; 437 }; 438 439 #else 440 typedef YYSTYPE semantic_type; 441 #endif 442 /// Symbol locations. 443 typedef location location_type; 444 445 /// Syntax errors thrown from user actions. 446 struct syntax_error : std::runtime_error 447 { syntax_errorTokenizer::parser::syntax_error448 syntax_error (const location_type& l, const std::string& m) 449 : std::runtime_error (m) 450 , location (l) 451 {} 452 syntax_errorTokenizer::parser::syntax_error453 syntax_error (const syntax_error& s) 454 : std::runtime_error (s.what ()) 455 , location (s.location) 456 {} 457 458 ~syntax_error () YY_NOEXCEPT YY_NOTHROW; 459 460 location_type location; 461 }; 462 463 /// Tokens. 464 struct token 465 { 466 enum yytokentype 467 { 468 FOR = 258, 469 ENDFOR = 259, 470 IF = 260, 471 IFDEF = 261, 472 IFNDEF = 262, 473 ELSEIF = 263, 474 ELSE = 264, 475 ENDIF = 265, 476 TRUE = 266, 477 FALSE = 267, 478 INCLUDE = 268, 479 INCLUDEPATH = 269, 480 DEFINE = 270, 481 EQUAL = 271, 482 D_ECHO = 272, 483 ERROR = 273, 484 COMMA = 274, 485 LPAREN = 275, 486 RPAREN = 276, 487 LBRACKET = 277, 488 RBRACKET = 278, 489 WHEN = 279, 490 BEGIN_EVAL = 280, 491 END_EVAL = 281, 492 ECHOMACROVARS = 282, 493 SAVE = 283, 494 LINE = 284, 495 EXP = 285, 496 LOG = 286, 497 LN = 287, 498 LOG10 = 288, 499 SIN = 289, 500 COS = 290, 501 TAN = 291, 502 ASIN = 292, 503 ACOS = 293, 504 ATAN = 294, 505 SQRT = 295, 506 CBRT = 296, 507 SIGN = 297, 508 MAX = 298, 509 MIN = 299, 510 FLOOR = 300, 511 CEIL = 301, 512 TRUNC = 302, 513 SUM = 303, 514 MOD = 304, 515 ERF = 305, 516 ERFC = 306, 517 GAMMA = 307, 518 LGAMMA = 308, 519 ROUND = 309, 520 NORMPDF = 310, 521 NORMCDF = 311, 522 LENGTH = 312, 523 ISEMPTY = 313, 524 ISBOOLEAN = 314, 525 ISREAL = 315, 526 ISSTRING = 316, 527 ISTUPLE = 317, 528 ISARRAY = 318, 529 BOOL = 319, 530 REAL = 320, 531 STRING = 321, 532 TUPLE = 322, 533 ARRAY = 323, 534 DEFINED = 324, 535 OR = 325, 536 AND = 326, 537 EQUAL_EQUAL = 327, 538 NOT_EQUAL = 328, 539 LESS = 329, 540 GREATER = 330, 541 LESS_EQUAL = 331, 542 GREATER_EQUAL = 332, 543 IN = 333, 544 COLON = 334, 545 UNION = 335, 546 INTERSECTION = 336, 547 PLUS = 337, 548 MINUS = 338, 549 TIMES = 339, 550 DIVIDE = 340, 551 UNARY = 341, 552 NOT = 342, 553 CAST = 343, 554 POWER = 344, 555 NAME = 345, 556 TEXT = 346, 557 QUOTED_STRING = 347, 558 NUMBER = 348, 559 EOL = 349 560 }; 561 }; 562 563 /// (External) token type, as returned by yylex. 564 typedef token::yytokentype token_type; 565 566 /// Symbol type: an internal symbol number. 567 typedef int symbol_number_type; 568 569 /// The symbol type number to denote an empty symbol. 570 enum { empty_symbol = -2 }; 571 572 /// Internal symbol number for tokens (subsumed by symbol_number_type). 573 typedef unsigned char token_number_type; 574 575 /// A complete symbol. 576 /// 577 /// Expects its Base type to provide access to the symbol type 578 /// via type_get (). 579 /// 580 /// Provide access to semantic value and location. 581 template <typename Base> 582 struct basic_symbol : Base 583 { 584 /// Alias to Base. 585 typedef Base super_type; 586 587 /// Default constructor. basic_symbolTokenizer::parser::basic_symbol588 basic_symbol () 589 : value () 590 , location () 591 {} 592 593 #if 201103L <= YY_CPLUSPLUS 594 /// Move constructor. 595 basic_symbol (basic_symbol&& that); 596 #endif 597 598 /// Copy constructor. 599 basic_symbol (const basic_symbol& that); 600 601 /// Constructor for valueless symbols, and symbols from each type. 602 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol603 basic_symbol (typename Base::kind_type t, location_type&& l) 604 : Base (t) 605 , location (std::move (l)) 606 {} 607 #else basic_symbolTokenizer::parser::basic_symbol608 basic_symbol (typename Base::kind_type t, const location_type& l) 609 : Base (t) 610 , location (l) 611 {} 612 #endif 613 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol614 basic_symbol (typename Base::kind_type t, DirectivePtr&& v, location_type&& l) 615 : Base (t) 616 , value (std::move (v)) 617 , location (std::move (l)) 618 {} 619 #else basic_symbolTokenizer::parser::basic_symbol620 basic_symbol (typename Base::kind_type t, const DirectivePtr& v, const location_type& l) 621 : Base (t) 622 , value (v) 623 , location (l) 624 {} 625 #endif 626 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol627 basic_symbol (typename Base::kind_type t, ExpressionPtr&& v, location_type&& l) 628 : Base (t) 629 , value (std::move (v)) 630 , location (std::move (l)) 631 {} 632 #else basic_symbolTokenizer::parser::basic_symbol633 basic_symbol (typename Base::kind_type t, const ExpressionPtr& v, const location_type& l) 634 : Base (t) 635 , value (v) 636 , location (l) 637 {} 638 #endif 639 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol640 basic_symbol (typename Base::kind_type t, FunctionPtr&& v, location_type&& l) 641 : Base (t) 642 , value (std::move (v)) 643 , location (std::move (l)) 644 {} 645 #else basic_symbolTokenizer::parser::basic_symbol646 basic_symbol (typename Base::kind_type t, const FunctionPtr& v, const location_type& l) 647 : Base (t) 648 , value (v) 649 , location (l) 650 {} 651 #endif 652 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol653 basic_symbol (typename Base::kind_type t, VariablePtr&& v, location_type&& l) 654 : Base (t) 655 , value (std::move (v)) 656 , location (std::move (l)) 657 {} 658 #else basic_symbolTokenizer::parser::basic_symbol659 basic_symbol (typename Base::kind_type t, const VariablePtr& v, const location_type& l) 660 : Base (t) 661 , value (v) 662 , location (l) 663 {} 664 #endif 665 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol666 basic_symbol (typename Base::kind_type t, pair<ExpressionPtr, vector<DirectivePtr>>&& v, location_type&& l) 667 : Base (t) 668 , value (std::move (v)) 669 , location (std::move (l)) 670 {} 671 #else basic_symbolTokenizer::parser::basic_symbol672 basic_symbol (typename Base::kind_type t, const pair<ExpressionPtr, vector<DirectivePtr>>& v, const location_type& l) 673 : Base (t) 674 , value (v) 675 , location (l) 676 {} 677 #endif 678 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol679 basic_symbol (typename Base::kind_type t, string&& v, location_type&& l) 680 : Base (t) 681 , value (std::move (v)) 682 , location (std::move (l)) 683 {} 684 #else basic_symbolTokenizer::parser::basic_symbol685 basic_symbol (typename Base::kind_type t, const string& v, const location_type& l) 686 : Base (t) 687 , value (v) 688 , location (l) 689 {} 690 #endif 691 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol692 basic_symbol (typename Base::kind_type t, vector<ExpressionPtr>&& v, location_type&& l) 693 : Base (t) 694 , value (std::move (v)) 695 , location (std::move (l)) 696 {} 697 #else basic_symbolTokenizer::parser::basic_symbol698 basic_symbol (typename Base::kind_type t, const vector<ExpressionPtr>& v, const location_type& l) 699 : Base (t) 700 , value (v) 701 , location (l) 702 {} 703 #endif 704 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol705 basic_symbol (typename Base::kind_type t, vector<pair<ExpressionPtr, vector<DirectivePtr>>>&& v, location_type&& l) 706 : Base (t) 707 , value (std::move (v)) 708 , location (std::move (l)) 709 {} 710 #else basic_symbolTokenizer::parser::basic_symbol711 basic_symbol (typename Base::kind_type t, const vector<pair<ExpressionPtr, vector<DirectivePtr>>>& v, const location_type& l) 712 : Base (t) 713 , value (v) 714 , location (l) 715 {} 716 #endif 717 #if 201103L <= YY_CPLUSPLUS basic_symbolTokenizer::parser::basic_symbol718 basic_symbol (typename Base::kind_type t, vector<string>&& v, location_type&& l) 719 : Base (t) 720 , value (std::move (v)) 721 , location (std::move (l)) 722 {} 723 #else basic_symbolTokenizer::parser::basic_symbol724 basic_symbol (typename Base::kind_type t, const vector<string>& v, const location_type& l) 725 : Base (t) 726 , value (v) 727 , location (l) 728 {} 729 #endif 730 731 /// Destroy the symbol. ~basic_symbolTokenizer::parser::basic_symbol732 ~basic_symbol () 733 { 734 clear (); 735 } 736 737 /// Destroy contents, and record that is empty. clearTokenizer::parser::basic_symbol738 void clear () 739 { 740 // User destructor. 741 symbol_number_type yytype = this->type_get (); 742 basic_symbol<Base>& yysym = *this; 743 (void) yysym; 744 switch (yytype) 745 { 746 default: 747 break; 748 } 749 750 // Type destructor. 751 switch (yytype) 752 { 753 case 97: // statement 754 case 98: // directive 755 case 99: // directive_one_line 756 case 101: // directive_multiline 757 case 103: // for 758 case 105: // if 759 case 107: // ifdef 760 case 109: // ifndef 761 case 117: // text 762 case 118: // eval 763 value.template destroy< DirectivePtr > (); 764 break; 765 766 case 102: // for_when 767 case 124: // primary_expr 768 case 125: // oper_expr 769 case 126: // colon_expr 770 case 127: // expr 771 value.template destroy< ExpressionPtr > (); 772 break; 773 774 case 120: // function 775 value.template destroy< FunctionPtr > (); 776 break; 777 778 case 119: // symbol 779 value.template destroy< VariablePtr > (); 780 break; 781 782 case 114: // elseif 783 case 116: // else 784 value.template destroy< pair<ExpressionPtr, vector<DirectivePtr>> > (); 785 break; 786 787 case 90: // NAME 788 case 91: // TEXT 789 case 92: // QUOTED_STRING 790 case 93: // NUMBER 791 case 94: // EOL 792 value.template destroy< string > (); 793 break; 794 795 case 121: // function_args 796 case 122: // comma_expr 797 case 123: // tuple_comma_expr 798 value.template destroy< vector<ExpressionPtr> > (); 799 break; 800 801 case 111: // if_list 802 case 112: // if_list1 803 value.template destroy< vector<pair<ExpressionPtr, vector<DirectivePtr>>> > (); 804 break; 805 806 case 100: // name_list 807 value.template destroy< vector<string> > (); 808 break; 809 810 default: 811 break; 812 } 813 814 Base::clear (); 815 } 816 817 /// Whether empty. 818 bool empty () const YY_NOEXCEPT; 819 820 /// Destructive move, \a s is emptied into this. 821 void move (basic_symbol& s); 822 823 /// The semantic value. 824 semantic_type value; 825 826 /// The location. 827 location_type location; 828 829 private: 830 #if YY_CPLUSPLUS < 201103L 831 /// Assignment operator. 832 basic_symbol& operator= (const basic_symbol& that); 833 #endif 834 }; 835 836 /// Type access provider for token (enum) based symbols. 837 struct by_type 838 { 839 /// Default constructor. 840 by_type (); 841 842 #if 201103L <= YY_CPLUSPLUS 843 /// Move constructor. 844 by_type (by_type&& that); 845 #endif 846 847 /// Copy constructor. 848 by_type (const by_type& that); 849 850 /// The symbol type as needed by the constructor. 851 typedef token_type kind_type; 852 853 /// Constructor from (external) token numbers. 854 by_type (kind_type t); 855 856 /// Record that this symbol is empty. 857 void clear (); 858 859 /// Steal the symbol type from \a that. 860 void move (by_type& that); 861 862 /// The (internal) type number (corresponding to \a type). 863 /// \a empty when empty. 864 symbol_number_type type_get () const YY_NOEXCEPT; 865 866 /// The token. 867 token_type token () const YY_NOEXCEPT; 868 869 /// The symbol type. 870 /// \a empty_symbol when empty. 871 /// An int, not token_number_type, to be able to store empty_symbol. 872 int type; 873 }; 874 875 /// "External" symbols: returned by the scanner. 876 struct symbol_type : basic_symbol<by_type> 877 { 878 /// Superclass. 879 typedef basic_symbol<by_type> super_type; 880 881 /// Empty symbol. symbol_typeTokenizer::parser::symbol_type882 symbol_type () {} 883 884 /// Constructor for valueless symbols, and symbols from each type. 885 #if 201103L <= YY_CPLUSPLUS symbol_typeTokenizer::parser::symbol_type886 symbol_type (int tok, location_type l) 887 : super_type(token_type (tok), std::move (l)) 888 { 889 YYASSERT (tok == 0 || tok == token::FOR || tok == token::ENDFOR || tok == token::IF || tok == token::IFDEF || tok == token::IFNDEF || tok == token::ELSEIF || tok == token::ELSE || tok == token::ENDIF || tok == token::TRUE || tok == token::FALSE || tok == token::INCLUDE || tok == token::INCLUDEPATH || tok == token::DEFINE || tok == token::EQUAL || tok == token::D_ECHO || tok == token::ERROR || tok == token::COMMA || tok == token::LPAREN || tok == token::RPAREN || tok == token::LBRACKET || tok == token::RBRACKET || tok == token::WHEN || tok == token::BEGIN_EVAL || tok == token::END_EVAL || tok == token::ECHOMACROVARS || tok == token::SAVE || tok == token::LINE || tok == token::EXP || tok == token::LOG || tok == token::LN || tok == token::LOG10 || tok == token::SIN || tok == token::COS || tok == token::TAN || tok == token::ASIN || tok == token::ACOS || tok == token::ATAN || tok == token::SQRT || tok == token::CBRT || tok == token::SIGN || tok == token::MAX || tok == token::MIN || tok == token::FLOOR || tok == token::CEIL || tok == token::TRUNC || tok == token::SUM || tok == token::MOD || tok == token::ERF || tok == token::ERFC || tok == token::GAMMA || tok == token::LGAMMA || tok == token::ROUND || tok == token::NORMPDF || tok == token::NORMCDF || tok == token::LENGTH || tok == token::ISEMPTY || tok == token::ISBOOLEAN || tok == token::ISREAL || tok == token::ISSTRING || tok == token::ISTUPLE || tok == token::ISARRAY || tok == token::BOOL || tok == token::REAL || tok == token::STRING || tok == token::TUPLE || tok == token::ARRAY || tok == token::DEFINED || tok == token::OR || tok == token::AND || tok == token::EQUAL_EQUAL || tok == token::NOT_EQUAL || tok == token::LESS || tok == token::GREATER || tok == token::LESS_EQUAL || tok == token::GREATER_EQUAL || tok == token::IN || tok == token::COLON || tok == token::UNION || tok == token::INTERSECTION || tok == token::PLUS || tok == token::MINUS || tok == token::TIMES || tok == token::DIVIDE || tok == token::UNARY || tok == token::NOT || tok == token::CAST || tok == token::POWER); 890 } 891 #else symbol_typeTokenizer::parser::symbol_type892 symbol_type (int tok, const location_type& l) 893 : super_type(token_type (tok), l) 894 { 895 YYASSERT (tok == 0 || tok == token::FOR || tok == token::ENDFOR || tok == token::IF || tok == token::IFDEF || tok == token::IFNDEF || tok == token::ELSEIF || tok == token::ELSE || tok == token::ENDIF || tok == token::TRUE || tok == token::FALSE || tok == token::INCLUDE || tok == token::INCLUDEPATH || tok == token::DEFINE || tok == token::EQUAL || tok == token::D_ECHO || tok == token::ERROR || tok == token::COMMA || tok == token::LPAREN || tok == token::RPAREN || tok == token::LBRACKET || tok == token::RBRACKET || tok == token::WHEN || tok == token::BEGIN_EVAL || tok == token::END_EVAL || tok == token::ECHOMACROVARS || tok == token::SAVE || tok == token::LINE || tok == token::EXP || tok == token::LOG || tok == token::LN || tok == token::LOG10 || tok == token::SIN || tok == token::COS || tok == token::TAN || tok == token::ASIN || tok == token::ACOS || tok == token::ATAN || tok == token::SQRT || tok == token::CBRT || tok == token::SIGN || tok == token::MAX || tok == token::MIN || tok == token::FLOOR || tok == token::CEIL || tok == token::TRUNC || tok == token::SUM || tok == token::MOD || tok == token::ERF || tok == token::ERFC || tok == token::GAMMA || tok == token::LGAMMA || tok == token::ROUND || tok == token::NORMPDF || tok == token::NORMCDF || tok == token::LENGTH || tok == token::ISEMPTY || tok == token::ISBOOLEAN || tok == token::ISREAL || tok == token::ISSTRING || tok == token::ISTUPLE || tok == token::ISARRAY || tok == token::BOOL || tok == token::REAL || tok == token::STRING || tok == token::TUPLE || tok == token::ARRAY || tok == token::DEFINED || tok == token::OR || tok == token::AND || tok == token::EQUAL_EQUAL || tok == token::NOT_EQUAL || tok == token::LESS || tok == token::GREATER || tok == token::LESS_EQUAL || tok == token::GREATER_EQUAL || tok == token::IN || tok == token::COLON || tok == token::UNION || tok == token::INTERSECTION || tok == token::PLUS || tok == token::MINUS || tok == token::TIMES || tok == token::DIVIDE || tok == token::UNARY || tok == token::NOT || tok == token::CAST || tok == token::POWER); 896 } 897 #endif 898 #if 201103L <= YY_CPLUSPLUS symbol_typeTokenizer::parser::symbol_type899 symbol_type (int tok, string v, location_type l) 900 : super_type(token_type (tok), std::move (v), std::move (l)) 901 { 902 YYASSERT (tok == token::NAME || tok == token::TEXT || tok == token::QUOTED_STRING || tok == token::NUMBER || tok == token::EOL); 903 } 904 #else symbol_typeTokenizer::parser::symbol_type905 symbol_type (int tok, const string& v, const location_type& l) 906 : super_type(token_type (tok), v, l) 907 { 908 YYASSERT (tok == token::NAME || tok == token::TEXT || tok == token::QUOTED_STRING || tok == token::NUMBER || tok == token::EOL); 909 } 910 #endif 911 }; 912 913 /// Build a parser object. 914 parser (macro::Driver &driver_yyarg); 915 virtual ~parser (); 916 917 /// Parse. An alias for parse (). 918 /// \returns 0 iff parsing succeeded. 919 int operator() (); 920 921 /// Parse. 922 /// \returns 0 iff parsing succeeded. 923 virtual int parse (); 924 925 #if YYDEBUG 926 /// The current debugging stream. 927 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; 928 /// Set the current debugging stream. 929 void set_debug_stream (std::ostream &); 930 931 /// Type for debugging levels. 932 typedef int debug_level_type; 933 /// The current debugging level. 934 debug_level_type debug_level () const YY_ATTRIBUTE_PURE; 935 /// Set the current debugging level. 936 void set_debug_level (debug_level_type l); 937 #endif 938 939 /// Report a syntax error. 940 /// \param loc where the syntax error is found. 941 /// \param msg a description of the syntax error. 942 virtual void error (const location_type& loc, const std::string& msg); 943 944 /// Report a syntax error. 945 void error (const syntax_error& err); 946 947 // Implementation of make_symbol for each symbol type. 948 #if 201103L <= YY_CPLUSPLUS 949 static 950 symbol_type make_FOR(location_type l)951 make_FOR (location_type l) 952 { 953 return symbol_type (token::FOR, std::move (l)); 954 } 955 #else 956 static 957 symbol_type make_FOR(const location_type & l)958 make_FOR (const location_type& l) 959 { 960 return symbol_type (token::FOR, l); 961 } 962 #endif 963 #if 201103L <= YY_CPLUSPLUS 964 static 965 symbol_type make_ENDFOR(location_type l)966 make_ENDFOR (location_type l) 967 { 968 return symbol_type (token::ENDFOR, std::move (l)); 969 } 970 #else 971 static 972 symbol_type make_ENDFOR(const location_type & l)973 make_ENDFOR (const location_type& l) 974 { 975 return symbol_type (token::ENDFOR, l); 976 } 977 #endif 978 #if 201103L <= YY_CPLUSPLUS 979 static 980 symbol_type make_IF(location_type l)981 make_IF (location_type l) 982 { 983 return symbol_type (token::IF, std::move (l)); 984 } 985 #else 986 static 987 symbol_type make_IF(const location_type & l)988 make_IF (const location_type& l) 989 { 990 return symbol_type (token::IF, l); 991 } 992 #endif 993 #if 201103L <= YY_CPLUSPLUS 994 static 995 symbol_type make_IFDEF(location_type l)996 make_IFDEF (location_type l) 997 { 998 return symbol_type (token::IFDEF, std::move (l)); 999 } 1000 #else 1001 static 1002 symbol_type make_IFDEF(const location_type & l)1003 make_IFDEF (const location_type& l) 1004 { 1005 return symbol_type (token::IFDEF, l); 1006 } 1007 #endif 1008 #if 201103L <= YY_CPLUSPLUS 1009 static 1010 symbol_type make_IFNDEF(location_type l)1011 make_IFNDEF (location_type l) 1012 { 1013 return symbol_type (token::IFNDEF, std::move (l)); 1014 } 1015 #else 1016 static 1017 symbol_type make_IFNDEF(const location_type & l)1018 make_IFNDEF (const location_type& l) 1019 { 1020 return symbol_type (token::IFNDEF, l); 1021 } 1022 #endif 1023 #if 201103L <= YY_CPLUSPLUS 1024 static 1025 symbol_type make_ELSEIF(location_type l)1026 make_ELSEIF (location_type l) 1027 { 1028 return symbol_type (token::ELSEIF, std::move (l)); 1029 } 1030 #else 1031 static 1032 symbol_type make_ELSEIF(const location_type & l)1033 make_ELSEIF (const location_type& l) 1034 { 1035 return symbol_type (token::ELSEIF, l); 1036 } 1037 #endif 1038 #if 201103L <= YY_CPLUSPLUS 1039 static 1040 symbol_type make_ELSE(location_type l)1041 make_ELSE (location_type l) 1042 { 1043 return symbol_type (token::ELSE, std::move (l)); 1044 } 1045 #else 1046 static 1047 symbol_type make_ELSE(const location_type & l)1048 make_ELSE (const location_type& l) 1049 { 1050 return symbol_type (token::ELSE, l); 1051 } 1052 #endif 1053 #if 201103L <= YY_CPLUSPLUS 1054 static 1055 symbol_type make_ENDIF(location_type l)1056 make_ENDIF (location_type l) 1057 { 1058 return symbol_type (token::ENDIF, std::move (l)); 1059 } 1060 #else 1061 static 1062 symbol_type make_ENDIF(const location_type & l)1063 make_ENDIF (const location_type& l) 1064 { 1065 return symbol_type (token::ENDIF, l); 1066 } 1067 #endif 1068 #if 201103L <= YY_CPLUSPLUS 1069 static 1070 symbol_type make_TRUE(location_type l)1071 make_TRUE (location_type l) 1072 { 1073 return symbol_type (token::TRUE, std::move (l)); 1074 } 1075 #else 1076 static 1077 symbol_type make_TRUE(const location_type & l)1078 make_TRUE (const location_type& l) 1079 { 1080 return symbol_type (token::TRUE, l); 1081 } 1082 #endif 1083 #if 201103L <= YY_CPLUSPLUS 1084 static 1085 symbol_type make_FALSE(location_type l)1086 make_FALSE (location_type l) 1087 { 1088 return symbol_type (token::FALSE, std::move (l)); 1089 } 1090 #else 1091 static 1092 symbol_type make_FALSE(const location_type & l)1093 make_FALSE (const location_type& l) 1094 { 1095 return symbol_type (token::FALSE, l); 1096 } 1097 #endif 1098 #if 201103L <= YY_CPLUSPLUS 1099 static 1100 symbol_type make_INCLUDE(location_type l)1101 make_INCLUDE (location_type l) 1102 { 1103 return symbol_type (token::INCLUDE, std::move (l)); 1104 } 1105 #else 1106 static 1107 symbol_type make_INCLUDE(const location_type & l)1108 make_INCLUDE (const location_type& l) 1109 { 1110 return symbol_type (token::INCLUDE, l); 1111 } 1112 #endif 1113 #if 201103L <= YY_CPLUSPLUS 1114 static 1115 symbol_type make_INCLUDEPATH(location_type l)1116 make_INCLUDEPATH (location_type l) 1117 { 1118 return symbol_type (token::INCLUDEPATH, std::move (l)); 1119 } 1120 #else 1121 static 1122 symbol_type make_INCLUDEPATH(const location_type & l)1123 make_INCLUDEPATH (const location_type& l) 1124 { 1125 return symbol_type (token::INCLUDEPATH, l); 1126 } 1127 #endif 1128 #if 201103L <= YY_CPLUSPLUS 1129 static 1130 symbol_type make_DEFINE(location_type l)1131 make_DEFINE (location_type l) 1132 { 1133 return symbol_type (token::DEFINE, std::move (l)); 1134 } 1135 #else 1136 static 1137 symbol_type make_DEFINE(const location_type & l)1138 make_DEFINE (const location_type& l) 1139 { 1140 return symbol_type (token::DEFINE, l); 1141 } 1142 #endif 1143 #if 201103L <= YY_CPLUSPLUS 1144 static 1145 symbol_type make_EQUAL(location_type l)1146 make_EQUAL (location_type l) 1147 { 1148 return symbol_type (token::EQUAL, std::move (l)); 1149 } 1150 #else 1151 static 1152 symbol_type make_EQUAL(const location_type & l)1153 make_EQUAL (const location_type& l) 1154 { 1155 return symbol_type (token::EQUAL, l); 1156 } 1157 #endif 1158 #if 201103L <= YY_CPLUSPLUS 1159 static 1160 symbol_type make_D_ECHO(location_type l)1161 make_D_ECHO (location_type l) 1162 { 1163 return symbol_type (token::D_ECHO, std::move (l)); 1164 } 1165 #else 1166 static 1167 symbol_type make_D_ECHO(const location_type & l)1168 make_D_ECHO (const location_type& l) 1169 { 1170 return symbol_type (token::D_ECHO, l); 1171 } 1172 #endif 1173 #if 201103L <= YY_CPLUSPLUS 1174 static 1175 symbol_type make_ERROR(location_type l)1176 make_ERROR (location_type l) 1177 { 1178 return symbol_type (token::ERROR, std::move (l)); 1179 } 1180 #else 1181 static 1182 symbol_type make_ERROR(const location_type & l)1183 make_ERROR (const location_type& l) 1184 { 1185 return symbol_type (token::ERROR, l); 1186 } 1187 #endif 1188 #if 201103L <= YY_CPLUSPLUS 1189 static 1190 symbol_type make_COMMA(location_type l)1191 make_COMMA (location_type l) 1192 { 1193 return symbol_type (token::COMMA, std::move (l)); 1194 } 1195 #else 1196 static 1197 symbol_type make_COMMA(const location_type & l)1198 make_COMMA (const location_type& l) 1199 { 1200 return symbol_type (token::COMMA, l); 1201 } 1202 #endif 1203 #if 201103L <= YY_CPLUSPLUS 1204 static 1205 symbol_type make_LPAREN(location_type l)1206 make_LPAREN (location_type l) 1207 { 1208 return symbol_type (token::LPAREN, std::move (l)); 1209 } 1210 #else 1211 static 1212 symbol_type make_LPAREN(const location_type & l)1213 make_LPAREN (const location_type& l) 1214 { 1215 return symbol_type (token::LPAREN, l); 1216 } 1217 #endif 1218 #if 201103L <= YY_CPLUSPLUS 1219 static 1220 symbol_type make_RPAREN(location_type l)1221 make_RPAREN (location_type l) 1222 { 1223 return symbol_type (token::RPAREN, std::move (l)); 1224 } 1225 #else 1226 static 1227 symbol_type make_RPAREN(const location_type & l)1228 make_RPAREN (const location_type& l) 1229 { 1230 return symbol_type (token::RPAREN, l); 1231 } 1232 #endif 1233 #if 201103L <= YY_CPLUSPLUS 1234 static 1235 symbol_type make_LBRACKET(location_type l)1236 make_LBRACKET (location_type l) 1237 { 1238 return symbol_type (token::LBRACKET, std::move (l)); 1239 } 1240 #else 1241 static 1242 symbol_type make_LBRACKET(const location_type & l)1243 make_LBRACKET (const location_type& l) 1244 { 1245 return symbol_type (token::LBRACKET, l); 1246 } 1247 #endif 1248 #if 201103L <= YY_CPLUSPLUS 1249 static 1250 symbol_type make_RBRACKET(location_type l)1251 make_RBRACKET (location_type l) 1252 { 1253 return symbol_type (token::RBRACKET, std::move (l)); 1254 } 1255 #else 1256 static 1257 symbol_type make_RBRACKET(const location_type & l)1258 make_RBRACKET (const location_type& l) 1259 { 1260 return symbol_type (token::RBRACKET, l); 1261 } 1262 #endif 1263 #if 201103L <= YY_CPLUSPLUS 1264 static 1265 symbol_type make_WHEN(location_type l)1266 make_WHEN (location_type l) 1267 { 1268 return symbol_type (token::WHEN, std::move (l)); 1269 } 1270 #else 1271 static 1272 symbol_type make_WHEN(const location_type & l)1273 make_WHEN (const location_type& l) 1274 { 1275 return symbol_type (token::WHEN, l); 1276 } 1277 #endif 1278 #if 201103L <= YY_CPLUSPLUS 1279 static 1280 symbol_type make_BEGIN_EVAL(location_type l)1281 make_BEGIN_EVAL (location_type l) 1282 { 1283 return symbol_type (token::BEGIN_EVAL, std::move (l)); 1284 } 1285 #else 1286 static 1287 symbol_type make_BEGIN_EVAL(const location_type & l)1288 make_BEGIN_EVAL (const location_type& l) 1289 { 1290 return symbol_type (token::BEGIN_EVAL, l); 1291 } 1292 #endif 1293 #if 201103L <= YY_CPLUSPLUS 1294 static 1295 symbol_type make_END_EVAL(location_type l)1296 make_END_EVAL (location_type l) 1297 { 1298 return symbol_type (token::END_EVAL, std::move (l)); 1299 } 1300 #else 1301 static 1302 symbol_type make_END_EVAL(const location_type & l)1303 make_END_EVAL (const location_type& l) 1304 { 1305 return symbol_type (token::END_EVAL, l); 1306 } 1307 #endif 1308 #if 201103L <= YY_CPLUSPLUS 1309 static 1310 symbol_type make_ECHOMACROVARS(location_type l)1311 make_ECHOMACROVARS (location_type l) 1312 { 1313 return symbol_type (token::ECHOMACROVARS, std::move (l)); 1314 } 1315 #else 1316 static 1317 symbol_type make_ECHOMACROVARS(const location_type & l)1318 make_ECHOMACROVARS (const location_type& l) 1319 { 1320 return symbol_type (token::ECHOMACROVARS, l); 1321 } 1322 #endif 1323 #if 201103L <= YY_CPLUSPLUS 1324 static 1325 symbol_type make_SAVE(location_type l)1326 make_SAVE (location_type l) 1327 { 1328 return symbol_type (token::SAVE, std::move (l)); 1329 } 1330 #else 1331 static 1332 symbol_type make_SAVE(const location_type & l)1333 make_SAVE (const location_type& l) 1334 { 1335 return symbol_type (token::SAVE, l); 1336 } 1337 #endif 1338 #if 201103L <= YY_CPLUSPLUS 1339 static 1340 symbol_type make_LINE(location_type l)1341 make_LINE (location_type l) 1342 { 1343 return symbol_type (token::LINE, std::move (l)); 1344 } 1345 #else 1346 static 1347 symbol_type make_LINE(const location_type & l)1348 make_LINE (const location_type& l) 1349 { 1350 return symbol_type (token::LINE, l); 1351 } 1352 #endif 1353 #if 201103L <= YY_CPLUSPLUS 1354 static 1355 symbol_type make_EXP(location_type l)1356 make_EXP (location_type l) 1357 { 1358 return symbol_type (token::EXP, std::move (l)); 1359 } 1360 #else 1361 static 1362 symbol_type make_EXP(const location_type & l)1363 make_EXP (const location_type& l) 1364 { 1365 return symbol_type (token::EXP, l); 1366 } 1367 #endif 1368 #if 201103L <= YY_CPLUSPLUS 1369 static 1370 symbol_type make_LOG(location_type l)1371 make_LOG (location_type l) 1372 { 1373 return symbol_type (token::LOG, std::move (l)); 1374 } 1375 #else 1376 static 1377 symbol_type make_LOG(const location_type & l)1378 make_LOG (const location_type& l) 1379 { 1380 return symbol_type (token::LOG, l); 1381 } 1382 #endif 1383 #if 201103L <= YY_CPLUSPLUS 1384 static 1385 symbol_type make_LN(location_type l)1386 make_LN (location_type l) 1387 { 1388 return symbol_type (token::LN, std::move (l)); 1389 } 1390 #else 1391 static 1392 symbol_type make_LN(const location_type & l)1393 make_LN (const location_type& l) 1394 { 1395 return symbol_type (token::LN, l); 1396 } 1397 #endif 1398 #if 201103L <= YY_CPLUSPLUS 1399 static 1400 symbol_type make_LOG10(location_type l)1401 make_LOG10 (location_type l) 1402 { 1403 return symbol_type (token::LOG10, std::move (l)); 1404 } 1405 #else 1406 static 1407 symbol_type make_LOG10(const location_type & l)1408 make_LOG10 (const location_type& l) 1409 { 1410 return symbol_type (token::LOG10, l); 1411 } 1412 #endif 1413 #if 201103L <= YY_CPLUSPLUS 1414 static 1415 symbol_type make_SIN(location_type l)1416 make_SIN (location_type l) 1417 { 1418 return symbol_type (token::SIN, std::move (l)); 1419 } 1420 #else 1421 static 1422 symbol_type make_SIN(const location_type & l)1423 make_SIN (const location_type& l) 1424 { 1425 return symbol_type (token::SIN, l); 1426 } 1427 #endif 1428 #if 201103L <= YY_CPLUSPLUS 1429 static 1430 symbol_type make_COS(location_type l)1431 make_COS (location_type l) 1432 { 1433 return symbol_type (token::COS, std::move (l)); 1434 } 1435 #else 1436 static 1437 symbol_type make_COS(const location_type & l)1438 make_COS (const location_type& l) 1439 { 1440 return symbol_type (token::COS, l); 1441 } 1442 #endif 1443 #if 201103L <= YY_CPLUSPLUS 1444 static 1445 symbol_type make_TAN(location_type l)1446 make_TAN (location_type l) 1447 { 1448 return symbol_type (token::TAN, std::move (l)); 1449 } 1450 #else 1451 static 1452 symbol_type make_TAN(const location_type & l)1453 make_TAN (const location_type& l) 1454 { 1455 return symbol_type (token::TAN, l); 1456 } 1457 #endif 1458 #if 201103L <= YY_CPLUSPLUS 1459 static 1460 symbol_type make_ASIN(location_type l)1461 make_ASIN (location_type l) 1462 { 1463 return symbol_type (token::ASIN, std::move (l)); 1464 } 1465 #else 1466 static 1467 symbol_type make_ASIN(const location_type & l)1468 make_ASIN (const location_type& l) 1469 { 1470 return symbol_type (token::ASIN, l); 1471 } 1472 #endif 1473 #if 201103L <= YY_CPLUSPLUS 1474 static 1475 symbol_type make_ACOS(location_type l)1476 make_ACOS (location_type l) 1477 { 1478 return symbol_type (token::ACOS, std::move (l)); 1479 } 1480 #else 1481 static 1482 symbol_type make_ACOS(const location_type & l)1483 make_ACOS (const location_type& l) 1484 { 1485 return symbol_type (token::ACOS, l); 1486 } 1487 #endif 1488 #if 201103L <= YY_CPLUSPLUS 1489 static 1490 symbol_type make_ATAN(location_type l)1491 make_ATAN (location_type l) 1492 { 1493 return symbol_type (token::ATAN, std::move (l)); 1494 } 1495 #else 1496 static 1497 symbol_type make_ATAN(const location_type & l)1498 make_ATAN (const location_type& l) 1499 { 1500 return symbol_type (token::ATAN, l); 1501 } 1502 #endif 1503 #if 201103L <= YY_CPLUSPLUS 1504 static 1505 symbol_type make_SQRT(location_type l)1506 make_SQRT (location_type l) 1507 { 1508 return symbol_type (token::SQRT, std::move (l)); 1509 } 1510 #else 1511 static 1512 symbol_type make_SQRT(const location_type & l)1513 make_SQRT (const location_type& l) 1514 { 1515 return symbol_type (token::SQRT, l); 1516 } 1517 #endif 1518 #if 201103L <= YY_CPLUSPLUS 1519 static 1520 symbol_type make_CBRT(location_type l)1521 make_CBRT (location_type l) 1522 { 1523 return symbol_type (token::CBRT, std::move (l)); 1524 } 1525 #else 1526 static 1527 symbol_type make_CBRT(const location_type & l)1528 make_CBRT (const location_type& l) 1529 { 1530 return symbol_type (token::CBRT, l); 1531 } 1532 #endif 1533 #if 201103L <= YY_CPLUSPLUS 1534 static 1535 symbol_type make_SIGN(location_type l)1536 make_SIGN (location_type l) 1537 { 1538 return symbol_type (token::SIGN, std::move (l)); 1539 } 1540 #else 1541 static 1542 symbol_type make_SIGN(const location_type & l)1543 make_SIGN (const location_type& l) 1544 { 1545 return symbol_type (token::SIGN, l); 1546 } 1547 #endif 1548 #if 201103L <= YY_CPLUSPLUS 1549 static 1550 symbol_type make_MAX(location_type l)1551 make_MAX (location_type l) 1552 { 1553 return symbol_type (token::MAX, std::move (l)); 1554 } 1555 #else 1556 static 1557 symbol_type make_MAX(const location_type & l)1558 make_MAX (const location_type& l) 1559 { 1560 return symbol_type (token::MAX, l); 1561 } 1562 #endif 1563 #if 201103L <= YY_CPLUSPLUS 1564 static 1565 symbol_type make_MIN(location_type l)1566 make_MIN (location_type l) 1567 { 1568 return symbol_type (token::MIN, std::move (l)); 1569 } 1570 #else 1571 static 1572 symbol_type make_MIN(const location_type & l)1573 make_MIN (const location_type& l) 1574 { 1575 return symbol_type (token::MIN, l); 1576 } 1577 #endif 1578 #if 201103L <= YY_CPLUSPLUS 1579 static 1580 symbol_type make_FLOOR(location_type l)1581 make_FLOOR (location_type l) 1582 { 1583 return symbol_type (token::FLOOR, std::move (l)); 1584 } 1585 #else 1586 static 1587 symbol_type make_FLOOR(const location_type & l)1588 make_FLOOR (const location_type& l) 1589 { 1590 return symbol_type (token::FLOOR, l); 1591 } 1592 #endif 1593 #if 201103L <= YY_CPLUSPLUS 1594 static 1595 symbol_type make_CEIL(location_type l)1596 make_CEIL (location_type l) 1597 { 1598 return symbol_type (token::CEIL, std::move (l)); 1599 } 1600 #else 1601 static 1602 symbol_type make_CEIL(const location_type & l)1603 make_CEIL (const location_type& l) 1604 { 1605 return symbol_type (token::CEIL, l); 1606 } 1607 #endif 1608 #if 201103L <= YY_CPLUSPLUS 1609 static 1610 symbol_type make_TRUNC(location_type l)1611 make_TRUNC (location_type l) 1612 { 1613 return symbol_type (token::TRUNC, std::move (l)); 1614 } 1615 #else 1616 static 1617 symbol_type make_TRUNC(const location_type & l)1618 make_TRUNC (const location_type& l) 1619 { 1620 return symbol_type (token::TRUNC, l); 1621 } 1622 #endif 1623 #if 201103L <= YY_CPLUSPLUS 1624 static 1625 symbol_type make_SUM(location_type l)1626 make_SUM (location_type l) 1627 { 1628 return symbol_type (token::SUM, std::move (l)); 1629 } 1630 #else 1631 static 1632 symbol_type make_SUM(const location_type & l)1633 make_SUM (const location_type& l) 1634 { 1635 return symbol_type (token::SUM, l); 1636 } 1637 #endif 1638 #if 201103L <= YY_CPLUSPLUS 1639 static 1640 symbol_type make_MOD(location_type l)1641 make_MOD (location_type l) 1642 { 1643 return symbol_type (token::MOD, std::move (l)); 1644 } 1645 #else 1646 static 1647 symbol_type make_MOD(const location_type & l)1648 make_MOD (const location_type& l) 1649 { 1650 return symbol_type (token::MOD, l); 1651 } 1652 #endif 1653 #if 201103L <= YY_CPLUSPLUS 1654 static 1655 symbol_type make_ERF(location_type l)1656 make_ERF (location_type l) 1657 { 1658 return symbol_type (token::ERF, std::move (l)); 1659 } 1660 #else 1661 static 1662 symbol_type make_ERF(const location_type & l)1663 make_ERF (const location_type& l) 1664 { 1665 return symbol_type (token::ERF, l); 1666 } 1667 #endif 1668 #if 201103L <= YY_CPLUSPLUS 1669 static 1670 symbol_type make_ERFC(location_type l)1671 make_ERFC (location_type l) 1672 { 1673 return symbol_type (token::ERFC, std::move (l)); 1674 } 1675 #else 1676 static 1677 symbol_type make_ERFC(const location_type & l)1678 make_ERFC (const location_type& l) 1679 { 1680 return symbol_type (token::ERFC, l); 1681 } 1682 #endif 1683 #if 201103L <= YY_CPLUSPLUS 1684 static 1685 symbol_type make_GAMMA(location_type l)1686 make_GAMMA (location_type l) 1687 { 1688 return symbol_type (token::GAMMA, std::move (l)); 1689 } 1690 #else 1691 static 1692 symbol_type make_GAMMA(const location_type & l)1693 make_GAMMA (const location_type& l) 1694 { 1695 return symbol_type (token::GAMMA, l); 1696 } 1697 #endif 1698 #if 201103L <= YY_CPLUSPLUS 1699 static 1700 symbol_type make_LGAMMA(location_type l)1701 make_LGAMMA (location_type l) 1702 { 1703 return symbol_type (token::LGAMMA, std::move (l)); 1704 } 1705 #else 1706 static 1707 symbol_type make_LGAMMA(const location_type & l)1708 make_LGAMMA (const location_type& l) 1709 { 1710 return symbol_type (token::LGAMMA, l); 1711 } 1712 #endif 1713 #if 201103L <= YY_CPLUSPLUS 1714 static 1715 symbol_type make_ROUND(location_type l)1716 make_ROUND (location_type l) 1717 { 1718 return symbol_type (token::ROUND, std::move (l)); 1719 } 1720 #else 1721 static 1722 symbol_type make_ROUND(const location_type & l)1723 make_ROUND (const location_type& l) 1724 { 1725 return symbol_type (token::ROUND, l); 1726 } 1727 #endif 1728 #if 201103L <= YY_CPLUSPLUS 1729 static 1730 symbol_type make_NORMPDF(location_type l)1731 make_NORMPDF (location_type l) 1732 { 1733 return symbol_type (token::NORMPDF, std::move (l)); 1734 } 1735 #else 1736 static 1737 symbol_type make_NORMPDF(const location_type & l)1738 make_NORMPDF (const location_type& l) 1739 { 1740 return symbol_type (token::NORMPDF, l); 1741 } 1742 #endif 1743 #if 201103L <= YY_CPLUSPLUS 1744 static 1745 symbol_type make_NORMCDF(location_type l)1746 make_NORMCDF (location_type l) 1747 { 1748 return symbol_type (token::NORMCDF, std::move (l)); 1749 } 1750 #else 1751 static 1752 symbol_type make_NORMCDF(const location_type & l)1753 make_NORMCDF (const location_type& l) 1754 { 1755 return symbol_type (token::NORMCDF, l); 1756 } 1757 #endif 1758 #if 201103L <= YY_CPLUSPLUS 1759 static 1760 symbol_type make_LENGTH(location_type l)1761 make_LENGTH (location_type l) 1762 { 1763 return symbol_type (token::LENGTH, std::move (l)); 1764 } 1765 #else 1766 static 1767 symbol_type make_LENGTH(const location_type & l)1768 make_LENGTH (const location_type& l) 1769 { 1770 return symbol_type (token::LENGTH, l); 1771 } 1772 #endif 1773 #if 201103L <= YY_CPLUSPLUS 1774 static 1775 symbol_type make_ISEMPTY(location_type l)1776 make_ISEMPTY (location_type l) 1777 { 1778 return symbol_type (token::ISEMPTY, std::move (l)); 1779 } 1780 #else 1781 static 1782 symbol_type make_ISEMPTY(const location_type & l)1783 make_ISEMPTY (const location_type& l) 1784 { 1785 return symbol_type (token::ISEMPTY, l); 1786 } 1787 #endif 1788 #if 201103L <= YY_CPLUSPLUS 1789 static 1790 symbol_type make_ISBOOLEAN(location_type l)1791 make_ISBOOLEAN (location_type l) 1792 { 1793 return symbol_type (token::ISBOOLEAN, std::move (l)); 1794 } 1795 #else 1796 static 1797 symbol_type make_ISBOOLEAN(const location_type & l)1798 make_ISBOOLEAN (const location_type& l) 1799 { 1800 return symbol_type (token::ISBOOLEAN, l); 1801 } 1802 #endif 1803 #if 201103L <= YY_CPLUSPLUS 1804 static 1805 symbol_type make_ISREAL(location_type l)1806 make_ISREAL (location_type l) 1807 { 1808 return symbol_type (token::ISREAL, std::move (l)); 1809 } 1810 #else 1811 static 1812 symbol_type make_ISREAL(const location_type & l)1813 make_ISREAL (const location_type& l) 1814 { 1815 return symbol_type (token::ISREAL, l); 1816 } 1817 #endif 1818 #if 201103L <= YY_CPLUSPLUS 1819 static 1820 symbol_type make_ISSTRING(location_type l)1821 make_ISSTRING (location_type l) 1822 { 1823 return symbol_type (token::ISSTRING, std::move (l)); 1824 } 1825 #else 1826 static 1827 symbol_type make_ISSTRING(const location_type & l)1828 make_ISSTRING (const location_type& l) 1829 { 1830 return symbol_type (token::ISSTRING, l); 1831 } 1832 #endif 1833 #if 201103L <= YY_CPLUSPLUS 1834 static 1835 symbol_type make_ISTUPLE(location_type l)1836 make_ISTUPLE (location_type l) 1837 { 1838 return symbol_type (token::ISTUPLE, std::move (l)); 1839 } 1840 #else 1841 static 1842 symbol_type make_ISTUPLE(const location_type & l)1843 make_ISTUPLE (const location_type& l) 1844 { 1845 return symbol_type (token::ISTUPLE, l); 1846 } 1847 #endif 1848 #if 201103L <= YY_CPLUSPLUS 1849 static 1850 symbol_type make_ISARRAY(location_type l)1851 make_ISARRAY (location_type l) 1852 { 1853 return symbol_type (token::ISARRAY, std::move (l)); 1854 } 1855 #else 1856 static 1857 symbol_type make_ISARRAY(const location_type & l)1858 make_ISARRAY (const location_type& l) 1859 { 1860 return symbol_type (token::ISARRAY, l); 1861 } 1862 #endif 1863 #if 201103L <= YY_CPLUSPLUS 1864 static 1865 symbol_type make_BOOL(location_type l)1866 make_BOOL (location_type l) 1867 { 1868 return symbol_type (token::BOOL, std::move (l)); 1869 } 1870 #else 1871 static 1872 symbol_type make_BOOL(const location_type & l)1873 make_BOOL (const location_type& l) 1874 { 1875 return symbol_type (token::BOOL, l); 1876 } 1877 #endif 1878 #if 201103L <= YY_CPLUSPLUS 1879 static 1880 symbol_type make_REAL(location_type l)1881 make_REAL (location_type l) 1882 { 1883 return symbol_type (token::REAL, std::move (l)); 1884 } 1885 #else 1886 static 1887 symbol_type make_REAL(const location_type & l)1888 make_REAL (const location_type& l) 1889 { 1890 return symbol_type (token::REAL, l); 1891 } 1892 #endif 1893 #if 201103L <= YY_CPLUSPLUS 1894 static 1895 symbol_type make_STRING(location_type l)1896 make_STRING (location_type l) 1897 { 1898 return symbol_type (token::STRING, std::move (l)); 1899 } 1900 #else 1901 static 1902 symbol_type make_STRING(const location_type & l)1903 make_STRING (const location_type& l) 1904 { 1905 return symbol_type (token::STRING, l); 1906 } 1907 #endif 1908 #if 201103L <= YY_CPLUSPLUS 1909 static 1910 symbol_type make_TUPLE(location_type l)1911 make_TUPLE (location_type l) 1912 { 1913 return symbol_type (token::TUPLE, std::move (l)); 1914 } 1915 #else 1916 static 1917 symbol_type make_TUPLE(const location_type & l)1918 make_TUPLE (const location_type& l) 1919 { 1920 return symbol_type (token::TUPLE, l); 1921 } 1922 #endif 1923 #if 201103L <= YY_CPLUSPLUS 1924 static 1925 symbol_type make_ARRAY(location_type l)1926 make_ARRAY (location_type l) 1927 { 1928 return symbol_type (token::ARRAY, std::move (l)); 1929 } 1930 #else 1931 static 1932 symbol_type make_ARRAY(const location_type & l)1933 make_ARRAY (const location_type& l) 1934 { 1935 return symbol_type (token::ARRAY, l); 1936 } 1937 #endif 1938 #if 201103L <= YY_CPLUSPLUS 1939 static 1940 symbol_type make_DEFINED(location_type l)1941 make_DEFINED (location_type l) 1942 { 1943 return symbol_type (token::DEFINED, std::move (l)); 1944 } 1945 #else 1946 static 1947 symbol_type make_DEFINED(const location_type & l)1948 make_DEFINED (const location_type& l) 1949 { 1950 return symbol_type (token::DEFINED, l); 1951 } 1952 #endif 1953 #if 201103L <= YY_CPLUSPLUS 1954 static 1955 symbol_type make_OR(location_type l)1956 make_OR (location_type l) 1957 { 1958 return symbol_type (token::OR, std::move (l)); 1959 } 1960 #else 1961 static 1962 symbol_type make_OR(const location_type & l)1963 make_OR (const location_type& l) 1964 { 1965 return symbol_type (token::OR, l); 1966 } 1967 #endif 1968 #if 201103L <= YY_CPLUSPLUS 1969 static 1970 symbol_type make_AND(location_type l)1971 make_AND (location_type l) 1972 { 1973 return symbol_type (token::AND, std::move (l)); 1974 } 1975 #else 1976 static 1977 symbol_type make_AND(const location_type & l)1978 make_AND (const location_type& l) 1979 { 1980 return symbol_type (token::AND, l); 1981 } 1982 #endif 1983 #if 201103L <= YY_CPLUSPLUS 1984 static 1985 symbol_type make_EQUAL_EQUAL(location_type l)1986 make_EQUAL_EQUAL (location_type l) 1987 { 1988 return symbol_type (token::EQUAL_EQUAL, std::move (l)); 1989 } 1990 #else 1991 static 1992 symbol_type make_EQUAL_EQUAL(const location_type & l)1993 make_EQUAL_EQUAL (const location_type& l) 1994 { 1995 return symbol_type (token::EQUAL_EQUAL, l); 1996 } 1997 #endif 1998 #if 201103L <= YY_CPLUSPLUS 1999 static 2000 symbol_type make_NOT_EQUAL(location_type l)2001 make_NOT_EQUAL (location_type l) 2002 { 2003 return symbol_type (token::NOT_EQUAL, std::move (l)); 2004 } 2005 #else 2006 static 2007 symbol_type make_NOT_EQUAL(const location_type & l)2008 make_NOT_EQUAL (const location_type& l) 2009 { 2010 return symbol_type (token::NOT_EQUAL, l); 2011 } 2012 #endif 2013 #if 201103L <= YY_CPLUSPLUS 2014 static 2015 symbol_type make_LESS(location_type l)2016 make_LESS (location_type l) 2017 { 2018 return symbol_type (token::LESS, std::move (l)); 2019 } 2020 #else 2021 static 2022 symbol_type make_LESS(const location_type & l)2023 make_LESS (const location_type& l) 2024 { 2025 return symbol_type (token::LESS, l); 2026 } 2027 #endif 2028 #if 201103L <= YY_CPLUSPLUS 2029 static 2030 symbol_type make_GREATER(location_type l)2031 make_GREATER (location_type l) 2032 { 2033 return symbol_type (token::GREATER, std::move (l)); 2034 } 2035 #else 2036 static 2037 symbol_type make_GREATER(const location_type & l)2038 make_GREATER (const location_type& l) 2039 { 2040 return symbol_type (token::GREATER, l); 2041 } 2042 #endif 2043 #if 201103L <= YY_CPLUSPLUS 2044 static 2045 symbol_type make_LESS_EQUAL(location_type l)2046 make_LESS_EQUAL (location_type l) 2047 { 2048 return symbol_type (token::LESS_EQUAL, std::move (l)); 2049 } 2050 #else 2051 static 2052 symbol_type make_LESS_EQUAL(const location_type & l)2053 make_LESS_EQUAL (const location_type& l) 2054 { 2055 return symbol_type (token::LESS_EQUAL, l); 2056 } 2057 #endif 2058 #if 201103L <= YY_CPLUSPLUS 2059 static 2060 symbol_type make_GREATER_EQUAL(location_type l)2061 make_GREATER_EQUAL (location_type l) 2062 { 2063 return symbol_type (token::GREATER_EQUAL, std::move (l)); 2064 } 2065 #else 2066 static 2067 symbol_type make_GREATER_EQUAL(const location_type & l)2068 make_GREATER_EQUAL (const location_type& l) 2069 { 2070 return symbol_type (token::GREATER_EQUAL, l); 2071 } 2072 #endif 2073 #if 201103L <= YY_CPLUSPLUS 2074 static 2075 symbol_type make_IN(location_type l)2076 make_IN (location_type l) 2077 { 2078 return symbol_type (token::IN, std::move (l)); 2079 } 2080 #else 2081 static 2082 symbol_type make_IN(const location_type & l)2083 make_IN (const location_type& l) 2084 { 2085 return symbol_type (token::IN, l); 2086 } 2087 #endif 2088 #if 201103L <= YY_CPLUSPLUS 2089 static 2090 symbol_type make_COLON(location_type l)2091 make_COLON (location_type l) 2092 { 2093 return symbol_type (token::COLON, std::move (l)); 2094 } 2095 #else 2096 static 2097 symbol_type make_COLON(const location_type & l)2098 make_COLON (const location_type& l) 2099 { 2100 return symbol_type (token::COLON, l); 2101 } 2102 #endif 2103 #if 201103L <= YY_CPLUSPLUS 2104 static 2105 symbol_type make_UNION(location_type l)2106 make_UNION (location_type l) 2107 { 2108 return symbol_type (token::UNION, std::move (l)); 2109 } 2110 #else 2111 static 2112 symbol_type make_UNION(const location_type & l)2113 make_UNION (const location_type& l) 2114 { 2115 return symbol_type (token::UNION, l); 2116 } 2117 #endif 2118 #if 201103L <= YY_CPLUSPLUS 2119 static 2120 symbol_type make_INTERSECTION(location_type l)2121 make_INTERSECTION (location_type l) 2122 { 2123 return symbol_type (token::INTERSECTION, std::move (l)); 2124 } 2125 #else 2126 static 2127 symbol_type make_INTERSECTION(const location_type & l)2128 make_INTERSECTION (const location_type& l) 2129 { 2130 return symbol_type (token::INTERSECTION, l); 2131 } 2132 #endif 2133 #if 201103L <= YY_CPLUSPLUS 2134 static 2135 symbol_type make_PLUS(location_type l)2136 make_PLUS (location_type l) 2137 { 2138 return symbol_type (token::PLUS, std::move (l)); 2139 } 2140 #else 2141 static 2142 symbol_type make_PLUS(const location_type & l)2143 make_PLUS (const location_type& l) 2144 { 2145 return symbol_type (token::PLUS, l); 2146 } 2147 #endif 2148 #if 201103L <= YY_CPLUSPLUS 2149 static 2150 symbol_type make_MINUS(location_type l)2151 make_MINUS (location_type l) 2152 { 2153 return symbol_type (token::MINUS, std::move (l)); 2154 } 2155 #else 2156 static 2157 symbol_type make_MINUS(const location_type & l)2158 make_MINUS (const location_type& l) 2159 { 2160 return symbol_type (token::MINUS, l); 2161 } 2162 #endif 2163 #if 201103L <= YY_CPLUSPLUS 2164 static 2165 symbol_type make_TIMES(location_type l)2166 make_TIMES (location_type l) 2167 { 2168 return symbol_type (token::TIMES, std::move (l)); 2169 } 2170 #else 2171 static 2172 symbol_type make_TIMES(const location_type & l)2173 make_TIMES (const location_type& l) 2174 { 2175 return symbol_type (token::TIMES, l); 2176 } 2177 #endif 2178 #if 201103L <= YY_CPLUSPLUS 2179 static 2180 symbol_type make_DIVIDE(location_type l)2181 make_DIVIDE (location_type l) 2182 { 2183 return symbol_type (token::DIVIDE, std::move (l)); 2184 } 2185 #else 2186 static 2187 symbol_type make_DIVIDE(const location_type & l)2188 make_DIVIDE (const location_type& l) 2189 { 2190 return symbol_type (token::DIVIDE, l); 2191 } 2192 #endif 2193 #if 201103L <= YY_CPLUSPLUS 2194 static 2195 symbol_type make_UNARY(location_type l)2196 make_UNARY (location_type l) 2197 { 2198 return symbol_type (token::UNARY, std::move (l)); 2199 } 2200 #else 2201 static 2202 symbol_type make_UNARY(const location_type & l)2203 make_UNARY (const location_type& l) 2204 { 2205 return symbol_type (token::UNARY, l); 2206 } 2207 #endif 2208 #if 201103L <= YY_CPLUSPLUS 2209 static 2210 symbol_type make_NOT(location_type l)2211 make_NOT (location_type l) 2212 { 2213 return symbol_type (token::NOT, std::move (l)); 2214 } 2215 #else 2216 static 2217 symbol_type make_NOT(const location_type & l)2218 make_NOT (const location_type& l) 2219 { 2220 return symbol_type (token::NOT, l); 2221 } 2222 #endif 2223 #if 201103L <= YY_CPLUSPLUS 2224 static 2225 symbol_type make_CAST(location_type l)2226 make_CAST (location_type l) 2227 { 2228 return symbol_type (token::CAST, std::move (l)); 2229 } 2230 #else 2231 static 2232 symbol_type make_CAST(const location_type & l)2233 make_CAST (const location_type& l) 2234 { 2235 return symbol_type (token::CAST, l); 2236 } 2237 #endif 2238 #if 201103L <= YY_CPLUSPLUS 2239 static 2240 symbol_type make_POWER(location_type l)2241 make_POWER (location_type l) 2242 { 2243 return symbol_type (token::POWER, std::move (l)); 2244 } 2245 #else 2246 static 2247 symbol_type make_POWER(const location_type & l)2248 make_POWER (const location_type& l) 2249 { 2250 return symbol_type (token::POWER, l); 2251 } 2252 #endif 2253 #if 201103L <= YY_CPLUSPLUS 2254 static 2255 symbol_type make_NAME(string v,location_type l)2256 make_NAME (string v, location_type l) 2257 { 2258 return symbol_type (token::NAME, std::move (v), std::move (l)); 2259 } 2260 #else 2261 static 2262 symbol_type make_NAME(const string & v,const location_type & l)2263 make_NAME (const string& v, const location_type& l) 2264 { 2265 return symbol_type (token::NAME, v, l); 2266 } 2267 #endif 2268 #if 201103L <= YY_CPLUSPLUS 2269 static 2270 symbol_type make_TEXT(string v,location_type l)2271 make_TEXT (string v, location_type l) 2272 { 2273 return symbol_type (token::TEXT, std::move (v), std::move (l)); 2274 } 2275 #else 2276 static 2277 symbol_type make_TEXT(const string & v,const location_type & l)2278 make_TEXT (const string& v, const location_type& l) 2279 { 2280 return symbol_type (token::TEXT, v, l); 2281 } 2282 #endif 2283 #if 201103L <= YY_CPLUSPLUS 2284 static 2285 symbol_type make_QUOTED_STRING(string v,location_type l)2286 make_QUOTED_STRING (string v, location_type l) 2287 { 2288 return symbol_type (token::QUOTED_STRING, std::move (v), std::move (l)); 2289 } 2290 #else 2291 static 2292 symbol_type make_QUOTED_STRING(const string & v,const location_type & l)2293 make_QUOTED_STRING (const string& v, const location_type& l) 2294 { 2295 return symbol_type (token::QUOTED_STRING, v, l); 2296 } 2297 #endif 2298 #if 201103L <= YY_CPLUSPLUS 2299 static 2300 symbol_type make_NUMBER(string v,location_type l)2301 make_NUMBER (string v, location_type l) 2302 { 2303 return symbol_type (token::NUMBER, std::move (v), std::move (l)); 2304 } 2305 #else 2306 static 2307 symbol_type make_NUMBER(const string & v,const location_type & l)2308 make_NUMBER (const string& v, const location_type& l) 2309 { 2310 return symbol_type (token::NUMBER, v, l); 2311 } 2312 #endif 2313 #if 201103L <= YY_CPLUSPLUS 2314 static 2315 symbol_type make_EOL(string v,location_type l)2316 make_EOL (string v, location_type l) 2317 { 2318 return symbol_type (token::EOL, std::move (v), std::move (l)); 2319 } 2320 #else 2321 static 2322 symbol_type make_EOL(const string & v,const location_type & l)2323 make_EOL (const string& v, const location_type& l) 2324 { 2325 return symbol_type (token::EOL, v, l); 2326 } 2327 #endif 2328 2329 2330 private: 2331 /// This class is not copyable. 2332 parser (const parser&); 2333 parser& operator= (const parser&); 2334 2335 /// State numbers. 2336 typedef int state_type; 2337 2338 /// Generate an error message. 2339 /// \param yystate the state where the error occurred. 2340 /// \param yyla the lookahead token. 2341 virtual std::string yysyntax_error_ (state_type yystate, 2342 const symbol_type& yyla) const; 2343 2344 /// Compute post-reduction state. 2345 /// \param yystate the current state 2346 /// \param yysym the nonterminal to push on the stack 2347 state_type yy_lr_goto_state_ (state_type yystate, int yysym); 2348 2349 /// Whether the given \c yypact_ value indicates a defaulted state. 2350 /// \param yyvalue the value to check 2351 static bool yy_pact_value_is_default_ (int yyvalue); 2352 2353 /// Whether the given \c yytable_ value indicates a syntax error. 2354 /// \param yyvalue the value to check 2355 static bool yy_table_value_is_error_ (int yyvalue); 2356 2357 static const short yypact_ninf_; 2358 static const signed char yytable_ninf_; 2359 2360 /// Convert a scanner token number \a t to a symbol number. 2361 static token_number_type yytranslate_ (int t); 2362 2363 // Tables. 2364 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 2365 // STATE-NUM. 2366 static const short yypact_[]; 2367 2368 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 2369 // Performed when YYTABLE does not specify something else to do. Zero 2370 // means the default is an error. 2371 static const unsigned char yydefact_[]; 2372 2373 // YYPGOTO[NTERM-NUM]. 2374 static const short yypgoto_[]; 2375 2376 // YYDEFGOTO[NTERM-NUM]. 2377 static const short yydefgoto_[]; 2378 2379 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 2380 // positive, shift that token. If negative, reduce the rule whose 2381 // number is the opposite. If YYTABLE_NINF, syntax error. 2382 static const short yytable_[]; 2383 2384 static const short yycheck_[]; 2385 2386 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing 2387 // symbol of state STATE-NUM. 2388 static const unsigned char yystos_[]; 2389 2390 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. 2391 static const unsigned char yyr1_[]; 2392 2393 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. 2394 static const unsigned char yyr2_[]; 2395 2396 2397 /// Convert the symbol name \a n to a form suitable for a diagnostic. 2398 static std::string yytnamerr_ (const char *n); 2399 2400 2401 /// For a symbol, its name in clear. 2402 static const char* const yytname_[]; 2403 #if YYDEBUG 2404 // YYRLINE[YYN] -- Source line where rule number YYN was defined. 2405 static const unsigned short yyrline_[]; 2406 /// Report on the debug stream that the rule \a r is going to be reduced. 2407 virtual void yy_reduce_print_ (int r); 2408 /// Print the state stack on the debug stream. 2409 virtual void yystack_print_ (); 2410 2411 /// Debugging level. 2412 int yydebug_; 2413 /// Debug stream. 2414 std::ostream* yycdebug_; 2415 2416 /// \brief Display a symbol type, value and location. 2417 /// \param yyo The output stream. 2418 /// \param yysym The symbol. 2419 template <typename Base> 2420 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const; 2421 #endif 2422 2423 /// \brief Reclaim the memory associated to a symbol. 2424 /// \param yymsg Why this token is reclaimed. 2425 /// If null, print nothing. 2426 /// \param yysym The symbol. 2427 template <typename Base> 2428 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const; 2429 2430 private: 2431 /// Type access provider for state based symbols. 2432 struct by_state 2433 { 2434 /// Default constructor. 2435 by_state () YY_NOEXCEPT; 2436 2437 /// The symbol type as needed by the constructor. 2438 typedef state_type kind_type; 2439 2440 /// Constructor. 2441 by_state (kind_type s) YY_NOEXCEPT; 2442 2443 /// Copy constructor. 2444 by_state (const by_state& that) YY_NOEXCEPT; 2445 2446 /// Record that this symbol is empty. 2447 void clear () YY_NOEXCEPT; 2448 2449 /// Steal the symbol type from \a that. 2450 void move (by_state& that); 2451 2452 /// The (internal) type number (corresponding to \a state). 2453 /// \a empty_symbol when empty. 2454 symbol_number_type type_get () const YY_NOEXCEPT; 2455 2456 /// The state number used to denote an empty symbol. 2457 enum { empty_state = -1 }; 2458 2459 /// The state. 2460 /// \a empty when empty. 2461 state_type state; 2462 }; 2463 2464 /// "Internal" symbol: element of the stack. 2465 struct stack_symbol_type : basic_symbol<by_state> 2466 { 2467 /// Superclass. 2468 typedef basic_symbol<by_state> super_type; 2469 /// Construct an empty symbol. 2470 stack_symbol_type (); 2471 /// Move or copy construction. 2472 stack_symbol_type (YY_RVREF (stack_symbol_type) that); 2473 /// Steal the contents from \a sym to build this. 2474 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); 2475 #if YY_CPLUSPLUS < 201103L 2476 /// Assignment, needed by push_back by some old implementations. 2477 /// Moves the contents of that. 2478 stack_symbol_type& operator= (stack_symbol_type& that); 2479 #endif 2480 }; 2481 2482 /// A stack with random access from its top. 2483 template <typename T, typename S = std::vector<T> > 2484 class stack 2485 { 2486 public: 2487 // Hide our reversed order. 2488 typedef typename S::reverse_iterator iterator; 2489 typedef typename S::const_reverse_iterator const_iterator; 2490 typedef typename S::size_type size_type; 2491 stack(size_type n=200)2492 stack (size_type n = 200) 2493 : seq_ (n) 2494 {} 2495 2496 /// Random access. 2497 /// 2498 /// Index 0 returns the topmost element. 2499 T& operator [](size_type i)2500 operator[] (size_type i) 2501 { 2502 return seq_[size () - 1 - i]; 2503 } 2504 2505 /// Random access. 2506 /// 2507 /// Index 0 returns the topmost element. 2508 T& operator [](int i)2509 operator[] (int i) 2510 { 2511 return operator[] (size_type (i)); 2512 } 2513 2514 /// Random access. 2515 /// 2516 /// Index 0 returns the topmost element. 2517 const T& operator [](size_type i) const2518 operator[] (size_type i) const 2519 { 2520 return seq_[size () - 1 - i]; 2521 } 2522 2523 /// Random access. 2524 /// 2525 /// Index 0 returns the topmost element. 2526 const T& operator [](int i) const2527 operator[] (int i) const 2528 { 2529 return operator[] (size_type (i)); 2530 } 2531 2532 /// Steal the contents of \a t. 2533 /// 2534 /// Close to move-semantics. 2535 void push(YY_MOVE_REF (T)t)2536 push (YY_MOVE_REF (T) t) 2537 { 2538 seq_.push_back (T ()); 2539 operator[] (0).move (t); 2540 } 2541 2542 /// Pop elements from the stack. 2543 void pop(int n=1)2544 pop (int n = 1) YY_NOEXCEPT 2545 { 2546 for (; 0 < n; --n) 2547 seq_.pop_back (); 2548 } 2549 2550 /// Pop all elements from the stack. 2551 void clear()2552 clear () YY_NOEXCEPT 2553 { 2554 seq_.clear (); 2555 } 2556 2557 /// Number of elements on the stack. 2558 size_type size() const2559 size () const YY_NOEXCEPT 2560 { 2561 return seq_.size (); 2562 } 2563 2564 /// Iterator on top of the stack (going downwards). 2565 const_iterator begin() const2566 begin () const YY_NOEXCEPT 2567 { 2568 return seq_.rbegin (); 2569 } 2570 2571 /// Bottom of the stack. 2572 const_iterator end() const2573 end () const YY_NOEXCEPT 2574 { 2575 return seq_.rend (); 2576 } 2577 2578 /// Present a slice of the top of a stack. 2579 class slice 2580 { 2581 public: slice(const stack & stack,int range)2582 slice (const stack& stack, int range) 2583 : stack_ (stack) 2584 , range_ (range) 2585 {} 2586 2587 const T& operator [](int i) const2588 operator[] (int i) const 2589 { 2590 return stack_[range_ - i]; 2591 } 2592 2593 private: 2594 const stack& stack_; 2595 int range_; 2596 }; 2597 2598 private: 2599 stack (const stack&); 2600 stack& operator= (const stack&); 2601 /// The wrapped container. 2602 S seq_; 2603 }; 2604 2605 2606 /// Stack type. 2607 typedef stack<stack_symbol_type> stack_type; 2608 2609 /// The stack. 2610 stack_type yystack_; 2611 2612 /// Push a new state on the stack. 2613 /// \param m a debug message to display 2614 /// if null, no trace is output. 2615 /// \param sym the symbol 2616 /// \warning the contents of \a s.value is stolen. 2617 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); 2618 2619 /// Push a new look ahead token on the state on the stack. 2620 /// \param m a debug message to display 2621 /// if null, no trace is output. 2622 /// \param s the state 2623 /// \param sym the symbol (for its value and location). 2624 /// \warning the contents of \a sym.value is stolen. 2625 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); 2626 2627 /// Pop \a n symbols from the stack. 2628 void yypop_ (int n = 1); 2629 2630 /// Constants. 2631 enum 2632 { 2633 yyeof_ = 0, 2634 yylast_ = 1084, ///< Last index in yytable_. 2635 yynnts_ = 33, ///< Number of nonterminal symbols. 2636 yyfinal_ = 91, ///< Termination state number. 2637 yyterror_ = 1, 2638 yyerrcode_ = 256, 2639 yyntokens_ = 95 ///< Number of tokens. 2640 }; 2641 2642 2643 // User arguments. 2644 macro::Driver &driver; 2645 }; 2646 2647 2648 #line 25 "Parser.yy" // lalr1.cc:401 2649 } // Tokenizer 2650 #line 2651 "Parser.hh" // lalr1.cc:401 2651 2652 2653 2654 2655 #endif // !YY_YY_PARSER_HH_INCLUDED 2656