pub fn generate(argv: &str) -> Result<String, String>
Expand description
This function can be called from within Rust to generate a parser/lexer.
It takes the same arguments as the rustlr command-line application.
Furthermore, if given the -trace 0
option, no output will be
sent to stdout or stderr. Instead, a log of events is recorded and
is returned. An Ok(_)
result indicates that some parser was created
and an Err(_)
result indicates failure.
Example:
ⓘ
let report = rustlr::generate("simplecalc.grammar -o src/main.rs -trace 0");