Context Free Grammars




CS154

Chris Pollett

Feb. 28, 2011

Outline

Context Free Languages

Example CFG

More on CFGs

Quiz

Which of the following is true?

  1. The procedure we gave in class to convert a DFA to a regular expression used the power set construction.
  2. Right linear grammars can recognize some languages not recognized by left linear grammars.
  3. The algorithm we gave for finiteness checking of the language of a DFA and the proof of the pumping lemma both involved checking for repeated state in a DFA.

Formal Definitions

Example

Techniques for Designing CFGs

Intuitions about Compilers

Ambiguity

Leftmost and Rightmost Derivations

Ambiguity and Leftmost Derivations