g2o
|
#include <driver.h>
Public Member Functions | |
Driver (class SlamContext &slamContext_) | |
construct a new parser driver context More... | |
bool | parse_stream (std::istream &in, const std::string &sname="stream input") |
bool | parse_string (const std::string &input, const std::string &sname="string stream") |
bool | parse_file (const std::string &filename) |
void | error (const class location &l, const std::string &m) |
void | error (const std::string &m) |
Public Attributes | |
bool | trace_scanning |
enable debug output in the flex scanner More... | |
bool | trace_parsing |
enable debug output in the bison parser More... | |
std::string | streamname |
stream name (file or input stream) used for error messages. More... | |
class Scanner * | lexer |
class SlamContext & | slamContext |
SlamParser::Driver::Driver | ( | class SlamContext & | slamContext_ | ) |
construct a new parser driver context
Definition at line 37 of file driver.cpp.
void SlamParser::Driver::error | ( | const class location & | l, |
const std::string & | m | ||
) |
Error handling with associated line number. This can be modified to output the error e.g. to a dialog box.
Definition at line 72 of file driver.cpp.
Referenced by SlamParser::Parser::error().
void SlamParser::Driver::error | ( | const std::string & | m | ) |
General error handling. This can be modified to output the error e.g. to a dialog box.
Definition at line 78 of file driver.cpp.
bool SlamParser::Driver::parse_file | ( | const std::string & | filename | ) |
Invoke the scanner and parser on a file. Use parse_stream with a std::ifstream if detection of file reading errors is required.
filename | input file name |
Definition at line 59 of file driver.cpp.
References parse_stream().
bool SlamParser::Driver::parse_stream | ( | std::istream & | in, |
const std::string & | sname = "stream input" |
||
) |
Invoke the scanner and parser for a stream.
in | input stream |
sname | stream name for error messages |
Definition at line 44 of file driver.cpp.
References lexer, SlamParser::Parser::parse(), SlamParser::Scanner::set_debug(), streamname, trace_parsing, and trace_scanning.
Referenced by main(), parse_file(), parse_string(), and SlamParser::ParserInterface::parseCommand().
bool SlamParser::Driver::parse_string | ( | const std::string & | input, |
const std::string & | sname = "string stream" |
||
) |
Invoke the scanner and parser on an input string.
input | input string |
sname | stream name for error messages |
Definition at line 66 of file driver.cpp.
References parse_stream().
class Scanner* SlamParser::Driver::lexer |
Pointer to the current lexer instance, this is used to connect the parser to the scanner. It is used in the yylex macro.
Definition at line 89 of file driver.h.
Referenced by parse_stream().
class SlamContext& SlamParser::Driver::slamContext |
Reference to the calculator context filled during parsing of the expressions.
Definition at line 93 of file driver.h.
Referenced by SlamParser::Parser::parse().
std::string SlamParser::Driver::streamname |
stream name (file or input stream) used for error messages.
Definition at line 50 of file driver.h.
Referenced by SlamParser::Parser::parse(), and parse_stream().
bool SlamParser::Driver::trace_parsing |
enable debug output in the bison parser
Definition at line 47 of file driver.h.
Referenced by main(), and parse_stream().
bool SlamParser::Driver::trace_scanning |
enable debug output in the flex scanner
Definition at line 44 of file driver.h.
Referenced by main(), and parse_stream().