Struct kconfig_parser::lex::lexer::Lexer

source ·
pub struct Lexer<T>where
    T: Read,
{ /* private fields */ }
Expand description

This structure holds the data of the actual lexer. It is expected that this structure can be mutated by the next_token function, which advances to the next token, and returns the term found by the lexer.

Implementations

The lexer implementation allows to read the tokens from a given type implementing the Read trait. If an error occurs while reading, or EOT has been reached, the next_token function will return Error or EOT as its term.

Creates a new lexer from the given input, where input supports the Read trait.

Trait Implementations

Finds the next token in a mutable self. If the next token can be found, returns it into Token. If the file or stream of data is found, the special term EOT is returned. If an error occurred of some sort, the special term Error is returned.

Returns the current stream’s name, if any (for example, the normal lexer does know this value) Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.