A parser for the FlatZinc modelling language version 2.8.3.
❯ cargo build --release
In your Cargo.toml
:
[dependencies]
flatzinc = "0.3.21"
In your code:
use flatzinc::Stmt;
match <Stmt as std::str::FromStr>::from_str(line) {
Ok(result) => println!("{:#?}", result),
Err(e) => {
error!("Failed to parse flatzinc statement:\n{}", e);
}
}
An example parser can be found in the examples/fz-parser.rs
.
To run the parser call:
❯ cargo run --example fz-parser -- -i jobshop.fzn
The binary can be found under target/release/examples/fz-parser
.