Parsing
Recall the recursive descent parsing from last year (an LL( k ) technique)…
- must predict what phrase is being parsed by looking just at the next 1 or more (k) tokens
Instead use an LR( k ) technique
- postpone choice of phrase until entire right hand side of production seen (and k more)
- most language grammars can be parsed using LR(1)
LR Parser operation can again be driven by DFA
- and so generation of a parser can be automated (thank goodness, as it's very tedious otherwise)