JSGLR misses ambiguity
No ambiguity is detected for the input “ac” and the following grammar.
module Test imports exports sorts S start-symbols S syntax "a" -> A1 {cons("A1")} A1 "c" -> C {cons("C1")} A1 "c" -> C {cons("C2")} C "\n" -> S {cons("S")}
When changing the order of the productions
Submitted by Sebastian Erdweg on 19 April 2011 at 18:13C1
andC2
the parse tree changes fromS(C1(A1))
toS(C2(A1))
without showing any ambiguity. The expected output wasS(amb(C1(A1), C2(A1)))
Issue Log
This is a duplicate of https://yellowgrass.org/issue/Spoofax/336 and likely of some other, parser-related issues. Maartje said she’d look into this again tomorrow. (Closing as duplicate.)
Also, I just noted that sglri does it wrong as well and delivers the same AST. This was not the case in issue 336, where sglr did it right but jsglr did not.
Alright, so perhaps it is different. Hard to rule out. I’ll reopen the issue, let’s see what the next release does for it.
This should be a question about the semantics of SDF. Probably such duplicate productions should be ruled out by static analysis.
Log in to post comments