Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
2 Contextfree Grammars and Pushdown Automata As we have seen in Exercise 15, regular languages are not even su#cient to cover wellbalanced
 

Summary: 2 Context­free Grammars and Pushdown Automata
As we have seen in Exercise 15, regular languages are not even su#cient to cover well­balanced
brackets. In order even to treat the problem of parsing a program we have to consider more
powerful languages. Our aim in this section is to generalize the concept of a regular language
to cover this example (and others like it), and to find ways of describing such languages. The
analogue of a regular expression is a context­free grammar while finite state machines are
generalized to pushdown automata. We establish the correspondence between the two and
then finish by describing the kinds of languages that are not captured by these more general
methods.
2.1 Context­free grammars
The question of recognizing well­balanced brackets is the same as that of dealing with nesting
to arbitrary depths, which certainly occurs in all programming languages. To cover these
examples we introduce the following definition.
Definition 11 A context­free grammar is given by the following:
. an alphabet # of terminal symbols, also called the object alphabet;
. an alphabet N of non­terminal symbols, the elements of which are also referred to as
auxiliary characters, placeholders or, in some books, variables, where N # # = #; 7
. a special non­terminal symbol S # N called the start symbol;
. a finite set of production rules, that is strings of the form R # # where R # N is a non­
terminal symbol and # # (# # N) # is an arbitrary string of terminal and non­terminal

  

Source: Aczel, Peter - Departments of Mathematics & Computer Science, University of Manchester

 

Collections: Mathematics