[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Conflict-markers for shift-reduce conflicts similar to Lezer
From: |
Adrian Vogelsgesang |
Subject: |
Conflict-markers for shift-reduce conflicts similar to Lezer |
Date: |
Tue, 21 Jan 2020 00:04:41 +0000 |
User-agent: |
Microsoft-MacOutlook/10.10.b.190609 |
Hi,
I came across https://lezer.codemirror.net last week and I think they have a
really good way of dealing with conflicts:
In Lezer’s grammars, all conflicts must be marked with “ambiguity markers”. The
concept is described on https://lezer.codemirror.net/docs/guide/, subsection
“Allowing ambiguity”.
I think this approach is superior to bison’s “%expect and %expect-rr modifiers
on individual rules” because:
* the ambiguity markers specify at what exact position inside the rule the
conflict occurs
* using the ambiguity markers, it is exactly documented which positions
conflict with which other rules, instead of only the number of conflicts
What do you think about this feature? Would something like this also be
valuable for bison?
How hard would it be to implement similar functionality in bison? (I have no
clue about bison’s C-parts, yet…)
Cheers,
Adrian
- Conflict-markers for shift-reduce conflicts similar to Lezer,
Adrian Vogelsgesang <=