ct_common
1.0.1
Common library for combinatorial testing
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Skeleton interface for Bison LALR(1) parsers in C++ 00004 00005 Copyright (C) 2002-2011 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 00033 /* C++ LALR(1) parser skeleton written by Akim Demaille. */ 00034 00035 #ifndef PARSER_HEADER_H 00036 # define PARSER_HEADER_H 00037 00038 /* "%code requires" blocks. */ 00039 00040 /* Line 35 of lalr1.cc */ 00041 #line 36 "ct_parser.ypp" 00042 00043 #include <ct_common/common/constraints.h> 00044 #include <ct_common/common/exps.h> 00045 #include <ct_common/common/paramspecs.h> 00046 #include <ct_common/common/seed.h> 00047 #include <ct_common/common/tuple.h> 00048 #include <ct_common/file_parse/assembler.h> 00049 00050 00051 00052 /* Line 35 of lalr1.cc */ 00053 #line 54 "ct_parser.tab.hpp" 00054 00055 00056 #include <string> 00057 #include <iostream> 00058 #include "stack.hh" 00059 #include "location.hh" 00060 00061 /* Enabling traces. */ 00062 #ifndef YYDEBUG 00063 # define YYDEBUG 1 00064 #endif 00065 00066 /* Enabling verbose error messages. */ 00067 #ifdef YYERROR_VERBOSE 00068 # undef YYERROR_VERBOSE 00069 # define YYERROR_VERBOSE 1 00070 #else 00071 # define YYERROR_VERBOSE 1 00072 #endif 00073 00074 /* Enabling the token table. */ 00075 #ifndef YYTOKEN_TABLE 00076 # define YYTOKEN_TABLE 0 00077 #endif 00078 00079 00080 namespace yy { 00081 00082 /* Line 35 of lalr1.cc */ 00083 #line 84 "ct_parser.tab.hpp" 00084 00086 class ct_parser 00087 { 00088 public: 00090 #ifndef YYSTYPE 00091 union semantic_type 00092 { 00093 00094 /* Line 35 of lalr1.cc */ 00095 #line 45 "ct_parser.ypp" 00096 00097 ct::common::TreeNode *tree_node; 00098 std::string *str; 00099 std::vector<boost::shared_ptr<ct::common::ParamSpec> > *vec_param_spec; 00100 std::vector<std::string> *vec_str; 00101 std::vector<boost::shared_ptr<ct::common::TreeNode> > *vec_exp; 00102 std::vector<std::pair<boost::shared_ptr<ct::common::TreeNode>, boost::shared_ptr<ct::common::TreeNode> > > *vec_auto_value_cases; 00103 std::pair<boost::shared_ptr<ct::common::TreeNode>, boost::shared_ptr<ct::common::TreeNode> > *auto_value_case; 00104 ct::common::PVPair *pvpair; 00105 ct::common::Tuple *tuple; 00106 00107 00108 00109 /* Line 35 of lalr1.cc */ 00110 #line 111 "ct_parser.tab.hpp" 00111 }; 00112 #else 00113 typedef YYSTYPE semantic_type; 00114 #endif 00115 00116 typedef location location_type; 00118 struct token 00119 { 00120 /* Tokens. */ 00121 enum yytokentype { 00122 TKN_END = 0, 00123 TKN_PARAMETERS_START = 258, 00124 TKN_STRENGTHS_START = 259, 00125 TKN_SEEDS_START = 260, 00126 TKN_CONSTRAINTS_START = 261, 00127 TKN_OPTIONS_START = 262, 00128 TKN_TYPE = 263, 00129 TKN_IDENTIFIER = 264, 00130 TKN_VAL_STRING = 265, 00131 TKN_VAL_DOUBLE = 266, 00132 TKN_VAL_INTEGER = 267, 00133 TKN_VAL_BOOL = 268, 00134 TKN_PARAM_AUX = 269, 00135 TKN_PARAM_AUTO = 270, 00136 TKN_SEED_STARTER = 271, 00137 TKN_DEFAULT = 272, 00138 TKN_INVALID = 273, 00139 TKN_INVALIDATION = 274, 00140 TKN_EQ = 275, 00141 TKN_NE = 276, 00142 TKN_GT = 277, 00143 TKN_GE = 278, 00144 TKN_LT = 279, 00145 TKN_LE = 280, 00146 TKN_AND = 281, 00147 TKN_OR = 282, 00148 TKN_XOR = 283, 00149 TKN_IMPLY = 284, 00150 TKN_IFF = 285, 00151 TKN_NOT = 286, 00152 TKN_ADD = 287, 00153 TKN_SUB = 288, 00154 TKN_MULT = 289, 00155 TKN_DIV = 290, 00156 TKN_MOD = 291, 00157 TKN_BRACKET_O = 292, 00158 TKN_BRACKET_C = 293, 00159 TKN_COLON = 294, 00160 TKN_SEMICOLON = 295, 00161 TKN_COMMA = 296, 00162 TKN_CORNER_BRACKET_O = 297, 00163 TKN_CORNER_BRACKET_C = 298, 00164 TKN_CURLY_BRACKET_O = 299, 00165 TKN_CURLY_BRACKET_C = 300, 00166 TKN_UPLUS = 301, 00167 TKN_NEG = 302 00168 }; 00169 00170 }; 00172 typedef token::yytokentype token_type; 00173 00175 ct_parser (ct::lexer &qlex_yyarg, std::vector<boost::shared_ptr<ct::common::ParamSpec> > ¶m_specs_yyarg, std::vector<ct::common::Strength> &strengths_yyarg, std::vector<boost::shared_ptr<ct::common::Seed> > &seeds_yyarg, std::vector<boost::shared_ptr<ct::common::Constraint> > &constraints_yyarg, ct::common::Assembler &assembler_yyarg); 00176 virtual ~ct_parser (); 00177 00180 virtual int parse (); 00181 00182 #if YYDEBUG 00183 00184 std::ostream& debug_stream () const; 00186 void set_debug_stream (std::ostream &); 00187 00189 typedef int debug_level_type; 00191 debug_level_type debug_level () const; 00193 void set_debug_level (debug_level_type l); 00194 #endif 00195 00196 private: 00200 virtual void error (const location_type& loc, const std::string& msg); 00201 00205 virtual std::string yysyntax_error_ (int yystate, int tok); 00206 00207 #if YYDEBUG 00208 00209 00210 00211 00212 virtual void yy_symbol_value_print_ (int yytype, 00213 const semantic_type* yyvaluep, 00214 const location_type* yylocationp); 00219 virtual void yy_symbol_print_ (int yytype, 00220 const semantic_type* yyvaluep, 00221 const location_type* yylocationp); 00222 #endif 00223 00224 00226 typedef int state_type; 00228 typedef stack<state_type> state_stack_type; 00230 typedef stack<semantic_type> semantic_stack_type; 00232 typedef stack<location_type> location_stack_type; 00233 00235 state_stack_type yystate_stack_; 00237 semantic_stack_type yysemantic_stack_; 00239 location_stack_type yylocation_stack_; 00240 00243 static bool yy_pact_value_is_default_ (int yyvalue); 00244 00247 static bool yy_table_value_is_error_ (int yyvalue); 00248 00250 typedef unsigned char token_number_type; 00251 /* Tables. */ 00253 static const short int yypact_[]; 00254 static const short int yypact_ninf_; 00255 00259 static const unsigned char yydefact_[]; 00260 00261 static const short int yypgoto_[]; 00262 static const short int yydefgoto_[]; 00263 00269 static const unsigned char yytable_[]; 00270 static const signed char yytable_ninf_; 00271 00272 static const short int yycheck_[]; 00273 00275 static const unsigned char yystos_[]; 00276 00278 static const unsigned char yyr1_[]; 00280 static const unsigned char yyr2_[]; 00281 00282 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 00283 00284 static const char* const yytname_[]; 00285 #endif 00286 00288 static std::string yytnamerr_ (const char *n); 00289 00290 #if YYDEBUG 00291 00292 typedef signed char rhs_number_type; 00294 static const rhs_number_type yyrhs_[]; 00296 static const unsigned short int yyprhs_[]; 00298 static const unsigned short int yyrline_[]; 00300 static const unsigned short int yytoken_number_[]; 00302 virtual void yy_reduce_print_ (int r); 00304 virtual void yystack_print_ (); 00305 00306 /* Debugging. */ 00307 int yydebug_; 00308 std::ostream* yycdebug_; 00309 #endif 00310 00312 token_number_type yytranslate_ (int t); 00313 00319 inline void yydestruct_ (const char* yymsg, 00320 int yytype, 00321 semantic_type* yyvaluep, 00322 location_type* yylocationp); 00323 00325 inline void yypop_ (unsigned int n = 1); 00326 00327 /* Constants. */ 00328 static const int yyeof_; 00329 /* LAST_ -- Last index in TABLE_. */ 00330 static const int yylast_; 00331 static const int yynnts_; 00332 static const int yyempty_; 00333 static const int yyfinal_; 00334 static const int yyterror_; 00335 static const int yyerrcode_; 00336 static const int yyntokens_; 00337 static const unsigned int yyuser_token_number_max_; 00338 static const token_number_type yyundef_token_; 00339 00340 /* User arguments. */ 00341 ct::lexer &qlex; 00342 std::vector<boost::shared_ptr<ct::common::ParamSpec> > ¶m_specs; 00343 std::vector<ct::common::Strength> &strengths; 00344 std::vector<boost::shared_ptr<ct::common::Seed> > &seeds; 00345 std::vector<boost::shared_ptr<ct::common::Constraint> > &constraints; 00346 ct::common::Assembler &assembler; 00347 }; 00348 00349 } // yy 00350 00351 /* Line 35 of lalr1.cc */ 00352 #line 353 "ct_parser.tab.hpp" 00353 00354 00355 00356 #endif /* ! defined PARSER_HEADER_H */