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 C1 and C2 the parse tree changes from S(C1(A1)) to S(C2(A1)) without showing any ambiguity. The expected output was S(amb(C1(A1), C2(A1)))

Submitted by Sebastian Erdweg on 19 April 2011 at 18:13

On 19 April 2011 at 19:28 Lennart Kats commented:

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.)


On 19 April 2011 at 19:28 Lennart Kats closed this issue.

On 19 April 2011 at 19:28 Lennart Kats tagged duplicate

On 20 April 2011 at 07:14 Sebastian Erdweg commented:

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.


On 20 April 2011 at 11:33 Lennart Kats commented:

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.


On 20 April 2011 at 11:33 Lennart Kats reopened this issue.

On 20 April 2011 at 11:33 Lennart Kats tagged parser

On 20 April 2011 at 11:33 Lennart Kats tagged @maartje

On 8 January 2013 at 15:01 Eelco Visser tagged sdf

On 8 January 2013 at 15:03 Eelco Visser commented:

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