Making Compiler: Lexer (Continued) and Parser

Latest progress…  I’m well into the parser now, for which I estimate I’ve done 35%-ish. It’s actually gotten a lot more fun as it feels like coding building blocks that work together nicely. The hand written, recursive descent parsing takes a bit of effort for debugging ambiguities and understanding what is going on, but at least it is fun. Initially I suspected recursion depth _might_ be a problem, but seeing the testcases, I suppose it’s not that big of a deal (at least from my unit tests).

Some excerpts:

Screenshot from 2015-03-14 02:32:02 Screenshot from 2015-03-14 02:32:48 Screenshot from 2015-03-14 02:32:53Screenshot from 2015-03-14 02:35:53

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s