If I take the example project, and add the following recovery rule:


ID -> Property {cons(“IncompleteProperty”), recover}

then it’s not used for an example like this:


entity URL {
location : String
HERE
}

why is that?

Might be related to Spoofax/244 or Spoofax/150.

Submitted by Lennart Kats on 6 September 2010 at 14:07

On 6 September 2010 at 16:01 Maartje commented:

[a-z]+ -> WATER{recover} is apparently used as recovery in this example.

On this moment the preference order for recoveries is arbitrary (recover productions that lead to ambiguities are ignored during parsing).

Idea: use prefer and avoid to introduce recover preferences as in WATER{recover, avoid}, Property{recover, prefer}
- then the parser should not ignore ambiguous recover productions
- ambiguities caused by recover productions with the same preference level should not lead to a ambiguity message in the editor

(Alternative: We could use a simple preference mechanism WATER < INSERTION < *)


On 6 September 2010 at 21:08 Lennart Kats commented:

Using avoid attributes (and perhaps prefer) seems like a cleaner design, even if they are handled a bit differently from regular avoid attributes. I added avoid attributes to the WATER productions in r21215.

WATER < INSERTION seems a slightly different issue where we may want to attach a score to both mechanisms.


On 8 January 2013 at 16:49 Gabriël Konat tagged sdf

Log in to post comments