pub struct Parser<I>where
    I: Iterator<Item = char>,
{ /* private fields */ }
Expand description

Parser for the kaleidoscope language.

Implementations

Implement the global variable int CurTok; from the tutorial.

Panics

Panics if the parser doesn’t have a current token.

Advance the cur_tok by getting the next token from the lexer.

Implement the fucntion int getNextToken(); from the tutorial.

definition ::= ‘def’ prototype expression

Implement std::unique_ptr<FunctionAST> ParseDefinition(); from the tutorial.

external ::= ‘extern’ prototype

Implement std::unique_ptr<PrototypeAST> ParseExtern(); from the tutorial.

toplevelexpr ::= expression

Implement std::unique_ptr<FunctionAST> ParseTopLevelExpr(); from the tutorial.

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.