[][src]Trait arithmetic_parser::Grammar

pub trait Grammar: 'static {
    type Lit: Clone + Debug;
    type Type: Clone + Debug;

    const FEATURES: Features;

    fn parse_literal(input: Span) -> NomResult<Self::Lit>;
fn parse_type(input: Span) -> NomResult<Self::Type>; }

Unites all necessary parsers to form a complete grammar definition.

Associated Types

type Lit: Clone + Debug

Type of the literal used in the grammar.

type Type: Clone + Debug

Type of the type declaration used in the grammar.

Loading content...

Associated Constants

const FEATURES: Features

Features supported by this grammar.

Loading content...

Required methods

fn parse_literal(input: Span) -> NomResult<Self::Lit>

Attempts to parse a literal.

Return value

The output should follow nom conventions on errors / failures.

fn parse_type(input: Span) -> NomResult<Self::Type>

Attempts to parse a type hint.

Return value

The output should follow nom conventions on errors / failures.

Loading content...

Implementors

impl<T: NumLiteral> Grammar for NumGrammar<T>[src]

type Lit = T

type Type = ()

Loading content...