19 #ifndef ROSTLAB_BLAST_PARSER_DRIVER_H
20 #define ROSTLAB_BLAST_PARSER_DRIVER_H 1
25 #include <rostlab/rostlab_stdexcept.h>
31 rostlab::blast::parser::token_type \
32 yylex( rostlab::blast::parser::semantic_type* __yylval, \
33 rostlab::blast::parser::location_type* __yylloc, \
34 rostlab::blast::parser_driver& __drv, \
38 #define YY_DECL_FRIEND \
39 rostlab::blast::parser::token_type \
40 ::yylex( rostlab::blast::parser::semantic_type* __yylval, \
41 rostlab::blast::parser::location_type* __yylloc, \
42 rostlab::blast::parser_driver& __drv, \
52 parser_error(
const std::string& __msg ) : rostlab::runtime_error(__msg){}
65 std::string _istream_name;
79 parser_driver( FILE* __istream = stdin,
const std::string& __istream_name =
"stdin" ) : _istream_name(__istream_name), _istream(__istream)
91 parse(
bool __trace_parsing =
false,
bool __trace_scanning =
false ) throw (rostlab::blast::
parser_error);
96 void trace_scanning(
bool __b );
99 void error( const rostlab::blast::
location& __loc, const std::
string __msg )
101 std::cerr << __loc <<
": " << __msg <<
"\n";
105 void error(
const std::string __msg )
107 std::cerr << __msg <<
"\n";
120 #endif // ROSTLAB_BLAST_PARSER_DRIVER_H
const result_type & result() const
Read-only access to results.
void error(const std::string __msg)
Print error message.
const result_type & parse(bool __trace_parsing=false, bool __trace_scanning=false)
Parse one result from the input stream.
Blast result for one query.
void error(const rostlab::blast::location &__loc, const std::string __msg)
Print error message for given location.
parser_driver(FILE *__istream=stdin, const std::string &__istream_name="stdin")
parser_error(const std::string &__msg)
bool trace_scanning()
Get tracing of scanning.
rostlab::blast::result result_type
Blast (default, -m 0) output parser.