lowparser.hpp
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Skeleton interface for Bison GLR parsers in C
4
5 Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <https://www.gnu.org/licenses/>. */
19
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33#ifndef YY_YY_USERS_KNIZ_REPO_BYEOLANG_BYEOL_MODULE_CORE_WORKER_BISON_LOWPARSER_HPP_INCLUDED
34# define YY_YY_USERS_KNIZ_REPO_BYEOLANG_BYEOL_MODULE_CORE_WORKER_BISON_LOWPARSER_HPP_INCLUDED
35/* Debug traces. */
36#ifndef YYDEBUG
37# define YYDEBUG 1
38#endif
39#if YYDEBUG
40extern int yydebug;
41#endif
42/* "%code requires" blocks. */
43
44 #include "core/ast/args.hpp"
46 #include "core/ast/modifier.hpp"
47
48 typedef void* yyscan_t;
49
50 namespace by {
51 class node;
52 class obj;
53 class immutableTactic;
54 template <typename K, typename V, typename TACTIC> class tnmap;
55 typedef tstr<node> str;
56 template <typename T, typename WRP> class tnarr;
57 typedef tnarr<node> narr;
58 }
59
60 struct lloc : public by::area {
61 int colcnt;
62 int strCol; // column position when it starts to parse string.
63
64 void rel() {
65 colcnt = 0;
66 by::area::rel();
67 }
68 };
69
70
71/* Token kinds. */
72#ifndef YYTOKENTYPE
73# define YYTOKENTYPE
74 enum yytokentype
75 {
76 YYEMPTY = -2,
77 YYEOF = 0, /* "end of file" */
78 YYerror = 256, /* error */
79 YYUNDEF = 257, /* "invalid token" */
80 SCAN_AGAIN = 258, /* SCAN_AGAIN */
81 SCAN_EXIT = 259, /* SCAN_EXIT */
82 SCAN_MODE_NORMAL = 260, /* SCAN_MODE_NORMAL */
83 SCAN_MODE_INDENT = 261, /* SCAN_MODE_INDENT */
84 SCAN_MODE_INDENT_IGNORE = 262, /* SCAN_MODE_INDENT_IGNORE */
85 SCAN_MODE_END = 263, /* SCAN_MODE_END */
86 IF = 264, /* IF */
87 _ELSE_ = 265, /* _ELSE_ */
88 RET = 266, /* RET */
89 NEXT = 267, /* NEXT */
90 BREAK = 268, /* BREAK */
91 _IN_ = 269, /* _IN_ */
92 IS = 270, /* IS */
93 _WHILE_ = 271, /* _WHILE_ */
94 FOR = 272, /* FOR */
95 DEF = 273, /* DEF */
96 WITH = 274, /* WITH */
97 AS = 275, /* AS */
98 ENUM = 276, /* ENUM */
99 ONLY = 277, /* ONLY */
100 END = 278, /* END */
101 _VOID_ = 279, /* _VOID_ */
102 _INT_ = 280, /* _INT_ */
103 _STR_ = 281, /* _STR_ */
104 _BOOL_ = 282, /* _BOOL_ */
105 FLT = 283, /* FLT */
106 NUL = 284, /* NUL */
107 _BYTE_ = 285, /* _BYTE_ */
108 ME = 286, /* ME */
109 SUPER = 287, /* SUPER */
110 IT = 288, /* IT */
111 CTOR = 289, /* CTOR */
112 PACK = 290, /* PACK */
113 NEWLINE = 291, /* NEWLINE */
114 INDENT = 292, /* INDENT */
115 DEDENT = 293, /* DEDENT */
116 ENDOFFILE = 294, /* ENDOFFILE */
117 DOUBLE_MINUS = 295, /* DOUBLE_MINUS */
118 DOUBLE_PLUS = 296, /* DOUBLE_PLUS */
119 DOUBLE_DOT = 297, /* DOUBLE_DOT */
120 ARROW = 298, /* ARROW */
121 TAB = 299, /* TAB */
122 ASSIGN = 300, /* ASSIGN */
123 DEFASSIGN = 301, /* DEFASSIGN */
124 OPEN_CLOSE_SQUARE_BRACKET = 302, /* OPEN_CLOSE_SQUARE_BRACKET */
125 GE = 303, /* GE */
126 LE = 304, /* LE */
127 EQ = 305, /* EQ */
128 NE = 306, /* NE */
129 LOGICAL_AND = 307, /* LOGICAL_AND */
130 LOGICAL_OR = 308, /* LOGICAL_OR */
131 LSHIFT = 309, /* LSHIFT */
132 RSHIFT = 310, /* RSHIFT */
133 ADD_ASSIGN = 311, /* ADD_ASSIGN */
134 SUB_ASSIGN = 312, /* SUB_ASSIGN */
135 MUL_ASSIGN = 313, /* MUL_ASSIGN */
136 DIV_ASSIGN = 314, /* DIV_ASSIGN */
137 MOD_ASSIGN = 315, /* MOD_ASSIGN */
138 OR_ASSIGN = 316, /* OR_ASSIGN */
139 AND_ASSIGN = 317, /* AND_ASSIGN */
140 XOR_ASSIGN = 318, /* XOR_ASSIGN */
141 INTVAL = 319, /* INTVAL */
142 FLTVAL = 320, /* FLTVAL */
143 BOOLVAL = 321, /* BOOLVAL */
144 NAME = 322, /* NAME */
145 STRVAL = 323 /* STRVAL */
146 };
147 typedef enum yytokentype yytoken_kind_t;
148#endif
149
150/* Value type. */
151#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
153{
154
155 int asInt;
156 std::string* asStr;
157 bool asBool;
158 float asFlt;
159 by::node* asNode;
160 by::obj* asObj;
161 by::narr* asNarr;
162 by::scope* asScope;
163 by::defBlock* asDefBlock;
164 by::args* asArgs;
165 by::modifier* asModifier;
166
167
168};
169typedef union YYSTYPE YYSTYPE;
170# define YYSTYPE_IS_TRIVIAL 1
171# define YYSTYPE_IS_DECLARED 1
172#endif
173
174/* Location type. */
175typedef lloc YYLTYPE;
176
177
178
179int yyparse (yyscan_t scanner);
180/* "%code provides" blocks. */
181
182 extern int yylineno;
183 extern char* yytext;
184 namespace by {
185 class parser;
186 }
187
188 extern "C" {
189 int yylex(YYSTYPE* val, YYLTYPE* loc, yyscan_t scanner);
190 void yyset_lineno(int linenumber, yyscan_t scanner);
191 by::parser* yyget_extra(yyscan_t scanner);
192 char* yyget_text(yyscan_t scanner);
193 void yyerror(YYLTYPE* loc, yyscan_t scanner, const char* msg);
194 }
195 std::string getTokenName(int tok);
196
197
198#endif /* !YY_YY_USERS_KNIZ_REPO_BYEOLANG_BYEOL_MODULE_CORE_WORKER_BISON_LOWPARSER_HPP_INCLUDED */
Function call arguments container.
Definition: args.hpp:13
Definition block for organizing object definitions.
Definition: defBlock.hpp:15
Access modifier for class members and func.
Definition: modifier.hpp:12
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Managed object in byeol programming environment.
Definition: obj.hpp:19
Parser for byeol language source code.
Definition: parser.hpp:43
Source code area tracking structure.
Definition: point.hpp:27
Definition: lowparser.hpp:60
Definition: lowparser.hpp:153