[][src]Struct yotc::lexer::Lexer

pub struct Lexer { /* fields omitted */ }

A lexical analyzer that splits the program into Tokens.

Implementations

impl Lexer[src]

pub fn from_file(file_path: &str) -> Result<Self>[src]

Creates a lexer from a program file given the path to the file.

Arguments

  • file_path - The path to the program file.

pub fn from_text(text: &str) -> Self[src]

Creates a lexer given the program data as plain text.

Arguments

  • text - The raw program.

Trait Implementations

impl Iterator for Lexer[src]

type Item = Token

The type of the elements being iterated over.

fn next(&mut self) -> Option<Token>[src]

Identifies the next token, None if the end of the program has been reached.

Auto Trait Implementations

impl RefUnwindSafe for Lexer

impl Send for Lexer

impl Sync for Lexer

impl Unpin for Lexer

impl UnwindSafe for Lexer

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.