g2o
bison_parser.h
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 SlamParser {
51 
52 /* Line 35 of lalr1.cc */
53 #line 54 "bison_parser.h"
54  class position;
55  class location;
56 
57 /* Line 35 of lalr1.cc */
58 #line 1 "[Bison:b4_percent_define_default]"
59 
60 } // SlamParser
61 
62 /* Line 35 of lalr1.cc */
63 #line 64 "bison_parser.h"
64 
65 #include "location.hh"
66 
67 /* Enabling traces. */
68 #ifndef YYDEBUG
69 # define YYDEBUG 0
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 SlamParser {
109 
110 /* Line 35 of lalr1.cc */
111 #line 112 "bison_parser.h"
112 
114  class Parser
115  {
116  public:
118 #ifndef YYSTYPE
120  {
121 
122 /* Line 35 of lalr1.cc */
123 #line 53 "parser.yy"
124 
126  double doubleVal;
127  std::string* stringVal;
129  std::vector<int>* intList;
130 
131 
132 
133 /* Line 35 of lalr1.cc */
134 #line 135 "bison_parser.h"
135  };
136 #else
137  typedef YYSTYPE semantic_type;
138 #endif
139  typedef location location_type;
142  struct token
143  {
144  /* Tokens. */
145  enum yytokentype {
146  END = 0,
147  EOL = 258,
148  INTEGER = 259,
149  DOUBLE = 260,
150  STRING = 261,
151  ADD = 262,
152  V_SE2 = 263,
153  V_SE3 = 264,
154  E_SE2 = 265,
155  E_SE3 = 266,
156  FIX = 267,
157  SOLVE_STATE = 268,
159  };
160 
161  };
164 
166  Parser (class Driver& driver_yyarg);
167  virtual ~Parser ();
168 
171  virtual int parse ();
172 
173 #if YYDEBUG
174  std::ostream& debug_stream () const;
177  void set_debug_stream (std::ostream &);
178 
180  typedef int debug_level_type;
182  debug_level_type debug_level () const;
184  void set_debug_level (debug_level_type l);
185 #endif
186 
187  private:
191  virtual void error (const location_type& loc, const std::string& msg);
192 
196  virtual std::string yysyntax_error_ (int yystate, int tok);
197 
198 #if YYDEBUG
199  virtual void yy_symbol_value_print_ (int yytype,
204  const semantic_type* yyvaluep,
205  const location_type* yylocationp);
210  virtual void yy_symbol_print_ (int yytype,
211  const semantic_type* yyvaluep,
212  const location_type* yylocationp);
213 #endif
214 
215 
217  typedef int state_type;
224 
226  state_stack_type yystate_stack_;
228  semantic_stack_type yysemantic_stack_;
230  location_stack_type yylocation_stack_;
231 
233  typedef unsigned char token_number_type;
234  /* Tables. */
236  static const signed char yypact_[];
237  static const signed char yypact_ninf_;
238 
242  static const unsigned char yydefact_[];
243 
244  static const signed char yypgoto_[];
245  static const signed char yydefgoto_[];
246 
252  static const unsigned char yytable_[];
253  static const signed char yytable_ninf_;
254 
255  static const signed char yycheck_[];
256 
258  static const unsigned char yystos_[];
259 
261  static const unsigned char yyr1_[];
263  static const unsigned char yyr2_[];
264 
265 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
266  static const char* const yytname_[];
268 #endif
269 
270 #if YYERROR_VERBOSE
271  virtual std::string yytnamerr_ (const char *n);
273 #endif
274 
275 #if YYDEBUG
276  typedef signed char rhs_number_type;
279  static const rhs_number_type yyrhs_[];
281  static const unsigned char yyprhs_[];
283  static const unsigned char yyrline_[];
285  static const unsigned short int yytoken_number_[];
287  virtual void yy_reduce_print_ (int r);
289  virtual void yystack_print_ ();
290 
291  /* Debugging. */
292  int yydebug_;
293  std::ostream* yycdebug_;
294 #endif
295 
297  token_number_type yytranslate_ (int t);
298 
304  inline void yydestruct_ (const char* yymsg,
305  int yytype,
306  semantic_type* yyvaluep,
307  location_type* yylocationp);
308 
310  inline void yypop_ (unsigned int n = 1);
311 
312  /* Constants. */
313  static const int yyeof_;
314  /* LAST_ -- Last index in TABLE_. */
315  static const int yylast_;
316  static const int yynnts_;
317  static const int yyempty_;
318  static const int yyfinal_;
319  static const int yyterror_;
320  static const int yyerrcode_;
321  static const int yyntokens_;
322  static const unsigned int yyuser_token_number_max_;
323  static const token_number_type yyundef_token_;
324 
325  /* User arguments. */
326  class Driver& driver;
327  };
328 
329 /* Line 35 of lalr1.cc */
330 #line 1 "[Bison:b4_percent_define_default]"
331 
332 } // SlamParser
333 
334 /* Line 35 of lalr1.cc */
335 #line 336 "bison_parser.h"
336 
337 
338 
339 #endif /* ! defined PARSER_HEADER_H */
static const int yyterror_
Definition: bison_parser.h:319
int state_type
State numbers.
Definition: bison_parser.h:217
static const unsigned char yyr1_[]
For a rule, its LHS.
Definition: bison_parser.h:261
static const int yyerrcode_
Definition: bison_parser.h:320
token_number_type yytranslate_(int t)
Convert a scanner token number t to a symbol number.
static const int yylast_
Definition: bison_parser.h:315
virtual int parse()
FIX
Definition: protocol.txt:28
void yydestruct_(const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
Reclaim the memory associated to a symbol.
static const token_number_type yyundef_token_
Definition: bison_parser.h:323
static const unsigned int yyuser_token_number_max_
Definition: bison_parser.h:322
static const unsigned char yytable_[]
Definition: bison_parser.h:252
static const signed char yycheck_[]
Definition: bison_parser.h:255
static const int yyfinal_
Definition: bison_parser.h:318
static const signed char yypact_ninf_
Definition: bison_parser.h:237
semantic_stack_type yysemantic_stack_
The semantic value stack.
Definition: bison_parser.h:228
virtual void error(const location_type &loc, const std::string &msg)
state_stack_type yystate_stack_
The state stack.
Definition: bison_parser.h:226
class Driver & driver
Definition: bison_parser.h:326
virtual std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
static const int yyeof_
Definition: bison_parser.h:313
static const signed char yypgoto_[]
Definition: bison_parser.h:244
unsigned char token_number_type
Internal symbol numbers.
Definition: bison_parser.h:233
stack< location_type > location_stack_type
location stack type.
Definition: bison_parser.h:223
Symbol semantic values.
Definition: bison_parser.h:119
A Bison parser.
Definition: bison_parser.h:114
std::vector< int > * intList
Definition: bison_parser.h:129
static const signed char yypact_[]
For a state, the index in yytable_ of its portion.
Definition: bison_parser.h:236
SOLVE_STATE
Definition: protocol.txt:29
virtual std::string yysyntax_error_(int yystate, int tok)
stack< semantic_type > semantic_stack_type
Semantic value stack type.
Definition: bison_parser.h:221
location location_type
Symbol locations.
Definition: bison_parser.h:140
Abstract a location.
Definition: location.hh:56
token::yytokentype token_type
Token type.
Definition: bison_parser.h:163
static const char *const yytname_[]
For a symbol, its name in clear.
Definition: bison_parser.h:267
static const signed char yytable_ninf_
Definition: bison_parser.h:253
QUERY_STATE
Definition: protocol.txt:30
static const int yyempty_
Definition: bison_parser.h:317
stack< state_type > state_stack_type
State stack type.
Definition: bison_parser.h:219
static const int yyntokens_
Definition: bison_parser.h:321
class CommandNode * commandNode
Definition: bison_parser.h:128
static const int yynnts_
Definition: bison_parser.h:316
static const signed char yydefgoto_[]
Definition: bison_parser.h:245
static const unsigned char yyr2_[]
For a rule, its RHS length.
Definition: bison_parser.h:263
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
location_stack_type yylocation_stack_
The location stack.
Definition: bison_parser.h:230
static const unsigned char yystos_[]
For a state, its accessing symbol.
Definition: bison_parser.h:258
static const unsigned char yydefact_[]
Definition: bison_parser.h:242
Parser(class Driver &driver_yyarg)
Build a parser object.