Experiment to automatically generate parser

Gonna give this a shot, automatically generate a recursive-descent
parser from BNF
This commit is contained in:
greg 2018-03-10 14:04:10 -08:00
parent 64a3705e35
commit aa40b985f3
3 changed files with 28 additions and 0 deletions

View File

@ -19,6 +19,7 @@ extern { }
fn main() {
let generators: Vec<PLIGenerator> = vec![
Box::new(|| { Box::new(schala_lang::Schala::new())}),
Box::new(|| { Box::new(schala_lang::autoparser::Schala::new())}),
Box::new(|| { Box::new(maaru_lang::Maaru::new())}),
Box::new(|| { Box::new(robo_lang::Robo::new())}),
Box::new(|| { Box::new(rukka_lang::Rukka::new())}),

View File

@ -0,0 +1,25 @@
use schala_lib::{ProgrammingLanguageInterface, EvalOptions, TraceArtifact, LanguageOutput};
use schala_lang::{tokenizing, parsing};
pub struct Schala { }
impl Schala {
pub fn new() -> Schala {
Schala { }
}
}
impl ProgrammingLanguageInterface for Schala {
fn get_language_name(&self) -> String {
"Schala-autoparser".to_string()
}
fn get_source_file_suffix(&self) -> String {
format!("schala")
}
fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> LanguageOutput {
let mut output = LanguageOutput::default();
output
}
}

View File

@ -5,6 +5,8 @@ macro_rules! bx {
($e:expr) => { Box::new($e) }
}
pub mod autoparser;
mod builtin;
mod tokenizing;