Skip to content

Commit

Permalink
nothing to be done rn for compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-johnson-4 committed Nov 24, 2023
1 parent f869b82 commit 0e41033
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/parser_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ pub fn compile_rule(grammar: &mut Grammar, rule_name: String, rule: Rhs) -> Symb
}

pub fn compile(input: &str) -> Grammar {
//Compilation Target here is just a dynamic Tree definition of the grammar
//Optimized compilation target should be defined in LM, not Rust
let input = StringSlice::new(input.to_string());
let grammar = parse_program(input);
match grammar {
let rules = parse_program(input);
match rules {
Ok(lines) => {
let mut grammar = Grammar::new();
for (k,v) in lines {
compile_rule(&mut grammar, k.clone(), v.clone());
println!("{} := {}", k, v);
}
unimplemented!("parser_generator::compile")
grammar
},
Err(err) => panic!("{}", err),
}
Expand Down

0 comments on commit 0e41033

Please sign in to comment.