why grammars?
convey language constraints to users
- look at any modern programming language manual
- all have precise description of syntax with a grammar
- some (eg Scheme) have precise description of semantics (meaning) too
constructive specification of parser
- can automate much of parser construction from grammar
tools called ‘parser generators’ take grammar
and generate parser code from it