Abstract

Among what are called languages, there are artificial languages such as programming languages and natural languages such as English, German, French, and Japanese, etc. The languages that we study in this book belong to the former group, and in this chapter we study context-free languages in the former group. A regular language studied in the previous chapter is defined to be the language that a finite automaton accepts. In this chapter, we introduce a context-free grammar, and define a context-free language to be the one that a context-free grammar generates. The class of context-free languages includes the class of regular languages and, furthermore, contains nonregular languages like {0 n 1 n |n=0}. So the generating power of a context-free grammar exceeds the accepting power of a finite automaton. Corresponding to the pumping lemma for regular languages, we introduce a pumping lemma for context-free languages, which shows that a language does not belong to the class of context-free languages. Context-free grammar are also used to describe practical programming languages.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call