logoalt Hacker News

userbinatortoday at 2:30 AM1 replyview on HN

It would be far more interesting to look at what this was "compiled" from; it looks like the output of a state-machine generator.


Replies

gaigalastoday at 6:58 AM

The source for BNF generator is here:

https://gist.github.com/alganet/4dfd501a3377a60f7825901114d6...

Roughly 70% of c89cc was generated from it (parser, emitter).

It can generate parsers for C, ES6 and XML for example (subsets but not missing a lot).

It's still a mess though and I have lots of work to do to a proper release.