schala/src/schala_lang/mod.rs

49 lines
984 B
Rust
Raw Normal View History

2017-08-29 04:15:31 -07:00
use language::{ProgrammingLanguage, EvaluationMachine, ParseError, TokenError, LLVMCodeString};
2017-08-29 04:27:07 -07:00
mod parsing;
2017-08-29 04:15:31 -07:00
pub struct Schala {
}
impl Schala {
pub fn new() -> Schala {
Schala { }
}
}
impl ProgrammingLanguage for Schala {
2017-08-29 04:27:07 -07:00
type Token = parsing::Token;
type AST = parsing::AST;
2017-08-29 04:15:31 -07:00
type Evaluator = SchalaEvaluator;
fn name() -> String {
"Schala".to_string()
}
fn tokenize(input: &str) -> Result<Vec<Self::Token>, TokenError> {
2017-08-29 05:08:09 -07:00
parsing::tokenize(input)
2017-08-29 04:15:31 -07:00
}
fn parse(input: Vec<Self::Token>) -> Result<Self::AST, ParseError> {
unimplemented!()
}
fn evaluate(ast: Self::AST, evaluator: &mut Self::Evaluator) -> Vec<String> {
unimplemented!()
}
fn compile(ast: Self::AST) -> LLVMCodeString {
unimplemented!()
}
}
pub struct SchalaEvaluator { }
impl EvaluationMachine for SchalaEvaluator {
fn new() -> SchalaEvaluator {
SchalaEvaluator { }
}
fn set_option(&mut self, option: &str, value: bool) -> bool {
false
}
}