We have tokens from the lexer. We have AST node definitions. Now we need to connect them - turn that flat list of tokens into a tree structure.

Let's build a parser.




Starting Simple


Just like with the lexer, we'll start simple. For now, we'll handle:


Numbers
Binary operations (+, -, *, /)
Parentheses for grouping


That's enough to...