[−][src]Struct combine_language::LanguageEnv
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]
I: Stream<Item = char>,
I::Error: ParseError<I::Item, I::Range, I::Position>,
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]
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,
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]
P: Parser<Input = I> + 'b,
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]
I: RangeStream<Range = &'a str>,
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]
I: RangeStream<Range = &'a str>,
pub fn reserved<'b>(&'b self, name: &'static str) -> Reserved<'a, 'b, I> where
I::Range: 'b,
[src]
I::Range: 'b,
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]
I: RangeStream<Range = &'a str>,
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]
I: RangeStream<Range = &'a str>,
pub fn reserved_op<'b>(
&'b self,
name: &'static str
) -> Lex<'a, 'b, Reserved<'a, 'b, I>> where
I::Range: 'b,
[src]
&'b self,
name: &'static str
) -> Lex<'a, 'b, Reserved<'a, 'b, I>> where
I::Range: 'b,
Parses the reserved operator name
pub fn reserved_op_<'b>(&'b self, name: &'static str) -> Reserved<'a, 'b, I> where
I::Range: 'b,
[src]
I::Range: 'b,
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]
P: Parser<Input = I>,
I::Range: 'b,
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]
P: Parser<Input = I>,
I::Range: 'b,
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]
P: Parser<Input = I>,
I::Range: 'b,
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]
P: Parser<Input = I>,
I::Range: 'b,
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]
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,