00001 /* A Bison parser, made by GNU Bison 2.7. */ 00002 00003 /* Skeleton interface for Bison LALR(1) parsers in C++ 00004 00005 Copyright (C) 2002-2012 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00038 /* C++ LALR(1) parser skeleton written by Akim Demaille. */ 00039 00040 #ifndef YY_YY_JSON_PARSER_HH_INCLUDED 00041 # define YY_YY_JSON_PARSER_HH_INCLUDED 00042 00043 /* "%code requires" blocks. */ 00044 /* Line 33 of lalr1.cc */ 00045 #line 26 "json_parser.yy" 00046 00047 #include "parser_p.h" 00048 #include "json_scanner.h" 00049 #include "qjson_debug.h" 00050 00051 #include <QtCore/QByteArray> 00052 #include <QtCore/QMap> 00053 #include <QtCore/QString> 00054 #include <QtCore/QVariant> 00055 00056 #include <limits> 00057 00058 class JSonScanner; 00059 00060 namespace QJson { 00061 class Parser; 00062 } 00063 00064 #define YYERROR_VERBOSE 1 00065 00066 Q_DECLARE_METATYPE(QVector<QVariant>*) 00067 Q_DECLARE_METATYPE(QVariantMap*) 00068 00069 00070 /* Line 33 of lalr1.cc */ 00071 #line 72 "json_parser.hh" 00072 00073 00074 #include <string> 00075 #include <iostream> 00076 #include "stack.hh" 00077 #include "location.hh" 00078 00079 /* Enabling traces. */ 00080 #ifndef YYDEBUG 00081 # define YYDEBUG 1 00082 #endif 00083 00084 00085 namespace yy { 00086 /* Line 33 of lalr1.cc */ 00087 #line 88 "json_parser.hh" 00088 00090 class json_parser 00091 { 00092 public: 00094 #ifndef YYSTYPE 00095 typedef int semantic_type; 00096 #else 00097 typedef YYSTYPE semantic_type; 00098 #endif 00100 typedef location location_type; 00102 struct token 00103 { 00104 /* Tokens. */ 00105 enum yytokentype { 00106 END = 0, 00107 CURLY_BRACKET_OPEN = 1, 00108 CURLY_BRACKET_CLOSE = 2, 00109 SQUARE_BRACKET_OPEN = 3, 00110 SQUARE_BRACKET_CLOSE = 4, 00111 COLON = 5, 00112 COMMA = 6, 00113 NUMBER = 7, 00114 TRUE_VAL = 8, 00115 FALSE_VAL = 9, 00116 NULL_VAL = 10, 00117 STRING = 11, 00118 INVALID = 12 00119 }; 00120 00121 }; 00123 typedef token::yytokentype token_type; 00124 00126 json_parser (QJson::ParserPrivate* driver_yyarg); 00127 virtual ~json_parser (); 00128 00131 virtual int parse (); 00132 00133 #if YYDEBUG 00135 std::ostream& debug_stream () const; 00137 void set_debug_stream (std::ostream &); 00138 00140 typedef int debug_level_type; 00142 debug_level_type debug_level () const; 00144 void set_debug_level (debug_level_type l); 00145 #endif 00146 00147 private: 00151 virtual void error (const location_type& loc, const std::string& msg); 00152 00156 virtual std::string yysyntax_error_ (int yystate, int tok); 00157 00158 #if YYDEBUG 00163 virtual void yy_symbol_value_print_ (int yytype, 00164 const semantic_type* yyvaluep, 00165 const location_type* yylocationp); 00170 virtual void yy_symbol_print_ (int yytype, 00171 const semantic_type* yyvaluep, 00172 const location_type* yylocationp); 00173 #endif 00174 00175 00177 typedef int state_type; 00179 typedef stack<state_type> state_stack_type; 00181 typedef stack<semantic_type> semantic_stack_type; 00183 typedef stack<location_type> location_stack_type; 00184 00186 state_stack_type yystate_stack_; 00188 semantic_stack_type yysemantic_stack_; 00190 location_stack_type yylocation_stack_; 00191 00194 static bool yy_pact_value_is_default_ (int yyvalue); 00195 00198 static bool yy_table_value_is_error_ (int yyvalue); 00199 00201 typedef unsigned char token_number_type; 00202 /* Tables. */ 00204 static const signed char yypact_[]; 00205 static const signed char yypact_ninf_; 00206 00210 static const unsigned char yydefact_[]; 00211 00212 static const signed char yypgoto_[]; 00213 static const signed char yydefgoto_[]; 00214 00220 static const unsigned char yytable_[]; 00221 static const signed char yytable_ninf_; 00222 00223 static const signed char yycheck_[]; 00224 00226 static const unsigned char yystos_[]; 00227 00229 static const unsigned char yyr1_[]; 00231 static const unsigned char yyr2_[]; 00232 00234 static std::string yytnamerr_ (const char *n); 00235 00236 00238 static const char* const yytname_[]; 00239 #if YYDEBUG 00241 typedef signed char rhs_number_type; 00243 static const rhs_number_type yyrhs_[]; 00245 static const unsigned char yyprhs_[]; 00247 static const unsigned char yyrline_[]; 00249 static const unsigned short int yytoken_number_[]; 00251 virtual void yy_reduce_print_ (int r); 00253 virtual void yystack_print_ (); 00254 00255 /* Debugging. */ 00256 int yydebug_; 00257 std::ostream* yycdebug_; 00258 #endif 00259 00261 token_number_type yytranslate_ (int t); 00262 00269 inline void yydestruct_ (const char* yymsg, 00270 int yytype, 00271 semantic_type* yyvaluep, 00272 location_type* yylocationp); 00273 00275 inline void yypop_ (unsigned int n = 1); 00276 00277 /* Constants. */ 00278 static const int yyeof_; 00279 /* LAST_ -- Last index in TABLE_. */ 00280 static const int yylast_; 00281 static const int yynnts_; 00282 static const int yyempty_; 00283 static const int yyfinal_; 00284 static const int yyterror_; 00285 static const int yyerrcode_; 00286 static const int yyntokens_; 00287 static const unsigned int yyuser_token_number_max_; 00288 static const token_number_type yyundef_token_; 00289 00290 /* User arguments. */ 00291 QJson::ParserPrivate* driver; 00292 }; 00293 00294 } // yy 00295 /* Line 33 of lalr1.cc */ 00296 #line 297 "json_parser.hh" 00297 00298 00299 00300 #endif /* !YY_YY_JSON_PARSER_HH_INCLUDED */
|
hosts this site. |
Send comments to: QJson Developers |