Parsing

Pratt parsing, aka top-down precedence parsing, aka precedence climbing

23 Jul 2024

Since last weekend I’ve been toying around implementing a calculator in Zig.

One of my favorite algorithms I learned in college from my data structures classes were the shunting yard algorithm to parse and evaluate expressions, converting to the reverse Polish notation. Those exercises were clearly an important part of my becoming a programmer, as I’ve implemented those in most major programming languages I’ve learned over the years.

Continue reading →