Kingdom of the Machine: The Tale of Operators and Commands

Leaving aside the trivialities of specific implementation details1, what are the fundamental problems a parser must confront and solve2?

Let’s consider the input: 1 + 2 * 3. Suppose a grammar dictates that this input should be structured as 1 + (2 * 3). As a parser reads the input from left to right, it reaches 1 + 2 and recognizes that the next token is *. At this point, it must decide whether to group the preceding part into a single unit or continue. This challenge is independent of how the parser is implemented; it's a universal problem inherent to parsing itself.

In this session, I will highlight several such problems within the parsing domain and explore how different parser implementations try to solve them.


  1. In truth, the "how" is where the real struggle lies… 

  2. I will limit my scope to one-way, non-backtracking parsers that read input from left to right.