silver icon indicating copy to clipboard operation
silver copied to clipboard

Crash when a concrete production has a child with no concrete productions

Open krame505 opened this issue 2 years ago • 0 comments

If a concrete production references a nonterminal in it its signature that does not have any productions, this results in a rather unhelpful error message

Generating parser silver:compiler:composed:Default:svParse.
silver:compiler:modification:lambda_fn/Lambda.sv:49.1 [parser silver_compiler_composed_Default_svParse]: Undefined reference to silver_compiler_modification_lambda_fn_LambdaRHS
silver:compiler:modification:lambda_fn/Lambda.sv:49.1 [parser silver_compiler_composed_Default_svParse]: Undefined reference to silver_compiler_modification_lambda_fn_LambdaRHS

followed by a crash. I think that we are eliminating nonterminals with no concrete productions from the syntax AST, and this leads to undefined references in the grammar given to Copper. Instead we probably need some sort of reachability analysis on the syntax AST? Or just want to flag this as an error before trying to generate a parser?

Thought this had been fixed before, but I guess not?

krame505 avatar Aug 30 '23 23:08 krame505