2023-07-27 20:47:50 +02:00
|
|
|
use crate::{lexer::Token, parser::TopLevelStatement, token_stream::TokenStream};
|
|
|
|
|
|
|
|
pub static EASIEST: &str = include_str!("../easiest.reid");
|
|
|
|
pub static EASY: &str = include_str!("../easy.reid");
|
|
|
|
pub static MEDIUM: &str = include_str!("../medium.reid");
|
|
|
|
pub static HARD: &str = include_str!("../hard.reid");
|
2023-07-27 16:40:12 +02:00
|
|
|
|
|
|
|
mod lexer;
|
2023-07-27 20:17:44 +02:00
|
|
|
mod parser;
|
|
|
|
mod token_stream;
|
2023-07-27 16:40:12 +02:00
|
|
|
|
|
|
|
fn main() {
|
2023-07-27 20:47:50 +02:00
|
|
|
let tokens = lexer::tokenize(EASY).unwrap();
|
|
|
|
|
|
|
|
dbg!(&tokens);
|
|
|
|
|
2023-07-27 20:17:44 +02:00
|
|
|
let mut token_stream = TokenStream::from(&tokens);
|
2023-07-27 16:40:12 +02:00
|
|
|
|
2023-07-27 20:47:50 +02:00
|
|
|
while let Ok(statement) = token_stream.parse::<TopLevelStatement>() {
|
|
|
|
dbg!(&statement);
|
|
|
|
}
|
|
|
|
|
|
|
|
dbg!(token_stream.expect(Token::Eof).ok());
|
2023-07-27 16:40:12 +02:00
|
|
|
}
|