The pushdown automata (PDA) has the largest number of applications in recognition of computer languages, called context-free languages. Since context-sensitive languages are not well understood yet, the PDA is used for the recognition of these languages also. Regular languages can be recognized by PDA, but without making use of the pushdown stack. Unlike finite automata, a PDA is by default a nondeterministic machine. This chapter presents models of PDA, its simulation program, deterministic and nondeterministic PDAs, and language acceptability by PDA. It is shown that context-free grammars and PDA are equivalent—the principle has been used to show that context-free grammars can be directly converted to PDA. Important properties of PDA and context-free languages have been proved. Parsers, also called translators, make use of stack automata and contribute to language processing in computer languages and human languages, particularly they dig up the syntax in the language sentence and to some extent, the semantics, have been presented in detail. Since the process of parsing consumes a relatively large share of time among all the steps in compilation, its complexity/run time is important. The chapter also introduces basic concepts of parsing— bottom-up and top-down parsing and derives the complexity results of brute-force parsing. This is followed with more efficient k-symbols look-ahead grammars, i.e., LL(k) and LR(k) grammars, which eliminate the time-consuming backtracking in the application of rules. The chapter ends with self-assessment preview questions, followed by a list of classified exercises.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Pushdown Automata and Parsers

  • K. R. Chowdhary

摘要

The pushdown automata (PDA) has the largest number of applications in recognition of computer languages, called context-free languages. Since context-sensitive languages are not well understood yet, the PDA is used for the recognition of these languages also. Regular languages can be recognized by PDA, but without making use of the pushdown stack. Unlike finite automata, a PDA is by default a nondeterministic machine. This chapter presents models of PDA, its simulation program, deterministic and nondeterministic PDAs, and language acceptability by PDA. It is shown that context-free grammars and PDA are equivalent—the principle has been used to show that context-free grammars can be directly converted to PDA. Important properties of PDA and context-free languages have been proved. Parsers, also called translators, make use of stack automata and contribute to language processing in computer languages and human languages, particularly they dig up the syntax in the language sentence and to some extent, the semantics, have been presented in detail. Since the process of parsing consumes a relatively large share of time among all the steps in compilation, its complexity/run time is important. The chapter also introduces basic concepts of parsing— bottom-up and top-down parsing and derives the complexity results of brute-force parsing. This is followed with more efficient k-symbols look-ahead grammars, i.e., LL(k) and LR(k) grammars, which eliminate the time-consuming backtracking in the application of rules. The chapter ends with self-assessment preview questions, followed by a list of classified exercises.