From: | James Harris <james.harris.1@googlemail.com> |
Newsgroups: | comp.compilers |
Date: | Tue, 24 Jun 2008 14:12:08 -0700 (PDT) |
Organization: | Compilers Central |
References: | 08-06-053 |
Keywords: | parse, LL(1) |
Posted-Date: | 24 Jun 2008 21:27:24 EDT |
On 24 Jun, 01:56, unix...@gmail.com wrote:
> I have one question regarding the difference between those two:
>
> I can use recursive predictive parsing, which is very straightforward.
> So what's the advantage of non-recursive predictive parsing. To
> perform non-recursive parsing, I need to construct FIRST, FOLLOW sets
> and use explicit stack. On the other hand, recursive predictive
> parsing is very easy to understand. I understand non-recursive calls
> have a better performance than recursive one. Is this the only reason?
Consider what happens when your input does not conform to the expected
structure. If you are going to recover from the error in the source
and continue processing you may need a way to unwind the stack under
your control. Recursive is fine if you have a way to recover from
source errors.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.