This (incorrect) stratego code:


module ambiguous_stratego
rules
r: x -> <> x

results in a syntax error at line 3 (expected) and a toplevel ambiguity (not expected):


amb(
[ Module(
“ambiguous_stratego”
, [Rules(
[RDefNoArgs(“r”, RuleNoCond(Var(“x”), Var(“x”)))]
)]
)
, Module(
“ambiguous_stratego”
, [ Rules(
[RDefNoArgs(
“r”
, RuleNoCond(Var(“x”), RootApp(CallNoArgs(SVar(“x”))))
)]
)
]
)
]
)

It appears to happen regardless of the rules before the rule with syntax error (whole file is underlined in Eclipse). It reduces to a local ambiguity if there is a correctly parsed construct after the construct with syntax error.

I don’t know if it’s desired to have this (completely) fixed but I report anyway because having a complete Stratego file underlined as ambiguous, when adding a rule at the end of the file, may scare some users maybe :)

Submitted by Tobi Vollebregt on 13 December 2010 at 11:44

On 14 December 2010 at 11:45 Lennart Kats tagged parser

On 14 December 2010 at 11:45 Lennart Kats tagged @maartje

On 14 December 2010 at 11:46 Lennart Kats commented:

It seems that error recovery somehow is causing an ambiguity here. Or maybe there was an ambiguity that is not properly filtered because of error recovery?


On 14 December 2010 at 15:26 Lennart Kats commented:

I think this is caused by the same deployment snafu as Spoofax/320. Should be fixed in 0.6.0.2.


On 14 December 2010 at 15:26 Lennart Kats closed this issue.

On 14 December 2010 at 15:26 Lennart Kats tagged 0.6.0.2

On 14 December 2010 at 15:27 Lennart Kats removed tag @maartje

On 14 December 2010 at 15:27 Lennart Kats tagged @lennartkats

On 16 December 2010 at 15:43 Lennart Kats removed tag 0.6.0.2

On 16 December 2010 at 15:43 Lennart Kats tagged 0.6.0

Log in to post comments