librostlab-blast  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
blast-parser-parser.h
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 2.5. */
2 
3 /* Skeleton interface for Bison LALR(1) parsers in C++
4 
5  Copyright (C) 2002-2011 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 
33 /* C++ LALR(1) parser skeleton written by Akim Demaille. */
34 
35 #ifndef PARSER_HEADER_H
36 # define PARSER_HEADER_H
37 
38 /* "%code requires" blocks. */
39 
40 /* Line 35 of lalr1.cc */
41 #line 24 "blast-parser-parser.ypp"
42 
43 #include <string>
44 #include "rostlab/blast-result.h"
45 namespace rostlab { namespace blast { class parser_driver; } }
46 
47 
48 
49 /* Line 35 of lalr1.cc */
50 #line 51 "rostlab/blast-parser-parser.h"
51 
52 
53 #include <string>
54 #include <iostream>
57 
58 /* Enabling traces. */
59 #ifndef YYDEBUG
60 # define YYDEBUG 1
61 #endif
62 
63 /* Enabling verbose error messages. */
64 #ifdef YYERROR_VERBOSE
65 # undef YYERROR_VERBOSE
66 # define YYERROR_VERBOSE 1
67 #else
68 # define YYERROR_VERBOSE 1
69 #endif
70 
71 /* Enabling the token table. */
72 #ifndef YYTOKEN_TABLE
73 # define YYTOKEN_TABLE 0
74 #endif
75 
76 
77 /* Line 35 of lalr1.cc */
78 #line 22 "blast-parser-parser.ypp"
79 namespace rostlab { namespace blast {
80 
81 /* Line 35 of lalr1.cc */
82 #line 83 "rostlab/blast-parser-parser.h"
83 
85  class parser
86  {
87  public:
89 #ifndef YYSTYPE
91  {
92 
93 /* Line 35 of lalr1.cc */
94 #line 47 "blast-parser-parser.ypp"
95 
96  long int ival;
97  double dval;
98  std::string* sval;
99 
100 
101 
102 /* Line 35 of lalr1.cc */
103 #line 104 "rostlab/blast-parser-parser.h"
104  };
105 #else
106  typedef YYSTYPE semantic_type;
107 #endif
108 
111  struct token
112  {
113  /* Tokens. */
114  enum yytokentype {
115  END = 0,
117  REFERENCE = 259,
118  STRING = 260,
119  INT = 261,
120  DBL = 262,
121  SEARCHING = 263,
122  NOHITS = 264,
126  CONVERGED = 268,
127  TAIL = 269,
128  QUERYEQ = 270,
131  SCOREEQ = 273,
132  EXPECTEQ = 274,
133  METHODCOLON = 275,
135  POSITIVESEQ = 277,
136  GAPSEQ = 278,
137  STRANDEQ = 279,
138  FRAMEEQ = 280,
139  QUERYCOLON = 281,
141  };
142 
143  };
146 
148  parser (rostlab::blast::parser_driver& drv_yyarg, void* yyscanner_yyarg);
149  virtual ~parser ();
150 
153  virtual int parse ();
154 
155 #if YYDEBUG
156 
157  std::ostream& debug_stream () const;
159  void set_debug_stream (std::ostream &);
160 
162  typedef int debug_level_type;
164  debug_level_type debug_level () const;
167 #endif
168 
169  private:
173  virtual void error (const location_type& loc, const std::string& msg);
174 
178  virtual std::string yysyntax_error_ (int yystate, int tok);
179 
180 #if YYDEBUG
181 
182 
183 
184 
185  virtual void yy_symbol_value_print_ (int yytype,
186  const semantic_type* yyvaluep,
187  const location_type* yylocationp);
192  virtual void yy_symbol_print_ (int yytype,
193  const semantic_type* yyvaluep,
194  const location_type* yylocationp);
195 #endif
196 
197 
199  typedef int state_type;
206 
208  state_stack_type yystate_stack_;
210  semantic_stack_type yysemantic_stack_;
212  location_stack_type yylocation_stack_;
213 
216  static bool yy_pact_value_is_default_ (int yyvalue);
217 
220  static bool yy_table_value_is_error_ (int yyvalue);
221 
223  typedef unsigned char token_number_type;
224  /* Tables. */
226  static const signed char yypact_[];
227  static const signed char yypact_ninf_;
228 
232  static const unsigned char yydefact_[];
233 
234  static const signed char yypgoto_[];
235  static const signed char yydefgoto_[];
236 
242  static const unsigned char yytable_[];
243  static const signed char yytable_ninf_;
244 
245  static const unsigned char yycheck_[];
246 
248  static const unsigned char yystos_[];
249 
251  static const unsigned char yyr1_[];
253  static const unsigned char yyr2_[];
254 
255 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
256 
257  static const char* const yytname_[];
258 #endif
259 
261  static std::string yytnamerr_ (const char *n);
262 
263 #if YYDEBUG
264 
265  typedef signed char rhs_number_type;
267  static const rhs_number_type yyrhs_[];
269  static const unsigned char yyprhs_[];
271  static const unsigned char yyrline_[];
273  static const unsigned short int yytoken_number_[];
275  virtual void yy_reduce_print_ (int r);
277  virtual void yystack_print_ ();
278 
279  /* Debugging. */
280  int yydebug_;
281  std::ostream* yycdebug_;
282 #endif
283 
285  token_number_type yytranslate_ (int t);
286 
292  inline void yydestruct_ (const char* yymsg,
293  int yytype,
294  semantic_type* yyvaluep,
295  location_type* yylocationp);
296 
298  inline void yypop_ (unsigned int n = 1);
299 
300  /* Constants. */
301  static const int yyeof_;
302  /* LAST_ -- Last index in TABLE_. */
303  static const int yylast_;
304  static const int yynnts_;
305  static const int yyempty_;
306  static const int yyfinal_;
307  static const int yyterror_;
308  static const int yyerrcode_;
309  static const int yyntokens_;
310  static const unsigned int yyuser_token_number_max_;
311  static const token_number_type yyundef_token_;
312 
313  /* User arguments. */
315  void* yyscanner;
316  };
317 
318 /* Line 35 of lalr1.cc */
319 #line 22 "blast-parser-parser.ypp"
320 } } // rostlab::blast
321 
322 /* Line 35 of lalr1.cc */
323 #line 324 "rostlab/blast-parser-parser.h"
324 
325 
326 
327 #endif /* ! defined PARSER_HEADER_H */