4 ms·
I'm not the person you asked but I believe there are two broad classes of answers: hand rolled parsers and PEG grammars e.g. https://github.com/llvm/llvm-proje
by mdaniel 1y ago
I'm not the person you asked but I believe there are two broad classes of answers: hand rolled parsers and PEG grammars
e.g. https://github.com/llvm/llvm-project/blob/llvmorg-20.1.5/clang/lib/Parse/Parser.cpp#L54 https://github.com/llvm/llvm-project/blob/llvmorg-20.1.5/cla... and https://github.com/python/cpython/blob/v3.13.3/Grammar/python.gram https://github.com/python/cpython/blob/v3.13.3/Grammar/pytho...
- alfiedotwtf 1y agoHand rolled and PEG are nice implementation wise, but to think about the grammar itself and needing to debug it not so much. Maybe it's a personal thing, but I'd rather something textual that generated a parser than have to hand roll rec decent etc.