Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evalexpr_parser.h
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 2.7. */
2 
3 /* Skeleton interface for Bison LALR(1) parsers in C++
4 
5  Copyright (C) 2002-2012 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
38 /* C++ LALR(1) parser skeleton written by Akim Demaille. */
39 
40 #ifndef YY_YY_EVALEXPR_PARSER_H_INCLUDED
41 # define YY_YY_EVALEXPR_PARSER_H_INCLUDED
42 
43 /* "%code requires" blocks. */
44 /* Line 33 of lalr1.cc */
45 #line 7 "evalexpr_parser.yy"
46 
47 #include <cmath>
48 #include <string>
49 
50 class EvalExpr;
51 
52 
53 /* Line 33 of lalr1.cc */
54 #line 55 "evalexpr_parser.h"
55 
56 
57 #include <string>
58 #include <iostream>
59 #include "stack.hh"
60 #include "location.hh"
61 
62 /* Enabling traces. */
63 #ifndef YYDEBUG
64 # define YYDEBUG 1
65 #endif
66 
67 /* Line 33 of lalr1.cc */
68 #line 4 "evalexpr_parser.yy"
69 namespace yy {
70 /* Line 33 of lalr1.cc */
71 #line 72 "evalexpr_parser.h"
72 
74  class parser
75  {
76  public:
78 #ifndef YYSTYPE
80  {
81 /* Line 33 of lalr1.cc */
82 #line 21 "evalexpr_parser.yy"
83 
84  double val;
85  char *sym;
86 
87 
88 /* Line 33 of lalr1.cc */
89 #line 90 "evalexpr_parser.h"
90  };
91 #else
92  typedef YYSTYPE semantic_type;
93 #endif
94  typedef location location_type;
97  struct token
98  {
99  /* Tokens. */
101  {
102  EOL = 258,
103  IDENTIFIER = 259,
104  NUMBER = 260,
105  NEG = 261,
106  PLS = 262
107  };
108  };
111 
113  parser(EvalExpr& driver_yyarg);
114  virtual ~parser();
115 
118  virtual int parse();
119 
120 #if YYDEBUG
121  std::ostream& debug_stream() const;
123 
125  void set_debug_stream(std::ostream&);
126 
128  typedef int debug_level_type;
131 
134 
135 #endif
136 
137  private:
141  virtual void error(const location_type& loc, const std::string& msg);
142 
146  virtual std::string yysyntax_error_(int yystate, int tok);
147 
148 #if YYDEBUG
149  virtual void yy_symbol_value_print_(int yytype,
154  const semantic_type *yyvaluep,
155  const location_type *yylocationp);
156 
161  virtual void yy_symbol_print_(int yytype,
162  const semantic_type *yyvaluep,
163  const location_type *yylocationp);
164 
165 #endif
166 
167 
169  typedef int state_type;
176 
183 
186  static bool yy_pact_value_is_default_(int yyvalue);
187 
190  static bool yy_table_value_is_error_(int yyvalue);
191 
193  typedef unsigned char token_number_type;
194  /* Tables. */
196  static const signed char yypact_[];
197  static const signed char yypact_ninf_;
198 
202  static const unsigned char yydefact_[];
203 
204  static const signed char yypgoto_[];
205  static const signed char yydefgoto_[];
206 
212  static const unsigned char yytable_[];
213  static const signed char yytable_ninf_;
214 
215  static const signed char yycheck_[];
216 
218  static const unsigned char yystos_[];
219 
221  static const unsigned char yyr1_[];
223  static const unsigned char yyr2_[];
224 
226  static std::string yytnamerr_(const char *n);
227 
228 
230  static const char *const yytname_[];
231 #if YYDEBUG
232  typedef signed char rhs_number_type;
235  static const rhs_number_type yyrhs_[];
237  static const unsigned char yyprhs_[];
239  static const unsigned char yyrline_[];
241  static const unsigned short int yytoken_number_[];
243  virtual void yy_reduce_print_(int r);
244 
246  virtual void yystack_print_();
247 
248  /* Debugging. */
249  int yydebug_;
250  std::ostream *yycdebug_;
251 #endif
252 
255 
262  inline void yydestruct_(const char *yymsg,
263  int yytype,
264  semantic_type *yyvaluep,
265  location_type *yylocationp);
266 
268  inline void yypop_(unsigned int n = 1);
269 
270  /* Constants. */
271  static const int yyeof_;
272  /* LAST_ -- Last index in TABLE_. */
273  static const int yylast_;
274  static const int yynnts_;
275  static const int yyempty_;
276  static const int yyfinal_;
277  static const int yyterror_;
278  static const int yyerrcode_;
279  static const int yyntokens_;
280  static const unsigned int yyuser_token_number_max_;
282 
283  /* User arguments. */
285  };
286 /* Line 33 of lalr1.cc */
287 #line 4 "evalexpr_parser.yy"
288 } // yy
289 /* Line 33 of lalr1.cc */
290 #line 285 "evalexpr_parser.h"
291 #endif /* !YY_YY_EVALEXPR_PARSER_H_INCLUDED */
static const signed char yypgoto_[]
location location_type
Symbol locations.
static const rhs_number_type yyrhs_[]
A `-1&#39;-separated list of the rules&#39; RHS.
static const char *const yytname_[]
For a symbol, its name in clear.
static const unsigned char yystos_[]
For a state, its accessing symbol.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
virtual std::string yysyntax_error_(int yystate, int tok)
static const signed char yytable_ninf_
state_stack_type yystate_stack_
The state stack.
int debug_level_type
Type for debugging levels.
void yydestruct_(const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
Reclaim the memory associated to a symbol.
virtual void yy_symbol_print_(int yytype, const semantic_type *yyvaluep, const location_type *yylocationp)
Report a symbol on the debug stream.
std::ostream & debug_stream() const
The current debugging stream.
virtual int parse()
static const unsigned char yydefact_[]
virtual ~parser()
int state_type
State numbers.
signed char rhs_number_type
A type to store symbol numbers and -1.
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
debug_level_type debug_level() const
The current debugging level.
virtual void yy_symbol_value_print_(int yytype, const semantic_type *yyvaluep, const location_type *yylocationp)
Report a symbol value on the debug stream.
static const unsigned char yytable_[]
static const int yyeof_
static const unsigned char yyprhs_[]
For each rule, the index of the first RHS symbol in yyrhs_.
void set_debug_level(debug_level_type l)
Set the current debugging level.
Symbol semantic values.
parser(EvalExpr &driver_yyarg)
Build a parser object.
static const unsigned short int yytoken_number_[]
For each scanner token number, its symbol number.
static const unsigned char yyr1_[]
For a rule, its LHS.
EvalExpr class for algebraic expression in parameter strings.
Definition: evalexpr.h:38
virtual void error(const location_type &loc, const std::string &msg)
virtual void yystack_print_()
Print the state stack on the debug stream.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
stack< location_type > location_stack_type
location stack type.
static const unsigned char yyrline_[]
For each rule, its source line number.
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
static const int yynnts_
static bool yy_table_value_is_error_(int yyvalue)
token::yytokentype token_type
Token type.
static const signed char yypact_ninf_
static const int yyntokens_
std::ostream * yycdebug_
static const signed char yycheck_[]
static const int yyfinal_
stack< semantic_type > semantic_stack_type
Semantic value stack type.
token_number_type yytranslate_(int t)
Convert a scanner token number t to a symbol number.
Abstract a location.
Definition: location.hh:50
static const token_number_type yyundef_token_
A Bison parser.
static const unsigned char yyr2_[]
For a rule, its RHS length.
stack< state_type > state_stack_type
State stack type.
static const signed char yydefgoto_[]
static const int yyerrcode_
EvalExpr & driver
location_stack_type yylocation_stack_
The location stack.
static const unsigned int yyuser_token_number_max_
static const signed char yypact_[]
For a state, the index in yytable_ of its portion.
static bool yy_pact_value_is_default_(int yyvalue)
static const int yylast_
unsigned char token_number_type
Internal symbol numbers.
static const int yyterror_
static const int yyempty_
semantic_stack_type yysemantic_stack_
The semantic value stack.