Last time we finished with a fully functional but limited parser. Let’s start adding some extras. Parsing arithmetic expressions still needs two, currently missing features: grouping and negation. This is what we are going to implement today.
Last time we fixed the grammar for basic arithmetic expressions. We also decided that a top-down operator precedence parser would be the best for parsing ASPL. Let’s start writing some code then!
Last time we created the basic grammar for ASPL’s arithmetic expressions. We discovered that the grammar has a big problem: it is ambiguous, and it is possible to choose different productions that will lead to the same string at the end. That is a big problem that needs fixing. Let’s do that right now.