Greedy annotation for lists
Support a greedy annotation for lists in lexical syntax. This would avoid some common pitfalls with follow restrictions. This requires changes to sdf2table.
Submitted by Guido Wachsmuth on 18 December 2012 at 12:05
Issue Log
On 18 December 2012 at 12:05 Guido Wachsmuth tagged sdf
On 18 December 2012 at 12:05 Guido Wachsmuth tagged parser
On 10 March 2013 at 09:07 Guido Wachsmuth commented:
Sebastian introduced a
longest-match
annotation for layout-sensitive parsing. This also works in lexical syntax:lexical syntax [0-9]+ -> INT {longest-match} [a-zA-Z][a-zA-Z0-9]* -> ID {longest-match}
This covers more cases than you could achieve with lexical restrictions, but comes at a runtime price, since longest match cannot be encoded directly in the parse table (in contrast to follow restrictions). But we can generate follow restrictions automatically from rules with
longest-match
annotations.Since this issue is particular about lists, we can generate follow restrictions from lists at the end of a production rule.
Log in to post comments