![]() |
Spicy
|
#include <driver.h>
Public Member Functions | |
hilti::rt::Result< hilti::rt::Nothing > | listParsers (std::ostream &out) |
hilti::rt::Result< const spicy::rt::Parser * > | lookupParser (const std::string &name="") |
hilti::rt::Result< spicy::rt::ParsedUnit > | processInput (const spicy::rt::Parser &parser, std::istream &in, int increment=0) |
hilti::rt::Result< hilti::rt::Nothing > | processPreBatchedInput (std::istream &in) |
void | debug (const std::string &msg) |
Runtime driver to retrieve and feed Spicy parsers.
The HILTI/Spicy runtime environments must be managed externally, and must have been initialized already before using any of the driver's functionality.
|
inline |
Records a debug message to the spicy-driver
runtime debug stream.
Prints a human-readable list of all available parsers, retrieved from the Spicy runtime system.
out | stream to print the summary to |
Result< const spicy::rt::Parser * > Driver::lookupParser | ( | const std::string & | name = "" | ) |
Retrieves a parser by its name.
name | name of the parser to be retrieved, either as shown in the output of listParsers() ; or, alternatively, as a string rendering of a port or MIME type as defined by a unit's properties. If no name is given and there's only one parser available, that one is taken automatically. |
Result< spicy::rt::ParsedUnit > Driver::processInput | ( | const spicy::rt::Parser & | parser, |
std::istream & | in, | ||
int | increment = 0 |
||
) |
Feeds a parser with an input stream of data.
parser | parser to instantiate and feed |
in | stream to read input data from; will read until EOF is encountered |
increment | if non-zero, will feed the data in small chunks at a time; this is mainly for testing parsers; incremental parsing |
HILTI | or Spocy runtime error if the parser into trouble |
Result< hilti::rt::Nothing > Driver::processPreBatchedInput | ( | std::istream & | in | ) |
Processes a batch of input data given in Spicy's custom batch format. See the documentation of spicy-driver
for a reference of the batch format.
in | an open stream to read the batch from |