00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef PARSER_HEADER_H
00038 # define PARSER_HEADER_H
00039
00040
00041
00042 #include <string>
00043 #include <iostream>
00044 #include "stack.hh"
00045
00046
00047
00048 #line 1 "[Bison:b4_percent_define_default]"
00049
00050 namespace example {
00051
00052
00053 #line 54 "parser.h"
00054 class position;
00055 class location;
00056
00057
00058 #line 1 "[Bison:b4_percent_define_default]"
00059
00060 }
00061
00062
00063 #line 64 "parser.h"
00064
00065 #include "location.hh"
00066
00067
00068 #ifndef YYDEBUG
00069 # define YYDEBUG 1
00070 #endif
00071
00072
00073 #ifdef YYERROR_VERBOSE
00074 # undef YYERROR_VERBOSE
00075 # define YYERROR_VERBOSE 1
00076 #else
00077 # define YYERROR_VERBOSE 1
00078 #endif
00079
00080
00081 #ifndef YYTOKEN_TABLE
00082 # define YYTOKEN_TABLE 0
00083 #endif
00084
00085
00086
00087
00088
00089 #ifndef YYLLOC_DEFAULT
00090 # define YYLLOC_DEFAULT(Current, Rhs, N) \
00091 do { \
00092 if (N) \
00093 { \
00094 (Current).begin = (Rhs)[1].begin; \
00095 (Current).end = (Rhs)[N].end; \
00096 } \
00097 else \
00098 { \
00099 (Current).begin = (Current).end = (Rhs)[0].end; \
00100 } \
00101 } while (false)
00102 #endif
00103
00104
00105
00106 #line 1 "[Bison:b4_percent_define_default]"
00107
00108 namespace example {
00109
00110
00111 #line 112 "parser.h"
00112
00114 class Parser
00115 {
00116 public:
00118 #ifndef YYSTYPE
00119 union semantic_type
00120 {
00121
00122
00123 #line 56 "parser.yy"
00124
00125 int integerVal;
00126 double doubleVal;
00127 std::string* stringVal;
00128 class CalcNode* calcnode;
00129
00130
00131
00132
00133 #line 134 "parser.h"
00134 };
00135 #else
00136 typedef YYSTYPE semantic_type;
00137 #endif
00139 typedef location location_type;
00141 struct token
00142 {
00143
00144 enum yytokentype {
00145 END = 0,
00146 EOL = 258,
00147 INTEGER = 259,
00148 DOUBLE = 260,
00149 STRING = 261
00150 };
00151
00152 };
00154 typedef token::yytokentype token_type;
00155
00157 Parser (class Driver& driver_yyarg);
00158 virtual ~Parser ();
00159
00162 virtual int parse ();
00163
00164 #if YYDEBUG
00166 std::ostream& debug_stream () const;
00168 void set_debug_stream (std::ostream &);
00169
00171 typedef int debug_level_type;
00173 debug_level_type debug_level () const;
00175 void set_debug_level (debug_level_type l);
00176 #endif
00177
00178 private:
00182 virtual void error (const location_type& loc, const std::string& msg);
00183
00187 virtual std::string yysyntax_error_ (int yystate, int tok);
00188
00189 #if YYDEBUG
00194 virtual void yy_symbol_value_print_ (int yytype,
00195 const semantic_type* yyvaluep,
00196 const location_type* yylocationp);
00201 virtual void yy_symbol_print_ (int yytype,
00202 const semantic_type* yyvaluep,
00203 const location_type* yylocationp);
00204 #endif
00205
00206
00208 typedef int state_type;
00210 typedef stack<state_type> state_stack_type;
00212 typedef stack<semantic_type> semantic_stack_type;
00214 typedef stack<location_type> location_stack_type;
00215
00217 state_stack_type yystate_stack_;
00219 semantic_stack_type yysemantic_stack_;
00221 location_stack_type yylocation_stack_;
00222
00224 typedef unsigned char token_number_type;
00225
00227 static const signed char yypact_[];
00228 static const signed char yypact_ninf_;
00229
00233 static const unsigned char yydefact_[];
00234
00235 static const signed char yypgoto_[];
00236 static const signed char yydefgoto_[];
00237
00243 static const unsigned char yytable_[];
00244 static const signed char yytable_ninf_;
00245
00246 static const unsigned char yycheck_[];
00247
00249 static const unsigned char yystos_[];
00250
00252 static const unsigned char yyr1_[];
00254 static const unsigned char yyr2_[];
00255
00256 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00258 static const char* const yytname_[];
00259 #endif
00260
00261 #if YYERROR_VERBOSE
00263 virtual std::string yytnamerr_ (const char *n);
00264 #endif
00265
00266 #if YYDEBUG
00268 typedef signed char rhs_number_type;
00270 static const rhs_number_type yyrhs_[];
00272 static const unsigned char yyprhs_[];
00274 static const unsigned char yyrline_[];
00276 static const unsigned short int yytoken_number_[];
00278 virtual void yy_reduce_print_ (int r);
00280 virtual void yystack_print_ ();
00281
00282
00283 int yydebug_;
00284 std::ostream* yycdebug_;
00285 #endif
00286
00288 token_number_type yytranslate_ (int t);
00289
00295 inline void yydestruct_ (const char* yymsg,
00296 int yytype,
00297 semantic_type* yyvaluep,
00298 location_type* yylocationp);
00299
00301 inline void yypop_ (unsigned int n = 1);
00302
00303
00304 static const int yyeof_;
00305
00306 static const int yylast_;
00307 static const int yynnts_;
00308 static const int yyempty_;
00309 static const int yyfinal_;
00310 static const int yyterror_;
00311 static const int yyerrcode_;
00312 static const int yyntokens_;
00313 static const unsigned int yyuser_token_number_max_;
00314 static const token_number_type yyundef_token_;
00315
00316
00317 class Driver& driver;
00318 };
00319
00320
00321 #line 1 "[Bison:b4_percent_define_default]"
00322
00323 }
00324
00325
00326 #line 327 "parser.h"
00327
00328
00329
00330 #endif