BRISTOL parser¶
The header <lorina/bristol.hpp>
implements methods to parse the BRISTOL formal (see https://homes.esat.kuleuven.be/~nsmart/MPC/).
The class lorina::bristol_reader
provides the following public
member functions.
Function |
Description |
---|---|
|
Callback method for parsed header |
|
Callback method for parsed gate |
The following reader functions are available.
Function
|
Description
|
---|---|
Reads a Bristol fashion circuit from a stream.
|
|
Reads a Bristol fashion circuit from a file.
|
-
inline return_code lorina::read_bristol(std::istream &is, const bristol_reader &reader, diagnostic_engine *diag = nullptr)¶
Reads a Bristol fashion circuit from a stream.
A callback method of the reader visitor is invoked for each primitive object matched in the specification.
- Parameters
in – Input stream
reader – A BRISTOL 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_bristol(const std::string &filename, const bristol_reader &reader, diagnostic_engine *diag = nullptr)¶
Reads a Bristol fashion circuit from a file.
A callback method of the reader visitor is invoked for each primitive object matched in the specification.
- Parameters
filename – Name of the file
reader – A BRISTOL 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