-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjparse.tab.ref.h
211 lines (186 loc) · 8.42 KB
/
jparse.tab.ref.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
* A programmer's apology and warning:
*
* Sorry (tm Canada :-)) for the appalling condition of the code below.
*
* The people who worked on these tools and library did NOT write this code.
* Well, OK, we DID write this comment and the code from jparse.y and jparse.l
* as well as the other tools; we refer instead to the code in jparse.tab.c,
* jparse.tab.h and their respective backup files jparse.tab.ref.c and
* jparse.tab.ref.h generated by bison, and the jparse.c, jparse.lex.h and their
* respective backup files jparse.ref.c and jparse.lex.ref.h generated by flex.
*
* WARNING: We do NOT recommend that you modify the generated code even though
* it is digitally odoriferous and has a gleety appearance. Beautification of
* this code, no matter how disagreeable it may seem, is unwise as such
* modifications tend to be practically impossible to maintain. Even if this
* Flying Spaghetti Monster style code tempts you to tweak it, doing so might
* produce visions and nightmares of Cthulhu-like tentacles grabbing at the very
* logic of your mind, pulling it down into a hideous maelstrom of code
* maintenance cacophony.
*
* OK, it might not give you nightmares but why take the risk? The point is
* don't work on this file! Instead work on the bison and flex related source
* files. See the Makefile for details on how this file was generated. See also
* run_bison.sh and run_flex.sh.
*
* Now some might be tempted to point out this code was originally in support of
* the International Obfuscated C Code Contest (IOCCC) and that objecting to the
* output of Bison and Flex borders on programming sanctimoniousness. At first
* glance, this incongruence is unsustainable. In response we opine that one of
* the fundamental undertones of the IOCCC is the promotion of good programming
* through irony by awarding highly obfuscated C code. So, if it helps, we
* suggest you view this apology in a satirical light, even if you are humour
* impaired. Nevertheless, we still recommend you to eschew modifying the code
* below.
*
* Thanks in advance for your understanding, and sorry (tm Canada :-)).
*
* Of course, on the other hand, the fact the scanner and parser are for JSON
* might suggest that we shouldn't have to apologise because the JSON spec is
* objectionable and so are the generated scanner and parser so this apology
* might very well be superfluous. If one were to then ignore the fact that
* bison and flex do not care what they are parsing this same person could
* argue, obviously by some perverted logical fallacies, that bison and flex did
* their job well. Well, OK they probably DID do their job well but in an
* objectionable way. :-)
*
* P.S. In 2022 April 04, when this comment was initially formed, none of the
* people working on this parser/scanner were Canadian. But some of them
* have several good friends who live in, or are from Canada. Those
* friends say sorry in a fun and friendly way, so we honour those friends
* accordingly.
*/
#line 1 "./jparse.tab.h"
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */
#ifndef YY_JPARSE_JPARSE_TAB_H_INCLUDED
# define YY_JPARSE_JPARSE_TAB_H_INCLUDED
/* Debug traces. */
#ifndef JPARSE_DEBUG
# if defined YYDEBUG
#if YYDEBUG
# define JPARSE_DEBUG 1
# else
# define JPARSE_DEBUG 0
# endif
# else /* ! defined YYDEBUG */
# define JPARSE_DEBUG 0
# endif /* ! defined YYDEBUG */
#endif /* ! defined JPARSE_DEBUG */
#if JPARSE_DEBUG
extern int jparse_debug;
#endif
/* "%code requires" blocks. */
#line 123 "./jparse.y"
#if !defined(JPARSE_LTYPE_IS_DECLARED)
struct JPARSE_LTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
char const *filename;
};
typedef struct JPARSE_LTYPE JPARSE_LTYPE;
#define JPARSE_LTYPE_IS_DECLARED 1
#define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
(Current).filename = YYRHSLOC (Rhs, 1).filename; \
} \
else \
{ /* empty RHS */ \
(Current).first_line = (Current).last_line = \
YYRHSLOC (Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
(Current).filename = NULL; \
} \
while (0)
#endif
typedef void * yyscan_t;
#line 94 "jparse.tab.h"
/* Token kinds. */
#ifndef JPARSE_TOKENTYPE
# define JPARSE_TOKENTYPE
enum jparse_tokentype
{
JPARSE_EMPTY = -2,
JPARSE_EOF = 0, /* "end of file" */
JPARSE_error = 256, /* error */
JPARSE_UNDEF = 257, /* "invalid token" */
JSON_OPEN_BRACE = 258, /* "{" */
JSON_CLOSE_BRACE = 259, /* "}" */
JSON_OPEN_BRACKET = 260, /* "[" */
JSON_CLOSE_BRACKET = 261, /* "]" */
JSON_COMMA = 262, /* "," */
JSON_COLON = 263, /* ":" */
JSON_NULL = 264, /* "null" */
JSON_TRUE = 265, /* "true" */
JSON_FALSE = 266, /* "false" */
JSON_STRING = 267, /* JSON_STRING */
JSON_NUMBER = 268, /* JSON_NUMBER */
token = 269 /* token */
};
typedef enum jparse_tokentype jparse_token_kind_t;
#endif
/* Value type. */
#if ! defined JPARSE_STYPE && ! defined JPARSE_STYPE_IS_DECLARED
typedef struct json * JPARSE_STYPE;
# define JPARSE_STYPE_IS_TRIVIAL 1
# define JPARSE_STYPE_IS_DECLARED 1
#endif
/* Location type. */
#if ! defined JPARSE_LTYPE && ! defined JPARSE_LTYPE_IS_DECLARED
typedef struct JPARSE_LTYPE JPARSE_LTYPE;
struct JPARSE_LTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
};
# define JPARSE_LTYPE_IS_DECLARED 1
# define JPARSE_LTYPE_IS_TRIVIAL 1
#endif
int jparse_parse (struct json **tree, yyscan_t scanner);
/* "%code provides" blocks. */
#line 115 "./jparse.y"
#ifndef YY_DECL
#define YY_DECL int jparse_lex(JPARSE_STYPE *yylval_param, JPARSE_LTYPE *yylloc_param, yyscan_t yyscanner)
YY_DECL;
#endif
#line 156 "jparse.tab.h"
#endif /* !YY_JPARSE_JPARSE_TAB_H_INCLUDED */