37 #ifndef PARSER_HEADER_H
38 # define PARSER_HEADER_H
51 #line 25 "json_parser.yy"
54 #include "json_scanner.h"
55 #include "qjson_debug.h"
57 #include <QtCore/QByteArray>
58 #include <QtCore/QMap>
59 #include <QtCore/QString>
60 #include <QtCore/QVariant>
68 #define YYERROR_VERBOSE 1
72 #line 73 "json_parser.hh"
82 #ifdef YYERROR_VERBOSE
83 # undef YYERROR_VERBOSE
84 # define YYERROR_VERBOSE 1
86 # define YYERROR_VERBOSE 1
91 # define YYTOKEN_TABLE 0
98 #ifndef YYLLOC_DEFAULT
99 # define YYLLOC_DEFAULT(Current, Rhs, N) \
103 (Current).begin = (Rhs)[1].begin; \
104 (Current).end = (Rhs)[N].end; \
108 (Current).begin = (Current).end = (Rhs)[0].end; \
134 CURLY_BRACKET_OPEN = 1,
135 CURLY_BRACKET_CLOSE = 2,
136 SQUARE_BRACKET_OPEN = 3,
137 SQUARE_BRACKET_CLOSE = 4,
162 virtual int parse ();
180 virtual void error (
const location_type& loc,
const std::string& msg);
185 virtual std::string yysyntax_error_ (
int yystate,
int tok);
192 virtual void yy_symbol_value_print_ (
int yytype,
199 virtual void yy_symbol_print_ (
int yytype,
206 typedef int state_type;
208 typedef stack<state_type> state_stack_type;
210 typedef stack<semantic_type> semantic_stack_type;
212 typedef stack<location_type> location_stack_type;
215 state_stack_type yystate_stack_;
217 semantic_stack_type yysemantic_stack_;
219 location_stack_type yylocation_stack_;
222 typedef unsigned char token_number_type;
225 static const signed char yypact_[];
226 static const signed char yypact_ninf_;
231 static const unsigned char yydefact_[];
233 static const signed char yypgoto_[];
234 static const signed char yydefgoto_[];
241 static const unsigned char yytable_[];
242 static const signed char yytable_ninf_;
244 static const unsigned char yycheck_[];
247 static const unsigned char yystos_[];
250 static const unsigned char yyr1_[];
252 static const unsigned char yyr2_[];
254 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
256 static const char*
const yytname_[];
261 virtual std::string yytnamerr_ (
const char *n);
266 typedef signed char rhs_number_type;
268 static const rhs_number_type yyrhs_[];
270 static const unsigned char yyprhs_[];
272 static const unsigned char yyrline_[];
274 static const unsigned short int yytoken_number_[];
276 virtual void yy_reduce_print_ (
int r);
278 virtual void yystack_print_ ();
282 token_number_type yytranslate_ (
int t);
289 inline void yydestruct_ (
const char* yymsg,
295 inline void yypop_ (
unsigned int n = 1);
298 static const int yyeof_;
300 static const int yylast_;
301 static const int yynnts_;
302 static const int yyempty_;
303 static const int yyfinal_;
304 static const int yyterror_;
305 static const int yyerrcode_;
306 static const int yyntokens_;
307 static const unsigned int yyuser_token_number_max_;
308 static const token_number_type yyundef_token_;
312 std::ostream* yycdebug_;
316 QJson::ParserPrivate* driver;