More semantics in lexer enabled more descriptive parser
Notice in the last example that we had built into the lexer a greater understanding of the data. Consequently, it served up more descriptive tokens - TITLE, AUTHOR, etc
The parser was then able to be written in a more descriptive fashion.
When you write your lexer and parser you can decide where you want to build in the interpretation of the data - in the lexer or in the parser.