• by userbinator on 3/30/2018, 11:11:33 PM

    The parser has a somewhat unusual structure:

    https://github.com/ShivamSarodia/ShivyC/blob/master/shivyc/p...

    It's been a while since I've had to use the phrase "exception-oriented programming", but it fits that code well. While that might be a useful or even necessary pattern to parse something like C++ which can have almost unbounded ambiguities, AFAIK C can be parsed solely by branching on the next token in the stream except for one tiny case (typedefs).

  • by deaddodo on 3/30/2018, 10:21:08 PM

    Now, compile CPython in it and you're fully boot strapped.