Skip to content

Improve API and structure #9

@timsueberkrueb

Description

@timsueberkrueb

We should get rid of unnecessary attributes and use standard language features over macros whenever possible.

This is a rough sketch of what it could look like:

impl LALR for Parser {
    type T = Terminal;
    type N = Nonterminal;
    const START: Self::N = Nonterminal::Start;
    const END: Self::T = Terminal::End;
    type Input = str;
    type Output = f32;
}

#[lalr]
#[assoc(...)]
impl Parser { /* Rule functions ... */ }

where LALR is a trait defined as:

trait LALR {
    type T;
    type N;
    const START: Self::N;
    const END: Self::T;
    type Input;
    type Output;
}

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions