pub mod tokenizer; pub mod parser; pub mod grammar; use std::{env, fs}; use crate::{tokenizer::{Token, tokenize}, parser::parse}; fn main() { let args: Vec = env::args().collect(); let file_content = fs::read_to_string(&args[1]).expect("Could not read source file"); match compile(&file_content) { Ok(()) => { println!("Done compiling"); } Err(msg) => println!("ERROR: {}", msg) } } fn compile(file_content: &String) -> Result<(), &'static str> { let tokens: Vec = tokenize(&file_content)?; println!("{:?}", tokens); let node = parse(tokens)?; println!("{:?}", node); return Ok(()); }