1 // A Bison parser, made by GNU Bison 3.7.2. 2 3 // Skeleton interface for Bison LALR(1) parsers in C++ 4 5 // Copyright (C) 2002-2015, 2018-2020 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 tools/pioasm/gen/parser.hpp 36 ** Define the yy::parser class. 37 */ 38 39 // C++ LALR(1) parser skeleton written by Akim Demaille. 40 41 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, 42 // especially those whose name start with YY_ or yy_. They are 43 // private implementation details that can be changed or removed. 44 45 #ifndef YY_YY_HOME_GRAHAM_DEV_AMY_AMY_SDK_TOOLS_PIOASM_GEN_PARSER_HPP_INCLUDED 46 # define YY_YY_HOME_GRAHAM_DEV_AMY_AMY_SDK_TOOLS_PIOASM_GEN_PARSER_HPP_INCLUDED 47 // "%code requires" blocks. 48 49 #include <string> 50 #include <fstream> 51 #include <sstream> 52 #include "pio_types.h" 53 struct pio_assembler; 54 55 #ifdef _MSC_VER 56 #pragma warning(disable : 4065) // default only switch statement 57 #endif 58 59 60 61 # include <cstdlib> // std::abort 62 # include <iostream> 63 # include <stdexcept> 64 # include <string> 65 # include <vector> 66 67 #if defined __cplusplus 68 # define YY_CPLUSPLUS __cplusplus 69 #else 70 # define YY_CPLUSPLUS 199711L 71 #endif 72 73 // Support move semantics when possible. 74 #if 201103L <= YY_CPLUSPLUS 75 # define YY_MOVE std::move 76 # define YY_MOVE_OR_COPY move 77 # define YY_MOVE_REF(Type) Type&& 78 # define YY_RVREF(Type) Type&& 79 # define YY_COPY(Type) Type 80 #else 81 # define YY_MOVE 82 # define YY_MOVE_OR_COPY copy 83 # define YY_MOVE_REF(Type) Type& 84 # define YY_RVREF(Type) const Type& 85 # define YY_COPY(Type) const Type& 86 #endif 87 88 // Support noexcept when possible. 89 #if 201103L <= YY_CPLUSPLUS 90 # define YY_NOEXCEPT noexcept 91 # define YY_NOTHROW 92 #else 93 # define YY_NOEXCEPT 94 # define YY_NOTHROW throw () 95 #endif 96 97 // Support constexpr when possible. 98 #if 201703 <= YY_CPLUSPLUS 99 # define YY_CONSTEXPR constexpr 100 #else 101 # define YY_CONSTEXPR 102 #endif 103 # include "location.h" 104 105 #ifndef YY_ASSERT 106 # include <cassert> 107 # define YY_ASSERT assert 108 #endif 109 110 111 #ifndef YY_ATTRIBUTE_PURE 112 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) 113 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) 114 # else 115 # define YY_ATTRIBUTE_PURE 116 # endif 117 #endif 118 119 #ifndef YY_ATTRIBUTE_UNUSED 120 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) 121 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 122 # else 123 # define YY_ATTRIBUTE_UNUSED 124 # endif 125 #endif 126 127 /* Suppress unused-variable warnings by "using" E. */ 128 #if ! defined lint || defined __GNUC__ 129 # define YYUSE(E) ((void) (E)) 130 #else 131 # define YYUSE(E) /* empty */ 132 #endif 133 134 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 135 /* Suppress an incorrect diagnostic about yylval being uninitialized. */ 136 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 137 _Pragma ("GCC diagnostic push") \ 138 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ 139 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 140 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 141 _Pragma ("GCC diagnostic pop") 142 #else 143 # define YY_INITIAL_VALUE(Value) Value 144 #endif 145 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 146 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 147 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 148 #endif 149 #ifndef YY_INITIAL_VALUE 150 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 151 #endif 152 153 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ 154 # define YY_IGNORE_USELESS_CAST_BEGIN \ 155 _Pragma ("GCC diagnostic push") \ 156 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") 157 # define YY_IGNORE_USELESS_CAST_END \ 158 _Pragma ("GCC diagnostic pop") 159 #endif 160 #ifndef YY_IGNORE_USELESS_CAST_BEGIN 161 # define YY_IGNORE_USELESS_CAST_BEGIN 162 # define YY_IGNORE_USELESS_CAST_END 163 #endif 164 165 # ifndef YY_CAST 166 # ifdef __cplusplus 167 # define YY_CAST(Type, Val) static_cast<Type> (Val) 168 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) 169 # else 170 # define YY_CAST(Type, Val) ((Type) (Val)) 171 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) 172 # endif 173 # endif 174 # ifndef YY_NULLPTR 175 # if defined __cplusplus 176 # if 201103L <= __cplusplus 177 # define YY_NULLPTR nullptr 178 # else 179 # define YY_NULLPTR 0 180 # endif 181 # else 182 # define YY_NULLPTR ((void*)0) 183 # endif 184 # endif 185 186 /* Debug traces. */ 187 #ifndef YYDEBUG 188 # define YYDEBUG 0 189 #endif 190 191 namespace yy { 192 193 194 195 196 /// A Bison parser. 197 class parser 198 { 199 public: 200 #ifndef YYSTYPE 201 /// A buffer to store and retrieve objects. 202 /// 203 /// Sort of a variant, but does not keep track of the nature 204 /// of the stored data, since that knowledge is available 205 /// via the current parser state. 206 class semantic_type 207 { 208 public: 209 /// Type of *this. 210 typedef semantic_type self_type; 211 212 /// Empty construction. semantic_type()213 semantic_type () YY_NOEXCEPT 214 : yybuffer_ () 215 {} 216 217 /// Construct and fill. 218 template <typename T> semantic_type(YY_RVREF (T)t)219 semantic_type (YY_RVREF (T) t) 220 { 221 YY_ASSERT (sizeof (T) <= size); 222 new (yyas_<T> ()) T (YY_MOVE (t)); 223 } 224 225 #if 201103L <= YY_CPLUSPLUS 226 /// Non copyable. 227 semantic_type (const self_type&) = delete; 228 /// Non copyable. 229 self_type& operator= (const self_type&) = delete; 230 #endif 231 232 /// Destruction, allowed only if empty. ~semantic_type()233 ~semantic_type () YY_NOEXCEPT 234 {} 235 236 # if 201103L <= YY_CPLUSPLUS 237 /// Instantiate a \a T in here from \a t. 238 template <typename T, typename... U> 239 T& 240 emplace (U&&... u) 241 { 242 return *new (yyas_<T> ()) T (std::forward <U>(u)...); 243 } 244 # else 245 /// Instantiate an empty \a T in here. 246 template <typename T> 247 T& emplace()248 emplace () 249 { 250 return *new (yyas_<T> ()) T (); 251 } 252 253 /// Instantiate a \a T in here from \a t. 254 template <typename T> 255 T& emplace(const T & t)256 emplace (const T& t) 257 { 258 return *new (yyas_<T> ()) T (t); 259 } 260 # endif 261 262 /// Instantiate an empty \a T in here. 263 /// Obsolete, use emplace. 264 template <typename T> 265 T& build()266 build () 267 { 268 return emplace<T> (); 269 } 270 271 /// Instantiate a \a T in here from \a t. 272 /// Obsolete, use emplace. 273 template <typename T> 274 T& build(const T & t)275 build (const T& t) 276 { 277 return emplace<T> (t); 278 } 279 280 /// Accessor to a built \a T. 281 template <typename T> 282 T& as()283 as () YY_NOEXCEPT 284 { 285 return *yyas_<T> (); 286 } 287 288 /// Const accessor to a built \a T (for %printer). 289 template <typename T> 290 const T& as() const291 as () const YY_NOEXCEPT 292 { 293 return *yyas_<T> (); 294 } 295 296 /// Swap the content with \a that, of same type. 297 /// 298 /// Both variants must be built beforehand, because swapping the actual 299 /// data requires reading it (with as()), and this is not possible on 300 /// unconstructed variants: it would require some dynamic testing, which 301 /// should not be the variant's responsibility. 302 /// Swapping between built and (possibly) non-built is done with 303 /// self_type::move (). 304 template <typename T> 305 void swap(self_type & that)306 swap (self_type& that) YY_NOEXCEPT 307 { 308 std::swap (as<T> (), that.as<T> ()); 309 } 310 311 /// Move the content of \a that to this. 312 /// 313 /// Destroys \a that. 314 template <typename T> 315 void move(self_type & that)316 move (self_type& that) 317 { 318 # if 201103L <= YY_CPLUSPLUS 319 emplace<T> (std::move (that.as<T> ())); 320 # else 321 emplace<T> (); 322 swap<T> (that); 323 # endif 324 that.destroy<T> (); 325 } 326 327 # if 201103L <= YY_CPLUSPLUS 328 /// Move the content of \a that to this. 329 template <typename T> 330 void move(self_type && that)331 move (self_type&& that) 332 { 333 emplace<T> (std::move (that.as<T> ())); 334 that.destroy<T> (); 335 } 336 #endif 337 338 /// Copy the content of \a that to this. 339 template <typename T> 340 void copy(const self_type & that)341 copy (const self_type& that) 342 { 343 emplace<T> (that.as<T> ()); 344 } 345 346 /// Destroy the stored \a T. 347 template <typename T> 348 void destroy()349 destroy () 350 { 351 as<T> ().~T (); 352 } 353 354 private: 355 #if YY_CPLUSPLUS < 201103L 356 /// Non copyable. 357 semantic_type (const self_type&); 358 /// Non copyable. 359 self_type& operator= (const self_type&); 360 #endif 361 362 /// Accessor to raw memory as \a T. 363 template <typename T> 364 T* yyas_()365 yyas_ () YY_NOEXCEPT 366 { 367 void *yyp = yybuffer_.yyraw; 368 return static_cast<T*> (yyp); 369 } 370 371 /// Const accessor to raw memory as \a T. 372 template <typename T> 373 const T* yyas_() const374 yyas_ () const YY_NOEXCEPT 375 { 376 const void *yyp = yybuffer_.yyraw; 377 return static_cast<const T*> (yyp); 378 } 379 380 /// An auxiliary type to compute the largest semantic type. 381 union union_type 382 { 383 // direction 384 // autop 385 // if_full 386 // if_empty 387 // blocking 388 char dummy1[sizeof (bool)]; 389 390 // condition 391 char dummy2[sizeof (enum condition)]; 392 393 // fifo_config 394 char dummy3[sizeof (enum fifo_config)]; 395 396 // in_source 397 // out_target 398 // set_target 399 char dummy4[sizeof (enum in_out_set)]; 400 401 // irq_modifiers 402 char dummy5[sizeof (enum irq)]; 403 404 // mov_op 405 char dummy6[sizeof (enum mov_op)]; 406 407 // mov_target 408 // mov_source 409 char dummy7[sizeof (extended_mov)]; 410 411 // "float" 412 char dummy8[sizeof (float)]; 413 414 // "integer" 415 char dummy9[sizeof (int)]; 416 417 // instruction 418 // base_instruction 419 char dummy10[sizeof (std::shared_ptr<instruction>)]; 420 421 // value 422 // expression 423 // delay 424 // sideset 425 // threshold 426 char dummy11[sizeof (std::shared_ptr<resolvable>)]; 427 428 // label_decl 429 // symbol_def 430 char dummy12[sizeof (std::shared_ptr<symbol>)]; 431 432 // wait_source 433 char dummy13[sizeof (std::shared_ptr<wait_source>)]; 434 435 // "identifier" 436 // "string" 437 // "text" 438 // "code block" 439 // "%}" 440 // UNKNOWN_DIRECTIVE 441 char dummy14[sizeof (std::string)]; 442 443 // pio_version 444 char dummy15[sizeof (uint)]; 445 }; 446 447 /// The size of the largest semantic type. 448 enum { size = sizeof (union_type) }; 449 450 /// A buffer to store semantic values. 451 union 452 { 453 /// Strongest alignment constraints. 454 long double yyalign_me; 455 /// A buffer large enough to store any of the semantic values. 456 char yyraw[size]; 457 } yybuffer_; 458 }; 459 460 #else 461 typedef YYSTYPE semantic_type; 462 #endif 463 /// Symbol locations. 464 typedef location location_type; 465 466 /// Syntax errors thrown from user actions. 467 struct syntax_error : std::runtime_error 468 { syntax_erroryy::parser::syntax_error469 syntax_error (const location_type& l, const std::string& m) 470 : std::runtime_error (m) 471 , location (l) 472 {} 473 syntax_erroryy::parser::syntax_error474 syntax_error (const syntax_error& s) 475 : std::runtime_error (s.what ()) 476 , location (s.location) 477 {} 478 479 ~syntax_error () YY_NOEXCEPT YY_NOTHROW; 480 481 location_type location; 482 }; 483 484 /// Token kinds. 485 struct token 486 { 487 enum token_kind_type 488 { 489 TOK_YYEMPTY = -2, 490 TOK_END = 0, // "end of file" 491 TOK_YYerror = 256, // error 492 TOK_YYUNDEF = 257, // "invalid token" 493 TOK_NEWLINE = 258, // "end of line" 494 TOK_COMMA = 259, // "," 495 TOK_COLON = 260, // ":" 496 TOK_LPAREN = 261, // "(" 497 TOK_RPAREN = 262, // ")" 498 TOK_LBRACKET = 263, // "[" 499 TOK_RBRACKET = 264, // "]" 500 TOK_PLUS = 265, // "+" 501 TOK_MINUS = 266, // "-" 502 TOK_MULTIPLY = 267, // "*" 503 TOK_DIVIDE = 268, // "/" 504 TOK_OR = 269, // "|" 505 TOK_AND = 270, // "&" 506 TOK_XOR = 271, // "^" 507 TOK_SHL = 272, // "<<" 508 TOK_SHR = 273, // ">>" 509 TOK_POST_DECREMENT = 274, // "--" 510 TOK_NOT_EQUAL = 275, // "!=" 511 TOK_NOT = 276, // "!" 512 TOK_REVERSE = 277, // "::" 513 TOK_ASSIGN = 278, // "=" 514 TOK_LESSTHAN = 279, // "<" 515 TOK_PROGRAM = 280, // ".program" 516 TOK_WRAP_TARGET = 281, // ".wrap_target" 517 TOK_WRAP = 282, // ".wrap" 518 TOK_DEFINE = 283, // ".define" 519 TOK_SIDE_SET = 284, // ".side_set" 520 TOK_WORD = 285, // ".word" 521 TOK_ORIGIN = 286, // ".origin" 522 TOK_LANG_OPT = 287, // ".lang_opt" 523 TOK_PIO_VERSION = 288, // ".pio_version" 524 TOK_CLOCK_DIV = 289, // ".clock_div" 525 TOK_FIFO = 290, // ".fifo" 526 TOK_MOV_STATUS = 291, // ".mov_status" 527 TOK_DOT_SET = 292, // ".set" 528 TOK_DOT_OUT = 293, // ".out" 529 TOK_DOT_IN = 294, // ".in" 530 TOK_JMP = 295, // "jmp" 531 TOK_WAIT = 296, // "wait" 532 TOK_IN = 297, // "in" 533 TOK_OUT = 298, // "out" 534 TOK_PUSH = 299, // "push" 535 TOK_PULL = 300, // "pull" 536 TOK_MOV = 301, // "mov" 537 TOK_IRQ = 302, // "irq" 538 TOK_SET = 303, // "set" 539 TOK_NOP = 304, // "nop" 540 TOK_PIN = 305, // "pin" 541 TOK_GPIO = 306, // "gpio" 542 TOK_OSRE = 307, // "osre" 543 TOK_JMPPIN = 308, // "jmppin" 544 TOK_PREV = 309, // "prev" 545 TOK_NEXT = 310, // "next" 546 TOK_PINS = 311, // "pins" 547 TOK_NULL = 312, // "null" 548 TOK_PINDIRS = 313, // "pindirs" 549 TOK_BLOCK = 314, // "block" 550 TOK_NOBLOCK = 315, // "noblock" 551 TOK_IFEMPTY = 316, // "ifempty" 552 TOK_IFFULL = 317, // "iffull" 553 TOK_NOWAIT = 318, // "nowait" 554 TOK_CLEAR = 319, // "clear" 555 TOK_REL = 320, // "rel" 556 TOK_X = 321, // "x" 557 TOK_Y = 322, // "y" 558 TOK_EXEC = 323, // "exec" 559 TOK_PC = 324, // "pc" 560 TOK_ISR = 325, // "isr" 561 TOK_OSR = 326, // "osr" 562 TOK_OPTIONAL = 327, // "opt" 563 TOK_SIDE = 328, // "side" 564 TOK_STATUS = 329, // "status" 565 TOK_PUBLIC = 330, // "public" 566 TOK_RP2040 = 331, // "rp2040" 567 TOK_RP2350 = 332, // "rp2350" 568 TOK_RXFIFO = 333, // "rxfifo" 569 TOK_TXFIFO = 334, // "txfifo" 570 TOK_TXRX = 335, // "txrx" 571 TOK_TX = 336, // "tx" 572 TOK_RX = 337, // "rx" 573 TOK_TXPUT = 338, // "txput" 574 TOK_TXGET = 339, // "txget" 575 TOK_PUTGET = 340, // "putget" 576 TOK_LEFT = 341, // "left" 577 TOK_RIGHT = 342, // "right" 578 TOK_AUTO = 343, // "auto" 579 TOK_MANUAL = 344, // "manual" 580 TOK_ID = 345, // "identifier" 581 TOK_STRING = 346, // "string" 582 TOK_NON_WS = 347, // "text" 583 TOK_CODE_BLOCK_START = 348, // "code block" 584 TOK_CODE_BLOCK_CONTENTS = 349, // "%}" 585 TOK_UNKNOWN_DIRECTIVE = 350, // UNKNOWN_DIRECTIVE 586 TOK_INT = 351, // "integer" 587 TOK_FLOAT = 352 // "float" 588 }; 589 /// Backward compatibility alias (Bison 3.6). 590 typedef token_kind_type yytokentype; 591 }; 592 593 /// Token kind, as returned by yylex. 594 typedef token::yytokentype token_kind_type; 595 596 /// Backward compatibility alias (Bison 3.6). 597 typedef token_kind_type token_type; 598 599 /// Symbol kinds. 600 struct symbol_kind 601 { 602 enum symbol_kind_type 603 { 604 YYNTOKENS = 98, ///< Number of tokens. 605 S_YYEMPTY = -2, 606 S_YYEOF = 0, // "end of file" 607 S_YYerror = 1, // error 608 S_YYUNDEF = 2, // "invalid token" 609 S_NEWLINE = 3, // "end of line" 610 S_COMMA = 4, // "," 611 S_COLON = 5, // ":" 612 S_LPAREN = 6, // "(" 613 S_RPAREN = 7, // ")" 614 S_LBRACKET = 8, // "[" 615 S_RBRACKET = 9, // "]" 616 S_PLUS = 10, // "+" 617 S_MINUS = 11, // "-" 618 S_MULTIPLY = 12, // "*" 619 S_DIVIDE = 13, // "/" 620 S_OR = 14, // "|" 621 S_AND = 15, // "&" 622 S_XOR = 16, // "^" 623 S_SHL = 17, // "<<" 624 S_SHR = 18, // ">>" 625 S_POST_DECREMENT = 19, // "--" 626 S_NOT_EQUAL = 20, // "!=" 627 S_NOT = 21, // "!" 628 S_REVERSE = 22, // "::" 629 S_ASSIGN = 23, // "=" 630 S_LESSTHAN = 24, // "<" 631 S_PROGRAM = 25, // ".program" 632 S_WRAP_TARGET = 26, // ".wrap_target" 633 S_WRAP = 27, // ".wrap" 634 S_DEFINE = 28, // ".define" 635 S_SIDE_SET = 29, // ".side_set" 636 S_WORD = 30, // ".word" 637 S_ORIGIN = 31, // ".origin" 638 S_LANG_OPT = 32, // ".lang_opt" 639 S_PIO_VERSION = 33, // ".pio_version" 640 S_CLOCK_DIV = 34, // ".clock_div" 641 S_FIFO = 35, // ".fifo" 642 S_MOV_STATUS = 36, // ".mov_status" 643 S_DOT_SET = 37, // ".set" 644 S_DOT_OUT = 38, // ".out" 645 S_DOT_IN = 39, // ".in" 646 S_JMP = 40, // "jmp" 647 S_WAIT = 41, // "wait" 648 S_IN = 42, // "in" 649 S_OUT = 43, // "out" 650 S_PUSH = 44, // "push" 651 S_PULL = 45, // "pull" 652 S_MOV = 46, // "mov" 653 S_IRQ = 47, // "irq" 654 S_SET = 48, // "set" 655 S_NOP = 49, // "nop" 656 S_PIN = 50, // "pin" 657 S_GPIO = 51, // "gpio" 658 S_OSRE = 52, // "osre" 659 S_JMPPIN = 53, // "jmppin" 660 S_PREV = 54, // "prev" 661 S_NEXT = 55, // "next" 662 S_PINS = 56, // "pins" 663 S_NULL = 57, // "null" 664 S_PINDIRS = 58, // "pindirs" 665 S_BLOCK = 59, // "block" 666 S_NOBLOCK = 60, // "noblock" 667 S_IFEMPTY = 61, // "ifempty" 668 S_IFFULL = 62, // "iffull" 669 S_NOWAIT = 63, // "nowait" 670 S_CLEAR = 64, // "clear" 671 S_REL = 65, // "rel" 672 S_X = 66, // "x" 673 S_Y = 67, // "y" 674 S_EXEC = 68, // "exec" 675 S_PC = 69, // "pc" 676 S_ISR = 70, // "isr" 677 S_OSR = 71, // "osr" 678 S_OPTIONAL = 72, // "opt" 679 S_SIDE = 73, // "side" 680 S_STATUS = 74, // "status" 681 S_PUBLIC = 75, // "public" 682 S_RP2040 = 76, // "rp2040" 683 S_RP2350 = 77, // "rp2350" 684 S_RXFIFO = 78, // "rxfifo" 685 S_TXFIFO = 79, // "txfifo" 686 S_TXRX = 80, // "txrx" 687 S_TX = 81, // "tx" 688 S_RX = 82, // "rx" 689 S_TXPUT = 83, // "txput" 690 S_TXGET = 84, // "txget" 691 S_PUTGET = 85, // "putget" 692 S_LEFT = 86, // "left" 693 S_RIGHT = 87, // "right" 694 S_AUTO = 88, // "auto" 695 S_MANUAL = 89, // "manual" 696 S_ID = 90, // "identifier" 697 S_STRING = 91, // "string" 698 S_NON_WS = 92, // "text" 699 S_CODE_BLOCK_START = 93, // "code block" 700 S_CODE_BLOCK_CONTENTS = 94, // "%}" 701 S_UNKNOWN_DIRECTIVE = 95, // UNKNOWN_DIRECTIVE 702 S_INT = 96, // "integer" 703 S_FLOAT = 97, // "float" 704 S_YYACCEPT = 98, // $accept 705 S_file = 99, // file 706 S_lines = 100, // lines 707 S_line = 101, // line 708 S_code_block = 102, // code_block 709 S_label_decl = 103, // label_decl 710 S_directive = 104, // directive 711 S_value = 105, // value 712 S_expression = 106, // expression 713 S_pio_version = 107, // pio_version 714 S_instruction = 108, // instruction 715 S_base_instruction = 109, // base_instruction 716 S_delay = 110, // delay 717 S_sideset = 111, // sideset 718 S_condition = 112, // condition 719 S_wait_source = 113, // wait_source 720 S_fifo_config = 114, // fifo_config 721 S_comma = 115, // comma 722 S_in_source = 116, // in_source 723 S_out_target = 117, // out_target 724 S_mov_target = 118, // mov_target 725 S_mov_source = 119, // mov_source 726 S_mov_op = 120, // mov_op 727 S_set_target = 121, // set_target 728 S_direction = 122, // direction 729 S_autop = 123, // autop 730 S_threshold = 124, // threshold 731 S_if_full = 125, // if_full 732 S_if_empty = 126, // if_empty 733 S_blocking = 127, // blocking 734 S_irq_modifiers = 128, // irq_modifiers 735 S_symbol_def = 129 // symbol_def 736 }; 737 }; 738 739 /// (Internal) symbol kind. 740 typedef symbol_kind::symbol_kind_type symbol_kind_type; 741 742 /// The number of tokens. 743 static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; 744 745 /// A complete symbol. 746 /// 747 /// Expects its Base type to provide access to the symbol kind 748 /// via kind (). 749 /// 750 /// Provide access to semantic value and location. 751 template <typename Base> 752 struct basic_symbol : Base 753 { 754 /// Alias to Base. 755 typedef Base super_type; 756 757 /// Default constructor. basic_symbolyy::parser::basic_symbol758 basic_symbol () 759 : value () 760 , location () 761 {} 762 763 #if 201103L <= YY_CPLUSPLUS 764 /// Move constructor. basic_symbolyy::parser::basic_symbol765 basic_symbol (basic_symbol&& that) 766 : Base (std::move (that)) 767 , value () 768 , location (std::move (that.location)) 769 { 770 switch (this->kind ()) 771 { 772 case symbol_kind::S_direction: // direction 773 case symbol_kind::S_autop: // autop 774 case symbol_kind::S_if_full: // if_full 775 case symbol_kind::S_if_empty: // if_empty 776 case symbol_kind::S_blocking: // blocking 777 value.move< bool > (std::move (that.value)); 778 break; 779 780 case symbol_kind::S_condition: // condition 781 value.move< enum condition > (std::move (that.value)); 782 break; 783 784 case symbol_kind::S_fifo_config: // fifo_config 785 value.move< enum fifo_config > (std::move (that.value)); 786 break; 787 788 case symbol_kind::S_in_source: // in_source 789 case symbol_kind::S_out_target: // out_target 790 case symbol_kind::S_set_target: // set_target 791 value.move< enum in_out_set > (std::move (that.value)); 792 break; 793 794 case symbol_kind::S_irq_modifiers: // irq_modifiers 795 value.move< enum irq > (std::move (that.value)); 796 break; 797 798 case symbol_kind::S_mov_op: // mov_op 799 value.move< enum mov_op > (std::move (that.value)); 800 break; 801 802 case symbol_kind::S_mov_target: // mov_target 803 case symbol_kind::S_mov_source: // mov_source 804 value.move< extended_mov > (std::move (that.value)); 805 break; 806 807 case symbol_kind::S_FLOAT: // "float" 808 value.move< float > (std::move (that.value)); 809 break; 810 811 case symbol_kind::S_INT: // "integer" 812 value.move< int > (std::move (that.value)); 813 break; 814 815 case symbol_kind::S_instruction: // instruction 816 case symbol_kind::S_base_instruction: // base_instruction 817 value.move< std::shared_ptr<instruction> > (std::move (that.value)); 818 break; 819 820 case symbol_kind::S_value: // value 821 case symbol_kind::S_expression: // expression 822 case symbol_kind::S_delay: // delay 823 case symbol_kind::S_sideset: // sideset 824 case symbol_kind::S_threshold: // threshold 825 value.move< std::shared_ptr<resolvable> > (std::move (that.value)); 826 break; 827 828 case symbol_kind::S_label_decl: // label_decl 829 case symbol_kind::S_symbol_def: // symbol_def 830 value.move< std::shared_ptr<symbol> > (std::move (that.value)); 831 break; 832 833 case symbol_kind::S_wait_source: // wait_source 834 value.move< std::shared_ptr<wait_source> > (std::move (that.value)); 835 break; 836 837 case symbol_kind::S_ID: // "identifier" 838 case symbol_kind::S_STRING: // "string" 839 case symbol_kind::S_NON_WS: // "text" 840 case symbol_kind::S_CODE_BLOCK_START: // "code block" 841 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}" 842 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE 843 value.move< std::string > (std::move (that.value)); 844 break; 845 846 case symbol_kind::S_pio_version: // pio_version 847 value.move< uint > (std::move (that.value)); 848 break; 849 850 default: 851 break; 852 } 853 854 } 855 #endif 856 857 /// Copy constructor. 858 basic_symbol (const basic_symbol& that); 859 860 /// Constructor for valueless symbols, and symbols from each type. 861 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol862 basic_symbol (typename Base::kind_type t, location_type&& l) 863 : Base (t) 864 , location (std::move (l)) 865 {} 866 #else basic_symbolyy::parser::basic_symbol867 basic_symbol (typename Base::kind_type t, const location_type& l) 868 : Base (t) 869 , location (l) 870 {} 871 #endif 872 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol873 basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l) 874 : Base (t) 875 , value (std::move (v)) 876 , location (std::move (l)) 877 {} 878 #else basic_symbolyy::parser::basic_symbol879 basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l) 880 : Base (t) 881 , value (v) 882 , location (l) 883 {} 884 #endif 885 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol886 basic_symbol (typename Base::kind_type t, enum condition&& v, location_type&& l) 887 : Base (t) 888 , value (std::move (v)) 889 , location (std::move (l)) 890 {} 891 #else basic_symbolyy::parser::basic_symbol892 basic_symbol (typename Base::kind_type t, const enum condition& v, const location_type& l) 893 : Base (t) 894 , value (v) 895 , location (l) 896 {} 897 #endif 898 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol899 basic_symbol (typename Base::kind_type t, enum fifo_config&& v, location_type&& l) 900 : Base (t) 901 , value (std::move (v)) 902 , location (std::move (l)) 903 {} 904 #else basic_symbolyy::parser::basic_symbol905 basic_symbol (typename Base::kind_type t, const enum fifo_config& v, const location_type& l) 906 : Base (t) 907 , value (v) 908 , location (l) 909 {} 910 #endif 911 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol912 basic_symbol (typename Base::kind_type t, enum in_out_set&& v, location_type&& l) 913 : Base (t) 914 , value (std::move (v)) 915 , location (std::move (l)) 916 {} 917 #else basic_symbolyy::parser::basic_symbol918 basic_symbol (typename Base::kind_type t, const enum in_out_set& v, const location_type& l) 919 : Base (t) 920 , value (v) 921 , location (l) 922 {} 923 #endif 924 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol925 basic_symbol (typename Base::kind_type t, enum irq&& v, location_type&& l) 926 : Base (t) 927 , value (std::move (v)) 928 , location (std::move (l)) 929 {} 930 #else basic_symbolyy::parser::basic_symbol931 basic_symbol (typename Base::kind_type t, const enum irq& v, const location_type& l) 932 : Base (t) 933 , value (v) 934 , location (l) 935 {} 936 #endif 937 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol938 basic_symbol (typename Base::kind_type t, enum mov_op&& v, location_type&& l) 939 : Base (t) 940 , value (std::move (v)) 941 , location (std::move (l)) 942 {} 943 #else basic_symbolyy::parser::basic_symbol944 basic_symbol (typename Base::kind_type t, const enum mov_op& v, const location_type& l) 945 : Base (t) 946 , value (v) 947 , location (l) 948 {} 949 #endif 950 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol951 basic_symbol (typename Base::kind_type t, extended_mov&& v, location_type&& l) 952 : Base (t) 953 , value (std::move (v)) 954 , location (std::move (l)) 955 {} 956 #else basic_symbolyy::parser::basic_symbol957 basic_symbol (typename Base::kind_type t, const extended_mov& v, const location_type& l) 958 : Base (t) 959 , value (v) 960 , location (l) 961 {} 962 #endif 963 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol964 basic_symbol (typename Base::kind_type t, float&& v, location_type&& l) 965 : Base (t) 966 , value (std::move (v)) 967 , location (std::move (l)) 968 {} 969 #else basic_symbolyy::parser::basic_symbol970 basic_symbol (typename Base::kind_type t, const float& v, const location_type& l) 971 : Base (t) 972 , value (v) 973 , location (l) 974 {} 975 #endif 976 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol977 basic_symbol (typename Base::kind_type t, int&& v, location_type&& l) 978 : Base (t) 979 , value (std::move (v)) 980 , location (std::move (l)) 981 {} 982 #else basic_symbolyy::parser::basic_symbol983 basic_symbol (typename Base::kind_type t, const int& v, const location_type& l) 984 : Base (t) 985 , value (v) 986 , location (l) 987 {} 988 #endif 989 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol990 basic_symbol (typename Base::kind_type t, std::shared_ptr<instruction>&& v, location_type&& l) 991 : Base (t) 992 , value (std::move (v)) 993 , location (std::move (l)) 994 {} 995 #else basic_symbolyy::parser::basic_symbol996 basic_symbol (typename Base::kind_type t, const std::shared_ptr<instruction>& v, const location_type& l) 997 : Base (t) 998 , value (v) 999 , location (l) 1000 {} 1001 #endif 1002 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol1003 basic_symbol (typename Base::kind_type t, std::shared_ptr<resolvable>&& v, location_type&& l) 1004 : Base (t) 1005 , value (std::move (v)) 1006 , location (std::move (l)) 1007 {} 1008 #else basic_symbolyy::parser::basic_symbol1009 basic_symbol (typename Base::kind_type t, const std::shared_ptr<resolvable>& v, const location_type& l) 1010 : Base (t) 1011 , value (v) 1012 , location (l) 1013 {} 1014 #endif 1015 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol1016 basic_symbol (typename Base::kind_type t, std::shared_ptr<symbol>&& v, location_type&& l) 1017 : Base (t) 1018 , value (std::move (v)) 1019 , location (std::move (l)) 1020 {} 1021 #else basic_symbolyy::parser::basic_symbol1022 basic_symbol (typename Base::kind_type t, const std::shared_ptr<symbol>& v, const location_type& l) 1023 : Base (t) 1024 , value (v) 1025 , location (l) 1026 {} 1027 #endif 1028 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol1029 basic_symbol (typename Base::kind_type t, std::shared_ptr<wait_source>&& v, location_type&& l) 1030 : Base (t) 1031 , value (std::move (v)) 1032 , location (std::move (l)) 1033 {} 1034 #else basic_symbolyy::parser::basic_symbol1035 basic_symbol (typename Base::kind_type t, const std::shared_ptr<wait_source>& v, const location_type& l) 1036 : Base (t) 1037 , value (v) 1038 , location (l) 1039 {} 1040 #endif 1041 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol1042 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) 1043 : Base (t) 1044 , value (std::move (v)) 1045 , location (std::move (l)) 1046 {} 1047 #else basic_symbolyy::parser::basic_symbol1048 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) 1049 : Base (t) 1050 , value (v) 1051 , location (l) 1052 {} 1053 #endif 1054 #if 201103L <= YY_CPLUSPLUS basic_symbolyy::parser::basic_symbol1055 basic_symbol (typename Base::kind_type t, uint&& v, location_type&& l) 1056 : Base (t) 1057 , value (std::move (v)) 1058 , location (std::move (l)) 1059 {} 1060 #else basic_symbolyy::parser::basic_symbol1061 basic_symbol (typename Base::kind_type t, const uint& v, const location_type& l) 1062 : Base (t) 1063 , value (v) 1064 , location (l) 1065 {} 1066 #endif 1067 1068 /// Destroy the symbol. ~basic_symbolyy::parser::basic_symbol1069 ~basic_symbol () 1070 { 1071 clear (); 1072 } 1073 1074 /// Destroy contents, and record that is empty. clearyy::parser::basic_symbol1075 void clear () 1076 { 1077 // User destructor. 1078 symbol_kind_type yykind = this->kind (); 1079 basic_symbol<Base>& yysym = *this; 1080 (void) yysym; 1081 switch (yykind) 1082 { 1083 default: 1084 break; 1085 } 1086 1087 // Value type destructor. 1088 switch (yykind) 1089 { 1090 case symbol_kind::S_direction: // direction 1091 case symbol_kind::S_autop: // autop 1092 case symbol_kind::S_if_full: // if_full 1093 case symbol_kind::S_if_empty: // if_empty 1094 case symbol_kind::S_blocking: // blocking 1095 value.template destroy< bool > (); 1096 break; 1097 1098 case symbol_kind::S_condition: // condition 1099 value.template destroy< enum condition > (); 1100 break; 1101 1102 case symbol_kind::S_fifo_config: // fifo_config 1103 value.template destroy< enum fifo_config > (); 1104 break; 1105 1106 case symbol_kind::S_in_source: // in_source 1107 case symbol_kind::S_out_target: // out_target 1108 case symbol_kind::S_set_target: // set_target 1109 value.template destroy< enum in_out_set > (); 1110 break; 1111 1112 case symbol_kind::S_irq_modifiers: // irq_modifiers 1113 value.template destroy< enum irq > (); 1114 break; 1115 1116 case symbol_kind::S_mov_op: // mov_op 1117 value.template destroy< enum mov_op > (); 1118 break; 1119 1120 case symbol_kind::S_mov_target: // mov_target 1121 case symbol_kind::S_mov_source: // mov_source 1122 value.template destroy< extended_mov > (); 1123 break; 1124 1125 case symbol_kind::S_FLOAT: // "float" 1126 value.template destroy< float > (); 1127 break; 1128 1129 case symbol_kind::S_INT: // "integer" 1130 value.template destroy< int > (); 1131 break; 1132 1133 case symbol_kind::S_instruction: // instruction 1134 case symbol_kind::S_base_instruction: // base_instruction 1135 value.template destroy< std::shared_ptr<instruction> > (); 1136 break; 1137 1138 case symbol_kind::S_value: // value 1139 case symbol_kind::S_expression: // expression 1140 case symbol_kind::S_delay: // delay 1141 case symbol_kind::S_sideset: // sideset 1142 case symbol_kind::S_threshold: // threshold 1143 value.template destroy< std::shared_ptr<resolvable> > (); 1144 break; 1145 1146 case symbol_kind::S_label_decl: // label_decl 1147 case symbol_kind::S_symbol_def: // symbol_def 1148 value.template destroy< std::shared_ptr<symbol> > (); 1149 break; 1150 1151 case symbol_kind::S_wait_source: // wait_source 1152 value.template destroy< std::shared_ptr<wait_source> > (); 1153 break; 1154 1155 case symbol_kind::S_ID: // "identifier" 1156 case symbol_kind::S_STRING: // "string" 1157 case symbol_kind::S_NON_WS: // "text" 1158 case symbol_kind::S_CODE_BLOCK_START: // "code block" 1159 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}" 1160 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE 1161 value.template destroy< std::string > (); 1162 break; 1163 1164 case symbol_kind::S_pio_version: // pio_version 1165 value.template destroy< uint > (); 1166 break; 1167 1168 default: 1169 break; 1170 } 1171 1172 Base::clear (); 1173 } 1174 1175 /// The user-facing name of this symbol. nameyy::parser::basic_symbol1176 std::string name () const YY_NOEXCEPT 1177 { 1178 return parser::symbol_name (this->kind ()); 1179 } 1180 1181 /// Backward compatibility (Bison 3.6). 1182 symbol_kind_type type_get () const YY_NOEXCEPT; 1183 1184 /// Whether empty. 1185 bool empty () const YY_NOEXCEPT; 1186 1187 /// Destructive move, \a s is emptied into this. 1188 void move (basic_symbol& s); 1189 1190 /// The semantic value. 1191 semantic_type value; 1192 1193 /// The location. 1194 location_type location; 1195 1196 private: 1197 #if YY_CPLUSPLUS < 201103L 1198 /// Assignment operator. 1199 basic_symbol& operator= (const basic_symbol& that); 1200 #endif 1201 }; 1202 1203 /// Type access provider for token (enum) based symbols. 1204 struct by_kind 1205 { 1206 /// Default constructor. 1207 by_kind (); 1208 1209 #if 201103L <= YY_CPLUSPLUS 1210 /// Move constructor. 1211 by_kind (by_kind&& that); 1212 #endif 1213 1214 /// Copy constructor. 1215 by_kind (const by_kind& that); 1216 1217 /// The symbol kind as needed by the constructor. 1218 typedef token_kind_type kind_type; 1219 1220 /// Constructor from (external) token numbers. 1221 by_kind (kind_type t); 1222 1223 /// Record that this symbol is empty. 1224 void clear (); 1225 1226 /// Steal the symbol kind from \a that. 1227 void move (by_kind& that); 1228 1229 /// The (internal) type number (corresponding to \a type). 1230 /// \a empty when empty. 1231 symbol_kind_type kind () const YY_NOEXCEPT; 1232 1233 /// Backward compatibility (Bison 3.6). 1234 symbol_kind_type type_get () const YY_NOEXCEPT; 1235 1236 /// The symbol kind. 1237 /// \a S_YYEMPTY when empty. 1238 symbol_kind_type kind_; 1239 }; 1240 1241 /// Backward compatibility for a private implementation detail (Bison 3.6). 1242 typedef by_kind by_type; 1243 1244 /// "External" symbols: returned by the scanner. 1245 struct symbol_type : basic_symbol<by_kind> 1246 { 1247 /// Superclass. 1248 typedef basic_symbol<by_kind> super_type; 1249 1250 /// Empty symbol. symbol_typeyy::parser::symbol_type1251 symbol_type () {} 1252 1253 /// Constructor for valueless symbols, and symbols from each type. 1254 #if 201103L <= YY_CPLUSPLUS symbol_typeyy::parser::symbol_type1255 symbol_type (int tok, location_type l) 1256 : super_type(token_type (tok), std::move (l)) 1257 { 1258 YY_ASSERT (tok == token::TOK_END || tok == token::TOK_YYerror || tok == token::TOK_YYUNDEF || tok == token::TOK_NEWLINE || tok == token::TOK_COMMA || tok == token::TOK_COLON || tok == token::TOK_LPAREN || tok == token::TOK_RPAREN || tok == token::TOK_LBRACKET || tok == token::TOK_RBRACKET || tok == token::TOK_PLUS || tok == token::TOK_MINUS || tok == token::TOK_MULTIPLY || tok == token::TOK_DIVIDE || tok == token::TOK_OR || tok == token::TOK_AND || tok == token::TOK_XOR || tok == token::TOK_SHL || tok == token::TOK_SHR || tok == token::TOK_POST_DECREMENT || tok == token::TOK_NOT_EQUAL || tok == token::TOK_NOT || tok == token::TOK_REVERSE || tok == token::TOK_ASSIGN || tok == token::TOK_LESSTHAN || tok == token::TOK_PROGRAM || tok == token::TOK_WRAP_TARGET || tok == token::TOK_WRAP || tok == token::TOK_DEFINE || tok == token::TOK_SIDE_SET || tok == token::TOK_WORD || tok == token::TOK_ORIGIN || tok == token::TOK_LANG_OPT || tok == token::TOK_PIO_VERSION || tok == token::TOK_CLOCK_DIV || tok == token::TOK_FIFO || tok == token::TOK_MOV_STATUS || tok == token::TOK_DOT_SET || tok == token::TOK_DOT_OUT || tok == token::TOK_DOT_IN || tok == token::TOK_JMP || tok == token::TOK_WAIT || tok == token::TOK_IN || tok == token::TOK_OUT || tok == token::TOK_PUSH || tok == token::TOK_PULL || tok == token::TOK_MOV || tok == token::TOK_IRQ || tok == token::TOK_SET || tok == token::TOK_NOP || tok == token::TOK_PIN || tok == token::TOK_GPIO || tok == token::TOK_OSRE || tok == token::TOK_JMPPIN || tok == token::TOK_PREV || tok == token::TOK_NEXT || tok == token::TOK_PINS || tok == token::TOK_NULL || tok == token::TOK_PINDIRS || tok == token::TOK_BLOCK || tok == token::TOK_NOBLOCK || tok == token::TOK_IFEMPTY || tok == token::TOK_IFFULL || tok == token::TOK_NOWAIT || tok == token::TOK_CLEAR || tok == token::TOK_REL || tok == token::TOK_X || tok == token::TOK_Y || tok == token::TOK_EXEC || tok == token::TOK_PC || tok == token::TOK_ISR || tok == token::TOK_OSR || tok == token::TOK_OPTIONAL || tok == token::TOK_SIDE || tok == token::TOK_STATUS || tok == token::TOK_PUBLIC || tok == token::TOK_RP2040 || tok == token::TOK_RP2350 || tok == token::TOK_RXFIFO || tok == token::TOK_TXFIFO || tok == token::TOK_TXRX || tok == token::TOK_TX || tok == token::TOK_RX || tok == token::TOK_TXPUT || tok == token::TOK_TXGET || tok == token::TOK_PUTGET || tok == token::TOK_LEFT || tok == token::TOK_RIGHT || tok == token::TOK_AUTO || tok == token::TOK_MANUAL); 1259 } 1260 #else symbol_typeyy::parser::symbol_type1261 symbol_type (int tok, const location_type& l) 1262 : super_type(token_type (tok), l) 1263 { 1264 YY_ASSERT (tok == token::TOK_END || tok == token::TOK_YYerror || tok == token::TOK_YYUNDEF || tok == token::TOK_NEWLINE || tok == token::TOK_COMMA || tok == token::TOK_COLON || tok == token::TOK_LPAREN || tok == token::TOK_RPAREN || tok == token::TOK_LBRACKET || tok == token::TOK_RBRACKET || tok == token::TOK_PLUS || tok == token::TOK_MINUS || tok == token::TOK_MULTIPLY || tok == token::TOK_DIVIDE || tok == token::TOK_OR || tok == token::TOK_AND || tok == token::TOK_XOR || tok == token::TOK_SHL || tok == token::TOK_SHR || tok == token::TOK_POST_DECREMENT || tok == token::TOK_NOT_EQUAL || tok == token::TOK_NOT || tok == token::TOK_REVERSE || tok == token::TOK_ASSIGN || tok == token::TOK_LESSTHAN || tok == token::TOK_PROGRAM || tok == token::TOK_WRAP_TARGET || tok == token::TOK_WRAP || tok == token::TOK_DEFINE || tok == token::TOK_SIDE_SET || tok == token::TOK_WORD || tok == token::TOK_ORIGIN || tok == token::TOK_LANG_OPT || tok == token::TOK_PIO_VERSION || tok == token::TOK_CLOCK_DIV || tok == token::TOK_FIFO || tok == token::TOK_MOV_STATUS || tok == token::TOK_DOT_SET || tok == token::TOK_DOT_OUT || tok == token::TOK_DOT_IN || tok == token::TOK_JMP || tok == token::TOK_WAIT || tok == token::TOK_IN || tok == token::TOK_OUT || tok == token::TOK_PUSH || tok == token::TOK_PULL || tok == token::TOK_MOV || tok == token::TOK_IRQ || tok == token::TOK_SET || tok == token::TOK_NOP || tok == token::TOK_PIN || tok == token::TOK_GPIO || tok == token::TOK_OSRE || tok == token::TOK_JMPPIN || tok == token::TOK_PREV || tok == token::TOK_NEXT || tok == token::TOK_PINS || tok == token::TOK_NULL || tok == token::TOK_PINDIRS || tok == token::TOK_BLOCK || tok == token::TOK_NOBLOCK || tok == token::TOK_IFEMPTY || tok == token::TOK_IFFULL || tok == token::TOK_NOWAIT || tok == token::TOK_CLEAR || tok == token::TOK_REL || tok == token::TOK_X || tok == token::TOK_Y || tok == token::TOK_EXEC || tok == token::TOK_PC || tok == token::TOK_ISR || tok == token::TOK_OSR || tok == token::TOK_OPTIONAL || tok == token::TOK_SIDE || tok == token::TOK_STATUS || tok == token::TOK_PUBLIC || tok == token::TOK_RP2040 || tok == token::TOK_RP2350 || tok == token::TOK_RXFIFO || tok == token::TOK_TXFIFO || tok == token::TOK_TXRX || tok == token::TOK_TX || tok == token::TOK_RX || tok == token::TOK_TXPUT || tok == token::TOK_TXGET || tok == token::TOK_PUTGET || tok == token::TOK_LEFT || tok == token::TOK_RIGHT || tok == token::TOK_AUTO || tok == token::TOK_MANUAL); 1265 } 1266 #endif 1267 #if 201103L <= YY_CPLUSPLUS symbol_typeyy::parser::symbol_type1268 symbol_type (int tok, float v, location_type l) 1269 : super_type(token_type (tok), std::move (v), std::move (l)) 1270 { 1271 YY_ASSERT (tok == token::TOK_FLOAT); 1272 } 1273 #else symbol_typeyy::parser::symbol_type1274 symbol_type (int tok, const float& v, const location_type& l) 1275 : super_type(token_type (tok), v, l) 1276 { 1277 YY_ASSERT (tok == token::TOK_FLOAT); 1278 } 1279 #endif 1280 #if 201103L <= YY_CPLUSPLUS symbol_typeyy::parser::symbol_type1281 symbol_type (int tok, int v, location_type l) 1282 : super_type(token_type (tok), std::move (v), std::move (l)) 1283 { 1284 YY_ASSERT (tok == token::TOK_INT); 1285 } 1286 #else symbol_typeyy::parser::symbol_type1287 symbol_type (int tok, const int& v, const location_type& l) 1288 : super_type(token_type (tok), v, l) 1289 { 1290 YY_ASSERT (tok == token::TOK_INT); 1291 } 1292 #endif 1293 #if 201103L <= YY_CPLUSPLUS symbol_typeyy::parser::symbol_type1294 symbol_type (int tok, std::string v, location_type l) 1295 : super_type(token_type (tok), std::move (v), std::move (l)) 1296 { 1297 YY_ASSERT (tok == token::TOK_ID || tok == token::TOK_STRING || tok == token::TOK_NON_WS || tok == token::TOK_CODE_BLOCK_START || tok == token::TOK_CODE_BLOCK_CONTENTS || tok == token::TOK_UNKNOWN_DIRECTIVE); 1298 } 1299 #else symbol_typeyy::parser::symbol_type1300 symbol_type (int tok, const std::string& v, const location_type& l) 1301 : super_type(token_type (tok), v, l) 1302 { 1303 YY_ASSERT (tok == token::TOK_ID || tok == token::TOK_STRING || tok == token::TOK_NON_WS || tok == token::TOK_CODE_BLOCK_START || tok == token::TOK_CODE_BLOCK_CONTENTS || tok == token::TOK_UNKNOWN_DIRECTIVE); 1304 } 1305 #endif 1306 }; 1307 1308 /// Build a parser object. 1309 parser (pio_assembler& pioasm_yyarg); 1310 virtual ~parser (); 1311 1312 #if 201103L <= YY_CPLUSPLUS 1313 /// Non copyable. 1314 parser (const parser&) = delete; 1315 /// Non copyable. 1316 parser& operator= (const parser&) = delete; 1317 #endif 1318 1319 /// Parse. An alias for parse (). 1320 /// \returns 0 iff parsing succeeded. 1321 int operator() (); 1322 1323 /// Parse. 1324 /// \returns 0 iff parsing succeeded. 1325 virtual int parse (); 1326 1327 #if YYDEBUG 1328 /// The current debugging stream. 1329 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; 1330 /// Set the current debugging stream. 1331 void set_debug_stream (std::ostream &); 1332 1333 /// Type for debugging levels. 1334 typedef int debug_level_type; 1335 /// The current debugging level. 1336 debug_level_type debug_level () const YY_ATTRIBUTE_PURE; 1337 /// Set the current debugging level. 1338 void set_debug_level (debug_level_type l); 1339 #endif 1340 1341 /// Report a syntax error. 1342 /// \param loc where the syntax error is found. 1343 /// \param msg a description of the syntax error. 1344 virtual void error (const location_type& loc, const std::string& msg); 1345 1346 /// Report a syntax error. 1347 void error (const syntax_error& err); 1348 1349 /// The user-facing name of the symbol whose (internal) number is 1350 /// YYSYMBOL. No bounds checking. 1351 static std::string symbol_name (symbol_kind_type yysymbol); 1352 1353 // Implementation of make_symbol for each symbol type. 1354 #if 201103L <= YY_CPLUSPLUS 1355 static 1356 symbol_type make_END(location_type l)1357 make_END (location_type l) 1358 { 1359 return symbol_type (token::TOK_END, std::move (l)); 1360 } 1361 #else 1362 static 1363 symbol_type make_END(const location_type & l)1364 make_END (const location_type& l) 1365 { 1366 return symbol_type (token::TOK_END, l); 1367 } 1368 #endif 1369 #if 201103L <= YY_CPLUSPLUS 1370 static 1371 symbol_type make_YYerror(location_type l)1372 make_YYerror (location_type l) 1373 { 1374 return symbol_type (token::TOK_YYerror, std::move (l)); 1375 } 1376 #else 1377 static 1378 symbol_type make_YYerror(const location_type & l)1379 make_YYerror (const location_type& l) 1380 { 1381 return symbol_type (token::TOK_YYerror, l); 1382 } 1383 #endif 1384 #if 201103L <= YY_CPLUSPLUS 1385 static 1386 symbol_type make_YYUNDEF(location_type l)1387 make_YYUNDEF (location_type l) 1388 { 1389 return symbol_type (token::TOK_YYUNDEF, std::move (l)); 1390 } 1391 #else 1392 static 1393 symbol_type make_YYUNDEF(const location_type & l)1394 make_YYUNDEF (const location_type& l) 1395 { 1396 return symbol_type (token::TOK_YYUNDEF, l); 1397 } 1398 #endif 1399 #if 201103L <= YY_CPLUSPLUS 1400 static 1401 symbol_type make_NEWLINE(location_type l)1402 make_NEWLINE (location_type l) 1403 { 1404 return symbol_type (token::TOK_NEWLINE, std::move (l)); 1405 } 1406 #else 1407 static 1408 symbol_type make_NEWLINE(const location_type & l)1409 make_NEWLINE (const location_type& l) 1410 { 1411 return symbol_type (token::TOK_NEWLINE, l); 1412 } 1413 #endif 1414 #if 201103L <= YY_CPLUSPLUS 1415 static 1416 symbol_type make_COMMA(location_type l)1417 make_COMMA (location_type l) 1418 { 1419 return symbol_type (token::TOK_COMMA, std::move (l)); 1420 } 1421 #else 1422 static 1423 symbol_type make_COMMA(const location_type & l)1424 make_COMMA (const location_type& l) 1425 { 1426 return symbol_type (token::TOK_COMMA, l); 1427 } 1428 #endif 1429 #if 201103L <= YY_CPLUSPLUS 1430 static 1431 symbol_type make_COLON(location_type l)1432 make_COLON (location_type l) 1433 { 1434 return symbol_type (token::TOK_COLON, std::move (l)); 1435 } 1436 #else 1437 static 1438 symbol_type make_COLON(const location_type & l)1439 make_COLON (const location_type& l) 1440 { 1441 return symbol_type (token::TOK_COLON, l); 1442 } 1443 #endif 1444 #if 201103L <= YY_CPLUSPLUS 1445 static 1446 symbol_type make_LPAREN(location_type l)1447 make_LPAREN (location_type l) 1448 { 1449 return symbol_type (token::TOK_LPAREN, std::move (l)); 1450 } 1451 #else 1452 static 1453 symbol_type make_LPAREN(const location_type & l)1454 make_LPAREN (const location_type& l) 1455 { 1456 return symbol_type (token::TOK_LPAREN, l); 1457 } 1458 #endif 1459 #if 201103L <= YY_CPLUSPLUS 1460 static 1461 symbol_type make_RPAREN(location_type l)1462 make_RPAREN (location_type l) 1463 { 1464 return symbol_type (token::TOK_RPAREN, std::move (l)); 1465 } 1466 #else 1467 static 1468 symbol_type make_RPAREN(const location_type & l)1469 make_RPAREN (const location_type& l) 1470 { 1471 return symbol_type (token::TOK_RPAREN, l); 1472 } 1473 #endif 1474 #if 201103L <= YY_CPLUSPLUS 1475 static 1476 symbol_type make_LBRACKET(location_type l)1477 make_LBRACKET (location_type l) 1478 { 1479 return symbol_type (token::TOK_LBRACKET, std::move (l)); 1480 } 1481 #else 1482 static 1483 symbol_type make_LBRACKET(const location_type & l)1484 make_LBRACKET (const location_type& l) 1485 { 1486 return symbol_type (token::TOK_LBRACKET, l); 1487 } 1488 #endif 1489 #if 201103L <= YY_CPLUSPLUS 1490 static 1491 symbol_type make_RBRACKET(location_type l)1492 make_RBRACKET (location_type l) 1493 { 1494 return symbol_type (token::TOK_RBRACKET, std::move (l)); 1495 } 1496 #else 1497 static 1498 symbol_type make_RBRACKET(const location_type & l)1499 make_RBRACKET (const location_type& l) 1500 { 1501 return symbol_type (token::TOK_RBRACKET, l); 1502 } 1503 #endif 1504 #if 201103L <= YY_CPLUSPLUS 1505 static 1506 symbol_type make_PLUS(location_type l)1507 make_PLUS (location_type l) 1508 { 1509 return symbol_type (token::TOK_PLUS, std::move (l)); 1510 } 1511 #else 1512 static 1513 symbol_type make_PLUS(const location_type & l)1514 make_PLUS (const location_type& l) 1515 { 1516 return symbol_type (token::TOK_PLUS, l); 1517 } 1518 #endif 1519 #if 201103L <= YY_CPLUSPLUS 1520 static 1521 symbol_type make_MINUS(location_type l)1522 make_MINUS (location_type l) 1523 { 1524 return symbol_type (token::TOK_MINUS, std::move (l)); 1525 } 1526 #else 1527 static 1528 symbol_type make_MINUS(const location_type & l)1529 make_MINUS (const location_type& l) 1530 { 1531 return symbol_type (token::TOK_MINUS, l); 1532 } 1533 #endif 1534 #if 201103L <= YY_CPLUSPLUS 1535 static 1536 symbol_type make_MULTIPLY(location_type l)1537 make_MULTIPLY (location_type l) 1538 { 1539 return symbol_type (token::TOK_MULTIPLY, std::move (l)); 1540 } 1541 #else 1542 static 1543 symbol_type make_MULTIPLY(const location_type & l)1544 make_MULTIPLY (const location_type& l) 1545 { 1546 return symbol_type (token::TOK_MULTIPLY, l); 1547 } 1548 #endif 1549 #if 201103L <= YY_CPLUSPLUS 1550 static 1551 symbol_type make_DIVIDE(location_type l)1552 make_DIVIDE (location_type l) 1553 { 1554 return symbol_type (token::TOK_DIVIDE, std::move (l)); 1555 } 1556 #else 1557 static 1558 symbol_type make_DIVIDE(const location_type & l)1559 make_DIVIDE (const location_type& l) 1560 { 1561 return symbol_type (token::TOK_DIVIDE, l); 1562 } 1563 #endif 1564 #if 201103L <= YY_CPLUSPLUS 1565 static 1566 symbol_type make_OR(location_type l)1567 make_OR (location_type l) 1568 { 1569 return symbol_type (token::TOK_OR, std::move (l)); 1570 } 1571 #else 1572 static 1573 symbol_type make_OR(const location_type & l)1574 make_OR (const location_type& l) 1575 { 1576 return symbol_type (token::TOK_OR, l); 1577 } 1578 #endif 1579 #if 201103L <= YY_CPLUSPLUS 1580 static 1581 symbol_type make_AND(location_type l)1582 make_AND (location_type l) 1583 { 1584 return symbol_type (token::TOK_AND, std::move (l)); 1585 } 1586 #else 1587 static 1588 symbol_type make_AND(const location_type & l)1589 make_AND (const location_type& l) 1590 { 1591 return symbol_type (token::TOK_AND, l); 1592 } 1593 #endif 1594 #if 201103L <= YY_CPLUSPLUS 1595 static 1596 symbol_type make_XOR(location_type l)1597 make_XOR (location_type l) 1598 { 1599 return symbol_type (token::TOK_XOR, std::move (l)); 1600 } 1601 #else 1602 static 1603 symbol_type make_XOR(const location_type & l)1604 make_XOR (const location_type& l) 1605 { 1606 return symbol_type (token::TOK_XOR, l); 1607 } 1608 #endif 1609 #if 201103L <= YY_CPLUSPLUS 1610 static 1611 symbol_type make_SHL(location_type l)1612 make_SHL (location_type l) 1613 { 1614 return symbol_type (token::TOK_SHL, std::move (l)); 1615 } 1616 #else 1617 static 1618 symbol_type make_SHL(const location_type & l)1619 make_SHL (const location_type& l) 1620 { 1621 return symbol_type (token::TOK_SHL, l); 1622 } 1623 #endif 1624 #if 201103L <= YY_CPLUSPLUS 1625 static 1626 symbol_type make_SHR(location_type l)1627 make_SHR (location_type l) 1628 { 1629 return symbol_type (token::TOK_SHR, std::move (l)); 1630 } 1631 #else 1632 static 1633 symbol_type make_SHR(const location_type & l)1634 make_SHR (const location_type& l) 1635 { 1636 return symbol_type (token::TOK_SHR, l); 1637 } 1638 #endif 1639 #if 201103L <= YY_CPLUSPLUS 1640 static 1641 symbol_type make_POST_DECREMENT(location_type l)1642 make_POST_DECREMENT (location_type l) 1643 { 1644 return symbol_type (token::TOK_POST_DECREMENT, std::move (l)); 1645 } 1646 #else 1647 static 1648 symbol_type make_POST_DECREMENT(const location_type & l)1649 make_POST_DECREMENT (const location_type& l) 1650 { 1651 return symbol_type (token::TOK_POST_DECREMENT, l); 1652 } 1653 #endif 1654 #if 201103L <= YY_CPLUSPLUS 1655 static 1656 symbol_type make_NOT_EQUAL(location_type l)1657 make_NOT_EQUAL (location_type l) 1658 { 1659 return symbol_type (token::TOK_NOT_EQUAL, std::move (l)); 1660 } 1661 #else 1662 static 1663 symbol_type make_NOT_EQUAL(const location_type & l)1664 make_NOT_EQUAL (const location_type& l) 1665 { 1666 return symbol_type (token::TOK_NOT_EQUAL, l); 1667 } 1668 #endif 1669 #if 201103L <= YY_CPLUSPLUS 1670 static 1671 symbol_type make_NOT(location_type l)1672 make_NOT (location_type l) 1673 { 1674 return symbol_type (token::TOK_NOT, std::move (l)); 1675 } 1676 #else 1677 static 1678 symbol_type make_NOT(const location_type & l)1679 make_NOT (const location_type& l) 1680 { 1681 return symbol_type (token::TOK_NOT, l); 1682 } 1683 #endif 1684 #if 201103L <= YY_CPLUSPLUS 1685 static 1686 symbol_type make_REVERSE(location_type l)1687 make_REVERSE (location_type l) 1688 { 1689 return symbol_type (token::TOK_REVERSE, std::move (l)); 1690 } 1691 #else 1692 static 1693 symbol_type make_REVERSE(const location_type & l)1694 make_REVERSE (const location_type& l) 1695 { 1696 return symbol_type (token::TOK_REVERSE, l); 1697 } 1698 #endif 1699 #if 201103L <= YY_CPLUSPLUS 1700 static 1701 symbol_type make_ASSIGN(location_type l)1702 make_ASSIGN (location_type l) 1703 { 1704 return symbol_type (token::TOK_ASSIGN, std::move (l)); 1705 } 1706 #else 1707 static 1708 symbol_type make_ASSIGN(const location_type & l)1709 make_ASSIGN (const location_type& l) 1710 { 1711 return symbol_type (token::TOK_ASSIGN, l); 1712 } 1713 #endif 1714 #if 201103L <= YY_CPLUSPLUS 1715 static 1716 symbol_type make_LESSTHAN(location_type l)1717 make_LESSTHAN (location_type l) 1718 { 1719 return symbol_type (token::TOK_LESSTHAN, std::move (l)); 1720 } 1721 #else 1722 static 1723 symbol_type make_LESSTHAN(const location_type & l)1724 make_LESSTHAN (const location_type& l) 1725 { 1726 return symbol_type (token::TOK_LESSTHAN, l); 1727 } 1728 #endif 1729 #if 201103L <= YY_CPLUSPLUS 1730 static 1731 symbol_type make_PROGRAM(location_type l)1732 make_PROGRAM (location_type l) 1733 { 1734 return symbol_type (token::TOK_PROGRAM, std::move (l)); 1735 } 1736 #else 1737 static 1738 symbol_type make_PROGRAM(const location_type & l)1739 make_PROGRAM (const location_type& l) 1740 { 1741 return symbol_type (token::TOK_PROGRAM, l); 1742 } 1743 #endif 1744 #if 201103L <= YY_CPLUSPLUS 1745 static 1746 symbol_type make_WRAP_TARGET(location_type l)1747 make_WRAP_TARGET (location_type l) 1748 { 1749 return symbol_type (token::TOK_WRAP_TARGET, std::move (l)); 1750 } 1751 #else 1752 static 1753 symbol_type make_WRAP_TARGET(const location_type & l)1754 make_WRAP_TARGET (const location_type& l) 1755 { 1756 return symbol_type (token::TOK_WRAP_TARGET, l); 1757 } 1758 #endif 1759 #if 201103L <= YY_CPLUSPLUS 1760 static 1761 symbol_type make_WRAP(location_type l)1762 make_WRAP (location_type l) 1763 { 1764 return symbol_type (token::TOK_WRAP, std::move (l)); 1765 } 1766 #else 1767 static 1768 symbol_type make_WRAP(const location_type & l)1769 make_WRAP (const location_type& l) 1770 { 1771 return symbol_type (token::TOK_WRAP, l); 1772 } 1773 #endif 1774 #if 201103L <= YY_CPLUSPLUS 1775 static 1776 symbol_type make_DEFINE(location_type l)1777 make_DEFINE (location_type l) 1778 { 1779 return symbol_type (token::TOK_DEFINE, std::move (l)); 1780 } 1781 #else 1782 static 1783 symbol_type make_DEFINE(const location_type & l)1784 make_DEFINE (const location_type& l) 1785 { 1786 return symbol_type (token::TOK_DEFINE, l); 1787 } 1788 #endif 1789 #if 201103L <= YY_CPLUSPLUS 1790 static 1791 symbol_type make_SIDE_SET(location_type l)1792 make_SIDE_SET (location_type l) 1793 { 1794 return symbol_type (token::TOK_SIDE_SET, std::move (l)); 1795 } 1796 #else 1797 static 1798 symbol_type make_SIDE_SET(const location_type & l)1799 make_SIDE_SET (const location_type& l) 1800 { 1801 return symbol_type (token::TOK_SIDE_SET, l); 1802 } 1803 #endif 1804 #if 201103L <= YY_CPLUSPLUS 1805 static 1806 symbol_type make_WORD(location_type l)1807 make_WORD (location_type l) 1808 { 1809 return symbol_type (token::TOK_WORD, std::move (l)); 1810 } 1811 #else 1812 static 1813 symbol_type make_WORD(const location_type & l)1814 make_WORD (const location_type& l) 1815 { 1816 return symbol_type (token::TOK_WORD, l); 1817 } 1818 #endif 1819 #if 201103L <= YY_CPLUSPLUS 1820 static 1821 symbol_type make_ORIGIN(location_type l)1822 make_ORIGIN (location_type l) 1823 { 1824 return symbol_type (token::TOK_ORIGIN, std::move (l)); 1825 } 1826 #else 1827 static 1828 symbol_type make_ORIGIN(const location_type & l)1829 make_ORIGIN (const location_type& l) 1830 { 1831 return symbol_type (token::TOK_ORIGIN, l); 1832 } 1833 #endif 1834 #if 201103L <= YY_CPLUSPLUS 1835 static 1836 symbol_type make_LANG_OPT(location_type l)1837 make_LANG_OPT (location_type l) 1838 { 1839 return symbol_type (token::TOK_LANG_OPT, std::move (l)); 1840 } 1841 #else 1842 static 1843 symbol_type make_LANG_OPT(const location_type & l)1844 make_LANG_OPT (const location_type& l) 1845 { 1846 return symbol_type (token::TOK_LANG_OPT, l); 1847 } 1848 #endif 1849 #if 201103L <= YY_CPLUSPLUS 1850 static 1851 symbol_type make_PIO_VERSION(location_type l)1852 make_PIO_VERSION (location_type l) 1853 { 1854 return symbol_type (token::TOK_PIO_VERSION, std::move (l)); 1855 } 1856 #else 1857 static 1858 symbol_type make_PIO_VERSION(const location_type & l)1859 make_PIO_VERSION (const location_type& l) 1860 { 1861 return symbol_type (token::TOK_PIO_VERSION, l); 1862 } 1863 #endif 1864 #if 201103L <= YY_CPLUSPLUS 1865 static 1866 symbol_type make_CLOCK_DIV(location_type l)1867 make_CLOCK_DIV (location_type l) 1868 { 1869 return symbol_type (token::TOK_CLOCK_DIV, std::move (l)); 1870 } 1871 #else 1872 static 1873 symbol_type make_CLOCK_DIV(const location_type & l)1874 make_CLOCK_DIV (const location_type& l) 1875 { 1876 return symbol_type (token::TOK_CLOCK_DIV, l); 1877 } 1878 #endif 1879 #if 201103L <= YY_CPLUSPLUS 1880 static 1881 symbol_type make_FIFO(location_type l)1882 make_FIFO (location_type l) 1883 { 1884 return symbol_type (token::TOK_FIFO, std::move (l)); 1885 } 1886 #else 1887 static 1888 symbol_type make_FIFO(const location_type & l)1889 make_FIFO (const location_type& l) 1890 { 1891 return symbol_type (token::TOK_FIFO, l); 1892 } 1893 #endif 1894 #if 201103L <= YY_CPLUSPLUS 1895 static 1896 symbol_type make_MOV_STATUS(location_type l)1897 make_MOV_STATUS (location_type l) 1898 { 1899 return symbol_type (token::TOK_MOV_STATUS, std::move (l)); 1900 } 1901 #else 1902 static 1903 symbol_type make_MOV_STATUS(const location_type & l)1904 make_MOV_STATUS (const location_type& l) 1905 { 1906 return symbol_type (token::TOK_MOV_STATUS, l); 1907 } 1908 #endif 1909 #if 201103L <= YY_CPLUSPLUS 1910 static 1911 symbol_type make_DOT_SET(location_type l)1912 make_DOT_SET (location_type l) 1913 { 1914 return symbol_type (token::TOK_DOT_SET, std::move (l)); 1915 } 1916 #else 1917 static 1918 symbol_type make_DOT_SET(const location_type & l)1919 make_DOT_SET (const location_type& l) 1920 { 1921 return symbol_type (token::TOK_DOT_SET, l); 1922 } 1923 #endif 1924 #if 201103L <= YY_CPLUSPLUS 1925 static 1926 symbol_type make_DOT_OUT(location_type l)1927 make_DOT_OUT (location_type l) 1928 { 1929 return symbol_type (token::TOK_DOT_OUT, std::move (l)); 1930 } 1931 #else 1932 static 1933 symbol_type make_DOT_OUT(const location_type & l)1934 make_DOT_OUT (const location_type& l) 1935 { 1936 return symbol_type (token::TOK_DOT_OUT, l); 1937 } 1938 #endif 1939 #if 201103L <= YY_CPLUSPLUS 1940 static 1941 symbol_type make_DOT_IN(location_type l)1942 make_DOT_IN (location_type l) 1943 { 1944 return symbol_type (token::TOK_DOT_IN, std::move (l)); 1945 } 1946 #else 1947 static 1948 symbol_type make_DOT_IN(const location_type & l)1949 make_DOT_IN (const location_type& l) 1950 { 1951 return symbol_type (token::TOK_DOT_IN, l); 1952 } 1953 #endif 1954 #if 201103L <= YY_CPLUSPLUS 1955 static 1956 symbol_type make_JMP(location_type l)1957 make_JMP (location_type l) 1958 { 1959 return symbol_type (token::TOK_JMP, std::move (l)); 1960 } 1961 #else 1962 static 1963 symbol_type make_JMP(const location_type & l)1964 make_JMP (const location_type& l) 1965 { 1966 return symbol_type (token::TOK_JMP, l); 1967 } 1968 #endif 1969 #if 201103L <= YY_CPLUSPLUS 1970 static 1971 symbol_type make_WAIT(location_type l)1972 make_WAIT (location_type l) 1973 { 1974 return symbol_type (token::TOK_WAIT, std::move (l)); 1975 } 1976 #else 1977 static 1978 symbol_type make_WAIT(const location_type & l)1979 make_WAIT (const location_type& l) 1980 { 1981 return symbol_type (token::TOK_WAIT, l); 1982 } 1983 #endif 1984 #if 201103L <= YY_CPLUSPLUS 1985 static 1986 symbol_type make_IN(location_type l)1987 make_IN (location_type l) 1988 { 1989 return symbol_type (token::TOK_IN, std::move (l)); 1990 } 1991 #else 1992 static 1993 symbol_type make_IN(const location_type & l)1994 make_IN (const location_type& l) 1995 { 1996 return symbol_type (token::TOK_IN, l); 1997 } 1998 #endif 1999 #if 201103L <= YY_CPLUSPLUS 2000 static 2001 symbol_type make_OUT(location_type l)2002 make_OUT (location_type l) 2003 { 2004 return symbol_type (token::TOK_OUT, std::move (l)); 2005 } 2006 #else 2007 static 2008 symbol_type make_OUT(const location_type & l)2009 make_OUT (const location_type& l) 2010 { 2011 return symbol_type (token::TOK_OUT, l); 2012 } 2013 #endif 2014 #if 201103L <= YY_CPLUSPLUS 2015 static 2016 symbol_type make_PUSH(location_type l)2017 make_PUSH (location_type l) 2018 { 2019 return symbol_type (token::TOK_PUSH, std::move (l)); 2020 } 2021 #else 2022 static 2023 symbol_type make_PUSH(const location_type & l)2024 make_PUSH (const location_type& l) 2025 { 2026 return symbol_type (token::TOK_PUSH, l); 2027 } 2028 #endif 2029 #if 201103L <= YY_CPLUSPLUS 2030 static 2031 symbol_type make_PULL(location_type l)2032 make_PULL (location_type l) 2033 { 2034 return symbol_type (token::TOK_PULL, std::move (l)); 2035 } 2036 #else 2037 static 2038 symbol_type make_PULL(const location_type & l)2039 make_PULL (const location_type& l) 2040 { 2041 return symbol_type (token::TOK_PULL, l); 2042 } 2043 #endif 2044 #if 201103L <= YY_CPLUSPLUS 2045 static 2046 symbol_type make_MOV(location_type l)2047 make_MOV (location_type l) 2048 { 2049 return symbol_type (token::TOK_MOV, std::move (l)); 2050 } 2051 #else 2052 static 2053 symbol_type make_MOV(const location_type & l)2054 make_MOV (const location_type& l) 2055 { 2056 return symbol_type (token::TOK_MOV, l); 2057 } 2058 #endif 2059 #if 201103L <= YY_CPLUSPLUS 2060 static 2061 symbol_type make_IRQ(location_type l)2062 make_IRQ (location_type l) 2063 { 2064 return symbol_type (token::TOK_IRQ, std::move (l)); 2065 } 2066 #else 2067 static 2068 symbol_type make_IRQ(const location_type & l)2069 make_IRQ (const location_type& l) 2070 { 2071 return symbol_type (token::TOK_IRQ, l); 2072 } 2073 #endif 2074 #if 201103L <= YY_CPLUSPLUS 2075 static 2076 symbol_type make_SET(location_type l)2077 make_SET (location_type l) 2078 { 2079 return symbol_type (token::TOK_SET, std::move (l)); 2080 } 2081 #else 2082 static 2083 symbol_type make_SET(const location_type & l)2084 make_SET (const location_type& l) 2085 { 2086 return symbol_type (token::TOK_SET, l); 2087 } 2088 #endif 2089 #if 201103L <= YY_CPLUSPLUS 2090 static 2091 symbol_type make_NOP(location_type l)2092 make_NOP (location_type l) 2093 { 2094 return symbol_type (token::TOK_NOP, std::move (l)); 2095 } 2096 #else 2097 static 2098 symbol_type make_NOP(const location_type & l)2099 make_NOP (const location_type& l) 2100 { 2101 return symbol_type (token::TOK_NOP, l); 2102 } 2103 #endif 2104 #if 201103L <= YY_CPLUSPLUS 2105 static 2106 symbol_type make_PIN(location_type l)2107 make_PIN (location_type l) 2108 { 2109 return symbol_type (token::TOK_PIN, std::move (l)); 2110 } 2111 #else 2112 static 2113 symbol_type make_PIN(const location_type & l)2114 make_PIN (const location_type& l) 2115 { 2116 return symbol_type (token::TOK_PIN, l); 2117 } 2118 #endif 2119 #if 201103L <= YY_CPLUSPLUS 2120 static 2121 symbol_type make_GPIO(location_type l)2122 make_GPIO (location_type l) 2123 { 2124 return symbol_type (token::TOK_GPIO, std::move (l)); 2125 } 2126 #else 2127 static 2128 symbol_type make_GPIO(const location_type & l)2129 make_GPIO (const location_type& l) 2130 { 2131 return symbol_type (token::TOK_GPIO, l); 2132 } 2133 #endif 2134 #if 201103L <= YY_CPLUSPLUS 2135 static 2136 symbol_type make_OSRE(location_type l)2137 make_OSRE (location_type l) 2138 { 2139 return symbol_type (token::TOK_OSRE, std::move (l)); 2140 } 2141 #else 2142 static 2143 symbol_type make_OSRE(const location_type & l)2144 make_OSRE (const location_type& l) 2145 { 2146 return symbol_type (token::TOK_OSRE, l); 2147 } 2148 #endif 2149 #if 201103L <= YY_CPLUSPLUS 2150 static 2151 symbol_type make_JMPPIN(location_type l)2152 make_JMPPIN (location_type l) 2153 { 2154 return symbol_type (token::TOK_JMPPIN, std::move (l)); 2155 } 2156 #else 2157 static 2158 symbol_type make_JMPPIN(const location_type & l)2159 make_JMPPIN (const location_type& l) 2160 { 2161 return symbol_type (token::TOK_JMPPIN, l); 2162 } 2163 #endif 2164 #if 201103L <= YY_CPLUSPLUS 2165 static 2166 symbol_type make_PREV(location_type l)2167 make_PREV (location_type l) 2168 { 2169 return symbol_type (token::TOK_PREV, std::move (l)); 2170 } 2171 #else 2172 static 2173 symbol_type make_PREV(const location_type & l)2174 make_PREV (const location_type& l) 2175 { 2176 return symbol_type (token::TOK_PREV, l); 2177 } 2178 #endif 2179 #if 201103L <= YY_CPLUSPLUS 2180 static 2181 symbol_type make_NEXT(location_type l)2182 make_NEXT (location_type l) 2183 { 2184 return symbol_type (token::TOK_NEXT, std::move (l)); 2185 } 2186 #else 2187 static 2188 symbol_type make_NEXT(const location_type & l)2189 make_NEXT (const location_type& l) 2190 { 2191 return symbol_type (token::TOK_NEXT, l); 2192 } 2193 #endif 2194 #if 201103L <= YY_CPLUSPLUS 2195 static 2196 symbol_type make_PINS(location_type l)2197 make_PINS (location_type l) 2198 { 2199 return symbol_type (token::TOK_PINS, std::move (l)); 2200 } 2201 #else 2202 static 2203 symbol_type make_PINS(const location_type & l)2204 make_PINS (const location_type& l) 2205 { 2206 return symbol_type (token::TOK_PINS, l); 2207 } 2208 #endif 2209 #if 201103L <= YY_CPLUSPLUS 2210 static 2211 symbol_type make_NULL(location_type l)2212 make_NULL (location_type l) 2213 { 2214 return symbol_type (token::TOK_NULL, std::move (l)); 2215 } 2216 #else 2217 static 2218 symbol_type make_NULL(const location_type & l)2219 make_NULL (const location_type& l) 2220 { 2221 return symbol_type (token::TOK_NULL, l); 2222 } 2223 #endif 2224 #if 201103L <= YY_CPLUSPLUS 2225 static 2226 symbol_type make_PINDIRS(location_type l)2227 make_PINDIRS (location_type l) 2228 { 2229 return symbol_type (token::TOK_PINDIRS, std::move (l)); 2230 } 2231 #else 2232 static 2233 symbol_type make_PINDIRS(const location_type & l)2234 make_PINDIRS (const location_type& l) 2235 { 2236 return symbol_type (token::TOK_PINDIRS, l); 2237 } 2238 #endif 2239 #if 201103L <= YY_CPLUSPLUS 2240 static 2241 symbol_type make_BLOCK(location_type l)2242 make_BLOCK (location_type l) 2243 { 2244 return symbol_type (token::TOK_BLOCK, std::move (l)); 2245 } 2246 #else 2247 static 2248 symbol_type make_BLOCK(const location_type & l)2249 make_BLOCK (const location_type& l) 2250 { 2251 return symbol_type (token::TOK_BLOCK, l); 2252 } 2253 #endif 2254 #if 201103L <= YY_CPLUSPLUS 2255 static 2256 symbol_type make_NOBLOCK(location_type l)2257 make_NOBLOCK (location_type l) 2258 { 2259 return symbol_type (token::TOK_NOBLOCK, std::move (l)); 2260 } 2261 #else 2262 static 2263 symbol_type make_NOBLOCK(const location_type & l)2264 make_NOBLOCK (const location_type& l) 2265 { 2266 return symbol_type (token::TOK_NOBLOCK, l); 2267 } 2268 #endif 2269 #if 201103L <= YY_CPLUSPLUS 2270 static 2271 symbol_type make_IFEMPTY(location_type l)2272 make_IFEMPTY (location_type l) 2273 { 2274 return symbol_type (token::TOK_IFEMPTY, std::move (l)); 2275 } 2276 #else 2277 static 2278 symbol_type make_IFEMPTY(const location_type & l)2279 make_IFEMPTY (const location_type& l) 2280 { 2281 return symbol_type (token::TOK_IFEMPTY, l); 2282 } 2283 #endif 2284 #if 201103L <= YY_CPLUSPLUS 2285 static 2286 symbol_type make_IFFULL(location_type l)2287 make_IFFULL (location_type l) 2288 { 2289 return symbol_type (token::TOK_IFFULL, std::move (l)); 2290 } 2291 #else 2292 static 2293 symbol_type make_IFFULL(const location_type & l)2294 make_IFFULL (const location_type& l) 2295 { 2296 return symbol_type (token::TOK_IFFULL, l); 2297 } 2298 #endif 2299 #if 201103L <= YY_CPLUSPLUS 2300 static 2301 symbol_type make_NOWAIT(location_type l)2302 make_NOWAIT (location_type l) 2303 { 2304 return symbol_type (token::TOK_NOWAIT, std::move (l)); 2305 } 2306 #else 2307 static 2308 symbol_type make_NOWAIT(const location_type & l)2309 make_NOWAIT (const location_type& l) 2310 { 2311 return symbol_type (token::TOK_NOWAIT, l); 2312 } 2313 #endif 2314 #if 201103L <= YY_CPLUSPLUS 2315 static 2316 symbol_type make_CLEAR(location_type l)2317 make_CLEAR (location_type l) 2318 { 2319 return symbol_type (token::TOK_CLEAR, std::move (l)); 2320 } 2321 #else 2322 static 2323 symbol_type make_CLEAR(const location_type & l)2324 make_CLEAR (const location_type& l) 2325 { 2326 return symbol_type (token::TOK_CLEAR, l); 2327 } 2328 #endif 2329 #if 201103L <= YY_CPLUSPLUS 2330 static 2331 symbol_type make_REL(location_type l)2332 make_REL (location_type l) 2333 { 2334 return symbol_type (token::TOK_REL, std::move (l)); 2335 } 2336 #else 2337 static 2338 symbol_type make_REL(const location_type & l)2339 make_REL (const location_type& l) 2340 { 2341 return symbol_type (token::TOK_REL, l); 2342 } 2343 #endif 2344 #if 201103L <= YY_CPLUSPLUS 2345 static 2346 symbol_type make_X(location_type l)2347 make_X (location_type l) 2348 { 2349 return symbol_type (token::TOK_X, std::move (l)); 2350 } 2351 #else 2352 static 2353 symbol_type make_X(const location_type & l)2354 make_X (const location_type& l) 2355 { 2356 return symbol_type (token::TOK_X, l); 2357 } 2358 #endif 2359 #if 201103L <= YY_CPLUSPLUS 2360 static 2361 symbol_type make_Y(location_type l)2362 make_Y (location_type l) 2363 { 2364 return symbol_type (token::TOK_Y, std::move (l)); 2365 } 2366 #else 2367 static 2368 symbol_type make_Y(const location_type & l)2369 make_Y (const location_type& l) 2370 { 2371 return symbol_type (token::TOK_Y, l); 2372 } 2373 #endif 2374 #if 201103L <= YY_CPLUSPLUS 2375 static 2376 symbol_type make_EXEC(location_type l)2377 make_EXEC (location_type l) 2378 { 2379 return symbol_type (token::TOK_EXEC, std::move (l)); 2380 } 2381 #else 2382 static 2383 symbol_type make_EXEC(const location_type & l)2384 make_EXEC (const location_type& l) 2385 { 2386 return symbol_type (token::TOK_EXEC, l); 2387 } 2388 #endif 2389 #if 201103L <= YY_CPLUSPLUS 2390 static 2391 symbol_type make_PC(location_type l)2392 make_PC (location_type l) 2393 { 2394 return symbol_type (token::TOK_PC, std::move (l)); 2395 } 2396 #else 2397 static 2398 symbol_type make_PC(const location_type & l)2399 make_PC (const location_type& l) 2400 { 2401 return symbol_type (token::TOK_PC, l); 2402 } 2403 #endif 2404 #if 201103L <= YY_CPLUSPLUS 2405 static 2406 symbol_type make_ISR(location_type l)2407 make_ISR (location_type l) 2408 { 2409 return symbol_type (token::TOK_ISR, std::move (l)); 2410 } 2411 #else 2412 static 2413 symbol_type make_ISR(const location_type & l)2414 make_ISR (const location_type& l) 2415 { 2416 return symbol_type (token::TOK_ISR, l); 2417 } 2418 #endif 2419 #if 201103L <= YY_CPLUSPLUS 2420 static 2421 symbol_type make_OSR(location_type l)2422 make_OSR (location_type l) 2423 { 2424 return symbol_type (token::TOK_OSR, std::move (l)); 2425 } 2426 #else 2427 static 2428 symbol_type make_OSR(const location_type & l)2429 make_OSR (const location_type& l) 2430 { 2431 return symbol_type (token::TOK_OSR, l); 2432 } 2433 #endif 2434 #if 201103L <= YY_CPLUSPLUS 2435 static 2436 symbol_type make_OPTIONAL(location_type l)2437 make_OPTIONAL (location_type l) 2438 { 2439 return symbol_type (token::TOK_OPTIONAL, std::move (l)); 2440 } 2441 #else 2442 static 2443 symbol_type make_OPTIONAL(const location_type & l)2444 make_OPTIONAL (const location_type& l) 2445 { 2446 return symbol_type (token::TOK_OPTIONAL, l); 2447 } 2448 #endif 2449 #if 201103L <= YY_CPLUSPLUS 2450 static 2451 symbol_type make_SIDE(location_type l)2452 make_SIDE (location_type l) 2453 { 2454 return symbol_type (token::TOK_SIDE, std::move (l)); 2455 } 2456 #else 2457 static 2458 symbol_type make_SIDE(const location_type & l)2459 make_SIDE (const location_type& l) 2460 { 2461 return symbol_type (token::TOK_SIDE, l); 2462 } 2463 #endif 2464 #if 201103L <= YY_CPLUSPLUS 2465 static 2466 symbol_type make_STATUS(location_type l)2467 make_STATUS (location_type l) 2468 { 2469 return symbol_type (token::TOK_STATUS, std::move (l)); 2470 } 2471 #else 2472 static 2473 symbol_type make_STATUS(const location_type & l)2474 make_STATUS (const location_type& l) 2475 { 2476 return symbol_type (token::TOK_STATUS, l); 2477 } 2478 #endif 2479 #if 201103L <= YY_CPLUSPLUS 2480 static 2481 symbol_type make_PUBLIC(location_type l)2482 make_PUBLIC (location_type l) 2483 { 2484 return symbol_type (token::TOK_PUBLIC, std::move (l)); 2485 } 2486 #else 2487 static 2488 symbol_type make_PUBLIC(const location_type & l)2489 make_PUBLIC (const location_type& l) 2490 { 2491 return symbol_type (token::TOK_PUBLIC, l); 2492 } 2493 #endif 2494 #if 201103L <= YY_CPLUSPLUS 2495 static 2496 symbol_type make_RP2040(location_type l)2497 make_RP2040 (location_type l) 2498 { 2499 return symbol_type (token::TOK_RP2040, std::move (l)); 2500 } 2501 #else 2502 static 2503 symbol_type make_RP2040(const location_type & l)2504 make_RP2040 (const location_type& l) 2505 { 2506 return symbol_type (token::TOK_RP2040, l); 2507 } 2508 #endif 2509 #if 201103L <= YY_CPLUSPLUS 2510 static 2511 symbol_type make_RP2350(location_type l)2512 make_RP2350 (location_type l) 2513 { 2514 return symbol_type (token::TOK_RP2350, std::move (l)); 2515 } 2516 #else 2517 static 2518 symbol_type make_RP2350(const location_type & l)2519 make_RP2350 (const location_type& l) 2520 { 2521 return symbol_type (token::TOK_RP2350, l); 2522 } 2523 #endif 2524 #if 201103L <= YY_CPLUSPLUS 2525 static 2526 symbol_type make_RXFIFO(location_type l)2527 make_RXFIFO (location_type l) 2528 { 2529 return symbol_type (token::TOK_RXFIFO, std::move (l)); 2530 } 2531 #else 2532 static 2533 symbol_type make_RXFIFO(const location_type & l)2534 make_RXFIFO (const location_type& l) 2535 { 2536 return symbol_type (token::TOK_RXFIFO, l); 2537 } 2538 #endif 2539 #if 201103L <= YY_CPLUSPLUS 2540 static 2541 symbol_type make_TXFIFO(location_type l)2542 make_TXFIFO (location_type l) 2543 { 2544 return symbol_type (token::TOK_TXFIFO, std::move (l)); 2545 } 2546 #else 2547 static 2548 symbol_type make_TXFIFO(const location_type & l)2549 make_TXFIFO (const location_type& l) 2550 { 2551 return symbol_type (token::TOK_TXFIFO, l); 2552 } 2553 #endif 2554 #if 201103L <= YY_CPLUSPLUS 2555 static 2556 symbol_type make_TXRX(location_type l)2557 make_TXRX (location_type l) 2558 { 2559 return symbol_type (token::TOK_TXRX, std::move (l)); 2560 } 2561 #else 2562 static 2563 symbol_type make_TXRX(const location_type & l)2564 make_TXRX (const location_type& l) 2565 { 2566 return symbol_type (token::TOK_TXRX, l); 2567 } 2568 #endif 2569 #if 201103L <= YY_CPLUSPLUS 2570 static 2571 symbol_type make_TX(location_type l)2572 make_TX (location_type l) 2573 { 2574 return symbol_type (token::TOK_TX, std::move (l)); 2575 } 2576 #else 2577 static 2578 symbol_type make_TX(const location_type & l)2579 make_TX (const location_type& l) 2580 { 2581 return symbol_type (token::TOK_TX, l); 2582 } 2583 #endif 2584 #if 201103L <= YY_CPLUSPLUS 2585 static 2586 symbol_type make_RX(location_type l)2587 make_RX (location_type l) 2588 { 2589 return symbol_type (token::TOK_RX, std::move (l)); 2590 } 2591 #else 2592 static 2593 symbol_type make_RX(const location_type & l)2594 make_RX (const location_type& l) 2595 { 2596 return symbol_type (token::TOK_RX, l); 2597 } 2598 #endif 2599 #if 201103L <= YY_CPLUSPLUS 2600 static 2601 symbol_type make_TXPUT(location_type l)2602 make_TXPUT (location_type l) 2603 { 2604 return symbol_type (token::TOK_TXPUT, std::move (l)); 2605 } 2606 #else 2607 static 2608 symbol_type make_TXPUT(const location_type & l)2609 make_TXPUT (const location_type& l) 2610 { 2611 return symbol_type (token::TOK_TXPUT, l); 2612 } 2613 #endif 2614 #if 201103L <= YY_CPLUSPLUS 2615 static 2616 symbol_type make_TXGET(location_type l)2617 make_TXGET (location_type l) 2618 { 2619 return symbol_type (token::TOK_TXGET, std::move (l)); 2620 } 2621 #else 2622 static 2623 symbol_type make_TXGET(const location_type & l)2624 make_TXGET (const location_type& l) 2625 { 2626 return symbol_type (token::TOK_TXGET, l); 2627 } 2628 #endif 2629 #if 201103L <= YY_CPLUSPLUS 2630 static 2631 symbol_type make_PUTGET(location_type l)2632 make_PUTGET (location_type l) 2633 { 2634 return symbol_type (token::TOK_PUTGET, std::move (l)); 2635 } 2636 #else 2637 static 2638 symbol_type make_PUTGET(const location_type & l)2639 make_PUTGET (const location_type& l) 2640 { 2641 return symbol_type (token::TOK_PUTGET, l); 2642 } 2643 #endif 2644 #if 201103L <= YY_CPLUSPLUS 2645 static 2646 symbol_type make_LEFT(location_type l)2647 make_LEFT (location_type l) 2648 { 2649 return symbol_type (token::TOK_LEFT, std::move (l)); 2650 } 2651 #else 2652 static 2653 symbol_type make_LEFT(const location_type & l)2654 make_LEFT (const location_type& l) 2655 { 2656 return symbol_type (token::TOK_LEFT, l); 2657 } 2658 #endif 2659 #if 201103L <= YY_CPLUSPLUS 2660 static 2661 symbol_type make_RIGHT(location_type l)2662 make_RIGHT (location_type l) 2663 { 2664 return symbol_type (token::TOK_RIGHT, std::move (l)); 2665 } 2666 #else 2667 static 2668 symbol_type make_RIGHT(const location_type & l)2669 make_RIGHT (const location_type& l) 2670 { 2671 return symbol_type (token::TOK_RIGHT, l); 2672 } 2673 #endif 2674 #if 201103L <= YY_CPLUSPLUS 2675 static 2676 symbol_type make_AUTO(location_type l)2677 make_AUTO (location_type l) 2678 { 2679 return symbol_type (token::TOK_AUTO, std::move (l)); 2680 } 2681 #else 2682 static 2683 symbol_type make_AUTO(const location_type & l)2684 make_AUTO (const location_type& l) 2685 { 2686 return symbol_type (token::TOK_AUTO, l); 2687 } 2688 #endif 2689 #if 201103L <= YY_CPLUSPLUS 2690 static 2691 symbol_type make_MANUAL(location_type l)2692 make_MANUAL (location_type l) 2693 { 2694 return symbol_type (token::TOK_MANUAL, std::move (l)); 2695 } 2696 #else 2697 static 2698 symbol_type make_MANUAL(const location_type & l)2699 make_MANUAL (const location_type& l) 2700 { 2701 return symbol_type (token::TOK_MANUAL, l); 2702 } 2703 #endif 2704 #if 201103L <= YY_CPLUSPLUS 2705 static 2706 symbol_type make_ID(std::string v,location_type l)2707 make_ID (std::string v, location_type l) 2708 { 2709 return symbol_type (token::TOK_ID, std::move (v), std::move (l)); 2710 } 2711 #else 2712 static 2713 symbol_type make_ID(const std::string & v,const location_type & l)2714 make_ID (const std::string& v, const location_type& l) 2715 { 2716 return symbol_type (token::TOK_ID, v, l); 2717 } 2718 #endif 2719 #if 201103L <= YY_CPLUSPLUS 2720 static 2721 symbol_type make_STRING(std::string v,location_type l)2722 make_STRING (std::string v, location_type l) 2723 { 2724 return symbol_type (token::TOK_STRING, std::move (v), std::move (l)); 2725 } 2726 #else 2727 static 2728 symbol_type make_STRING(const std::string & v,const location_type & l)2729 make_STRING (const std::string& v, const location_type& l) 2730 { 2731 return symbol_type (token::TOK_STRING, v, l); 2732 } 2733 #endif 2734 #if 201103L <= YY_CPLUSPLUS 2735 static 2736 symbol_type make_NON_WS(std::string v,location_type l)2737 make_NON_WS (std::string v, location_type l) 2738 { 2739 return symbol_type (token::TOK_NON_WS, std::move (v), std::move (l)); 2740 } 2741 #else 2742 static 2743 symbol_type make_NON_WS(const std::string & v,const location_type & l)2744 make_NON_WS (const std::string& v, const location_type& l) 2745 { 2746 return symbol_type (token::TOK_NON_WS, v, l); 2747 } 2748 #endif 2749 #if 201103L <= YY_CPLUSPLUS 2750 static 2751 symbol_type make_CODE_BLOCK_START(std::string v,location_type l)2752 make_CODE_BLOCK_START (std::string v, location_type l) 2753 { 2754 return symbol_type (token::TOK_CODE_BLOCK_START, std::move (v), std::move (l)); 2755 } 2756 #else 2757 static 2758 symbol_type make_CODE_BLOCK_START(const std::string & v,const location_type & l)2759 make_CODE_BLOCK_START (const std::string& v, const location_type& l) 2760 { 2761 return symbol_type (token::TOK_CODE_BLOCK_START, v, l); 2762 } 2763 #endif 2764 #if 201103L <= YY_CPLUSPLUS 2765 static 2766 symbol_type make_CODE_BLOCK_CONTENTS(std::string v,location_type l)2767 make_CODE_BLOCK_CONTENTS (std::string v, location_type l) 2768 { 2769 return symbol_type (token::TOK_CODE_BLOCK_CONTENTS, std::move (v), std::move (l)); 2770 } 2771 #else 2772 static 2773 symbol_type make_CODE_BLOCK_CONTENTS(const std::string & v,const location_type & l)2774 make_CODE_BLOCK_CONTENTS (const std::string& v, const location_type& l) 2775 { 2776 return symbol_type (token::TOK_CODE_BLOCK_CONTENTS, v, l); 2777 } 2778 #endif 2779 #if 201103L <= YY_CPLUSPLUS 2780 static 2781 symbol_type make_UNKNOWN_DIRECTIVE(std::string v,location_type l)2782 make_UNKNOWN_DIRECTIVE (std::string v, location_type l) 2783 { 2784 return symbol_type (token::TOK_UNKNOWN_DIRECTIVE, std::move (v), std::move (l)); 2785 } 2786 #else 2787 static 2788 symbol_type make_UNKNOWN_DIRECTIVE(const std::string & v,const location_type & l)2789 make_UNKNOWN_DIRECTIVE (const std::string& v, const location_type& l) 2790 { 2791 return symbol_type (token::TOK_UNKNOWN_DIRECTIVE, v, l); 2792 } 2793 #endif 2794 #if 201103L <= YY_CPLUSPLUS 2795 static 2796 symbol_type make_INT(int v,location_type l)2797 make_INT (int v, location_type l) 2798 { 2799 return symbol_type (token::TOK_INT, std::move (v), std::move (l)); 2800 } 2801 #else 2802 static 2803 symbol_type make_INT(const int & v,const location_type & l)2804 make_INT (const int& v, const location_type& l) 2805 { 2806 return symbol_type (token::TOK_INT, v, l); 2807 } 2808 #endif 2809 #if 201103L <= YY_CPLUSPLUS 2810 static 2811 symbol_type make_FLOAT(float v,location_type l)2812 make_FLOAT (float v, location_type l) 2813 { 2814 return symbol_type (token::TOK_FLOAT, std::move (v), std::move (l)); 2815 } 2816 #else 2817 static 2818 symbol_type make_FLOAT(const float & v,const location_type & l)2819 make_FLOAT (const float& v, const location_type& l) 2820 { 2821 return symbol_type (token::TOK_FLOAT, v, l); 2822 } 2823 #endif 2824 2825 2826 class context 2827 { 2828 public: 2829 context (const parser& yyparser, const symbol_type& yyla); lookahead() const2830 const symbol_type& lookahead () const { return yyla_; } token() const2831 symbol_kind_type token () const { return yyla_.kind (); } location() const2832 const location_type& location () const { return yyla_.location; } 2833 2834 /// Put in YYARG at most YYARGN of the expected tokens, and return the 2835 /// number of tokens stored in YYARG. If YYARG is null, return the 2836 /// number of expected tokens (guaranteed to be less than YYNTOKENS). 2837 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; 2838 2839 private: 2840 const parser& yyparser_; 2841 const symbol_type& yyla_; 2842 }; 2843 2844 private: 2845 #if YY_CPLUSPLUS < 201103L 2846 /// Non copyable. 2847 parser (const parser&); 2848 /// Non copyable. 2849 parser& operator= (const parser&); 2850 #endif 2851 2852 /// Check the lookahead yytoken. 2853 /// \returns true iff the token will be eventually shifted. 2854 bool yy_lac_check_ (symbol_kind_type yytoken) const; 2855 /// Establish the initial context if no initial context currently exists. 2856 /// \returns true iff the token will be eventually shifted. 2857 bool yy_lac_establish_ (symbol_kind_type yytoken); 2858 /// Discard any previous initial lookahead context because of event. 2859 /// \param event the event which caused the lookahead to be discarded. 2860 /// Only used for debbuging output. 2861 void yy_lac_discard_ (const char* event); 2862 2863 /// Stored state numbers (used for stacks). 2864 typedef short state_type; 2865 2866 /// The arguments of the error message. 2867 int yy_syntax_error_arguments_ (const context& yyctx, 2868 symbol_kind_type yyarg[], int yyargn) const; 2869 2870 /// Generate an error message. 2871 /// \param yyctx the context in which the error occurred. 2872 virtual std::string yysyntax_error_ (const context& yyctx) const; 2873 /// Compute post-reduction state. 2874 /// \param yystate the current state 2875 /// \param yysym the nonterminal to push on the stack 2876 static state_type yy_lr_goto_state_ (state_type yystate, int yysym); 2877 2878 /// Whether the given \c yypact_ value indicates a defaulted state. 2879 /// \param yyvalue the value to check 2880 static bool yy_pact_value_is_default_ (int yyvalue); 2881 2882 /// Whether the given \c yytable_ value indicates a syntax error. 2883 /// \param yyvalue the value to check 2884 static bool yy_table_value_is_error_ (int yyvalue); 2885 2886 static const signed char yypact_ninf_; 2887 static const signed char yytable_ninf_; 2888 2889 /// Convert a scanner token kind \a t to a symbol kind. 2890 /// In theory \a t should be a token_kind_type, but character literals 2891 /// are valid, yet not members of the token_type enum. 2892 static symbol_kind_type yytranslate_ (int t); 2893 2894 /// Convert the symbol name \a n to a form suitable for a diagnostic. 2895 static std::string yytnamerr_ (const char *yystr); 2896 2897 /// For a symbol, its name in clear. 2898 static const char* const yytname_[]; 2899 2900 2901 // Tables. 2902 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 2903 // STATE-NUM. 2904 static const short yypact_[]; 2905 2906 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 2907 // Performed when YYTABLE does not specify something else to do. Zero 2908 // means the default is an error. 2909 static const unsigned char yydefact_[]; 2910 2911 // YYPGOTO[NTERM-NUM]. 2912 static const short yypgoto_[]; 2913 2914 // YYDEFGOTO[NTERM-NUM]. 2915 static const short yydefgoto_[]; 2916 2917 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 2918 // positive, shift that token. If negative, reduce the rule whose 2919 // number is the opposite. If YYTABLE_NINF, syntax error. 2920 static const short yytable_[]; 2921 2922 static const short yycheck_[]; 2923 2924 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing 2925 // symbol of state STATE-NUM. 2926 static const unsigned char yystos_[]; 2927 2928 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. 2929 static const unsigned char yyr1_[]; 2930 2931 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. 2932 static const signed char yyr2_[]; 2933 2934 2935 #if YYDEBUG 2936 // YYRLINE[YYN] -- Source line where rule number YYN was defined. 2937 static const short yyrline_[]; 2938 /// Report on the debug stream that the rule \a r is going to be reduced. 2939 virtual void yy_reduce_print_ (int r) const; 2940 /// Print the state stack on the debug stream. 2941 virtual void yy_stack_print_ () const; 2942 2943 /// Debugging level. 2944 int yydebug_; 2945 /// Debug stream. 2946 std::ostream* yycdebug_; 2947 2948 /// \brief Display a symbol kind, value and location. 2949 /// \param yyo The output stream. 2950 /// \param yysym The symbol. 2951 template <typename Base> 2952 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const; 2953 #endif 2954 2955 /// \brief Reclaim the memory associated to a symbol. 2956 /// \param yymsg Why this token is reclaimed. 2957 /// If null, print nothing. 2958 /// \param yysym The symbol. 2959 template <typename Base> 2960 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const; 2961 2962 private: 2963 /// Type access provider for state based symbols. 2964 struct by_state 2965 { 2966 /// Default constructor. 2967 by_state () YY_NOEXCEPT; 2968 2969 /// The symbol kind as needed by the constructor. 2970 typedef state_type kind_type; 2971 2972 /// Constructor. 2973 by_state (kind_type s) YY_NOEXCEPT; 2974 2975 /// Copy constructor. 2976 by_state (const by_state& that) YY_NOEXCEPT; 2977 2978 /// Record that this symbol is empty. 2979 void clear () YY_NOEXCEPT; 2980 2981 /// Steal the symbol kind from \a that. 2982 void move (by_state& that); 2983 2984 /// The symbol kind (corresponding to \a state). 2985 /// \a symbol_kind::S_YYEMPTY when empty. 2986 symbol_kind_type kind () const YY_NOEXCEPT; 2987 2988 /// The state number used to denote an empty symbol. 2989 /// We use the initial state, as it does not have a value. 2990 enum { empty_state = 0 }; 2991 2992 /// The state. 2993 /// \a empty when empty. 2994 state_type state; 2995 }; 2996 2997 /// "Internal" symbol: element of the stack. 2998 struct stack_symbol_type : basic_symbol<by_state> 2999 { 3000 /// Superclass. 3001 typedef basic_symbol<by_state> super_type; 3002 /// Construct an empty symbol. 3003 stack_symbol_type (); 3004 /// Move or copy construction. 3005 stack_symbol_type (YY_RVREF (stack_symbol_type) that); 3006 /// Steal the contents from \a sym to build this. 3007 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); 3008 #if YY_CPLUSPLUS < 201103L 3009 /// Assignment, needed by push_back by some old implementations. 3010 /// Moves the contents of that. 3011 stack_symbol_type& operator= (stack_symbol_type& that); 3012 3013 /// Assignment, needed by push_back by other implementations. 3014 /// Needed by some other old implementations. 3015 stack_symbol_type& operator= (const stack_symbol_type& that); 3016 #endif 3017 }; 3018 3019 /// A stack with random access from its top. 3020 template <typename T, typename S = std::vector<T> > 3021 class stack 3022 { 3023 public: 3024 // Hide our reversed order. 3025 typedef typename S::iterator iterator; 3026 typedef typename S::const_iterator const_iterator; 3027 typedef typename S::size_type size_type; 3028 typedef typename std::ptrdiff_t index_type; 3029 stack(size_type n=200)3030 stack (size_type n = 200) 3031 : seq_ (n) 3032 {} 3033 3034 #if 201103L <= YY_CPLUSPLUS 3035 /// Non copyable. 3036 stack (const stack&) = delete; 3037 /// Non copyable. 3038 stack& operator= (const stack&) = delete; 3039 #endif 3040 3041 /// Random access. 3042 /// 3043 /// Index 0 returns the topmost element. 3044 const T& operator [](index_type i) const3045 operator[] (index_type i) const 3046 { 3047 return seq_[size_type (size () - 1 - i)]; 3048 } 3049 3050 /// Random access. 3051 /// 3052 /// Index 0 returns the topmost element. 3053 T& operator [](index_type i)3054 operator[] (index_type i) 3055 { 3056 return seq_[size_type (size () - 1 - i)]; 3057 } 3058 3059 /// Steal the contents of \a t. 3060 /// 3061 /// Close to move-semantics. 3062 void push(YY_MOVE_REF (T)t)3063 push (YY_MOVE_REF (T) t) 3064 { 3065 seq_.push_back (T ()); 3066 operator[] (0).move (t); 3067 } 3068 3069 /// Pop elements from the stack. 3070 void pop(std::ptrdiff_t n=1)3071 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT 3072 { 3073 for (; 0 < n; --n) 3074 seq_.pop_back (); 3075 } 3076 3077 /// Pop all elements from the stack. 3078 void clear()3079 clear () YY_NOEXCEPT 3080 { 3081 seq_.clear (); 3082 } 3083 3084 /// Number of elements on the stack. 3085 index_type size() const3086 size () const YY_NOEXCEPT 3087 { 3088 return index_type (seq_.size ()); 3089 } 3090 3091 /// Iterator on top of the stack (going downwards). 3092 const_iterator begin() const3093 begin () const YY_NOEXCEPT 3094 { 3095 return seq_.begin (); 3096 } 3097 3098 /// Bottom of the stack. 3099 const_iterator end() const3100 end () const YY_NOEXCEPT 3101 { 3102 return seq_.end (); 3103 } 3104 3105 /// Present a slice of the top of a stack. 3106 class slice 3107 { 3108 public: slice(const stack & stack,index_type range)3109 slice (const stack& stack, index_type range) 3110 : stack_ (stack) 3111 , range_ (range) 3112 {} 3113 3114 const T& operator [](index_type i) const3115 operator[] (index_type i) const 3116 { 3117 return stack_[range_ - i]; 3118 } 3119 3120 private: 3121 const stack& stack_; 3122 index_type range_; 3123 }; 3124 3125 private: 3126 #if YY_CPLUSPLUS < 201103L 3127 /// Non copyable. 3128 stack (const stack&); 3129 /// Non copyable. 3130 stack& operator= (const stack&); 3131 #endif 3132 /// The wrapped container. 3133 S seq_; 3134 }; 3135 3136 3137 /// Stack type. 3138 typedef stack<stack_symbol_type> stack_type; 3139 3140 /// The stack. 3141 stack_type yystack_; 3142 /// The stack for LAC. 3143 /// Logically, the yy_lac_stack's lifetime is confined to the function 3144 /// yy_lac_check_. We just store it as a member of this class to hold 3145 /// on to the memory and to avoid frequent reallocations. 3146 /// Since yy_lac_check_ is const, this member must be mutable. 3147 mutable std::vector<state_type> yylac_stack_; 3148 /// Whether an initial LAC context was established. 3149 bool yy_lac_established_; 3150 3151 3152 /// Push a new state on the stack. 3153 /// \param m a debug message to display 3154 /// if null, no trace is output. 3155 /// \param sym the symbol 3156 /// \warning the contents of \a s.value is stolen. 3157 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); 3158 3159 /// Push a new look ahead token on the state on the stack. 3160 /// \param m a debug message to display 3161 /// if null, no trace is output. 3162 /// \param s the state 3163 /// \param sym the symbol (for its value and location). 3164 /// \warning the contents of \a sym.value is stolen. 3165 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); 3166 3167 /// Pop \a n symbols from the stack. 3168 void yypop_ (int n = 1); 3169 3170 /// Constants. 3171 enum 3172 { 3173 yylast_ = 307, ///< Last index in yytable_. 3174 yynnts_ = 32, ///< Number of nonterminal symbols. 3175 yyfinal_ = 127 ///< Termination state number. 3176 }; 3177 3178 3179 // User arguments. 3180 pio_assembler& pioasm; 3181 3182 }; 3183 3184 inline 3185 parser::symbol_kind_type yytranslate_(int t)3186 parser::yytranslate_ (int t) 3187 { 3188 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to 3189 // TOKEN-NUM as returned by yylex. 3190 static 3191 const signed char 3192 translate_table[] = 3193 { 3194 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3195 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3196 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3197 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3198 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3201 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3203 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3204 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3205 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3206 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3207 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3208 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3209 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3210 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3211 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3212 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3213 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3214 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3215 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3216 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3217 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3218 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3219 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 3220 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 3221 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 3222 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 3223 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 3224 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 3225 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 3226 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 3227 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 3228 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 3229 95, 96, 97 3230 }; 3231 // Last valid token kind. 3232 const int code_max = 352; 3233 3234 if (t <= 0) 3235 return symbol_kind::S_YYEOF; 3236 else if (t <= code_max) 3237 return YY_CAST (symbol_kind_type, translate_table[t]); 3238 else 3239 return symbol_kind::S_YYUNDEF; 3240 } 3241 3242 // basic_symbol. 3243 template <typename Base> basic_symbol(const basic_symbol & that)3244 parser::basic_symbol<Base>::basic_symbol (const basic_symbol& that) 3245 : Base (that) 3246 , value () 3247 , location (that.location) 3248 { 3249 switch (this->kind ()) 3250 { 3251 case symbol_kind::S_direction: // direction 3252 case symbol_kind::S_autop: // autop 3253 case symbol_kind::S_if_full: // if_full 3254 case symbol_kind::S_if_empty: // if_empty 3255 case symbol_kind::S_blocking: // blocking 3256 value.copy< bool > (YY_MOVE (that.value)); 3257 break; 3258 3259 case symbol_kind::S_condition: // condition 3260 value.copy< enum condition > (YY_MOVE (that.value)); 3261 break; 3262 3263 case symbol_kind::S_fifo_config: // fifo_config 3264 value.copy< enum fifo_config > (YY_MOVE (that.value)); 3265 break; 3266 3267 case symbol_kind::S_in_source: // in_source 3268 case symbol_kind::S_out_target: // out_target 3269 case symbol_kind::S_set_target: // set_target 3270 value.copy< enum in_out_set > (YY_MOVE (that.value)); 3271 break; 3272 3273 case symbol_kind::S_irq_modifiers: // irq_modifiers 3274 value.copy< enum irq > (YY_MOVE (that.value)); 3275 break; 3276 3277 case symbol_kind::S_mov_op: // mov_op 3278 value.copy< enum mov_op > (YY_MOVE (that.value)); 3279 break; 3280 3281 case symbol_kind::S_mov_target: // mov_target 3282 case symbol_kind::S_mov_source: // mov_source 3283 value.copy< extended_mov > (YY_MOVE (that.value)); 3284 break; 3285 3286 case symbol_kind::S_FLOAT: // "float" 3287 value.copy< float > (YY_MOVE (that.value)); 3288 break; 3289 3290 case symbol_kind::S_INT: // "integer" 3291 value.copy< int > (YY_MOVE (that.value)); 3292 break; 3293 3294 case symbol_kind::S_instruction: // instruction 3295 case symbol_kind::S_base_instruction: // base_instruction 3296 value.copy< std::shared_ptr<instruction> > (YY_MOVE (that.value)); 3297 break; 3298 3299 case symbol_kind::S_value: // value 3300 case symbol_kind::S_expression: // expression 3301 case symbol_kind::S_delay: // delay 3302 case symbol_kind::S_sideset: // sideset 3303 case symbol_kind::S_threshold: // threshold 3304 value.copy< std::shared_ptr<resolvable> > (YY_MOVE (that.value)); 3305 break; 3306 3307 case symbol_kind::S_label_decl: // label_decl 3308 case symbol_kind::S_symbol_def: // symbol_def 3309 value.copy< std::shared_ptr<symbol> > (YY_MOVE (that.value)); 3310 break; 3311 3312 case symbol_kind::S_wait_source: // wait_source 3313 value.copy< std::shared_ptr<wait_source> > (YY_MOVE (that.value)); 3314 break; 3315 3316 case symbol_kind::S_ID: // "identifier" 3317 case symbol_kind::S_STRING: // "string" 3318 case symbol_kind::S_NON_WS: // "text" 3319 case symbol_kind::S_CODE_BLOCK_START: // "code block" 3320 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}" 3321 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE 3322 value.copy< std::string > (YY_MOVE (that.value)); 3323 break; 3324 3325 case symbol_kind::S_pio_version: // pio_version 3326 value.copy< uint > (YY_MOVE (that.value)); 3327 break; 3328 3329 default: 3330 break; 3331 } 3332 3333 } 3334 3335 3336 3337 template <typename Base> 3338 parser::symbol_kind_type type_get() const3339 parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT 3340 { 3341 return this->kind (); 3342 } 3343 3344 template <typename Base> 3345 bool empty() const3346 parser::basic_symbol<Base>::empty () const YY_NOEXCEPT 3347 { 3348 return this->kind () == symbol_kind::S_YYEMPTY; 3349 } 3350 3351 template <typename Base> 3352 void move(basic_symbol & s)3353 parser::basic_symbol<Base>::move (basic_symbol& s) 3354 { 3355 super_type::move (s); 3356 switch (this->kind ()) 3357 { 3358 case symbol_kind::S_direction: // direction 3359 case symbol_kind::S_autop: // autop 3360 case symbol_kind::S_if_full: // if_full 3361 case symbol_kind::S_if_empty: // if_empty 3362 case symbol_kind::S_blocking: // blocking 3363 value.move< bool > (YY_MOVE (s.value)); 3364 break; 3365 3366 case symbol_kind::S_condition: // condition 3367 value.move< enum condition > (YY_MOVE (s.value)); 3368 break; 3369 3370 case symbol_kind::S_fifo_config: // fifo_config 3371 value.move< enum fifo_config > (YY_MOVE (s.value)); 3372 break; 3373 3374 case symbol_kind::S_in_source: // in_source 3375 case symbol_kind::S_out_target: // out_target 3376 case symbol_kind::S_set_target: // set_target 3377 value.move< enum in_out_set > (YY_MOVE (s.value)); 3378 break; 3379 3380 case symbol_kind::S_irq_modifiers: // irq_modifiers 3381 value.move< enum irq > (YY_MOVE (s.value)); 3382 break; 3383 3384 case symbol_kind::S_mov_op: // mov_op 3385 value.move< enum mov_op > (YY_MOVE (s.value)); 3386 break; 3387 3388 case symbol_kind::S_mov_target: // mov_target 3389 case symbol_kind::S_mov_source: // mov_source 3390 value.move< extended_mov > (YY_MOVE (s.value)); 3391 break; 3392 3393 case symbol_kind::S_FLOAT: // "float" 3394 value.move< float > (YY_MOVE (s.value)); 3395 break; 3396 3397 case symbol_kind::S_INT: // "integer" 3398 value.move< int > (YY_MOVE (s.value)); 3399 break; 3400 3401 case symbol_kind::S_instruction: // instruction 3402 case symbol_kind::S_base_instruction: // base_instruction 3403 value.move< std::shared_ptr<instruction> > (YY_MOVE (s.value)); 3404 break; 3405 3406 case symbol_kind::S_value: // value 3407 case symbol_kind::S_expression: // expression 3408 case symbol_kind::S_delay: // delay 3409 case symbol_kind::S_sideset: // sideset 3410 case symbol_kind::S_threshold: // threshold 3411 value.move< std::shared_ptr<resolvable> > (YY_MOVE (s.value)); 3412 break; 3413 3414 case symbol_kind::S_label_decl: // label_decl 3415 case symbol_kind::S_symbol_def: // symbol_def 3416 value.move< std::shared_ptr<symbol> > (YY_MOVE (s.value)); 3417 break; 3418 3419 case symbol_kind::S_wait_source: // wait_source 3420 value.move< std::shared_ptr<wait_source> > (YY_MOVE (s.value)); 3421 break; 3422 3423 case symbol_kind::S_ID: // "identifier" 3424 case symbol_kind::S_STRING: // "string" 3425 case symbol_kind::S_NON_WS: // "text" 3426 case symbol_kind::S_CODE_BLOCK_START: // "code block" 3427 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}" 3428 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE 3429 value.move< std::string > (YY_MOVE (s.value)); 3430 break; 3431 3432 case symbol_kind::S_pio_version: // pio_version 3433 value.move< uint > (YY_MOVE (s.value)); 3434 break; 3435 3436 default: 3437 break; 3438 } 3439 3440 location = YY_MOVE (s.location); 3441 } 3442 3443 // by_kind. 3444 inline by_kind()3445 parser::by_kind::by_kind () 3446 : kind_ (symbol_kind::S_YYEMPTY) 3447 {} 3448 3449 #if 201103L <= YY_CPLUSPLUS 3450 inline by_kind(by_kind && that)3451 parser::by_kind::by_kind (by_kind&& that) 3452 : kind_ (that.kind_) 3453 { 3454 that.clear (); 3455 } 3456 #endif 3457 3458 inline by_kind(const by_kind & that)3459 parser::by_kind::by_kind (const by_kind& that) 3460 : kind_ (that.kind_) 3461 {} 3462 3463 inline by_kind(token_kind_type t)3464 parser::by_kind::by_kind (token_kind_type t) 3465 : kind_ (yytranslate_ (t)) 3466 {} 3467 3468 inline 3469 void clear()3470 parser::by_kind::clear () 3471 { 3472 kind_ = symbol_kind::S_YYEMPTY; 3473 } 3474 3475 inline 3476 void move(by_kind & that)3477 parser::by_kind::move (by_kind& that) 3478 { 3479 kind_ = that.kind_; 3480 that.clear (); 3481 } 3482 3483 inline 3484 parser::symbol_kind_type kind() const3485 parser::by_kind::kind () const YY_NOEXCEPT 3486 { 3487 return kind_; 3488 } 3489 3490 inline 3491 parser::symbol_kind_type type_get() const3492 parser::by_kind::type_get () const YY_NOEXCEPT 3493 { 3494 return this->kind (); 3495 } 3496 3497 } // yy 3498 3499 3500 3501 3502 #endif // !YY_YY_HOME_GRAHAM_DEV_AMY_AMY_SDK_TOOLS_PIOASM_GEN_PARSER_HPP_INCLUDED 3503