26 releases

0.3.21 Oct 11, 2024
0.3.20 May 10, 2024
0.3.19 Mar 1, 2022
0.3.18 Aug 25, 2021
0.3.14 Jun 27, 2020

#488 in Parser implementations

Download history 24/week @ 2024-09-07 2/week @ 2024-09-14 31/week @ 2024-09-21 20/week @ 2024-09-28 140/week @ 2024-10-05 119/week @ 2024-10-12 25/week @ 2024-10-19 52/week @ 2024-10-26 95/week @ 2024-11-02 15/week @ 2024-11-09 17/week @ 2024-11-16

180 downloads per month
Used in pumpkin-solver

MIT license

105KB
3K SLoC

flatzinc Build Status Latest Version Rust Documentation

A parser for the FlatZinc modelling language version 2.8.3.

Compile

❯ cargo build --release

Usage

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);
    }
}

fz-parser

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.

FAQ

Dependencies

~1MB
~15K SLoC