Post #2479125
2026-05-10 14:48 UTC
Replies (2)
-
@olynch@mathstodon.xyz 2026-05-10 14:50
@zwarich@hachyderm.io @MartinEscardo@mathstodon.xyz And I will admit that I probably ignorantly used LL(1) incorrectly; I really just meant "no backtracking, always commit to a decision on what to do by looking only at the next token."
-
@zwarich@hachyderm.io 2026-05-10 14:52
@olynch@mathstodon.xyz @MartinEscardo@mathstodon.xyz Another solution is to write the ambiguous grammar but disambiguate by intersecting with regular tree languages. This is a folklore idea from the formal languages world, but it thankfully got published separately at a workshop: https://michaeldadams.org/papers/disambiguating-grammars/ Most (all?) interesting grammar classes are closed under intersection with regular string and tree languages, so it shouldn't affect the rest of your generator.