BENCH parser¶
The header <lorina/bench.hpp>
implements methods to parse the BENCH format.
The class lorina::bench_reader
provides the following public
member functions.
Function |
Description |
---|---|
|
Callback method for parsed input |
|
Callback method for parsed output |
|
Callback method for parsed gate |
|
Callback method for parsed gate assignment |
The following reader functions are available.
Function
|
Description
|
---|---|
Reader function for the BENCH format.
|
|
Reader function for BENCH format.
|
-
inline return_code lorina::read_bench(std::istream &in, const bench_reader &reader, diagnostic_engine *diag = nullptr)¶
Reader function for the BENCH format.
Reads BENCH format from a stream and invokes a callback method for each parsed primitive and each detected parse error.
- Parameters
in – Input stream
reader – A BENCH reader with callback methods invoked for parsed primitives
diag – An optional diagnostic engine with callback methods for parse errors
- Returns
Success if parsing has been successful, or parse error if parsing has failed
-
inline return_code lorina::read_bench(const std::string &filename, const bench_reader &reader, diagnostic_engine *diag = nullptr)¶
Reader function for BENCH format.
Reads BENCH format from a file and invokes a callback method for each parsed primitive and each detected parse error.
- Parameters
filename – Name of the file
reader – A BENCH reader with callback methods invoked for parsed primitives
diag – An optional diagnostic engine with callback methods for parse errors
- Returns
Success if parsing has been successful, or parse error if parsing has failed