Concrete syntax recovery rule not working
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
Issue Log
[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 < *)
Using
avoid
attributes (and perhapsprefer
) seems like a cleaner design, even if they are handled a bit differently from regularavoid
attributes. I addedavoid
attributes to theWATER
productions inr21215
.WATER < INSERTION seems a slightly different issue where we may want to attach a score to both mechanisms.
Log in to post comments