leafLowparser.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_ZZ_USERS_KNIZ_REPO_BYEOLANG_BYEOL_MODULE_LEAF_PARSER_BISON_LEAFLOWPARSER_HPP_INCLUDED
34# define YY_ZZ_USERS_KNIZ_REPO_BYEOLANG_BYEOL_MODULE_LEAF_PARSER_BISON_LEAFLOWPARSER_HPP_INCLUDED
35/* Debug traces. */
36#ifndef ZZDEBUG
37# if defined YYDEBUG
38#if YYDEBUG
39# define ZZDEBUG 1
40# else
41# define ZZDEBUG 0
42# endif
43# else /* ! defined YYDEBUG */
44# define ZZDEBUG 1
45# endif /* ! defined YYDEBUG */
46#endif /* ! defined ZZDEBUG */
47#if ZZDEBUG
48extern int zzdebug;
49#endif
50/* "%code requires" blocks. */
51
52 #include "leaf/ast/point.hpp"
53
54 typedef void* zzscan_t;
55
56 namespace by {
57 class leaf;
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 ZZTOKENTYPE
73# define ZZTOKENTYPE
74 enum zztokentype
75 {
76 ZZEMPTY = -2,
77 ZZEOF = 0, /* "end of file" */
78 ZZerror = 256, /* error */
79 ZZUNDEF = 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 DEF = 264, /* DEF */
87 _IN_ = 265, /* _IN_ */
88 _INT_ = 266, /* _INT_ */
89 _STR_ = 267, /* _STR_ */
90 _BOOL_ = 268, /* _BOOL_ */
91 FLT = 269, /* FLT */
92 NUL = 270, /* NUL */
93 _BYTE_ = 271, /* _BYTE_ */
94 NEWLINE = 272, /* NEWLINE */
95 INDENT = 273, /* INDENT */
96 DEDENT = 274, /* DEDENT */
97 ENDOFFILE = 275, /* ENDOFFILE */
98 DOUBLE_DOT = 276, /* DOUBLE_DOT */
99 TAB = 277, /* TAB */
100 DEFASSIGN = 278, /* DEFASSIGN */
101 OPEN_CLOSE_SQUARE_BRACKET = 279, /* OPEN_CLOSE_SQUARE_BRACKET */
102 INTVAL = 280, /* INTVAL */
103 FLTVAL = 281, /* FLTVAL */
104 BOOLVAL = 282, /* BOOLVAL */
105 NAME = 283, /* NAME */
106 STRVAL = 284, /* STRVAL */
107 VERVAL = 285 /* VERVAL */
108 };
109 typedef enum zztokentype zztoken_kind_t;
110#endif
111
112/* Value type. */
113#if ! defined ZZSTYPE && ! defined ZZSTYPE_IS_DECLARED
115{
116
117 int asInt;
118 float asFlt;
119 bool asBool;
120 char asChar;
121 std::string* asStr;
122 by::leaf* asLeaf;
123
124
125};
126typedef union ZZSTYPE ZZSTYPE;
127# define ZZSTYPE_IS_TRIVIAL 1
128# define ZZSTYPE_IS_DECLARED 1
129#endif
130
131/* Location type. */
132typedef lloc ZZLTYPE;
133
134
135
136int zzparse (zzscan_t scanner);
137/* "%code provides" blocks. */
138
139 extern int zzlineno;
140 extern char* yytext;
141 namespace by {
142 class leafParser;
143 }
144
145 extern "C" {
146 int zzlex(ZZSTYPE* val, ZZLTYPE* loc, zzscan_t scanner);
147 void zzset_lineno(int linenumber, zzscan_t scanner);
148 by::leafParser* zzget_extra(zzscan_t scanner);
149 char* zzget_text(zzscan_t scanner);
150 void zzerror(ZZLTYPE* loc, zzscan_t scanner, const char* msg);
151 }
152
153 std::string getTokenName(int tok);
154
155
156#endif /* !YY_ZZ_USERS_KNIZ_REPO_BYEOLANG_BYEOL_MODULE_LEAF_PARSER_BISON_LEAFLOWPARSER_HPP_INCLUDED */
Core AST node for leaf configuration language.
Definition: leaf.hpp:12
Parser for leaf configuration language.
Definition: leafParser.hpp:17
Source code area tracking structure.
Definition: point.hpp:27
Definition: lowparser.hpp:60
Definition: leafLowparser.hpp:115