gregex-macros

Crates.iogregex-macros
lib.rsgregex-macros
version0.1.1
sourcesrc
created_at2024-07-04 06:42:40.14106
updated_at2024-07-04 06:42:40.14106
descriptionProc-Macros for the gregex crate
homepage
repositoryhttps://github.com/Saphereye/gregex/gregex-macros
max_upload_size
id1291346
size8,165
Adarsh Das (Saphereye)

documentation

https://docs.rs/gregex-macros

README

Gregex Macros

Contains the macro interface for all the gregex function.

Without these, users would have to rely on function that generate the Node tree. To explain this we can first look at an example.

Let's take the regex a*.

The Node tree in our case would be,

Node::Operation(
    Operator::Production,
    Box::new(Node::Terminal('a', 0u32)),
    None,
)

Although we can wrap this in a function or a macro_rules! macro, the generated code is quite bloated. We can do the hard work during compilation, i.e. converting our regex to the end NFA.

Currently converting to NFA is not possible, but this crate can convert it to the interstitial form of the Node Tree.

Commit count: 23

cargo fmt