Struct ketos::parser::Parser
[−]
[src]
pub struct Parser<'a, 'lex> { /* fields omitted */ }
Parses a stream of tokens into an expression.
Methods
impl<'a, 'lex> Parser<'a, 'lex>
[src]
fn new(ctx: &'a Context, lexer: Lexer<'lex>) -> Parser<'a, 'lex>
Creates a new Parser
using the given Lexer
.
Identifiers received from the lexer will be inserted into the given context.
fn skip_shebang(&mut self)
Skips the "shebang" line of a source file.
fn parse_expr(&mut self) -> Result<Value, Error>
Parses an expression from the input stream.
fn parse_single_expr(&mut self) -> Result<Value, Error>
Parses a single expression from the input stream. If any tokens remain after the expression, an error is returned.
fn parse_exprs(&mut self) -> Result<Vec<Value>, Error>
Parse a series of expressions from the input stream.
fn lexer(&self) -> &Lexer<'lex>
Returns a borrowed reference to the contained Lexer
.