50 likes | 182 Views
This week's focus includes homework review for assignments #5 and #6, key concepts from Chapter 14, and a discussion on Lab 2's initiation. Major topics covered include regular grammar production rules, removal of lambda and unit productions, and practical exercises. We will review what’s on Test #2, including important concepts like machines that serve as recognizers and pushdown automata (PDA). The class will work on constructing PDAs for various languages, enhancing understanding of memory models and efficient parser implementations.
E N D
CST229 Week 8 • Questions or concerns? • Hand back Homework #6 & #5 • Reading: Chapter 14 • Comment about Lab1 • Getting started with Lab2 • Chapter 14 • Regular Grammar Production rules • Remove Lambda productions • Remove Unit productions • In-Class Exercise #6 • What’s on test#2 • Review & answer questions
Machines • They served as Recognizers • They match the type of language
Pushdown Automata • An abstract machine model • Has memory, but not random access memory • Stack – push/pop • Serves as abstract model of a parser, syntax recognizer • Proof of concept • Needs strategy for efficient parser implementation
CFG -> PDA • Two different types of problems: • 1. Given a language description, construct a pushdown automata directly. (Chapter 14) • L = anbn • 2. Given a grammar, convert it into a standard format, then construct a pushdown automata directly from the grammar. (Chapter 15)
In-Class Exercise #6Construct pushdown automata for the following: • L = anb2n+1 • L= wcwr where w {a, b}* • L = anbn+mcm | n >= 0, m>= 1