SDF editor report unreachable productions
The SDF editor should report productions that are unreachable from the start symbol.
example:
module Test hiddens context-free start-symbols Statement context-free syntax "foo" -> Statements {cons("Statement")} "bar" -> Statement {cons("Statement")}
Everything compiles without errors, also the stratego code that uses the
Statement
constructor, butfoo
will never parse.In the lab we’ve found that this can be difficult to spot in larger grammars, symptoms are constructors not being generated, or parsing failures.
Although technically not an error, it is usually a bug, and should at least give a warning.
Submitted by Danny Groenewegen on 7 July 2010 at 16:51
Issue Log
This would be very nice to have. I think Spoofax/133 already addresses most cases of it not parsing though (not all). And maybe
sdf2rtg
could just be changed to generate constructors for all productions to somewhat alleviate the other constructors issue (StrategoXT/831)?
This is still an annoying pitfall, especially after not having done any SDF in a while.
Log in to post comments