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

#1664 in Parser implementations

Download history 52/week @ 2024-12-04 39/week @ 2024-12-11 25/week @ 2024-12-18 5/week @ 2024-12-25 14/week @ 2025-01-08 5/week @ 2025-01-15 24/week @ 2025-01-22 18/week @ 2025-01-29 65/week @ 2025-02-05 53/week @ 2025-02-12 12/week @ 2025-02-19 24/week @ 2025-02-26 62/week @ 2025-03-05 18/week @ 2025-03-12 9/week @ 2025-03-19

114 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
~27K SLoC