Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a hand-written parser for the shell itself (portable shell parsing portable shell):

https://gist.github.com/alganet/23df53c567b8a0bf959ecbc7b689...

It's an incomplete idea from around a year ago. The approach taken here (aliases as macro-like evals, AST generation using shell variables) became the backbone for the BNF parser generator.

This one is much simpler to understand. Simpler grammars tend to produce parser code that looks more like this one.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: