From 4e711ee8989e3077123bcd4e6c146de1ba4c5cd8 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 16 Oct 2022 01:37:51 -0700 Subject: [PATCH] Add BNF generation --- src/bnf.rs | 1 + src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 src/bnf.rs diff --git a/src/bnf.rs b/src/bnf.rs new file mode 100644 index 0000000..bb36eca --- /dev/null +++ b/src/bnf.rs @@ -0,0 +1 @@ +pub struct Bnf {} diff --git a/src/lib.rs b/src/lib.rs index ec1ccf1..0d43c51 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,17 @@ #![feature(assert_matches)] #![allow(dead_code)] //TODO eventually turn this off +mod bnf; + +use bnf::Bnf; use std::rc::Rc; type ParseResult = Result<(O, I), E>; trait Parser { fn parse(&self, input: I) -> ParseResult; + fn bnf(&self) -> Option { + None + } fn map<'a, F, O2>(self, map_fn: F) -> BoxedParser<'a, I, O2, E> where