Trait LangParser

Source
pub trait LangParser: Sized {
    type Item;

    // Required methods
    fn new() -> Self;
    fn parse<L: HasLexerError + Iterator<Item = Result<(LexerPosition, Token, LexerPosition), L::Error>>>(
        &self,
        ctx: ParseContext,
        input: &mut L,
    ) -> Result<Self::Item, ParseError<LexerPosition, Token, L::Error>>;
}
Expand description

GLSL language parser

Required Associated Types§

Source

type Item

AST node returned by this parser

Required Methods§

Source

fn new() -> Self

Instantiate the parser

Source

fn parse<L: HasLexerError + Iterator<Item = Result<(LexerPosition, Token, LexerPosition), L::Error>>>( &self, ctx: ParseContext, input: &mut L, ) -> Result<Self::Item, ParseError<LexerPosition, Token, L::Error>>

Parse the input

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§