CS 3304: Comparative Languages
Syntax
[
Course Documents
] : [
Syntax
]
Previous
Contents
Next
Keyword Index
Recognizers vs. Generators
We don't want to use English to describe a language (too long, tedious, imprecise), so ...
There are two formal approaches to describing syntax:
Recognizers
Given a string, a recognizer for a language L tells whether or not the string is in L (ex: Compiler)
Generators
A generator for L will produce an arbitrary string in L on demand. (ex: Grammar, BNF)
Recognition and generation are useful for different things, but are closely related