Crates.io | wagon-parser |
lib.rs | wagon-parser |
version | 1.0.0 |
source | src |
created_at | 2024-06-06 14:43:19.78202 |
updated_at | 2024-06-06 14:43:19.78202 |
description | Parser for the WAGon DSL. |
homepage | |
repository | https://github.com/Rafaeltheraven/wagon |
max_upload_size | |
id | 1263770 |
size | 124,255 |
A library for parsing the WAGon DSL. This crate provides a struct that, given a String
with the DSL as input, either returns a full AST representing the input file, or a proper error. The error can be handled as needed, the AST can function as the basis for any code generation or analysis that one wants to do.
Additionally, this crate includes a very simple checker which does the following things:
S<*a, *a> -> ...;
).S<*a> -> ...; S<*b, *c> -> ...;
).This crate will be the main entrypoint for any language designer who wants to use WAGs.
use wagon_parser::parse_and_check;
let input_grammar = ...;
let wag = parse_and_check(input_grammar);
assert!(wag.is_ok());
This crate also defines the AST for a fully parsed WAGon WAG. It's structure mirrors that of the formal DSL.