pub mod tokenizer; pub mod parser; pub mod eval; pub mod compilation; use language::{ProgrammingLanguage, ParseError, TokenError, LLVMCodeString}; pub struct Schala { } impl<'a> ProgrammingLanguage> for Schala { type Token = tokenizer::Token; type AST = parser::AST; fn tokenize(input: &str) -> Result, TokenError> { tokenizer::tokenize(input) } fn parse(input: Vec) -> Result { parser::parse(&input, &[]).map_err(|x| ParseError { msg: x.msg }) } fn evaluate(ast: Self::AST, evaluator: &mut eval::Evaluator) -> Vec { evaluator.run(ast) } fn compile(ast: Self::AST) -> LLVMCodeString { compilation::compile_ast(ast) } }