-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Hi,
I think there may be an off-by-one bug in genLR0items.
The initial LR(0) kernels are seeded with:
startRules = [ Set.singleton (Lr0 rule 0) | rule <- [0..n_starts] ]
where n_starts = length (starts g).
This creates n_starts + 1 initial kernels.
However, elsewhere start rules seem to be treated as only the first n_starts rules, e.g. with logic like:
isStartRule rule = rule < n_starts
So the two conventions do not appear consistent.
In practice, with multiple %name directives, I observe one extra initial seeded state corresponding to the first ordinary grammar production after the synthetic start rules. This introduces states unrelated to any declared entry point.
It looks like the seed range in genLR0items should perhaps be:
[0 .. n_starts - 1]
instead of:
[0 .. n_starts]
I can provide a minimal reproducer if needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels