Skip to content

Compare parser automata with lrama diff - #890

Open
ydah wants to merge 6 commits into
feature/graph-snapshotfrom
feature/automaton-diff
Open

ydah wants to merge 6 commits into
feature/graph-snapshotfrom
feature/automaton-diff

Conversation

@ydah

@ydah ydah commented Dec 3, 2026

Copy link
Copy Markdown
Member

A grammar edit can renumber states throughout the automaton. lrama diff OLD NEW matches the two automata before comparing transitions, reduction lookaheads and conflicts. Either input can be a grammar or a saved snapshot. The text report identifies how each state matched, including matches inferred from access paths or kernel similarity.

Adding a remainder operator and unary minus to the calculator grammar gives this summary.

states      18 -> 22   unchanged 6, changed 12, added 4
matched     initial 1, kernel 11, path 6
conflicts   S/R 0 -> 0, R/R 0 -> 0

For merged_lookaheads.y, forcing LALR on OLD and IELR on NEW shows one state split and the R/R conflict count falling from 1 to 0. With --exit-code, a difference returns 1 and an input error returns 2.

@ydah
ydah added this pull request to stack #889 December 3, 2026 06:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant