Chapter 5 Context-Free Languages - PowerPoint PPT Presentation

About This Presentation
Title:

Chapter 5 Context-Free Languages

Description:

Title: PowerPoint Presentation Created Date: 1/1/1601 12:00:00 AM Document presentation format: On-screen Show Other titles: Times New Roman MS P MS ... – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 15
Provided by: tns97
Learn more at: https://www.tnstate.edu
Category:

less

Transcript and Presenter's Notes

Title: Chapter 5 Context-Free Languages


1
Chapter 5 Context-Free Languages
  • Regular language are effective in describing
    certain simple patterns. But it is not enough to
    describe programming languages.
  • Context-Free languages cover more complicated
    languages.

Context free
2
(No Transcript)
3
It is not a linear grammar.
4
Leftmost and Rightmost Derivations
Definition5.2 A derivation is said to be
leftmost if in each step the leftmost variable in
the sentential form is replaced. If in each step
the rightmost variable is replaced, we call the
derivation rightmost.
5
Definition 5.3 Let G(V,T,S,P) be a context-free
grammar. An ordered tree is a derivation tree for
G if and only if it has the following properties
6
5.2 Parsing and Ambiguity
Parsing and Membership
7
(No Transcript)
8
Ambiguity in grammars and languages
S
9
(No Transcript)
10
.
5.3 Context-free Grammars and Programming
Languages
Why we learn the theory of formal
languages?----We use the theory to design
programming languages and to design the
interpreters and compiles for them.
A programming language has two aspects syntax
and semantics.
Related to context-free grammar.
11
Chapter 7 Pushdown Automata
Pushdown Automata
12
Definition 7.1 A nondeterministic pushdown
accepter or npda is defined by the septuple
13
Context-free Language and Pushdown Automata
Theorem 7.1 For any context-free language L,
there is an npda M such that L L(M).
14
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com