Adding a Parser on top of the lexer
We now have a real good grasp of writing lexers.
Let's now add a parser on top of the lexer.
- We will modify our lexer so that it returns (to the parser) the tokens it encounters (till now the lexer itself has been acting on the tokens. Now we will let the parser do that).
- The parser will "catch" the tokens, decide if they agree to a "grammar", and act on the tokens.