(DPDA) and DCFLs | ||
We have already seen a cubic-time pursing algorithm (based on dynamic programming technique) that works for any given context-free language. For almost all practical purposes it is considered to be two slow. The most successful parser which have been developed in the recent past are based on the idea of a PDA. Since PDAs and CFGs are found to be equivalent one can develop a parser for CFLs that behave like PDAs. But because of the nondeterministic nature of PDAs they are still not of immediate practical use in parsing. The parsing process may involve back tracking because of the nondeterministic steps and hence would lead to inefficiency. On the other hand, a parser rooted in the idea of a DPDA does not involve backtrack----ing and hence expected to work efficiently. Even though the capability of DPDAs are limited in the sense that they accept DCFLs which is a proper subset of CFLs, it turns out that the syntax of most programming languages can be modeled by means of DCFLs. One of the main motivations for studying DCFLs lies in the fact that- they can describe the syntax of programming languages and they can be parsed efficiently using DPDAs. To produce a compiler for a given programming language the syntax is required to be described by some CFGin restricted form that generate only DCFLs. There are different kinds of such CFGs in restricted forms. The LL- and LR-grammars are two important classes in this category. |
||