Roughing out pratt parser logic

This commit is contained in:
Andy Grove 2018-09-01 08:39:27 -06:00
parent e6e9c8d2cc
commit 72cff632c1
5 changed files with 91 additions and 46 deletions

View file

@ -50,6 +50,9 @@ pub enum SQLToken<T: Debug + PartialEq> {
pub trait SQLTokenizer<TokenType>
where TokenType: Debug + PartialEq {
/// get the precendence of a token
fn precedence(&self, token: &SQLToken<TokenType>) -> usize;
/// return a reference to the next token but do not advance the index
fn peek_token(&self, chars: &mut Peekable<Chars>) -> Result<Option<SQLToken<TokenType>>, TokenizerError<TokenType>>;