1 / 3

CST229 Week 7

CST229 Week 7. Questions or concerns? Hand back Test#1 & Homework #4 Test1 Average (45/50) Reading: Chapters 12&13 Chapter 12 Grammar – production rules Derivation/Parse Tree How to tell if a grammar is ambiguous In-Class Exercise #5 part 1 Chapter 13

dionne
Télécharger la présentation

CST229 Week 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CST229 Week 7 • Questions or concerns? • Hand back Test#1 & Homework #4 • Test1 Average (45/50) • Reading: Chapters 12&13 • Chapter 12 • Grammar – production rules • Derivation/Parse Tree • How to tell if a grammar is ambiguous • In-Class Exercise #5 part 1 • Chapter 13 • Regular Grammar Production rules • Remove Lambda productions • Remove Unit productions • In-Class Exercise #5 part 2

  2. In-Class Exercise #5 part 1Construct Grammar Production Rules for the following: • All words over {a,b} in which the letter a is never tripled. (i.e. no aaa allowed) • L = {anbm | 2n <= m <= 3n} • L = {anbmck| m = 3k} • L = {anbmck| m = n+k}

  3. In-Class Exercise #5 part 2 • Define a regular grammar for these languages: • All strings over {a,b} with 2 or 3 b’s and no more. • (a+b)*ab(a+b)* • Remove lambda and unit productions from this grammar: S-> aA | aaB A-> aaA | aC |  B -> C | bbB C -> cC | c

More Related