Struct lexx::Parser [] [src]

pub struct Parser {
    // some fields omitted
}

Parser type

This is a high level object that wraps the file loader/parser.his doesn't do much special. The ParseSess object must be borrowed by the parsing processing. So this class ensures this is happening without much drama or requiring you to peer into the syntex_syntax internals.

There are methods to load external files, and borrow a string. That'll be immediately cloned just fyi.

Methods

impl Parser
[src]

fn new() -> Parser

Construct a new parser.

fn get_tokens<'a>(&'a self, path: &str) -> Result<Vec<Token>, Fault<'a>>

Get a vector of all tokens, or get an error. Loads a file

fn get_tokentree<'a>(&'a self, path: &str) -> Result<Vec<TokenTree>, Fault<'a>>

Get the token tree, or get an error. Loads a file

fn get_tokens_local<'a>(&'a self, code: &str) -> Result<Vec<Token>, Fault<'a>>

Get a flat list of tokens, while using pre-loaded code. Does not file IO

fn get_tokenstree_local<'a>(&'a self, code: &str) -> Result<Vec<TokenTree>, Fault<'a>>

Get token tree, while using pre-loaded code. Does not file IO