[][src]Struct combine_language::LanguageEnv

pub struct LanguageEnv<'a, I> { /* fields omitted */ }

A type containing parsers for a specific language. For some parsers there are two version where the parser which ends with a _ is a variant which does not skip whitespace and comments after parsing the token itself.

Methods

impl<'a, I> LanguageEnv<'a, I> where
    I: Stream<Item = char>,
    I::Error: ParseError<I::Item, I::Range, I::Position>, 
[src]

pub fn new<A, B, C, D, E, F, G>(
    def: LanguageDef<A, B, C, D, E, F, G>
) -> LanguageEnv<'a, I> where
    A: Parser<Input = I, Output = char> + 'a,
    B: Parser<Input = I, Output = char> + 'a,
    C: Parser<Input = I, Output = char> + 'a,
    D: Parser<Input = I, Output = char> + 'a,
    E: Parser<Input = I, Output = ()> + 'a,
    F: Parser<Input = I, Output = ()> + 'a,
    G: Parser<Input = I, Output = ()> + 'a, 
[src]

Constructs a new parser from a language defintion

pub fn lex<'b, P>(&'b self, p: P) -> Lex<'a, 'b, P> where
    P: Parser<Input = I> + 'b, 
[src]

Creates a lexing parser from p

pub fn white_space<'b>(&'b self) -> WhiteSpace<'a, 'b, I>[src]

Skips spaces and comments

pub fn symbol<'b>(&'b self, name: &'static str) -> Lex<'a, 'b, Str<I>>[src]

Parses a symbol, lexing the stream if it is successful

pub fn identifier<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, String>[src]

Parses an identifier, failing if it parses something that is a reserved identifier

pub fn identifier_<'b>(&'b self) -> LanguageParser<'a, 'b, I, String>[src]

pub fn range_identifier<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, &'a str> where
    I: RangeStream<Range = &'a str>, 
[src]

Parses an identifier, failing if it parses something that is a reserved identifier

pub fn range_identifier_<'b>(&'b self) -> LanguageParser<'a, 'b, I, &'a str> where
    I: RangeStream<Range = &'a str>, 
[src]

pub fn reserved<'b>(&'b self, name: &'static str) -> Reserved<'a, 'b, I> where
    I::Range: 'b, 
[src]

Parses the reserved identifier name

pub fn op<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, String>[src]

Parses an operator, failing if it parses something that is a reserved operator

pub fn op_<'b>(&'b self) -> LanguageParser<'a, 'b, I, String>[src]

pub fn range_op<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, &'a str> where
    I: RangeStream<Range = &'a str>, 
[src]

Parses an identifier, failing if it parses something that is a reserved identifier

pub fn range_op_<'b>(&'b self) -> LanguageParser<'a, 'b, I, &'a str> where
    I: RangeStream<Range = &'a str>, 
[src]

pub fn reserved_op<'b>(
    &'b self,
    name: &'static str
) -> Lex<'a, 'b, Reserved<'a, 'b, I>> where
    I::Range: 'b, 
[src]

Parses the reserved operator name

pub fn reserved_op_<'b>(&'b self, name: &'static str) -> Reserved<'a, 'b, I> where
    I::Range: 'b, 
[src]

pub fn char_literal<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, char>[src]

Parses a character literal taking escape sequences into account

pub fn char_literal_<'b>(&'b self) -> LanguageParser<'a, 'b, I, char>[src]

pub fn string_literal<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, String>[src]

Parses a string literal taking character escapes into account

pub fn string_literal_<'b>(&'b self) -> LanguageParser<'a, 'b, I, String>[src]

pub fn angles<'b, P>(&'b self, parser: P) -> BetweenChar<'a, 'b, P> where
    P: Parser<Input = I>,
    I::Range: 'b, 
[src]

Parses p inside angle brackets < p >

pub fn braces<'b, P>(&'b self, parser: P) -> BetweenChar<'a, 'b, P> where
    P: Parser<Input = I>,
    I::Range: 'b, 
[src]

Parses p inside braces { p }

pub fn brackets<'b, P>(&'b self, parser: P) -> BetweenChar<'a, 'b, P> where
    P: Parser<Input = I>,
    I::Range: 'b, 
[src]

Parses p inside brackets [ p ]

pub fn parens<'b, P>(&'b self, parser: P) -> BetweenChar<'a, 'b, P> where
    P: Parser<Input = I>,
    I::Range: 'b, 
[src]

Parses p inside parentheses ( p )

pub fn integer<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, i64>[src]

Parses an integer

pub fn integer_<'b>(&'b self) -> LanguageParser<'a, 'b, I, i64>[src]

pub fn float<'b>(&'b self) -> LexLanguageParser<'a, 'b, I, f64>[src]

Parses a floating point number

pub fn float_<'b>(&'b self) -> LanguageParser<'a, 'b, I, f64>[src]

Auto Trait Implementations

impl<'a, I> !Send for LanguageEnv<'a, I>

impl<'a, I> !Sync for LanguageEnv<'a, I>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]