|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
predictive parsing and non-recursive predictive parsing
Max Hailperin schrieb:
Consider for example the following situation: > A -B c A -D e [] In fact, given that there is some lookahead, the LR parser can do even more. Suppose we complete the grammar with > B -f f f f f D -f f f f f IM this is an example of a bad language design, which I encounterd already in many languages. The fact, that a parser generator can handle such a grammar, is not an excuse for a thoughtless language design. No offense on you, your example is a very practical one <sigh>. When we have an look at any application, using the above grammar for e.g. serializing data, a possibly huge amount of input must be kept in the stack, before any action can be taken. And more memory is wasted for the automaton tables. When the language, and consequently also the grammar is converted into LL(1), by swapping the terms in A, no special amount of time or memory has to be wasted in the analysis of the input. DoDi |
![]() |
| Viewing: Web Development Archives > FAQs > Compilers > predictive parsing and non-recursive predictive parsing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|