librostlab-blast  1.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
blast-parser-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 /* "%code requires" blocks. */
41 
42 /* Line 35 of lalr1.cc */
43 #line 24 "blast-parser-parser.ypp"
44 
45 #include <string>
46 #include "rostlab/blast-result.h"
47 namespace rostlab { namespace blast { class parser_driver; } }
48 
49 
50 
51 /* Line 35 of lalr1.cc */
52 #line 53 "rostlab/blast-parser-parser.h"
53 
54 
55 #include <string>
56 #include <iostream>
58 
59 
60 /* Line 35 of lalr1.cc */
61 #line 22 "blast-parser-parser.ypp"
62 namespace rostlab { namespace blast {
63 
64 /* Line 35 of lalr1.cc */
65 #line 66 "rostlab/blast-parser-parser.h"
66  class position;
67  class location;
68 
69 /* Line 35 of lalr1.cc */
70 #line 22 "blast-parser-parser.ypp"
71 } } // rostlab::blast
72 
73 /* Line 35 of lalr1.cc */
74 #line 75 "rostlab/blast-parser-parser.h"
75 
77 
78 /* Enabling traces. */
79 #ifndef YYDEBUG
80 # define YYDEBUG 1
81 #endif
82 
83 /* Enabling verbose error messages. */
84 #ifdef YYERROR_VERBOSE
85 # undef YYERROR_VERBOSE
86 # define YYERROR_VERBOSE 1
87 #else
88 # define YYERROR_VERBOSE 1
89 #endif
90 
91 /* Enabling the token table. */
92 #ifndef YYTOKEN_TABLE
93 # define YYTOKEN_TABLE 0
94 #endif
95 
96 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
97  If N is 0, then set CURRENT to the empty location which ends
98  the previous symbol: RHS[0] (always defined). */
99 
100 #ifndef YYLLOC_DEFAULT
101 # define YYLLOC_DEFAULT(Current, Rhs, N) \
102 do { \
103  if (N) \
104  { \
105  (Current).begin = (Rhs)[1].begin; \
106  (Current).end = (Rhs)[N].end; \
107  } \
108  else \
109  { \
110  (Current).begin = (Current).end = (Rhs)[0].end; \
111  } \
112 } while (false)
113 #endif
114 
115 
116 /* Line 35 of lalr1.cc */
117 #line 22 "blast-parser-parser.ypp"
118 namespace rostlab { namespace blast {
119 
120 /* Line 35 of lalr1.cc */
121 #line 122 "rostlab/blast-parser-parser.h"
122 
124  class parser
125  {
126  public:
128 #ifndef YYSTYPE
130  {
131 
132 /* Line 35 of lalr1.cc */
133 #line 47 "blast-parser-parser.ypp"
134 
135  long int ival;
136  double dval;
137  std::string* sval;
138 
139 
140 
141 /* Line 35 of lalr1.cc */
142 #line 143 "rostlab/blast-parser-parser.h"
143  };
144 #else
145  typedef YYSTYPE semantic_type;
146 #endif
147 
150  struct token
151  {
152  /* Tokens. */
153  enum yytokentype {
154  END = 0,
156  REFERENCE = 259,
157  STRING = 260,
158  INT = 261,
159  DBL = 262,
160  SEARCHING = 263,
161  NOHITS = 264,
165  CONVERGED = 268,
166  TAIL = 269,
167  QUERYEQ = 270,
170  SCOREEQ = 273,
171  EXPECTEQ = 274,
172  METHODCOLON = 275,
174  POSITIVESEQ = 277,
175  GAPSEQ = 278,
176  STRANDEQ = 279,
177  FRAMEEQ = 280,
178  QUERYCOLON = 281,
180  };
181 
182  };
185 
187  parser (rostlab::blast::parser_driver& drv_yyarg, void* yyscanner_yyarg);
188  virtual ~parser ();
189 
192  virtual int parse ();
193 
194 #if YYDEBUG
195 
196  std::ostream& debug_stream () const;
198  void set_debug_stream (std::ostream &);
199 
201  typedef int debug_level_type;
203  debug_level_type debug_level () const;
206 #endif
207 
208  private:
212  virtual void error (const location_type& loc, const std::string& msg);
213 
217  virtual std::string yysyntax_error_ (int yystate, int tok);
218 
219 #if YYDEBUG
220 
221 
222 
223 
224  virtual void yy_symbol_value_print_ (int yytype,
225  const semantic_type* yyvaluep,
226  const location_type* yylocationp);
231  virtual void yy_symbol_print_ (int yytype,
232  const semantic_type* yyvaluep,
233  const location_type* yylocationp);
234 #endif
235 
236 
238  typedef int state_type;
245 
247  state_stack_type yystate_stack_;
249  semantic_stack_type yysemantic_stack_;
251  location_stack_type yylocation_stack_;
252 
254  typedef unsigned char token_number_type;
255  /* Tables. */
257  static const signed char yypact_[];
258  static const signed char yypact_ninf_;
259 
263  static const unsigned char yydefact_[];
264 
265  static const signed char yypgoto_[];
266  static const signed char yydefgoto_[];
267 
273  static const unsigned char yytable_[];
274  static const signed char yytable_ninf_;
275 
276  static const unsigned char yycheck_[];
277 
279  static const unsigned char yystos_[];
280 
282  static const unsigned char yyr1_[];
284  static const unsigned char yyr2_[];
285 
286 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
287 
288  static const char* const yytname_[];
289 #endif
290 
291 #if YYERROR_VERBOSE
292 
293  virtual std::string yytnamerr_ (const char *n);
294 #endif
295 
296 #if YYDEBUG
297 
298  typedef signed char rhs_number_type;
300  static const rhs_number_type yyrhs_[];
302  static const unsigned char yyprhs_[];
304  static const unsigned char yyrline_[];
306  static const unsigned short int yytoken_number_[];
308  virtual void yy_reduce_print_ (int r);
310  virtual void yystack_print_ ();
311 
312  /* Debugging. */
313  int yydebug_;
314  std::ostream* yycdebug_;
315 #endif
316 
318  token_number_type yytranslate_ (int t);
319 
325  inline void yydestruct_ (const char* yymsg,
326  int yytype,
327  semantic_type* yyvaluep,
328  location_type* yylocationp);
329 
331  inline void yypop_ (unsigned int n = 1);
332 
333  /* Constants. */
334  static const int yyeof_;
335  /* LAST_ -- Last index in TABLE_. */
336  static const int yylast_;
337  static const int yynnts_;
338  static const int yyempty_;
339  static const int yyfinal_;
340  static const int yyterror_;
341  static const int yyerrcode_;
342  static const int yyntokens_;
343  static const unsigned int yyuser_token_number_max_;
344  static const token_number_type yyundef_token_;
345 
346  /* User arguments. */
348  void* yyscanner;
349  };
350 
351 /* Line 35 of lalr1.cc */
352 #line 22 "blast-parser-parser.ypp"
353 } } // rostlab::blast
354 
355 /* Line 35 of lalr1.cc */
356 #line 357 "rostlab/blast-parser-parser.h"
357 
358 
359 
360 #endif /* ! defined PARSER_HEADER_H */