00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PARSER_HEADER_H
00023 # define PARSER_HEADER_H
00024
00025 #include <string>
00026 #include <iostream>
00027
00028
00029 #define YYLSP_NEEDED 1
00030
00031 namespace yy
00032 {
00033 class position;
00034 class location;
00035 }
00036
00037
00038 enum yytokentype {
00039 VRMLID = 258,
00040 STRING = 259,
00041 AS = 260,
00042 VRMLNULL = 261,
00043 SCRIPT = 262,
00044 VRMLTRUE = 263,
00045 VRMLFALSE = 264,
00046 PROFILE = 265,
00047 COMPONENT = 266,
00048 EXPORT = 267,
00049 IMPORT = 268,
00050 META = 269,
00051 DEF = 270,
00052 USE = 271,
00053 PROTO = 272,
00054 inputOnly = 273,
00055 outputOnly = 274,
00056 initializeOnly = 275,
00057 inputOutput = 276,
00058 EXTERNPROTO = 277,
00059 ROUTE = 278,
00060 TO = 279,
00061 IS = 280
00062 };
00063
00064
00065
00066 #line 6 "vrml.bison"
00067
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00094
00095
00096
00097
00098
00100
00101
00102 #include "H3DApi.h"
00103 #include "Node.h"
00104 #include "Group.h"
00105 #include "DEFNodes.h"
00106 #include "Inline.h"
00107 #include "H3DExports.h"
00108 #include "X3D.h"
00109 #include "X3DTypeFunctions.h"
00110
00111 using namespace H3D;
00112 using namespace X3D;
00113
00114
00115
00116
00117 #include "FlexLexer.h"
00118 #include "VrmlDriver.h"
00119
00120 #include <iostream>
00121 #include <sstream>
00122 using namespace std;
00123
00124
00125 #define YYERROR_VERBOSE 1
00126
00127 int yylex (YYSTYPE* yylval, yy::location* yylloc, VrmlDriver& driver);
00128
00129
00130
00131
00132 #line 133 "vrml.hpp"
00133
00134 #include "stack.hh"
00135 #include "location.hh"
00136
00137
00138 #ifndef YYDEBUG
00139 # define YYDEBUG 1
00140 #endif
00141
00142
00143 #ifdef YYERROR_VERBOSE
00144 # undef YYERROR_VERBOSE
00145 # define YYERROR_VERBOSE 1
00146 #else
00147 # define YYERROR_VERBOSE 1
00148 #endif
00149
00150 #if YYERROR_VERBOSE
00151 # define YYERROR_VERBOSE_IF(x) x
00152 #else
00153 # define YYERROR_VERBOSE_IF(x)
00154 #endif
00155
00156
00157 #ifndef YYTOKEN_TABLE
00158 # define YYTOKEN_TABLE 0
00159 #endif
00160
00161 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
00162 #line 84 "vrml.bison"
00163 union YYSTYPE {
00164 char* val;
00165 };
00166
00167 #line 168 "vrml.hpp"
00168 # define yystype YYSTYPE
00169 # define YYSTYPE_IS_DECLARED 1
00170 # define YYSTYPE_IS_TRIVIAL 1
00171 #endif
00172
00173
00174
00175
00176
00177 #line 178 "vrml.hpp"
00178
00179
00180
00181
00182 #ifndef YYLLOC_DEFAULT
00183 # define YYLLOC_DEFAULT(Current, Rhs, N) \
00184 do { \
00185 if (N) \
00186 { \
00187 (Current).begin = (Rhs)[1].begin; \
00188 (Current).end = (Rhs)[N].end; \
00189 } \
00190 else \
00191 { \
00192 (Current).begin = (Current).end = (Rhs)[0].end; \
00193 } \
00194 } while (0)
00195 #endif
00196
00197 namespace yy
00198 {
00199 class VrmlParser;
00200
00201 template <typename P>
00202 struct traits
00203 {
00204 };
00205
00206 template <>
00207 struct traits<VrmlParser>
00208 {
00209 typedef unsigned char token_number_type;
00210 typedef signed char rhs_number_type;
00211 typedef int state_type;
00212 typedef YYSTYPE semantic_type;
00213 typedef location location_type;
00214 };
00215 }
00216
00217 namespace yy
00218 {
00220 class VrmlParser
00221 {
00223 typedef traits<VrmlParser>::semantic_type semantic_type;
00225 typedef traits<VrmlParser>::location_type location_type;
00226
00227 public:
00229 VrmlParser (VrmlDriver& driver_yyarg) :
00230 yydebug_ (false),
00231 yycdebug_ (&std::cerr),
00232 driver (driver_yyarg)
00233 {
00234 }
00235
00236 virtual ~VrmlParser ()
00237 {
00238 }
00239
00242 virtual int parse ();
00243
00245 std::ostream& debug_stream () const;
00247 void set_debug_stream (std::ostream &);
00248
00250 typedef int debug_level_type;
00252 debug_level_type debug_level () const;
00254 void set_debug_level (debug_level_type l);
00255
00256 private:
00260 virtual void error (const location_type& loc, const std::string& msg);
00261
00264 virtual std::string yysyntax_error_ (YYERROR_VERBOSE_IF (int tok));
00265
00266 #if YYDEBUG
00271 virtual void yysymprint_ (int yytype,
00272 const semantic_type* yyvaluep,
00273 const location_type* yylocationp);
00274 #endif
00275
00276
00278 typedef traits<VrmlParser>::state_type state_type;
00280 typedef stack<state_type> state_stack_type;
00282 typedef stack<semantic_type> semantic_stack_type;
00284 typedef stack<location_type> location_stack_type;
00285
00287 state_stack_type yystate_stack_;
00289 semantic_stack_type yysemantic_stack_;
00291 location_stack_type yylocation_stack_;
00292
00294 typedef traits<VrmlParser>::token_number_type token_number_type;
00295
00297 static const short int yypact_[];
00298 static const signed char yypact_ninf_;
00299
00303 static const unsigned char yydefact_[];
00304
00305 static const short int yypgoto_[];
00306 static const short int yydefgoto_[];
00307
00313 static const short int yytable_[];
00314 static const signed char yytable_ninf_;
00315
00316 static const short int yycheck_[];
00317
00319 static const unsigned char yystos_[];
00320
00322 static const unsigned char yyr1_[];
00324 static const unsigned char yyr2_[];
00325
00326 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00328 static const char* const yytname_[];
00329 #endif
00330
00331 #if YYERROR_VERBOSE
00333 virtual std::string yytnamerr_ (const char *n);
00334 #endif
00335
00336 #if YYDEBUG
00337
00338 typedef traits<VrmlParser>::rhs_number_type rhs_number_type;
00340 static const rhs_number_type yyrhs_[];
00342 static const unsigned short int yyprhs_[];
00344 static const unsigned short int yyrline_[];
00346 static const unsigned short int yytoken_number_[];
00348 virtual void yyreduce_print_ (int r);
00350 virtual void yystack_print_ ();
00351 #endif
00352
00354 inline token_number_type yytranslate_ (int token);
00355
00361 inline void yydestruct_ (const char* yymsg,
00362 int yytype,
00363 semantic_type* yyvaluep,
00364 location_type* yylocationp);
00365
00367 inline void yypop_ (unsigned int n = 1);
00368
00369
00370 static const int yyeof_;
00371
00372 static const int yylast_;
00373 static const int yynnts_;
00374 static const int yyempty_;
00375 static const int yyfinal_;
00376 static const int yyterror_;
00377 static const int yyerrcode_;
00378 static const int yyntokens_;
00379 static const unsigned int yyuser_token_number_max_;
00380 static const token_number_type yyundef_token_;
00381
00382
00383 int yyn_;
00384 int yylen_;
00385 int yystate_;
00386
00387
00388 int yynerrs_;
00389 int yyerrstatus_;
00390
00391
00392 int yydebug_;
00393 std::ostream* yycdebug_;
00394
00395
00396
00397 VrmlDriver& driver;
00398 };
00399 }
00400
00401 #endif