blob: 11d83931a2ac32eac267bde7310aa8643d0e7a09 [file] [log] [blame]
Austin Schuh208337d2022-01-01 14:29:11 -08001// 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 pico_sdk/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_MU_PICO_SDK_TOOLS_PIOASM_GEN_PARSER_HPP_INCLUDED
46# define YY_YY_HOME_GRAHAM_DEV_MU_PICO_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
191namespace 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.
213 semantic_type () YY_NOEXCEPT
214 : yybuffer_ ()
215 {}
216
217 /// Construct and fill.
218 template <typename 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.
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&
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&
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&
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&
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&
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&
291 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
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
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
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
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
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*
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*
374 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 // if_full
384 // if_empty
385 // blocking
386 char dummy1[sizeof (bool)];
387
388 // condition
389 char dummy2[sizeof (enum condition)];
390
391 // in_source
392 // out_target
393 // set_target
394 char dummy3[sizeof (enum in_out_set)];
395
396 // irq_modifiers
397 char dummy4[sizeof (enum irq)];
398
399 // mov_target
400 // mov_source
401 char dummy5[sizeof (enum mov)];
402
403 // mov_op
404 char dummy6[sizeof (enum mov_op)];
405
406 // "integer"
407 char dummy7[sizeof (int)];
408
409 // instruction
410 // base_instruction
411 char dummy8[sizeof (std::shared_ptr<instruction>)];
412
413 // value
414 // expression
415 // delay
416 // sideset
417 char dummy9[sizeof (std::shared_ptr<resolvable>)];
418
419 // label_decl
420 // symbol_def
421 char dummy10[sizeof (std::shared_ptr<symbol>)];
422
423 // wait_source
424 char dummy11[sizeof (std::shared_ptr<wait_source>)];
425
426 // "identifier"
427 // "string"
428 // "text"
429 // "code block"
430 // "%}"
431 // UNKNOWN_DIRECTIVE
432 char dummy12[sizeof (std::string)];
433 };
434
435 /// The size of the largest semantic type.
436 enum { size = sizeof (union_type) };
437
438 /// A buffer to store semantic values.
439 union
440 {
441 /// Strongest alignment constraints.
442 long double yyalign_me;
443 /// A buffer large enough to store any of the semantic values.
444 char yyraw[size];
445 } yybuffer_;
446 };
447
448#else
449 typedef YYSTYPE semantic_type;
450#endif
451 /// Symbol locations.
452 typedef location location_type;
453
454 /// Syntax errors thrown from user actions.
455 struct syntax_error : std::runtime_error
456 {
457 syntax_error (const location_type& l, const std::string& m)
458 : std::runtime_error (m)
459 , location (l)
460 {}
461
462 syntax_error (const syntax_error& s)
463 : std::runtime_error (s.what ())
464 , location (s.location)
465 {}
466
467 ~syntax_error () YY_NOEXCEPT YY_NOTHROW;
468
469 location_type location;
470 };
471
472 /// Token kinds.
473 struct token
474 {
475 enum token_kind_type
476 {
477 TOK_YYEMPTY = -2,
478 TOK_END = 0, // "end of file"
479 TOK_YYerror = 256, // error
480 TOK_YYUNDEF = 257, // "invalid token"
481 TOK_NEWLINE = 258, // "end of line"
482 TOK_COMMA = 259, // ","
483 TOK_COLON = 260, // ":"
484 TOK_LPAREN = 261, // "("
485 TOK_RPAREN = 262, // ")"
486 TOK_LBRACKET = 263, // "["
487 TOK_RBRACKET = 264, // "]"
488 TOK_PLUS = 265, // "+"
489 TOK_MINUS = 266, // "-"
490 TOK_MULTIPLY = 267, // "*"
491 TOK_DIVIDE = 268, // "/"
492 TOK_OR = 269, // "|"
493 TOK_AND = 270, // "&"
494 TOK_XOR = 271, // "^"
495 TOK_POST_DECREMENT = 272, // "--"
496 TOK_NOT_EQUAL = 273, // "!="
497 TOK_NOT = 274, // "!"
498 TOK_REVERSE = 275, // "::"
499 TOK_EQUAL = 276, // "="
500 TOK_PROGRAM = 277, // ".program"
501 TOK_WRAP_TARGET = 278, // ".wrap_target"
502 TOK_WRAP = 279, // ".wrap"
503 TOK_DEFINE = 280, // ".define"
504 TOK_SIDE_SET = 281, // ".side_set"
505 TOK_WORD = 282, // ".word"
506 TOK_ORIGIN = 283, // ".origin"
507 TOK_LANG_OPT = 284, // ".lang_opt"
508 TOK_JMP = 285, // "jmp"
509 TOK_WAIT = 286, // "wait"
510 TOK_IN = 287, // "in"
511 TOK_OUT = 288, // "out"
512 TOK_PUSH = 289, // "push"
513 TOK_PULL = 290, // "pull"
514 TOK_MOV = 291, // "mov"
515 TOK_IRQ = 292, // "irq"
516 TOK_SET = 293, // "set"
517 TOK_NOP = 294, // "nop"
518 TOK_PIN = 295, // "pin"
519 TOK_GPIO = 296, // "gpio"
520 TOK_OSRE = 297, // "osre"
521 TOK_PINS = 298, // "pins"
522 TOK_NULL = 299, // "null"
523 TOK_PINDIRS = 300, // "pindirs"
524 TOK_BLOCK = 301, // "block"
525 TOK_NOBLOCK = 302, // "noblock"
526 TOK_IFEMPTY = 303, // "ifempty"
527 TOK_IFFULL = 304, // "iffull"
528 TOK_NOWAIT = 305, // "nowait"
529 TOK_CLEAR = 306, // "clear"
530 TOK_REL = 307, // "rel"
531 TOK_X = 308, // "x"
532 TOK_Y = 309, // "y"
533 TOK_EXEC = 310, // "exec"
534 TOK_PC = 311, // "pc"
535 TOK_ISR = 312, // "isr"
536 TOK_OSR = 313, // "osr"
537 TOK_OPTIONAL = 314, // "opt"
538 TOK_SIDE = 315, // "side"
539 TOK_STATUS = 316, // "status"
540 TOK_PUBLIC = 317, // "public"
541 TOK_ID = 318, // "identifier"
542 TOK_STRING = 319, // "string"
543 TOK_NON_WS = 320, // "text"
544 TOK_CODE_BLOCK_START = 321, // "code block"
545 TOK_CODE_BLOCK_CONTENTS = 322, // "%}"
546 TOK_UNKNOWN_DIRECTIVE = 323, // UNKNOWN_DIRECTIVE
547 TOK_INT = 324 // "integer"
548 };
549 /// Backward compatibility alias (Bison 3.6).
550 typedef token_kind_type yytokentype;
551 };
552
553 /// Token kind, as returned by yylex.
554 typedef token::yytokentype token_kind_type;
555
556 /// Backward compatibility alias (Bison 3.6).
557 typedef token_kind_type token_type;
558
559 /// Symbol kinds.
560 struct symbol_kind
561 {
562 enum symbol_kind_type
563 {
564 YYNTOKENS = 70, ///< Number of tokens.
565 S_YYEMPTY = -2,
566 S_YYEOF = 0, // "end of file"
567 S_YYerror = 1, // error
568 S_YYUNDEF = 2, // "invalid token"
569 S_NEWLINE = 3, // "end of line"
570 S_COMMA = 4, // ","
571 S_COLON = 5, // ":"
572 S_LPAREN = 6, // "("
573 S_RPAREN = 7, // ")"
574 S_LBRACKET = 8, // "["
575 S_RBRACKET = 9, // "]"
576 S_PLUS = 10, // "+"
577 S_MINUS = 11, // "-"
578 S_MULTIPLY = 12, // "*"
579 S_DIVIDE = 13, // "/"
580 S_OR = 14, // "|"
581 S_AND = 15, // "&"
582 S_XOR = 16, // "^"
583 S_POST_DECREMENT = 17, // "--"
584 S_NOT_EQUAL = 18, // "!="
585 S_NOT = 19, // "!"
586 S_REVERSE = 20, // "::"
587 S_EQUAL = 21, // "="
588 S_PROGRAM = 22, // ".program"
589 S_WRAP_TARGET = 23, // ".wrap_target"
590 S_WRAP = 24, // ".wrap"
591 S_DEFINE = 25, // ".define"
592 S_SIDE_SET = 26, // ".side_set"
593 S_WORD = 27, // ".word"
594 S_ORIGIN = 28, // ".origin"
595 S_LANG_OPT = 29, // ".lang_opt"
596 S_JMP = 30, // "jmp"
597 S_WAIT = 31, // "wait"
598 S_IN = 32, // "in"
599 S_OUT = 33, // "out"
600 S_PUSH = 34, // "push"
601 S_PULL = 35, // "pull"
602 S_MOV = 36, // "mov"
603 S_IRQ = 37, // "irq"
604 S_SET = 38, // "set"
605 S_NOP = 39, // "nop"
606 S_PIN = 40, // "pin"
607 S_GPIO = 41, // "gpio"
608 S_OSRE = 42, // "osre"
609 S_PINS = 43, // "pins"
610 S_NULL = 44, // "null"
611 S_PINDIRS = 45, // "pindirs"
612 S_BLOCK = 46, // "block"
613 S_NOBLOCK = 47, // "noblock"
614 S_IFEMPTY = 48, // "ifempty"
615 S_IFFULL = 49, // "iffull"
616 S_NOWAIT = 50, // "nowait"
617 S_CLEAR = 51, // "clear"
618 S_REL = 52, // "rel"
619 S_X = 53, // "x"
620 S_Y = 54, // "y"
621 S_EXEC = 55, // "exec"
622 S_PC = 56, // "pc"
623 S_ISR = 57, // "isr"
624 S_OSR = 58, // "osr"
625 S_OPTIONAL = 59, // "opt"
626 S_SIDE = 60, // "side"
627 S_STATUS = 61, // "status"
628 S_PUBLIC = 62, // "public"
629 S_ID = 63, // "identifier"
630 S_STRING = 64, // "string"
631 S_NON_WS = 65, // "text"
632 S_CODE_BLOCK_START = 66, // "code block"
633 S_CODE_BLOCK_CONTENTS = 67, // "%}"
634 S_UNKNOWN_DIRECTIVE = 68, // UNKNOWN_DIRECTIVE
635 S_INT = 69, // "integer"
636 S_YYACCEPT = 70, // $accept
637 S_file = 71, // file
638 S_lines = 72, // lines
639 S_line = 73, // line
640 S_code_block = 74, // code_block
641 S_label_decl = 75, // label_decl
642 S_directive = 76, // directive
643 S_value = 77, // value
644 S_expression = 78, // expression
645 S_instruction = 79, // instruction
646 S_base_instruction = 80, // base_instruction
647 S_delay = 81, // delay
648 S_sideset = 82, // sideset
649 S_condition = 83, // condition
650 S_wait_source = 84, // wait_source
651 S_comma = 85, // comma
652 S_in_source = 86, // in_source
653 S_out_target = 87, // out_target
654 S_mov_target = 88, // mov_target
655 S_mov_source = 89, // mov_source
656 S_mov_op = 90, // mov_op
657 S_set_target = 91, // set_target
658 S_if_full = 92, // if_full
659 S_if_empty = 93, // if_empty
660 S_blocking = 94, // blocking
661 S_irq_modifiers = 95, // irq_modifiers
662 S_symbol_def = 96 // symbol_def
663 };
664 };
665
666 /// (Internal) symbol kind.
667 typedef symbol_kind::symbol_kind_type symbol_kind_type;
668
669 /// The number of tokens.
670 static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS;
671
672 /// A complete symbol.
673 ///
674 /// Expects its Base type to provide access to the symbol kind
675 /// via kind ().
676 ///
677 /// Provide access to semantic value and location.
678 template <typename Base>
679 struct basic_symbol : Base
680 {
681 /// Alias to Base.
682 typedef Base super_type;
683
684 /// Default constructor.
685 basic_symbol ()
686 : value ()
687 , location ()
688 {}
689
690#if 201103L <= YY_CPLUSPLUS
691 /// Move constructor.
692 basic_symbol (basic_symbol&& that)
693 : Base (std::move (that))
694 , value ()
695 , location (std::move (that.location))
696 {
697 switch (this->kind ())
698 {
699 case symbol_kind::S_if_full: // if_full
700 case symbol_kind::S_if_empty: // if_empty
701 case symbol_kind::S_blocking: // blocking
702 value.move< bool > (std::move (that.value));
703 break;
704
705 case symbol_kind::S_condition: // condition
706 value.move< enum condition > (std::move (that.value));
707 break;
708
709 case symbol_kind::S_in_source: // in_source
710 case symbol_kind::S_out_target: // out_target
711 case symbol_kind::S_set_target: // set_target
712 value.move< enum in_out_set > (std::move (that.value));
713 break;
714
715 case symbol_kind::S_irq_modifiers: // irq_modifiers
716 value.move< enum irq > (std::move (that.value));
717 break;
718
719 case symbol_kind::S_mov_target: // mov_target
720 case symbol_kind::S_mov_source: // mov_source
721 value.move< enum mov > (std::move (that.value));
722 break;
723
724 case symbol_kind::S_mov_op: // mov_op
725 value.move< enum mov_op > (std::move (that.value));
726 break;
727
728 case symbol_kind::S_INT: // "integer"
729 value.move< int > (std::move (that.value));
730 break;
731
732 case symbol_kind::S_instruction: // instruction
733 case symbol_kind::S_base_instruction: // base_instruction
734 value.move< std::shared_ptr<instruction> > (std::move (that.value));
735 break;
736
737 case symbol_kind::S_value: // value
738 case symbol_kind::S_expression: // expression
739 case symbol_kind::S_delay: // delay
740 case symbol_kind::S_sideset: // sideset
741 value.move< std::shared_ptr<resolvable> > (std::move (that.value));
742 break;
743
744 case symbol_kind::S_label_decl: // label_decl
745 case symbol_kind::S_symbol_def: // symbol_def
746 value.move< std::shared_ptr<symbol> > (std::move (that.value));
747 break;
748
749 case symbol_kind::S_wait_source: // wait_source
750 value.move< std::shared_ptr<wait_source> > (std::move (that.value));
751 break;
752
753 case symbol_kind::S_ID: // "identifier"
754 case symbol_kind::S_STRING: // "string"
755 case symbol_kind::S_NON_WS: // "text"
756 case symbol_kind::S_CODE_BLOCK_START: // "code block"
757 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}"
758 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE
759 value.move< std::string > (std::move (that.value));
760 break;
761
762 default:
763 break;
764 }
765
766 }
767#endif
768
769 /// Copy constructor.
770 basic_symbol (const basic_symbol& that);
771
772 /// Constructor for valueless symbols, and symbols from each type.
773#if 201103L <= YY_CPLUSPLUS
774 basic_symbol (typename Base::kind_type t, location_type&& l)
775 : Base (t)
776 , location (std::move (l))
777 {}
778#else
779 basic_symbol (typename Base::kind_type t, const location_type& l)
780 : Base (t)
781 , location (l)
782 {}
783#endif
784#if 201103L <= YY_CPLUSPLUS
785 basic_symbol (typename Base::kind_type t, bool&& v, location_type&& l)
786 : Base (t)
787 , value (std::move (v))
788 , location (std::move (l))
789 {}
790#else
791 basic_symbol (typename Base::kind_type t, const bool& v, const location_type& l)
792 : Base (t)
793 , value (v)
794 , location (l)
795 {}
796#endif
797#if 201103L <= YY_CPLUSPLUS
798 basic_symbol (typename Base::kind_type t, enum condition&& v, location_type&& l)
799 : Base (t)
800 , value (std::move (v))
801 , location (std::move (l))
802 {}
803#else
804 basic_symbol (typename Base::kind_type t, const enum condition& v, const location_type& l)
805 : Base (t)
806 , value (v)
807 , location (l)
808 {}
809#endif
810#if 201103L <= YY_CPLUSPLUS
811 basic_symbol (typename Base::kind_type t, enum in_out_set&& v, location_type&& l)
812 : Base (t)
813 , value (std::move (v))
814 , location (std::move (l))
815 {}
816#else
817 basic_symbol (typename Base::kind_type t, const enum in_out_set& v, const location_type& l)
818 : Base (t)
819 , value (v)
820 , location (l)
821 {}
822#endif
823#if 201103L <= YY_CPLUSPLUS
824 basic_symbol (typename Base::kind_type t, enum irq&& v, location_type&& l)
825 : Base (t)
826 , value (std::move (v))
827 , location (std::move (l))
828 {}
829#else
830 basic_symbol (typename Base::kind_type t, const enum irq& v, const location_type& l)
831 : Base (t)
832 , value (v)
833 , location (l)
834 {}
835#endif
836#if 201103L <= YY_CPLUSPLUS
837 basic_symbol (typename Base::kind_type t, enum mov&& v, location_type&& l)
838 : Base (t)
839 , value (std::move (v))
840 , location (std::move (l))
841 {}
842#else
843 basic_symbol (typename Base::kind_type t, const enum mov& v, const location_type& l)
844 : Base (t)
845 , value (v)
846 , location (l)
847 {}
848#endif
849#if 201103L <= YY_CPLUSPLUS
850 basic_symbol (typename Base::kind_type t, enum mov_op&& v, location_type&& l)
851 : Base (t)
852 , value (std::move (v))
853 , location (std::move (l))
854 {}
855#else
856 basic_symbol (typename Base::kind_type t, const enum mov_op& v, const location_type& l)
857 : Base (t)
858 , value (v)
859 , location (l)
860 {}
861#endif
862#if 201103L <= YY_CPLUSPLUS
863 basic_symbol (typename Base::kind_type t, int&& v, location_type&& l)
864 : Base (t)
865 , value (std::move (v))
866 , location (std::move (l))
867 {}
868#else
869 basic_symbol (typename Base::kind_type t, const int& v, const location_type& l)
870 : Base (t)
871 , value (v)
872 , location (l)
873 {}
874#endif
875#if 201103L <= YY_CPLUSPLUS
876 basic_symbol (typename Base::kind_type t, std::shared_ptr<instruction>&& v, location_type&& l)
877 : Base (t)
878 , value (std::move (v))
879 , location (std::move (l))
880 {}
881#else
882 basic_symbol (typename Base::kind_type t, const std::shared_ptr<instruction>& v, const location_type& l)
883 : Base (t)
884 , value (v)
885 , location (l)
886 {}
887#endif
888#if 201103L <= YY_CPLUSPLUS
889 basic_symbol (typename Base::kind_type t, std::shared_ptr<resolvable>&& v, location_type&& l)
890 : Base (t)
891 , value (std::move (v))
892 , location (std::move (l))
893 {}
894#else
895 basic_symbol (typename Base::kind_type t, const std::shared_ptr<resolvable>& v, const location_type& l)
896 : Base (t)
897 , value (v)
898 , location (l)
899 {}
900#endif
901#if 201103L <= YY_CPLUSPLUS
902 basic_symbol (typename Base::kind_type t, std::shared_ptr<symbol>&& v, location_type&& l)
903 : Base (t)
904 , value (std::move (v))
905 , location (std::move (l))
906 {}
907#else
908 basic_symbol (typename Base::kind_type t, const std::shared_ptr<symbol>& v, const location_type& l)
909 : Base (t)
910 , value (v)
911 , location (l)
912 {}
913#endif
914#if 201103L <= YY_CPLUSPLUS
915 basic_symbol (typename Base::kind_type t, std::shared_ptr<wait_source>&& v, location_type&& l)
916 : Base (t)
917 , value (std::move (v))
918 , location (std::move (l))
919 {}
920#else
921 basic_symbol (typename Base::kind_type t, const std::shared_ptr<wait_source>& v, const location_type& l)
922 : Base (t)
923 , value (v)
924 , location (l)
925 {}
926#endif
927#if 201103L <= YY_CPLUSPLUS
928 basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l)
929 : Base (t)
930 , value (std::move (v))
931 , location (std::move (l))
932 {}
933#else
934 basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l)
935 : Base (t)
936 , value (v)
937 , location (l)
938 {}
939#endif
940
941 /// Destroy the symbol.
942 ~basic_symbol ()
943 {
944 clear ();
945 }
946
947 /// Destroy contents, and record that is empty.
948 void clear ()
949 {
950 // User destructor.
951 symbol_kind_type yykind = this->kind ();
952 basic_symbol<Base>& yysym = *this;
953 (void) yysym;
954 switch (yykind)
955 {
956 default:
957 break;
958 }
959
960 // Value type destructor.
961switch (yykind)
962 {
963 case symbol_kind::S_if_full: // if_full
964 case symbol_kind::S_if_empty: // if_empty
965 case symbol_kind::S_blocking: // blocking
966 value.template destroy< bool > ();
967 break;
968
969 case symbol_kind::S_condition: // condition
970 value.template destroy< enum condition > ();
971 break;
972
973 case symbol_kind::S_in_source: // in_source
974 case symbol_kind::S_out_target: // out_target
975 case symbol_kind::S_set_target: // set_target
976 value.template destroy< enum in_out_set > ();
977 break;
978
979 case symbol_kind::S_irq_modifiers: // irq_modifiers
980 value.template destroy< enum irq > ();
981 break;
982
983 case symbol_kind::S_mov_target: // mov_target
984 case symbol_kind::S_mov_source: // mov_source
985 value.template destroy< enum mov > ();
986 break;
987
988 case symbol_kind::S_mov_op: // mov_op
989 value.template destroy< enum mov_op > ();
990 break;
991
992 case symbol_kind::S_INT: // "integer"
993 value.template destroy< int > ();
994 break;
995
996 case symbol_kind::S_instruction: // instruction
997 case symbol_kind::S_base_instruction: // base_instruction
998 value.template destroy< std::shared_ptr<instruction> > ();
999 break;
1000
1001 case symbol_kind::S_value: // value
1002 case symbol_kind::S_expression: // expression
1003 case symbol_kind::S_delay: // delay
1004 case symbol_kind::S_sideset: // sideset
1005 value.template destroy< std::shared_ptr<resolvable> > ();
1006 break;
1007
1008 case symbol_kind::S_label_decl: // label_decl
1009 case symbol_kind::S_symbol_def: // symbol_def
1010 value.template destroy< std::shared_ptr<symbol> > ();
1011 break;
1012
1013 case symbol_kind::S_wait_source: // wait_source
1014 value.template destroy< std::shared_ptr<wait_source> > ();
1015 break;
1016
1017 case symbol_kind::S_ID: // "identifier"
1018 case symbol_kind::S_STRING: // "string"
1019 case symbol_kind::S_NON_WS: // "text"
1020 case symbol_kind::S_CODE_BLOCK_START: // "code block"
1021 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}"
1022 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE
1023 value.template destroy< std::string > ();
1024 break;
1025
1026 default:
1027 break;
1028 }
1029
1030 Base::clear ();
1031 }
1032
1033 /// The user-facing name of this symbol.
1034 std::string name () const YY_NOEXCEPT
1035 {
1036 return parser::symbol_name (this->kind ());
1037 }
1038
1039 /// Backward compatibility (Bison 3.6).
1040 symbol_kind_type type_get () const YY_NOEXCEPT;
1041
1042 /// Whether empty.
1043 bool empty () const YY_NOEXCEPT;
1044
1045 /// Destructive move, \a s is emptied into this.
1046 void move (basic_symbol& s);
1047
1048 /// The semantic value.
1049 semantic_type value;
1050
1051 /// The location.
1052 location_type location;
1053
1054 private:
1055#if YY_CPLUSPLUS < 201103L
1056 /// Assignment operator.
1057 basic_symbol& operator= (const basic_symbol& that);
1058#endif
1059 };
1060
1061 /// Type access provider for token (enum) based symbols.
1062 struct by_kind
1063 {
1064 /// Default constructor.
1065 by_kind ();
1066
1067#if 201103L <= YY_CPLUSPLUS
1068 /// Move constructor.
1069 by_kind (by_kind&& that);
1070#endif
1071
1072 /// Copy constructor.
1073 by_kind (const by_kind& that);
1074
1075 /// The symbol kind as needed by the constructor.
1076 typedef token_kind_type kind_type;
1077
1078 /// Constructor from (external) token numbers.
1079 by_kind (kind_type t);
1080
1081 /// Record that this symbol is empty.
1082 void clear ();
1083
1084 /// Steal the symbol kind from \a that.
1085 void move (by_kind& that);
1086
1087 /// The (internal) type number (corresponding to \a type).
1088 /// \a empty when empty.
1089 symbol_kind_type kind () const YY_NOEXCEPT;
1090
1091 /// Backward compatibility (Bison 3.6).
1092 symbol_kind_type type_get () const YY_NOEXCEPT;
1093
1094 /// The symbol kind.
1095 /// \a S_YYEMPTY when empty.
1096 symbol_kind_type kind_;
1097 };
1098
1099 /// Backward compatibility for a private implementation detail (Bison 3.6).
1100 typedef by_kind by_type;
1101
1102 /// "External" symbols: returned by the scanner.
1103 struct symbol_type : basic_symbol<by_kind>
1104 {
1105 /// Superclass.
1106 typedef basic_symbol<by_kind> super_type;
1107
1108 /// Empty symbol.
1109 symbol_type () {}
1110
1111 /// Constructor for valueless symbols, and symbols from each type.
1112#if 201103L <= YY_CPLUSPLUS
1113 symbol_type (int tok, location_type l)
1114 : super_type(token_type (tok), std::move (l))
1115 {
1116 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_POST_DECREMENT || tok == token::TOK_NOT_EQUAL || tok == token::TOK_NOT || tok == token::TOK_REVERSE || tok == token::TOK_EQUAL || 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_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_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);
1117 }
1118#else
1119 symbol_type (int tok, const location_type& l)
1120 : super_type(token_type (tok), l)
1121 {
1122 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_POST_DECREMENT || tok == token::TOK_NOT_EQUAL || tok == token::TOK_NOT || tok == token::TOK_REVERSE || tok == token::TOK_EQUAL || 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_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_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);
1123 }
1124#endif
1125#if 201103L <= YY_CPLUSPLUS
1126 symbol_type (int tok, int v, location_type l)
1127 : super_type(token_type (tok), std::move (v), std::move (l))
1128 {
1129 YY_ASSERT (tok == token::TOK_INT);
1130 }
1131#else
1132 symbol_type (int tok, const int& v, const location_type& l)
1133 : super_type(token_type (tok), v, l)
1134 {
1135 YY_ASSERT (tok == token::TOK_INT);
1136 }
1137#endif
1138#if 201103L <= YY_CPLUSPLUS
1139 symbol_type (int tok, std::string v, location_type l)
1140 : super_type(token_type (tok), std::move (v), std::move (l))
1141 {
1142 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);
1143 }
1144#else
1145 symbol_type (int tok, const std::string& v, const location_type& l)
1146 : super_type(token_type (tok), v, l)
1147 {
1148 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);
1149 }
1150#endif
1151 };
1152
1153 /// Build a parser object.
1154 parser (pio_assembler& pioasm_yyarg);
1155 virtual ~parser ();
1156
1157#if 201103L <= YY_CPLUSPLUS
1158 /// Non copyable.
1159 parser (const parser&) = delete;
1160 /// Non copyable.
1161 parser& operator= (const parser&) = delete;
1162#endif
1163
1164 /// Parse. An alias for parse ().
1165 /// \returns 0 iff parsing succeeded.
1166 int operator() ();
1167
1168 /// Parse.
1169 /// \returns 0 iff parsing succeeded.
1170 virtual int parse ();
1171
1172#if YYDEBUG
1173 /// The current debugging stream.
1174 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
1175 /// Set the current debugging stream.
1176 void set_debug_stream (std::ostream &);
1177
1178 /// Type for debugging levels.
1179 typedef int debug_level_type;
1180 /// The current debugging level.
1181 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
1182 /// Set the current debugging level.
1183 void set_debug_level (debug_level_type l);
1184#endif
1185
1186 /// Report a syntax error.
1187 /// \param loc where the syntax error is found.
1188 /// \param msg a description of the syntax error.
1189 virtual void error (const location_type& loc, const std::string& msg);
1190
1191 /// Report a syntax error.
1192 void error (const syntax_error& err);
1193
1194 /// The user-facing name of the symbol whose (internal) number is
1195 /// YYSYMBOL. No bounds checking.
1196 static std::string symbol_name (symbol_kind_type yysymbol);
1197
1198 // Implementation of make_symbol for each symbol type.
1199#if 201103L <= YY_CPLUSPLUS
1200 static
1201 symbol_type
1202 make_END (location_type l)
1203 {
1204 return symbol_type (token::TOK_END, std::move (l));
1205 }
1206#else
1207 static
1208 symbol_type
1209 make_END (const location_type& l)
1210 {
1211 return symbol_type (token::TOK_END, l);
1212 }
1213#endif
1214#if 201103L <= YY_CPLUSPLUS
1215 static
1216 symbol_type
1217 make_YYerror (location_type l)
1218 {
1219 return symbol_type (token::TOK_YYerror, std::move (l));
1220 }
1221#else
1222 static
1223 symbol_type
1224 make_YYerror (const location_type& l)
1225 {
1226 return symbol_type (token::TOK_YYerror, l);
1227 }
1228#endif
1229#if 201103L <= YY_CPLUSPLUS
1230 static
1231 symbol_type
1232 make_YYUNDEF (location_type l)
1233 {
1234 return symbol_type (token::TOK_YYUNDEF, std::move (l));
1235 }
1236#else
1237 static
1238 symbol_type
1239 make_YYUNDEF (const location_type& l)
1240 {
1241 return symbol_type (token::TOK_YYUNDEF, l);
1242 }
1243#endif
1244#if 201103L <= YY_CPLUSPLUS
1245 static
1246 symbol_type
1247 make_NEWLINE (location_type l)
1248 {
1249 return symbol_type (token::TOK_NEWLINE, std::move (l));
1250 }
1251#else
1252 static
1253 symbol_type
1254 make_NEWLINE (const location_type& l)
1255 {
1256 return symbol_type (token::TOK_NEWLINE, l);
1257 }
1258#endif
1259#if 201103L <= YY_CPLUSPLUS
1260 static
1261 symbol_type
1262 make_COMMA (location_type l)
1263 {
1264 return symbol_type (token::TOK_COMMA, std::move (l));
1265 }
1266#else
1267 static
1268 symbol_type
1269 make_COMMA (const location_type& l)
1270 {
1271 return symbol_type (token::TOK_COMMA, l);
1272 }
1273#endif
1274#if 201103L <= YY_CPLUSPLUS
1275 static
1276 symbol_type
1277 make_COLON (location_type l)
1278 {
1279 return symbol_type (token::TOK_COLON, std::move (l));
1280 }
1281#else
1282 static
1283 symbol_type
1284 make_COLON (const location_type& l)
1285 {
1286 return symbol_type (token::TOK_COLON, l);
1287 }
1288#endif
1289#if 201103L <= YY_CPLUSPLUS
1290 static
1291 symbol_type
1292 make_LPAREN (location_type l)
1293 {
1294 return symbol_type (token::TOK_LPAREN, std::move (l));
1295 }
1296#else
1297 static
1298 symbol_type
1299 make_LPAREN (const location_type& l)
1300 {
1301 return symbol_type (token::TOK_LPAREN, l);
1302 }
1303#endif
1304#if 201103L <= YY_CPLUSPLUS
1305 static
1306 symbol_type
1307 make_RPAREN (location_type l)
1308 {
1309 return symbol_type (token::TOK_RPAREN, std::move (l));
1310 }
1311#else
1312 static
1313 symbol_type
1314 make_RPAREN (const location_type& l)
1315 {
1316 return symbol_type (token::TOK_RPAREN, l);
1317 }
1318#endif
1319#if 201103L <= YY_CPLUSPLUS
1320 static
1321 symbol_type
1322 make_LBRACKET (location_type l)
1323 {
1324 return symbol_type (token::TOK_LBRACKET, std::move (l));
1325 }
1326#else
1327 static
1328 symbol_type
1329 make_LBRACKET (const location_type& l)
1330 {
1331 return symbol_type (token::TOK_LBRACKET, l);
1332 }
1333#endif
1334#if 201103L <= YY_CPLUSPLUS
1335 static
1336 symbol_type
1337 make_RBRACKET (location_type l)
1338 {
1339 return symbol_type (token::TOK_RBRACKET, std::move (l));
1340 }
1341#else
1342 static
1343 symbol_type
1344 make_RBRACKET (const location_type& l)
1345 {
1346 return symbol_type (token::TOK_RBRACKET, l);
1347 }
1348#endif
1349#if 201103L <= YY_CPLUSPLUS
1350 static
1351 symbol_type
1352 make_PLUS (location_type l)
1353 {
1354 return symbol_type (token::TOK_PLUS, std::move (l));
1355 }
1356#else
1357 static
1358 symbol_type
1359 make_PLUS (const location_type& l)
1360 {
1361 return symbol_type (token::TOK_PLUS, l);
1362 }
1363#endif
1364#if 201103L <= YY_CPLUSPLUS
1365 static
1366 symbol_type
1367 make_MINUS (location_type l)
1368 {
1369 return symbol_type (token::TOK_MINUS, std::move (l));
1370 }
1371#else
1372 static
1373 symbol_type
1374 make_MINUS (const location_type& l)
1375 {
1376 return symbol_type (token::TOK_MINUS, l);
1377 }
1378#endif
1379#if 201103L <= YY_CPLUSPLUS
1380 static
1381 symbol_type
1382 make_MULTIPLY (location_type l)
1383 {
1384 return symbol_type (token::TOK_MULTIPLY, std::move (l));
1385 }
1386#else
1387 static
1388 symbol_type
1389 make_MULTIPLY (const location_type& l)
1390 {
1391 return symbol_type (token::TOK_MULTIPLY, l);
1392 }
1393#endif
1394#if 201103L <= YY_CPLUSPLUS
1395 static
1396 symbol_type
1397 make_DIVIDE (location_type l)
1398 {
1399 return symbol_type (token::TOK_DIVIDE, std::move (l));
1400 }
1401#else
1402 static
1403 symbol_type
1404 make_DIVIDE (const location_type& l)
1405 {
1406 return symbol_type (token::TOK_DIVIDE, l);
1407 }
1408#endif
1409#if 201103L <= YY_CPLUSPLUS
1410 static
1411 symbol_type
1412 make_OR (location_type l)
1413 {
1414 return symbol_type (token::TOK_OR, std::move (l));
1415 }
1416#else
1417 static
1418 symbol_type
1419 make_OR (const location_type& l)
1420 {
1421 return symbol_type (token::TOK_OR, l);
1422 }
1423#endif
1424#if 201103L <= YY_CPLUSPLUS
1425 static
1426 symbol_type
1427 make_AND (location_type l)
1428 {
1429 return symbol_type (token::TOK_AND, std::move (l));
1430 }
1431#else
1432 static
1433 symbol_type
1434 make_AND (const location_type& l)
1435 {
1436 return symbol_type (token::TOK_AND, l);
1437 }
1438#endif
1439#if 201103L <= YY_CPLUSPLUS
1440 static
1441 symbol_type
1442 make_XOR (location_type l)
1443 {
1444 return symbol_type (token::TOK_XOR, std::move (l));
1445 }
1446#else
1447 static
1448 symbol_type
1449 make_XOR (const location_type& l)
1450 {
1451 return symbol_type (token::TOK_XOR, l);
1452 }
1453#endif
1454#if 201103L <= YY_CPLUSPLUS
1455 static
1456 symbol_type
1457 make_POST_DECREMENT (location_type l)
1458 {
1459 return symbol_type (token::TOK_POST_DECREMENT, std::move (l));
1460 }
1461#else
1462 static
1463 symbol_type
1464 make_POST_DECREMENT (const location_type& l)
1465 {
1466 return symbol_type (token::TOK_POST_DECREMENT, l);
1467 }
1468#endif
1469#if 201103L <= YY_CPLUSPLUS
1470 static
1471 symbol_type
1472 make_NOT_EQUAL (location_type l)
1473 {
1474 return symbol_type (token::TOK_NOT_EQUAL, std::move (l));
1475 }
1476#else
1477 static
1478 symbol_type
1479 make_NOT_EQUAL (const location_type& l)
1480 {
1481 return symbol_type (token::TOK_NOT_EQUAL, l);
1482 }
1483#endif
1484#if 201103L <= YY_CPLUSPLUS
1485 static
1486 symbol_type
1487 make_NOT (location_type l)
1488 {
1489 return symbol_type (token::TOK_NOT, std::move (l));
1490 }
1491#else
1492 static
1493 symbol_type
1494 make_NOT (const location_type& l)
1495 {
1496 return symbol_type (token::TOK_NOT, l);
1497 }
1498#endif
1499#if 201103L <= YY_CPLUSPLUS
1500 static
1501 symbol_type
1502 make_REVERSE (location_type l)
1503 {
1504 return symbol_type (token::TOK_REVERSE, std::move (l));
1505 }
1506#else
1507 static
1508 symbol_type
1509 make_REVERSE (const location_type& l)
1510 {
1511 return symbol_type (token::TOK_REVERSE, l);
1512 }
1513#endif
1514#if 201103L <= YY_CPLUSPLUS
1515 static
1516 symbol_type
1517 make_EQUAL (location_type l)
1518 {
1519 return symbol_type (token::TOK_EQUAL, std::move (l));
1520 }
1521#else
1522 static
1523 symbol_type
1524 make_EQUAL (const location_type& l)
1525 {
1526 return symbol_type (token::TOK_EQUAL, l);
1527 }
1528#endif
1529#if 201103L <= YY_CPLUSPLUS
1530 static
1531 symbol_type
1532 make_PROGRAM (location_type l)
1533 {
1534 return symbol_type (token::TOK_PROGRAM, std::move (l));
1535 }
1536#else
1537 static
1538 symbol_type
1539 make_PROGRAM (const location_type& l)
1540 {
1541 return symbol_type (token::TOK_PROGRAM, l);
1542 }
1543#endif
1544#if 201103L <= YY_CPLUSPLUS
1545 static
1546 symbol_type
1547 make_WRAP_TARGET (location_type l)
1548 {
1549 return symbol_type (token::TOK_WRAP_TARGET, std::move (l));
1550 }
1551#else
1552 static
1553 symbol_type
1554 make_WRAP_TARGET (const location_type& l)
1555 {
1556 return symbol_type (token::TOK_WRAP_TARGET, l);
1557 }
1558#endif
1559#if 201103L <= YY_CPLUSPLUS
1560 static
1561 symbol_type
1562 make_WRAP (location_type l)
1563 {
1564 return symbol_type (token::TOK_WRAP, std::move (l));
1565 }
1566#else
1567 static
1568 symbol_type
1569 make_WRAP (const location_type& l)
1570 {
1571 return symbol_type (token::TOK_WRAP, l);
1572 }
1573#endif
1574#if 201103L <= YY_CPLUSPLUS
1575 static
1576 symbol_type
1577 make_DEFINE (location_type l)
1578 {
1579 return symbol_type (token::TOK_DEFINE, std::move (l));
1580 }
1581#else
1582 static
1583 symbol_type
1584 make_DEFINE (const location_type& l)
1585 {
1586 return symbol_type (token::TOK_DEFINE, l);
1587 }
1588#endif
1589#if 201103L <= YY_CPLUSPLUS
1590 static
1591 symbol_type
1592 make_SIDE_SET (location_type l)
1593 {
1594 return symbol_type (token::TOK_SIDE_SET, std::move (l));
1595 }
1596#else
1597 static
1598 symbol_type
1599 make_SIDE_SET (const location_type& l)
1600 {
1601 return symbol_type (token::TOK_SIDE_SET, l);
1602 }
1603#endif
1604#if 201103L <= YY_CPLUSPLUS
1605 static
1606 symbol_type
1607 make_WORD (location_type l)
1608 {
1609 return symbol_type (token::TOK_WORD, std::move (l));
1610 }
1611#else
1612 static
1613 symbol_type
1614 make_WORD (const location_type& l)
1615 {
1616 return symbol_type (token::TOK_WORD, l);
1617 }
1618#endif
1619#if 201103L <= YY_CPLUSPLUS
1620 static
1621 symbol_type
1622 make_ORIGIN (location_type l)
1623 {
1624 return symbol_type (token::TOK_ORIGIN, std::move (l));
1625 }
1626#else
1627 static
1628 symbol_type
1629 make_ORIGIN (const location_type& l)
1630 {
1631 return symbol_type (token::TOK_ORIGIN, l);
1632 }
1633#endif
1634#if 201103L <= YY_CPLUSPLUS
1635 static
1636 symbol_type
1637 make_LANG_OPT (location_type l)
1638 {
1639 return symbol_type (token::TOK_LANG_OPT, std::move (l));
1640 }
1641#else
1642 static
1643 symbol_type
1644 make_LANG_OPT (const location_type& l)
1645 {
1646 return symbol_type (token::TOK_LANG_OPT, l);
1647 }
1648#endif
1649#if 201103L <= YY_CPLUSPLUS
1650 static
1651 symbol_type
1652 make_JMP (location_type l)
1653 {
1654 return symbol_type (token::TOK_JMP, std::move (l));
1655 }
1656#else
1657 static
1658 symbol_type
1659 make_JMP (const location_type& l)
1660 {
1661 return symbol_type (token::TOK_JMP, l);
1662 }
1663#endif
1664#if 201103L <= YY_CPLUSPLUS
1665 static
1666 symbol_type
1667 make_WAIT (location_type l)
1668 {
1669 return symbol_type (token::TOK_WAIT, std::move (l));
1670 }
1671#else
1672 static
1673 symbol_type
1674 make_WAIT (const location_type& l)
1675 {
1676 return symbol_type (token::TOK_WAIT, l);
1677 }
1678#endif
1679#if 201103L <= YY_CPLUSPLUS
1680 static
1681 symbol_type
1682 make_IN (location_type l)
1683 {
1684 return symbol_type (token::TOK_IN, std::move (l));
1685 }
1686#else
1687 static
1688 symbol_type
1689 make_IN (const location_type& l)
1690 {
1691 return symbol_type (token::TOK_IN, l);
1692 }
1693#endif
1694#if 201103L <= YY_CPLUSPLUS
1695 static
1696 symbol_type
1697 make_OUT (location_type l)
1698 {
1699 return symbol_type (token::TOK_OUT, std::move (l));
1700 }
1701#else
1702 static
1703 symbol_type
1704 make_OUT (const location_type& l)
1705 {
1706 return symbol_type (token::TOK_OUT, l);
1707 }
1708#endif
1709#if 201103L <= YY_CPLUSPLUS
1710 static
1711 symbol_type
1712 make_PUSH (location_type l)
1713 {
1714 return symbol_type (token::TOK_PUSH, std::move (l));
1715 }
1716#else
1717 static
1718 symbol_type
1719 make_PUSH (const location_type& l)
1720 {
1721 return symbol_type (token::TOK_PUSH, l);
1722 }
1723#endif
1724#if 201103L <= YY_CPLUSPLUS
1725 static
1726 symbol_type
1727 make_PULL (location_type l)
1728 {
1729 return symbol_type (token::TOK_PULL, std::move (l));
1730 }
1731#else
1732 static
1733 symbol_type
1734 make_PULL (const location_type& l)
1735 {
1736 return symbol_type (token::TOK_PULL, l);
1737 }
1738#endif
1739#if 201103L <= YY_CPLUSPLUS
1740 static
1741 symbol_type
1742 make_MOV (location_type l)
1743 {
1744 return symbol_type (token::TOK_MOV, std::move (l));
1745 }
1746#else
1747 static
1748 symbol_type
1749 make_MOV (const location_type& l)
1750 {
1751 return symbol_type (token::TOK_MOV, l);
1752 }
1753#endif
1754#if 201103L <= YY_CPLUSPLUS
1755 static
1756 symbol_type
1757 make_IRQ (location_type l)
1758 {
1759 return symbol_type (token::TOK_IRQ, std::move (l));
1760 }
1761#else
1762 static
1763 symbol_type
1764 make_IRQ (const location_type& l)
1765 {
1766 return symbol_type (token::TOK_IRQ, l);
1767 }
1768#endif
1769#if 201103L <= YY_CPLUSPLUS
1770 static
1771 symbol_type
1772 make_SET (location_type l)
1773 {
1774 return symbol_type (token::TOK_SET, std::move (l));
1775 }
1776#else
1777 static
1778 symbol_type
1779 make_SET (const location_type& l)
1780 {
1781 return symbol_type (token::TOK_SET, l);
1782 }
1783#endif
1784#if 201103L <= YY_CPLUSPLUS
1785 static
1786 symbol_type
1787 make_NOP (location_type l)
1788 {
1789 return symbol_type (token::TOK_NOP, std::move (l));
1790 }
1791#else
1792 static
1793 symbol_type
1794 make_NOP (const location_type& l)
1795 {
1796 return symbol_type (token::TOK_NOP, l);
1797 }
1798#endif
1799#if 201103L <= YY_CPLUSPLUS
1800 static
1801 symbol_type
1802 make_PIN (location_type l)
1803 {
1804 return symbol_type (token::TOK_PIN, std::move (l));
1805 }
1806#else
1807 static
1808 symbol_type
1809 make_PIN (const location_type& l)
1810 {
1811 return symbol_type (token::TOK_PIN, l);
1812 }
1813#endif
1814#if 201103L <= YY_CPLUSPLUS
1815 static
1816 symbol_type
1817 make_GPIO (location_type l)
1818 {
1819 return symbol_type (token::TOK_GPIO, std::move (l));
1820 }
1821#else
1822 static
1823 symbol_type
1824 make_GPIO (const location_type& l)
1825 {
1826 return symbol_type (token::TOK_GPIO, l);
1827 }
1828#endif
1829#if 201103L <= YY_CPLUSPLUS
1830 static
1831 symbol_type
1832 make_OSRE (location_type l)
1833 {
1834 return symbol_type (token::TOK_OSRE, std::move (l));
1835 }
1836#else
1837 static
1838 symbol_type
1839 make_OSRE (const location_type& l)
1840 {
1841 return symbol_type (token::TOK_OSRE, l);
1842 }
1843#endif
1844#if 201103L <= YY_CPLUSPLUS
1845 static
1846 symbol_type
1847 make_PINS (location_type l)
1848 {
1849 return symbol_type (token::TOK_PINS, std::move (l));
1850 }
1851#else
1852 static
1853 symbol_type
1854 make_PINS (const location_type& l)
1855 {
1856 return symbol_type (token::TOK_PINS, l);
1857 }
1858#endif
1859#if 201103L <= YY_CPLUSPLUS
1860 static
1861 symbol_type
1862 make_NULL (location_type l)
1863 {
1864 return symbol_type (token::TOK_NULL, std::move (l));
1865 }
1866#else
1867 static
1868 symbol_type
1869 make_NULL (const location_type& l)
1870 {
1871 return symbol_type (token::TOK_NULL, l);
1872 }
1873#endif
1874#if 201103L <= YY_CPLUSPLUS
1875 static
1876 symbol_type
1877 make_PINDIRS (location_type l)
1878 {
1879 return symbol_type (token::TOK_PINDIRS, std::move (l));
1880 }
1881#else
1882 static
1883 symbol_type
1884 make_PINDIRS (const location_type& l)
1885 {
1886 return symbol_type (token::TOK_PINDIRS, l);
1887 }
1888#endif
1889#if 201103L <= YY_CPLUSPLUS
1890 static
1891 symbol_type
1892 make_BLOCK (location_type l)
1893 {
1894 return symbol_type (token::TOK_BLOCK, std::move (l));
1895 }
1896#else
1897 static
1898 symbol_type
1899 make_BLOCK (const location_type& l)
1900 {
1901 return symbol_type (token::TOK_BLOCK, l);
1902 }
1903#endif
1904#if 201103L <= YY_CPLUSPLUS
1905 static
1906 symbol_type
1907 make_NOBLOCK (location_type l)
1908 {
1909 return symbol_type (token::TOK_NOBLOCK, std::move (l));
1910 }
1911#else
1912 static
1913 symbol_type
1914 make_NOBLOCK (const location_type& l)
1915 {
1916 return symbol_type (token::TOK_NOBLOCK, l);
1917 }
1918#endif
1919#if 201103L <= YY_CPLUSPLUS
1920 static
1921 symbol_type
1922 make_IFEMPTY (location_type l)
1923 {
1924 return symbol_type (token::TOK_IFEMPTY, std::move (l));
1925 }
1926#else
1927 static
1928 symbol_type
1929 make_IFEMPTY (const location_type& l)
1930 {
1931 return symbol_type (token::TOK_IFEMPTY, l);
1932 }
1933#endif
1934#if 201103L <= YY_CPLUSPLUS
1935 static
1936 symbol_type
1937 make_IFFULL (location_type l)
1938 {
1939 return symbol_type (token::TOK_IFFULL, std::move (l));
1940 }
1941#else
1942 static
1943 symbol_type
1944 make_IFFULL (const location_type& l)
1945 {
1946 return symbol_type (token::TOK_IFFULL, l);
1947 }
1948#endif
1949#if 201103L <= YY_CPLUSPLUS
1950 static
1951 symbol_type
1952 make_NOWAIT (location_type l)
1953 {
1954 return symbol_type (token::TOK_NOWAIT, std::move (l));
1955 }
1956#else
1957 static
1958 symbol_type
1959 make_NOWAIT (const location_type& l)
1960 {
1961 return symbol_type (token::TOK_NOWAIT, l);
1962 }
1963#endif
1964#if 201103L <= YY_CPLUSPLUS
1965 static
1966 symbol_type
1967 make_CLEAR (location_type l)
1968 {
1969 return symbol_type (token::TOK_CLEAR, std::move (l));
1970 }
1971#else
1972 static
1973 symbol_type
1974 make_CLEAR (const location_type& l)
1975 {
1976 return symbol_type (token::TOK_CLEAR, l);
1977 }
1978#endif
1979#if 201103L <= YY_CPLUSPLUS
1980 static
1981 symbol_type
1982 make_REL (location_type l)
1983 {
1984 return symbol_type (token::TOK_REL, std::move (l));
1985 }
1986#else
1987 static
1988 symbol_type
1989 make_REL (const location_type& l)
1990 {
1991 return symbol_type (token::TOK_REL, l);
1992 }
1993#endif
1994#if 201103L <= YY_CPLUSPLUS
1995 static
1996 symbol_type
1997 make_X (location_type l)
1998 {
1999 return symbol_type (token::TOK_X, std::move (l));
2000 }
2001#else
2002 static
2003 symbol_type
2004 make_X (const location_type& l)
2005 {
2006 return symbol_type (token::TOK_X, l);
2007 }
2008#endif
2009#if 201103L <= YY_CPLUSPLUS
2010 static
2011 symbol_type
2012 make_Y (location_type l)
2013 {
2014 return symbol_type (token::TOK_Y, std::move (l));
2015 }
2016#else
2017 static
2018 symbol_type
2019 make_Y (const location_type& l)
2020 {
2021 return symbol_type (token::TOK_Y, l);
2022 }
2023#endif
2024#if 201103L <= YY_CPLUSPLUS
2025 static
2026 symbol_type
2027 make_EXEC (location_type l)
2028 {
2029 return symbol_type (token::TOK_EXEC, std::move (l));
2030 }
2031#else
2032 static
2033 symbol_type
2034 make_EXEC (const location_type& l)
2035 {
2036 return symbol_type (token::TOK_EXEC, l);
2037 }
2038#endif
2039#if 201103L <= YY_CPLUSPLUS
2040 static
2041 symbol_type
2042 make_PC (location_type l)
2043 {
2044 return symbol_type (token::TOK_PC, std::move (l));
2045 }
2046#else
2047 static
2048 symbol_type
2049 make_PC (const location_type& l)
2050 {
2051 return symbol_type (token::TOK_PC, l);
2052 }
2053#endif
2054#if 201103L <= YY_CPLUSPLUS
2055 static
2056 symbol_type
2057 make_ISR (location_type l)
2058 {
2059 return symbol_type (token::TOK_ISR, std::move (l));
2060 }
2061#else
2062 static
2063 symbol_type
2064 make_ISR (const location_type& l)
2065 {
2066 return symbol_type (token::TOK_ISR, l);
2067 }
2068#endif
2069#if 201103L <= YY_CPLUSPLUS
2070 static
2071 symbol_type
2072 make_OSR (location_type l)
2073 {
2074 return symbol_type (token::TOK_OSR, std::move (l));
2075 }
2076#else
2077 static
2078 symbol_type
2079 make_OSR (const location_type& l)
2080 {
2081 return symbol_type (token::TOK_OSR, l);
2082 }
2083#endif
2084#if 201103L <= YY_CPLUSPLUS
2085 static
2086 symbol_type
2087 make_OPTIONAL (location_type l)
2088 {
2089 return symbol_type (token::TOK_OPTIONAL, std::move (l));
2090 }
2091#else
2092 static
2093 symbol_type
2094 make_OPTIONAL (const location_type& l)
2095 {
2096 return symbol_type (token::TOK_OPTIONAL, l);
2097 }
2098#endif
2099#if 201103L <= YY_CPLUSPLUS
2100 static
2101 symbol_type
2102 make_SIDE (location_type l)
2103 {
2104 return symbol_type (token::TOK_SIDE, std::move (l));
2105 }
2106#else
2107 static
2108 symbol_type
2109 make_SIDE (const location_type& l)
2110 {
2111 return symbol_type (token::TOK_SIDE, l);
2112 }
2113#endif
2114#if 201103L <= YY_CPLUSPLUS
2115 static
2116 symbol_type
2117 make_STATUS (location_type l)
2118 {
2119 return symbol_type (token::TOK_STATUS, std::move (l));
2120 }
2121#else
2122 static
2123 symbol_type
2124 make_STATUS (const location_type& l)
2125 {
2126 return symbol_type (token::TOK_STATUS, l);
2127 }
2128#endif
2129#if 201103L <= YY_CPLUSPLUS
2130 static
2131 symbol_type
2132 make_PUBLIC (location_type l)
2133 {
2134 return symbol_type (token::TOK_PUBLIC, std::move (l));
2135 }
2136#else
2137 static
2138 symbol_type
2139 make_PUBLIC (const location_type& l)
2140 {
2141 return symbol_type (token::TOK_PUBLIC, l);
2142 }
2143#endif
2144#if 201103L <= YY_CPLUSPLUS
2145 static
2146 symbol_type
2147 make_ID (std::string v, location_type l)
2148 {
2149 return symbol_type (token::TOK_ID, std::move (v), std::move (l));
2150 }
2151#else
2152 static
2153 symbol_type
2154 make_ID (const std::string& v, const location_type& l)
2155 {
2156 return symbol_type (token::TOK_ID, v, l);
2157 }
2158#endif
2159#if 201103L <= YY_CPLUSPLUS
2160 static
2161 symbol_type
2162 make_STRING (std::string v, location_type l)
2163 {
2164 return symbol_type (token::TOK_STRING, std::move (v), std::move (l));
2165 }
2166#else
2167 static
2168 symbol_type
2169 make_STRING (const std::string& v, const location_type& l)
2170 {
2171 return symbol_type (token::TOK_STRING, v, l);
2172 }
2173#endif
2174#if 201103L <= YY_CPLUSPLUS
2175 static
2176 symbol_type
2177 make_NON_WS (std::string v, location_type l)
2178 {
2179 return symbol_type (token::TOK_NON_WS, std::move (v), std::move (l));
2180 }
2181#else
2182 static
2183 symbol_type
2184 make_NON_WS (const std::string& v, const location_type& l)
2185 {
2186 return symbol_type (token::TOK_NON_WS, v, l);
2187 }
2188#endif
2189#if 201103L <= YY_CPLUSPLUS
2190 static
2191 symbol_type
2192 make_CODE_BLOCK_START (std::string v, location_type l)
2193 {
2194 return symbol_type (token::TOK_CODE_BLOCK_START, std::move (v), std::move (l));
2195 }
2196#else
2197 static
2198 symbol_type
2199 make_CODE_BLOCK_START (const std::string& v, const location_type& l)
2200 {
2201 return symbol_type (token::TOK_CODE_BLOCK_START, v, l);
2202 }
2203#endif
2204#if 201103L <= YY_CPLUSPLUS
2205 static
2206 symbol_type
2207 make_CODE_BLOCK_CONTENTS (std::string v, location_type l)
2208 {
2209 return symbol_type (token::TOK_CODE_BLOCK_CONTENTS, std::move (v), std::move (l));
2210 }
2211#else
2212 static
2213 symbol_type
2214 make_CODE_BLOCK_CONTENTS (const std::string& v, const location_type& l)
2215 {
2216 return symbol_type (token::TOK_CODE_BLOCK_CONTENTS, v, l);
2217 }
2218#endif
2219#if 201103L <= YY_CPLUSPLUS
2220 static
2221 symbol_type
2222 make_UNKNOWN_DIRECTIVE (std::string v, location_type l)
2223 {
2224 return symbol_type (token::TOK_UNKNOWN_DIRECTIVE, std::move (v), std::move (l));
2225 }
2226#else
2227 static
2228 symbol_type
2229 make_UNKNOWN_DIRECTIVE (const std::string& v, const location_type& l)
2230 {
2231 return symbol_type (token::TOK_UNKNOWN_DIRECTIVE, v, l);
2232 }
2233#endif
2234#if 201103L <= YY_CPLUSPLUS
2235 static
2236 symbol_type
2237 make_INT (int v, location_type l)
2238 {
2239 return symbol_type (token::TOK_INT, std::move (v), std::move (l));
2240 }
2241#else
2242 static
2243 symbol_type
2244 make_INT (const int& v, const location_type& l)
2245 {
2246 return symbol_type (token::TOK_INT, v, l);
2247 }
2248#endif
2249
2250
2251 class context
2252 {
2253 public:
2254 context (const parser& yyparser, const symbol_type& yyla);
2255 const symbol_type& lookahead () const { return yyla_; }
2256 symbol_kind_type token () const { return yyla_.kind (); }
2257 const location_type& location () const { return yyla_.location; }
2258
2259 /// Put in YYARG at most YYARGN of the expected tokens, and return the
2260 /// number of tokens stored in YYARG. If YYARG is null, return the
2261 /// number of expected tokens (guaranteed to be less than YYNTOKENS).
2262 int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
2263
2264 private:
2265 const parser& yyparser_;
2266 const symbol_type& yyla_;
2267 };
2268
2269 private:
2270#if YY_CPLUSPLUS < 201103L
2271 /// Non copyable.
2272 parser (const parser&);
2273 /// Non copyable.
2274 parser& operator= (const parser&);
2275#endif
2276
2277 /// Check the lookahead yytoken.
2278 /// \returns true iff the token will be eventually shifted.
2279 bool yy_lac_check_ (symbol_kind_type yytoken) const;
2280 /// Establish the initial context if no initial context currently exists.
2281 /// \returns true iff the token will be eventually shifted.
2282 bool yy_lac_establish_ (symbol_kind_type yytoken);
2283 /// Discard any previous initial lookahead context because of event.
2284 /// \param event the event which caused the lookahead to be discarded.
2285 /// Only used for debbuging output.
2286 void yy_lac_discard_ (const char* event);
2287
2288 /// Stored state numbers (used for stacks).
2289 typedef unsigned char state_type;
2290
2291 /// The arguments of the error message.
2292 int yy_syntax_error_arguments_ (const context& yyctx,
2293 symbol_kind_type yyarg[], int yyargn) const;
2294
2295 /// Generate an error message.
2296 /// \param yyctx the context in which the error occurred.
2297 virtual std::string yysyntax_error_ (const context& yyctx) const;
2298 /// Compute post-reduction state.
2299 /// \param yystate the current state
2300 /// \param yysym the nonterminal to push on the stack
2301 static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
2302
2303 /// Whether the given \c yypact_ value indicates a defaulted state.
2304 /// \param yyvalue the value to check
2305 static bool yy_pact_value_is_default_ (int yyvalue);
2306
2307 /// Whether the given \c yytable_ value indicates a syntax error.
2308 /// \param yyvalue the value to check
2309 static bool yy_table_value_is_error_ (int yyvalue);
2310
2311 static const signed char yypact_ninf_;
2312 static const signed char yytable_ninf_;
2313
2314 /// Convert a scanner token kind \a t to a symbol kind.
2315 /// In theory \a t should be a token_kind_type, but character literals
2316 /// are valid, yet not members of the token_type enum.
2317 static symbol_kind_type yytranslate_ (int t);
2318
2319 /// Convert the symbol name \a n to a form suitable for a diagnostic.
2320 static std::string yytnamerr_ (const char *yystr);
2321
2322 /// For a symbol, its name in clear.
2323 static const char* const yytname_[];
2324
2325
2326 // Tables.
2327 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2328 // STATE-NUM.
2329 static const short yypact_[];
2330
2331 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
2332 // Performed when YYTABLE does not specify something else to do. Zero
2333 // means the default is an error.
2334 static const signed char yydefact_[];
2335
2336 // YYPGOTO[NTERM-NUM].
2337 static const short yypgoto_[];
2338
2339 // YYDEFGOTO[NTERM-NUM].
2340 static const short yydefgoto_[];
2341
2342 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
2343 // positive, shift that token. If negative, reduce the rule whose
2344 // number is the opposite. If YYTABLE_NINF, syntax error.
2345 static const short yytable_[];
2346
2347 static const unsigned char yycheck_[];
2348
2349 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2350 // symbol of state STATE-NUM.
2351 static const signed char yystos_[];
2352
2353 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
2354 static const signed char yyr1_[];
2355
2356 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
2357 static const signed char yyr2_[];
2358
2359
2360#if YYDEBUG
2361 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
2362 static const short yyrline_[];
2363 /// Report on the debug stream that the rule \a r is going to be reduced.
2364 virtual void yy_reduce_print_ (int r) const;
2365 /// Print the state stack on the debug stream.
2366 virtual void yy_stack_print_ () const;
2367
2368 /// Debugging level.
2369 int yydebug_;
2370 /// Debug stream.
2371 std::ostream* yycdebug_;
2372
2373 /// \brief Display a symbol kind, value and location.
2374 /// \param yyo The output stream.
2375 /// \param yysym The symbol.
2376 template <typename Base>
2377 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
2378#endif
2379
2380 /// \brief Reclaim the memory associated to a symbol.
2381 /// \param yymsg Why this token is reclaimed.
2382 /// If null, print nothing.
2383 /// \param yysym The symbol.
2384 template <typename Base>
2385 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
2386
2387 private:
2388 /// Type access provider for state based symbols.
2389 struct by_state
2390 {
2391 /// Default constructor.
2392 by_state () YY_NOEXCEPT;
2393
2394 /// The symbol kind as needed by the constructor.
2395 typedef state_type kind_type;
2396
2397 /// Constructor.
2398 by_state (kind_type s) YY_NOEXCEPT;
2399
2400 /// Copy constructor.
2401 by_state (const by_state& that) YY_NOEXCEPT;
2402
2403 /// Record that this symbol is empty.
2404 void clear () YY_NOEXCEPT;
2405
2406 /// Steal the symbol kind from \a that.
2407 void move (by_state& that);
2408
2409 /// The symbol kind (corresponding to \a state).
2410 /// \a symbol_kind::S_YYEMPTY when empty.
2411 symbol_kind_type kind () const YY_NOEXCEPT;
2412
2413 /// The state number used to denote an empty symbol.
2414 /// We use the initial state, as it does not have a value.
2415 enum { empty_state = 0 };
2416
2417 /// The state.
2418 /// \a empty when empty.
2419 state_type state;
2420 };
2421
2422 /// "Internal" symbol: element of the stack.
2423 struct stack_symbol_type : basic_symbol<by_state>
2424 {
2425 /// Superclass.
2426 typedef basic_symbol<by_state> super_type;
2427 /// Construct an empty symbol.
2428 stack_symbol_type ();
2429 /// Move or copy construction.
2430 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
2431 /// Steal the contents from \a sym to build this.
2432 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
2433#if YY_CPLUSPLUS < 201103L
2434 /// Assignment, needed by push_back by some old implementations.
2435 /// Moves the contents of that.
2436 stack_symbol_type& operator= (stack_symbol_type& that);
2437
2438 /// Assignment, needed by push_back by other implementations.
2439 /// Needed by some other old implementations.
2440 stack_symbol_type& operator= (const stack_symbol_type& that);
2441#endif
2442 };
2443
2444 /// A stack with random access from its top.
2445 template <typename T, typename S = std::vector<T> >
2446 class stack
2447 {
2448 public:
2449 // Hide our reversed order.
2450 typedef typename S::iterator iterator;
2451 typedef typename S::const_iterator const_iterator;
2452 typedef typename S::size_type size_type;
2453 typedef typename std::ptrdiff_t index_type;
2454
2455 stack (size_type n = 200)
2456 : seq_ (n)
2457 {}
2458
2459#if 201103L <= YY_CPLUSPLUS
2460 /// Non copyable.
2461 stack (const stack&) = delete;
2462 /// Non copyable.
2463 stack& operator= (const stack&) = delete;
2464#endif
2465
2466 /// Random access.
2467 ///
2468 /// Index 0 returns the topmost element.
2469 const T&
2470 operator[] (index_type i) const
2471 {
2472 return seq_[size_type (size () - 1 - i)];
2473 }
2474
2475 /// Random access.
2476 ///
2477 /// Index 0 returns the topmost element.
2478 T&
2479 operator[] (index_type i)
2480 {
2481 return seq_[size_type (size () - 1 - i)];
2482 }
2483
2484 /// Steal the contents of \a t.
2485 ///
2486 /// Close to move-semantics.
2487 void
2488 push (YY_MOVE_REF (T) t)
2489 {
2490 seq_.push_back (T ());
2491 operator[] (0).move (t);
2492 }
2493
2494 /// Pop elements from the stack.
2495 void
2496 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
2497 {
2498 for (; 0 < n; --n)
2499 seq_.pop_back ();
2500 }
2501
2502 /// Pop all elements from the stack.
2503 void
2504 clear () YY_NOEXCEPT
2505 {
2506 seq_.clear ();
2507 }
2508
2509 /// Number of elements on the stack.
2510 index_type
2511 size () const YY_NOEXCEPT
2512 {
2513 return index_type (seq_.size ());
2514 }
2515
2516 /// Iterator on top of the stack (going downwards).
2517 const_iterator
2518 begin () const YY_NOEXCEPT
2519 {
2520 return seq_.begin ();
2521 }
2522
2523 /// Bottom of the stack.
2524 const_iterator
2525 end () const YY_NOEXCEPT
2526 {
2527 return seq_.end ();
2528 }
2529
2530 /// Present a slice of the top of a stack.
2531 class slice
2532 {
2533 public:
2534 slice (const stack& stack, index_type range)
2535 : stack_ (stack)
2536 , range_ (range)
2537 {}
2538
2539 const T&
2540 operator[] (index_type i) const
2541 {
2542 return stack_[range_ - i];
2543 }
2544
2545 private:
2546 const stack& stack_;
2547 index_type range_;
2548 };
2549
2550 private:
2551#if YY_CPLUSPLUS < 201103L
2552 /// Non copyable.
2553 stack (const stack&);
2554 /// Non copyable.
2555 stack& operator= (const stack&);
2556#endif
2557 /// The wrapped container.
2558 S seq_;
2559 };
2560
2561
2562 /// Stack type.
2563 typedef stack<stack_symbol_type> stack_type;
2564
2565 /// The stack.
2566 stack_type yystack_;
2567 /// The stack for LAC.
2568 /// Logically, the yy_lac_stack's lifetime is confined to the function
2569 /// yy_lac_check_. We just store it as a member of this class to hold
2570 /// on to the memory and to avoid frequent reallocations.
2571 /// Since yy_lac_check_ is const, this member must be mutable.
2572 mutable std::vector<state_type> yylac_stack_;
2573 /// Whether an initial LAC context was established.
2574 bool yy_lac_established_;
2575
2576
2577 /// Push a new state on the stack.
2578 /// \param m a debug message to display
2579 /// if null, no trace is output.
2580 /// \param sym the symbol
2581 /// \warning the contents of \a s.value is stolen.
2582 void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
2583
2584 /// Push a new look ahead token on the state on the stack.
2585 /// \param m a debug message to display
2586 /// if null, no trace is output.
2587 /// \param s the state
2588 /// \param sym the symbol (for its value and location).
2589 /// \warning the contents of \a sym.value is stolen.
2590 void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
2591
2592 /// Pop \a n symbols from the stack.
2593 void yypop_ (int n = 1);
2594
2595 /// Constants.
2596 enum
2597 {
2598 yylast_ = 205, ///< Last index in yytable_.
2599 yynnts_ = 27, ///< Number of nonterminal symbols.
2600 yyfinal_ = 96 ///< Termination state number.
2601 };
2602
2603
2604 // User arguments.
2605 pio_assembler& pioasm;
2606
2607 };
2608
2609 inline
2610 parser::symbol_kind_type
2611 parser::yytranslate_ (int t)
2612 {
2613 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
2614 // TOKEN-NUM as returned by yylex.
2615 static
2616 const signed char
2617 translate_table[] =
2618 {
2619 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2644 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2645 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2646 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2647 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2648 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2649 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2650 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2651 65, 66, 67, 68, 69
2652 };
2653 // Last valid token kind.
2654 const int code_max = 324;
2655
2656 if (t <= 0)
2657 return symbol_kind::S_YYEOF;
2658 else if (t <= code_max)
2659 return YY_CAST (symbol_kind_type, translate_table[t]);
2660 else
2661 return symbol_kind::S_YYUNDEF;
2662 }
2663
2664 // basic_symbol.
2665 template <typename Base>
2666 parser::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
2667 : Base (that)
2668 , value ()
2669 , location (that.location)
2670 {
2671 switch (this->kind ())
2672 {
2673 case symbol_kind::S_if_full: // if_full
2674 case symbol_kind::S_if_empty: // if_empty
2675 case symbol_kind::S_blocking: // blocking
2676 value.copy< bool > (YY_MOVE (that.value));
2677 break;
2678
2679 case symbol_kind::S_condition: // condition
2680 value.copy< enum condition > (YY_MOVE (that.value));
2681 break;
2682
2683 case symbol_kind::S_in_source: // in_source
2684 case symbol_kind::S_out_target: // out_target
2685 case symbol_kind::S_set_target: // set_target
2686 value.copy< enum in_out_set > (YY_MOVE (that.value));
2687 break;
2688
2689 case symbol_kind::S_irq_modifiers: // irq_modifiers
2690 value.copy< enum irq > (YY_MOVE (that.value));
2691 break;
2692
2693 case symbol_kind::S_mov_target: // mov_target
2694 case symbol_kind::S_mov_source: // mov_source
2695 value.copy< enum mov > (YY_MOVE (that.value));
2696 break;
2697
2698 case symbol_kind::S_mov_op: // mov_op
2699 value.copy< enum mov_op > (YY_MOVE (that.value));
2700 break;
2701
2702 case symbol_kind::S_INT: // "integer"
2703 value.copy< int > (YY_MOVE (that.value));
2704 break;
2705
2706 case symbol_kind::S_instruction: // instruction
2707 case symbol_kind::S_base_instruction: // base_instruction
2708 value.copy< std::shared_ptr<instruction> > (YY_MOVE (that.value));
2709 break;
2710
2711 case symbol_kind::S_value: // value
2712 case symbol_kind::S_expression: // expression
2713 case symbol_kind::S_delay: // delay
2714 case symbol_kind::S_sideset: // sideset
2715 value.copy< std::shared_ptr<resolvable> > (YY_MOVE (that.value));
2716 break;
2717
2718 case symbol_kind::S_label_decl: // label_decl
2719 case symbol_kind::S_symbol_def: // symbol_def
2720 value.copy< std::shared_ptr<symbol> > (YY_MOVE (that.value));
2721 break;
2722
2723 case symbol_kind::S_wait_source: // wait_source
2724 value.copy< std::shared_ptr<wait_source> > (YY_MOVE (that.value));
2725 break;
2726
2727 case symbol_kind::S_ID: // "identifier"
2728 case symbol_kind::S_STRING: // "string"
2729 case symbol_kind::S_NON_WS: // "text"
2730 case symbol_kind::S_CODE_BLOCK_START: // "code block"
2731 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}"
2732 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE
2733 value.copy< std::string > (YY_MOVE (that.value));
2734 break;
2735
2736 default:
2737 break;
2738 }
2739
2740 }
2741
2742
2743
2744 template <typename Base>
2745 parser::symbol_kind_type
2746 parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
2747 {
2748 return this->kind ();
2749 }
2750
2751 template <typename Base>
2752 bool
2753 parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
2754 {
2755 return this->kind () == symbol_kind::S_YYEMPTY;
2756 }
2757
2758 template <typename Base>
2759 void
2760 parser::basic_symbol<Base>::move (basic_symbol& s)
2761 {
2762 super_type::move (s);
2763 switch (this->kind ())
2764 {
2765 case symbol_kind::S_if_full: // if_full
2766 case symbol_kind::S_if_empty: // if_empty
2767 case symbol_kind::S_blocking: // blocking
2768 value.move< bool > (YY_MOVE (s.value));
2769 break;
2770
2771 case symbol_kind::S_condition: // condition
2772 value.move< enum condition > (YY_MOVE (s.value));
2773 break;
2774
2775 case symbol_kind::S_in_source: // in_source
2776 case symbol_kind::S_out_target: // out_target
2777 case symbol_kind::S_set_target: // set_target
2778 value.move< enum in_out_set > (YY_MOVE (s.value));
2779 break;
2780
2781 case symbol_kind::S_irq_modifiers: // irq_modifiers
2782 value.move< enum irq > (YY_MOVE (s.value));
2783 break;
2784
2785 case symbol_kind::S_mov_target: // mov_target
2786 case symbol_kind::S_mov_source: // mov_source
2787 value.move< enum mov > (YY_MOVE (s.value));
2788 break;
2789
2790 case symbol_kind::S_mov_op: // mov_op
2791 value.move< enum mov_op > (YY_MOVE (s.value));
2792 break;
2793
2794 case symbol_kind::S_INT: // "integer"
2795 value.move< int > (YY_MOVE (s.value));
2796 break;
2797
2798 case symbol_kind::S_instruction: // instruction
2799 case symbol_kind::S_base_instruction: // base_instruction
2800 value.move< std::shared_ptr<instruction> > (YY_MOVE (s.value));
2801 break;
2802
2803 case symbol_kind::S_value: // value
2804 case symbol_kind::S_expression: // expression
2805 case symbol_kind::S_delay: // delay
2806 case symbol_kind::S_sideset: // sideset
2807 value.move< std::shared_ptr<resolvable> > (YY_MOVE (s.value));
2808 break;
2809
2810 case symbol_kind::S_label_decl: // label_decl
2811 case symbol_kind::S_symbol_def: // symbol_def
2812 value.move< std::shared_ptr<symbol> > (YY_MOVE (s.value));
2813 break;
2814
2815 case symbol_kind::S_wait_source: // wait_source
2816 value.move< std::shared_ptr<wait_source> > (YY_MOVE (s.value));
2817 break;
2818
2819 case symbol_kind::S_ID: // "identifier"
2820 case symbol_kind::S_STRING: // "string"
2821 case symbol_kind::S_NON_WS: // "text"
2822 case symbol_kind::S_CODE_BLOCK_START: // "code block"
2823 case symbol_kind::S_CODE_BLOCK_CONTENTS: // "%}"
2824 case symbol_kind::S_UNKNOWN_DIRECTIVE: // UNKNOWN_DIRECTIVE
2825 value.move< std::string > (YY_MOVE (s.value));
2826 break;
2827
2828 default:
2829 break;
2830 }
2831
2832 location = YY_MOVE (s.location);
2833 }
2834
2835 // by_kind.
2836 inline
2837 parser::by_kind::by_kind ()
2838 : kind_ (symbol_kind::S_YYEMPTY)
2839 {}
2840
2841#if 201103L <= YY_CPLUSPLUS
2842 inline
2843 parser::by_kind::by_kind (by_kind&& that)
2844 : kind_ (that.kind_)
2845 {
2846 that.clear ();
2847 }
2848#endif
2849
2850 inline
2851 parser::by_kind::by_kind (const by_kind& that)
2852 : kind_ (that.kind_)
2853 {}
2854
2855 inline
2856 parser::by_kind::by_kind (token_kind_type t)
2857 : kind_ (yytranslate_ (t))
2858 {}
2859
2860 inline
2861 void
2862 parser::by_kind::clear ()
2863 {
2864 kind_ = symbol_kind::S_YYEMPTY;
2865 }
2866
2867 inline
2868 void
2869 parser::by_kind::move (by_kind& that)
2870 {
2871 kind_ = that.kind_;
2872 that.clear ();
2873 }
2874
2875 inline
2876 parser::symbol_kind_type
2877 parser::by_kind::kind () const YY_NOEXCEPT
2878 {
2879 return kind_;
2880 }
2881
2882 inline
2883 parser::symbol_kind_type
2884 parser::by_kind::type_get () const YY_NOEXCEPT
2885 {
2886 return this->kind ();
2887 }
2888
2889} // yy
2890
2891
2892
2893
2894#endif // !YY_YY_HOME_GRAHAM_DEV_MU_PICO_SDK_TOOLS_PIOASM_GEN_PARSER_HPP_INCLUDED