| Crates.io | merc_syntax |
| lib.rs | merc_syntax |
| version | 1.0.0 |
| created_at | 2025-12-27 22:41:48.1094+00 |
| updated_at | 2025-12-27 22:41:48.1094+00 |
| description | Provides an AST and Pest grammar for the mCRL2 specification language. |
| homepage | https://mercorg.github.io/merc/ |
| repository | https://github.com/MERCorg/merc |
| max_upload_size | |
| id | 2007961 |
| size | 249,017 |
This crate contains a complete Pest grammar for the mCRL2 specification language, along with functionality to consume the resulting parse tree into an abstract syntax tree (AST). As opposed to the mCRL2 toolset where the AST is represented by terms, we store the AST in a Rust-idiomatic way using enums and structs. This means that we potentially use more memory because there is no term sharing of expressions, but manipulating the AST is much easier.
The mCRL2 specifications can simply be parsed using the untyped variants of the
various objects: UntypedProcessSpecification, UntypedDataSpecification, etc.
use merc_syntax::UntypedProcessSpecification;
let mcrl2_spec = UntypedProcessSpecification::parse("
act
a, b: Nat;
proc
P(n: Nat) = a(n).P(n + 1) + b(n).P(n - 1);
init
P(0);
").unwrap();
This crate contains no unsafe code.
We do not maintain an official minimum supported rust version (MSRV), and it may be upgraded at any time when necessary.
All MERC crates are licensed under the BSL-1.0 license. See the LICENSE file in the repository root for more information.