Add a --no-minimize flag to suppress table minimization for debugging
This commit is contained in:
parent
bf9556dadc
commit
70aa4c2b2d
6 changed files with 58 additions and 24 deletions
|
|
@ -4,14 +4,15 @@ use crate::prepare_grammar::prepare_grammar;
|
|||
use crate::build_tables::build_tables;
|
||||
use crate::render::render_c_code;
|
||||
|
||||
pub fn generate_parser_for_grammar(input: &str) -> Result<String> {
|
||||
pub fn generate_parser_for_grammar(input: &str, minimize: bool) -> Result<String> {
|
||||
let input_grammar = parse_grammar(input)?;
|
||||
let (syntax_grammar, lexical_grammar, inlines, simple_aliases) = prepare_grammar(&input_grammar)?;
|
||||
let (parse_table, main_lex_table, keyword_lex_table, keyword_capture_token) = build_tables(
|
||||
&syntax_grammar,
|
||||
&lexical_grammar,
|
||||
&simple_aliases,
|
||||
&inlines
|
||||
&inlines,
|
||||
minimize
|
||||
)?;
|
||||
let c_code = render_c_code(
|
||||
&input_grammar.name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue