dyck 0.1.0

A crate for running Dyck and InterDyck algorithms over languages of generic <T> token enum instances or string slice types.
Documentation
  • Coverage
  • 93.33%
    14 out of 15 items documented1 out of 14 items with examples
  • Size
  • Source code size: 21.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.21 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • raquentin/dyck
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • r4c3

A library for running Dyck algorithms over languages of generic string slice types.

This module provides functionalities to create and manipulate languages based on user-defined tokens, allowing for the evaluation and transformation of sequences of tokens (words) according to the rules of Dyck languages.

Usage

Add dyck to your Cargo.toml:

[dependencies]
dyck = "0.1"

Example: Creating a Dyck language and checking if a word is valid.

use dyck::{Language, Word};

// define pairs of tokens for the language
let pairs = vec![("(", ")"), ("[", "]"), ("{", "}")];
let language = Language::new_from_vec(&pairs).expect("Failed to create language");

// define a word to check
let word: Word<&str> = vec!["(", "[", "]", "(", ")", ")"];

// check if the word is a valid Dyck word
if language.is_valid(&word) {
        println!("The word is a valid Dyck word.");
} else {
    println!("The word is not a valid Dyck word.");
}

See /examples in the repository root for more examples.