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 #include <string>
00041 #include <iostream>
00042 #include "stack.hh"
00043
00044 namespace vrml1
00045 {
00046 class position;
00047 class location;
00048 }
00049
00050
00051 #line 7 "./vrml1-parser.yy"
00052
00053 #include <string>
00054
00055
00056 namespace vrml1 {
00057 class Driver;
00058 }
00059
00060
00061
00062 #line 63 "./vrml1-parser.hh"
00063
00064 #include "location.hh"
00065
00066
00067 #ifndef YYDEBUG
00068 # define YYDEBUG 1
00069 #endif
00070
00071
00072 #ifdef YYERROR_VERBOSE
00073 # undef YYERROR_VERBOSE
00074 # define YYERROR_VERBOSE 1
00075 #else
00076 # define YYERROR_VERBOSE 1
00077 #endif
00078
00079
00080 #ifndef YYTOKEN_TABLE
00081 # define YYTOKEN_TABLE 0
00082 #endif
00083
00084
00085
00086
00087
00088 #ifndef YYLLOC_DEFAULT
00089 # define YYLLOC_DEFAULT(Current, Rhs, N) \
00090 do { \
00091 if (N) \
00092 { \
00093 (Current).begin = (Rhs)[1].begin; \
00094 (Current).end = (Rhs)[N].end; \
00095 } \
00096 else \
00097 { \
00098 (Current).begin = (Current).end = (Rhs)[0].end; \
00099 } \
00100 } while (false)
00101 #endif
00102
00103 namespace vrml1
00104 {
00105
00107 class vrml1_parser
00108 {
00109 public:
00111 #ifndef YYSTYPE
00112 union semantic_type
00113 #line 32 "./vrml1-parser.yy"
00114 {
00115 int ival;
00116 float fval;
00117 std::string *sval;
00118 }
00119
00120 #line 121 "./vrml1-parser.hh"
00121 ;
00122 #else
00123 typedef YYSTYPE semantic_type;
00124 #endif
00126 typedef location location_type;
00128 struct token
00129 {
00130
00131 enum yytokentype {
00132 END = 0,
00133 KW_Separator = 258,
00134 KW_BRACKETOPEN = 259,
00135 KW_BRACKETCLOSE = 260,
00136 KW_Cube = 261,
00137 KW_width = 262,
00138 KW_height = 263,
00139 KW_depth = 264,
00140 KW_SIDES = 265,
00141 KW_parts = 266,
00142 KW_bottomRadius = 267,
00143 KW_BOTTOM = 268,
00144 KW_Cone = 269,
00145 KW_ALL = 270,
00146 KW_Sphere = 271,
00147 KW_radius = 272,
00148 KW_Cylinder = 273,
00149 KW_TOP = 274,
00150 KW_DirectionalLight = 275,
00151 KW_intensity = 276,
00152 KW_color = 277,
00153 KW_on = 278,
00154 KW_direction = 279,
00155 KW_FALSE = 280,
00156 KW_TRUE = 281,
00157 KW_transparency = 282,
00158 KW_Material = 283,
00159 KW_emissiveColor = 284,
00160 KW_ambientColor = 285,
00161 KW_specularColor = 286,
00162 KW_shininess = 287,
00163 KW_diffuseColor = 288,
00164 KW_OVERALL = 289,
00165 KW_MaterialBinding = 290,
00166 KW_PER_FACE = 291,
00167 KW_value = 292,
00168 KW_PER_VERTEX_INDEXED = 293,
00169 KW_PER_PART = 294,
00170 KW_PER_FACE_INDEXED = 295,
00171 KW_DEFAULT = 296,
00172 KW_PER_PART_INDEXED = 297,
00173 KW_PER_VERTEX = 298,
00174 KW_Translation = 299,
00175 KW_translation = 300,
00176 KW_Rotation = 301,
00177 KW_rotation = 302,
00178 KW_Scale = 303,
00179 KW_scaleFactor = 304,
00180 KW_MatrixTransform = 305,
00181 KW_matrix = 306,
00182 KW_scaleOrientation = 307,
00183 KW_Transform = 308,
00184 KW_center = 309,
00185 KW_OrthographicCamera = 310,
00186 KW_position = 311,
00187 KW_orientation = 312,
00188 KW_focalDistance = 313,
00189 KW_heightAngle = 314,
00190 KW_PerspectiveCamera = 315,
00191 KW_PointLight = 316,
00192 KW_SpotLight = 317,
00193 KW_cutOffAngle = 318,
00194 KW_dropOffRate = 319,
00195 KW_location = 320,
00196 KW_Texture2Transform = 321,
00197 KW_creaseAngle = 322,
00198 KW_CLOCKWISE = 323,
00199 KW_CONVEX = 324,
00200 KW_vertexOrdering = 325,
00201 KW_SOLID = 326,
00202 KW_COUNTERCLOCKWISE = 327,
00203 KW_shapeType = 328,
00204 KW_UNKNOWN_FACE_TYPE = 329,
00205 KW_UNKNOWN_ORDERING = 330,
00206 KW_faceType = 331,
00207 KW_UNKNOWN_SHAPE_TYPE = 332,
00208 KW_ShapeHints = 333,
00209 KW_NormalBinding = 334,
00210 KW_SANS = 335,
00211 KW_TYPEWRITER = 336,
00212 KW_LOD = 337,
00213 KW_style = 338,
00214 KW_SERIF = 339,
00215 KW_size = 340,
00216 KW_range = 341,
00217 KW_family = 342,
00218 KW_FontStyle = 343,
00219 KW_ITALIC = 344,
00220 KW_NONE = 345,
00221 KW_BOLD = 346,
00222 KW_LEFTPARENTHESIS = 347,
00223 KW_RIGHTPARENTHESIS = 348,
00224 KW_BAR = 349,
00225 KW_COMMA = 350,
00226 KW_SQUAREDBRACKETOPEN = 351,
00227 KW_SQUAREDBRACKETCLOSE = 352,
00228 KW_vector = 353,
00229 KW_Normal = 354,
00230 KW_point = 355,
00231 KW_Coordinate3 = 356,
00232 KW_TextureCoordinate2 = 357,
00233 KW_startIndex = 358,
00234 KW_numPoints = 359,
00235 KW_PointSet = 360,
00236 KW_textureCoordIndex = 361,
00237 KW_normalIndex = 362,
00238 KW_coordIndex = 363,
00239 KW_IndexedLineSet = 364,
00240 KW_materialIndex = 365,
00241 KW_IndexedFaceSet = 366,
00242 KW_renderCulling = 367,
00243 KW_OFF = 368,
00244 KW_AUTO = 369,
00245 KW_ON = 370,
00246 KW_whichChild = 371,
00247 KW_Switch = 372,
00248 KW_filename = 373,
00249 KW_wrapT = 374,
00250 KW_CLAMP = 375,
00251 KW_Texture2 = 376,
00252 KW_image = 377,
00253 KW_REPEAT = 378,
00254 KW_wrapS = 379,
00255 KW_WWWInline = 380,
00256 KW_bboxCenter = 381,
00257 KW_bboxSize = 382,
00258 KW_name = 383,
00259 KW_map = 384,
00260 KW_POINT = 385,
00261 KW_description = 386,
00262 KW_WWWAnchor = 387,
00263 KW_justification = 388,
00264 KW_CENTER = 389,
00265 KW_spacing = 390,
00266 KW_string = 391,
00267 KW_RIGHT = 392,
00268 KW_AsciiText = 393,
00269 KW_LEFT = 394,
00270 KW_ZERO = 395,
00271 KW_ONE = 396,
00272 KW_DEF = 397,
00273 KW_USE = 398,
00274 KW_VRML_ID = 399,
00275 TYPE_FLOAT = 400,
00276 TYPE_INTEGER = 401,
00277 TYPE_STRING = 402
00278 };
00279
00280 };
00282 typedef token::yytokentype token_type;
00283
00285 vrml1_parser (vrml1::Driver& driver_yyarg);
00286 virtual ~vrml1_parser ();
00287
00290 virtual int parse ();
00291
00293 std::ostream& debug_stream () const;
00295 void set_debug_stream (std::ostream &);
00296
00298 typedef int debug_level_type;
00300 debug_level_type debug_level () const;
00302 void set_debug_level (debug_level_type l);
00303
00304 private:
00308 virtual void error (const location_type& loc, const std::string& msg);
00309
00313 virtual std::string yysyntax_error_ (int yystate, int tok);
00314
00315 #if YYDEBUG
00320 virtual void yy_symbol_value_print_ (int yytype,
00321 const semantic_type* yyvaluep,
00322 const location_type* yylocationp);
00327 virtual void yy_symbol_print_ (int yytype,
00328 const semantic_type* yyvaluep,
00329 const location_type* yylocationp);
00330 #endif
00331
00332
00334 typedef int state_type;
00336 typedef stack<state_type> state_stack_type;
00338 typedef stack<semantic_type> semantic_stack_type;
00340 typedef stack<location_type> location_stack_type;
00341
00343 state_stack_type yystate_stack_;
00345 semantic_stack_type yysemantic_stack_;
00347 location_stack_type yylocation_stack_;
00348
00350 typedef unsigned char token_number_type;
00351
00353 static const short int yypact_[];
00354 static const short int yypact_ninf_;
00355
00359 static const unsigned short int yydefact_[];
00360
00361 static const short int yypgoto_[];
00362 static const short int yydefgoto_[];
00363
00369 static const unsigned short int yytable_[];
00370 static const signed char yytable_ninf_;
00371
00372 static const short int yycheck_[];
00373
00375 static const unsigned short int yystos_[];
00376
00378 static const unsigned short int yyr1_[];
00380 static const unsigned char yyr2_[];
00381
00382 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00384 static const char* const yytname_[];
00385 #endif
00386
00387 #if YYERROR_VERBOSE
00389 virtual std::string yytnamerr_ (const char *n);
00390 #endif
00391
00392 #if YYDEBUG
00394 typedef short int rhs_number_type;
00396 static const rhs_number_type yyrhs_[];
00398 static const unsigned short int yyprhs_[];
00400 static const unsigned short int yyrline_[];
00402 static const unsigned short int yytoken_number_[];
00404 virtual void yy_reduce_print_ (int r);
00406 virtual void yystack_print_ ();
00407 #endif
00408
00410 token_number_type yytranslate_ (int t);
00411
00417 inline void yydestruct_ (const char* yymsg,
00418 int yytype,
00419 semantic_type* yyvaluep,
00420 location_type* yylocationp);
00421
00423 inline void yypop_ (unsigned int n = 1);
00424
00425
00426 static const int yyeof_;
00427
00428 static const int yylast_;
00429 static const int yynnts_;
00430 static const int yyempty_;
00431 static const int yyfinal_;
00432 static const int yyterror_;
00433 static const int yyerrcode_;
00434 static const int yyntokens_;
00435 static const unsigned int yyuser_token_number_max_;
00436 static const token_number_type yyundef_token_;
00437
00438
00439 int yydebug_;
00440 std::ostream* yycdebug_;
00441
00442
00443
00444 vrml1::Driver& driver;
00445 };
00446 }
00447
00448
00449 #endif