flatzinc

Crates.ioflatzinc
lib.rsflatzinc
version0.3.21
created_at2020-04-25 20:26:53.138537+00
updated_at2024-10-11 07:38:21.535549+00
descriptionA FlatZinc parser
homepage
repositoryhttps://github.com/potassco/flatzinc
max_upload_size
id234086
size120,920
Sven Thiele (sthiele)

documentation

https://docs.rs/flatzinc

README

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

Commit count: 136

cargo fmt