Initial Schala (for real) commit
This commit is contained in:
parent
dd22ca0291
commit
ff01d4b798
@ -15,6 +15,7 @@ use schala_lang::SchalaEvaluator;
|
|||||||
use schala_lang::Schala;
|
use schala_lang::Schala;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
mod schala_lang;
|
||||||
mod maaru_lang;
|
mod maaru_lang;
|
||||||
mod robo_lang;
|
mod robo_lang;
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ use virtual_machine::{run_vm, run_assembler};
|
|||||||
fn main() {
|
fn main() {
|
||||||
let languages: Vec<Box<LanguageInterface>> =
|
let languages: Vec<Box<LanguageInterface>> =
|
||||||
vec![
|
vec![
|
||||||
|
Box::new((schala_lang::Schala::new(), schala_lang::SchalaEvaluator::new())),
|
||||||
Box::new((maaru_lang::Maaru::new(), maaru_lang::MaaruEvaluator::new(None))),
|
Box::new((maaru_lang::Maaru::new(), maaru_lang::MaaruEvaluator::new(None))),
|
||||||
Box::new((robo_lang::Robo::new(), robo_lang::RoboEvaluator::new())),
|
Box::new((robo_lang::Robo::new(), robo_lang::RoboEvaluator::new())),
|
||||||
];
|
];
|
||||||
|
51
src/schala_lang/mod.rs
Normal file
51
src/schala_lang/mod.rs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
use language::{ProgrammingLanguage, EvaluationMachine, ParseError, TokenError, LLVMCodeString};
|
||||||
|
|
||||||
|
pub struct Schala {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum Token { }
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum AST { }
|
||||||
|
|
||||||
|
impl Schala {
|
||||||
|
pub fn new() -> Schala {
|
||||||
|
Schala { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProgrammingLanguage for Schala {
|
||||||
|
type Token = Token;
|
||||||
|
type AST = AST;
|
||||||
|
type Evaluator = SchalaEvaluator;
|
||||||
|
|
||||||
|
fn name() -> String {
|
||||||
|
"Schala".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn tokenize(input: &str) -> Result<Vec<Self::Token>, TokenError> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user