The Driver is the base class for all the parsers.
More...
#include <Driver.h>
|
|
| Driver (LpSolver &lp_solver, const std::string &class_name="Driver") |
| | construct a new parser driver context
|
| bool | ParseStream (std::istream &in, const std::string &sname="stream input") |
| | Invoke the scanner and parser for a stream.
|
| bool | ParseString (std::string_view input, const std::string &sname="string stream") |
| | Invoke the scanner and parser on an input string.
|
| virtual bool | ParseFile (const std::string &filename) |
| | Invoke the scanner and parser on a file.
|
|
void | Solve () |
| | Call context_.CheckSat() and print proper output messages to the standard output.
|
|
|
static void | Error (const std::string &m) |
| | General error handling.
|
|
| virtual bool | ParseStreamCore (std::istream &in)=0 |
| | Parse the stream.
|
| virtual bool | ParseFileCore (const std::string &filename)=0 |
| | Parse the input file.
|
| virtual bool | ParseStringCore (std::string_view input)=0 |
| | Parse the string.
|
|
|
std::string | input_name_ |
| | The name of the stream being parsed.
|
|
LpSolver & | lp_solver_ |
| | LP parser that will store the parsed data.
|
|
IterationStats | stats_ |
| | Statistics for the driver.
|
The Driver is the base class for all the parsers.
It contains the common logic to allow the parsed data to be saved in the context. It coordinates the communication between the parser (bison) and the scanner (flex).
Definition at line 22 of file Driver.h.
◆ ParseFile()
| bool delpi::Driver::ParseFile |
( |
const std::string & | filename | ) |
|
|
virtual |
Invoke the scanner and parser on a file.
Use parse_stream with a std::ifstream if detection of file reading errors is required.
- Parameters
-
- Returns
- true if successfully parsed
-
false if an error occurred
Definition at line 34 of file Driver.cpp.
◆ ParseFileCore()
| virtual bool delpi::Driver::ParseFileCore |
( |
const std::string & | filename | ) |
|
|
protectedpure virtual |
Parse the input file.
- Parameters
-
| filename | path to the file to parse |
- Returns
- true if successfully parsed
-
false if an error occurred
◆ ParseStream()
| bool delpi::Driver::ParseStream |
( |
std::istream & | in, |
|
|
const std::string & | sname = "stream input" ) |
Invoke the scanner and parser for a stream.
- Parameters
-
| in | input stream |
| sname | stream name for error messages |
- Returns
- true if successfully parsed
-
false if an error occurred
Definition at line 22 of file Driver.cpp.
◆ ParseStreamCore()
| virtual bool delpi::Driver::ParseStreamCore |
( |
std::istream & | in | ) |
|
|
protectedpure virtual |
Parse the stream.
- Parameters
-
- Returns
- true if successfully parsed
-
false if an error occurred
◆ ParseString()
| bool delpi::Driver::ParseString |
( |
std::string_view | input, |
|
|
const std::string & | sname = "string stream" ) |
Invoke the scanner and parser on an input string.
- Parameters
-
| input | input string |
| sname | stream name for error messages |
- Returns
- true if successfully parsed
-
false if an error occurred
Definition at line 28 of file Driver.cpp.
◆ ParseStringCore()
| virtual bool delpi::Driver::ParseStringCore |
( |
std::string_view | input | ) |
|
|
protectedpure virtual |
Parse the string.
- Parameters
-
- Returns
- true if successfully parsed
-
false if an error occurred
The documentation for this class was generated from the following files: