Add BNF generation
This commit is contained in:
parent
22d0aa73de
commit
4e711ee898
1
src/bnf.rs
Normal file
1
src/bnf.rs
Normal file
@ -0,0 +1 @@
|
||||
pub struct Bnf {}
|
@ -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<I, O, E> = Result<(O, I), E>;
|
||||
|
||||
trait Parser<I, O, E> {
|
||||
fn parse(&self, input: I) -> ParseResult<I, O, E>;
|
||||
fn bnf(&self) -> Option<Bnf> {
|
||||
None
|
||||
}
|
||||
|
||||
fn map<'a, F, O2>(self, map_fn: F) -> BoxedParser<'a, I, O2, E>
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user