[][src]Trait turtle_syntax::Parsable

pub trait Parsable: Sized {
    fn parse<E: Error, L: Iterator<Item = Result<Loc<Token>, E>>>(
        lexer: &mut Peekable<L>,
        pos: Position
    ) -> Result<Loc<Self>, E>; }

Elements that can be parsed using a lexer.

Document might be the most useful parsable element that implement this trait.

Required methods

fn parse<E: Error, L: Iterator<Item = Result<Loc<Token>, E>>>(
    lexer: &mut Peekable<L>,
    pos: Position
) -> Result<Loc<Self>, E>

Parse the element, pulling the tokens from the given lexer.

Since the grammar of Turtle is LL1, the lexer must be Peekable to be able to look the next token ahead.

Loading content...

Implementors

impl Parsable for Statement[src]

impl Parsable for Document[src]

Loading content...