H3D API  2.4.1
vrml.hpp
Go to the documentation of this file.
1 
2 /* A Bison parser, made by GNU Bison 2.4.1. */
3 
4 /* Skeleton interface for Bison LALR(1) parsers in C++
5 
6  Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
7  Foundation, Inc.
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 
22 /* As a special exception, you may create a larger work that contains
23  part or all of the Bison parser skeleton and distribute that work
24  under terms of your choice, so long as that work isn't itself a
25  parser generator using the skeleton or a modified version thereof
26  as a parser skeleton. Alternatively, if you modify or redistribute
27  the parser skeleton itself, you may (at your option) remove this
28  special exception, which will cause the skeleton and the resulting
29  Bison output files to be licensed under the GNU General Public
30  License without this special exception.
31 
32  This special exception was added by the Free Software Foundation in
33  version 2.2 of Bison. */
34 
35 /* C++ LALR(1) parser skeleton written by Akim Demaille. */
36 
37 #ifndef PARSER_HEADER_H
38 # define PARSER_HEADER_H
39 
40 
41 
42 #include <string>
43 #include <iostream>
44 #include "stack.hh"
45 
46 
47 /* Line 35 of lalr1.cc */
48 #line 1 "[Bison:b4_percent_define_default]"
49 
50 namespace yy {
51 
52 /* Line 35 of lalr1.cc */
53 #line 54 "vrml.hpp"
54  class position;
55  class location;
56 
57 /* Line 35 of lalr1.cc */
58 #line 1 "[Bison:b4_percent_define_default]"
59 
60 } // yy
61 
62 /* Line 35 of lalr1.cc */
63 #line 64 "vrml.hpp"
64 
65 #include "location.hh"
66 
67 /* Enabling traces. */
68 #ifndef YYDEBUG
69 # define YYDEBUG 1
70 #endif
71 
72 /* Enabling verbose error messages. */
73 #ifdef YYERROR_VERBOSE
74 # undef YYERROR_VERBOSE
75 # define YYERROR_VERBOSE 1
76 #else
77 # define YYERROR_VERBOSE 1
78 #endif
79 
80 /* Enabling the token table. */
81 #ifndef YYTOKEN_TABLE
82 # define YYTOKEN_TABLE 0
83 #endif
84 
85 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
86  If N is 0, then set CURRENT to the empty location which ends
87  the previous symbol: RHS[0] (always defined). */
88 
89 #ifndef YYLLOC_DEFAULT
90 # define YYLLOC_DEFAULT(Current, Rhs, N) \
91 do { \
92  if (N) \
93  { \
94  (Current).begin = (Rhs)[1].begin; \
95  (Current).end = (Rhs)[N].end; \
96  } \
97  else \
98  { \
99  (Current).begin = (Current).end = (Rhs)[0].end; \
100  } \
101 } while (false)
102 #endif
103 
104 
105 /* Line 35 of lalr1.cc */
106 #line 1 "[Bison:b4_percent_define_default]"
107 
108 namespace yy {
109 
110 /* Line 35 of lalr1.cc */
111 #line 112 "vrml.hpp"
112 
115  {
116  public:
118 #ifndef YYSTYPE
119  typedef int semantic_type;
120 #else
121  typedef YYSTYPE semantic_type;
122 #endif
126  struct token
127  {
128  /* Tokens. */
129  enum yytokentype {
130  VRMLID = 258,
131  STRING = 259,
132  AS = 260,
133  VRMLNULL = 261,
134  SCRIPT = 262,
135  VRMLTRUE = 263,
136  VRMLFALSE = 264,
137  PROFILE = 265,
138  COMPONENT = 266,
139  EXPORT = 267,
140  IMPORT = 268,
141  META = 269,
142  DEF = 270,
143  USE = 271,
144  PROTO = 272,
145  inputOnly = 273,
146  outputOnly = 274,
147  initializeOnly = 275,
148  inputOutput = 276,
149  EXTERNPROTO = 277,
150  ROUTE = 278,
151  TO = 279,
152  IS = 280
153  };
154 
155  };
157  typedef token::yytokentype token_type;
158 
160  VrmlParser (VrmlDriver& driver_yyarg);
161  virtual ~VrmlParser ();
162 
165  virtual int parse ();
166 
167 #if YYDEBUG
169  std::ostream& debug_stream () const;
171  void set_debug_stream (std::ostream &);
172 
174  typedef int debug_level_type;
176  debug_level_type debug_level () const;
179 #endif
180 
181  private:
185  virtual void error (const location_type& loc, const std::string& msg);
186 
190  virtual std::string yysyntax_error_ (int yystate, int tok);
191 
192 #if YYDEBUG
197  virtual void yy_symbol_value_print_ (int yytype,
198  const semantic_type* yyvaluep,
199  const location_type* yylocationp);
204  virtual void yy_symbol_print_ (int yytype,
205  const semantic_type* yyvaluep,
206  const location_type* yylocationp);
207 #endif
208 
209 
211  typedef int state_type;
213  typedef stack<state_type> state_stack_type;
215  typedef stack<semantic_type> semantic_stack_type;
217  typedef stack<location_type> location_stack_type;
218 
220  state_stack_type yystate_stack_;
222  semantic_stack_type yysemantic_stack_;
224  location_stack_type yylocation_stack_;
225 
227  typedef unsigned char token_number_type;
228  /* Tables. */
230  static const short int yypact_[];
231  static const signed char yypact_ninf_;
232 
236  static const unsigned char yydefact_[];
237 
238  static const short int yypgoto_[];
239  static const short int yydefgoto_[];
240 
246  static const short int yytable_[];
247  static const signed char yytable_ninf_;
248 
249  static const short int yycheck_[];
250 
252  static const unsigned char yystos_[];
253 
255  static const unsigned char yyr1_[];
257  static const unsigned char yyr2_[];
258 
259 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
261  static const char* const yytname_[];
262 #endif
263 
264 #if YYERROR_VERBOSE
266  virtual std::string yytnamerr_ (const char *n);
267 #endif
268 
269 #if YYDEBUG
271  typedef signed char rhs_number_type;
273  static const rhs_number_type yyrhs_[];
275  static const unsigned short int yyprhs_[];
277  static const unsigned short int yyrline_[];
279  static const unsigned short int yytoken_number_[];
281  virtual void yy_reduce_print_ (int r);
283  virtual void yystack_print_ ();
284 
285  /* Debugging. */
286  int yydebug_;
287  std::ostream* yycdebug_;
288 #endif
289 
291  token_number_type yytranslate_ (int t);
292 
298  inline void yydestruct_ (const char* yymsg,
299  int yytype,
300  semantic_type* yyvaluep,
301  location_type* yylocationp);
302 
304  inline void yypop_ (unsigned int n = 1);
305 
306  /* Constants. */
307  static const int yyeof_;
308  /* LAST_ -- Last index in TABLE_. */
309  static const int yylast_;
310  static const int yynnts_;
311  static const int yyempty_;
312  static const int yyfinal_;
313  static const int yyterror_;
314  static const int yyerrcode_;
315  static const int yyntokens_;
316  static const unsigned int yyuser_token_number_max_;
317  static const token_number_type yyundef_token_;
318 
319  /* User arguments. */
320  VrmlDriver& driver;
321  };
322 
323 /* Line 35 of lalr1.cc */
324 #line 1 "[Bison:b4_percent_define_default]"
325 
326 } // yy
327 
328 /* Line 35 of lalr1.cc */
329 #line 330 "vrml.hpp"
330 
331 
332 
333 #endif /* ! defined PARSER_HEADER_H */
A Bison parser.
Definition: vrml.hpp:115
virtual int parse()
Parse.
Definition: vrml.cpp:322
VrmlParser(VrmlDriver &driver_yyarg)
Build a parser object.
Definition: vrml.cpp:235
int semantic_type
Symbol semantic values.
Definition: vrml.hpp:119
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: vrml.cpp:315
location location_type
Symbol locations.
Definition: vrml.hpp:124
int debug_level_type
Type for debugging levels.
Definition: vrml.hpp:174
debug_level_type debug_level() const
The current debugging level.
Definition: vrml.cpp:309
token::yytokentype token_type
Token type.
Definition: vrml.hpp:157
std::ostream & debug_stream() const
The current debugging stream.
Definition: vrml.cpp:296
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: vrml.cpp:302
Abstract a location.
Definition: location.hh:57
Define the yy::location class.
Tokens.
Definition: vrml.hpp:127