Creating Grammars - Dealing with Ambiguity




CS154

Chris Pollett

Mar 16, 2020

Outline

Introduction

Techniques for Designing CFGs

Intuitions about Compilers

Ambiguity

Leftmost and Rightmost Derivations

Ambiguity and Leftmost Derivations

Brute Force Parsing

s-grammars

Quiz

Which of the following is true?

  1. There is no known algorithm for checking if a regular language is non-empty.
  2. The proof of the pumping lemma was a proof by induction.
  3. The language of the context-free grammar: `A -> 0A1`, `A -> B`, `B -> epsilon` is non-regular.