SDF3 generates pretty printer files for unused sorts, resulting in compile errors (1)
rtg2sig will not produce constructor signatures for sorts that are not used, but SDF3 does generate pretty printer rules for unused sort. This results in an error because a constructor is referenced that is not used.
Submitted by Gabriël Konat on 21 March 2014 at 10:26
Issue Log
Perhaps the error is in rtg2sig, then.
It’s a ‘feature’ of rtg2sig that it does not generate signatures for unreachable sorts. So either it needs to generate those signatures, or SDF3 should not generate pretty print rules for unreachable sorts.
If an unreachable sort defines a constructor, might that constructor still be used somewhere else? If that’s the case, the signatures for unreachable sorts should still be generated.
To reproduce
Create a new minimal Spoofax project
MyLang
.In the created
syntax/MyLang.sdf3
file, add the following line:Test.MyConstr = <test>
Compile.
Actual result
Now the following compilation error will appear:
stratego.jvm.helper: [java] [ Main | error ] in rule prettyprint-Test(0|0): constructor MyConstr/0 not declared [java] MyConstr() [java] [ Main | error ] Compilation failed
Environment
- Spoofax Core 1.2.0.0-s41606
Log in to post comments