Re: predictive parsing and non-recursive predictive parsing

James Harris <james.harris.1@googlemail.com>
Tue, 24 Jun 2008 14:12:08 -0700 (PDT)

          From comp.compilers

Related articles
predictive parsing and non-recursive predictive parsing unix.sh@gmail.com (2008-06-23)
Re: predictive parsing and non-recursive predictive parsing kamalpr@hp.com (kamal) (2008-06-24)
Re: predictive parsing and non-recursive predictive parsing torbenm@pc-003.diku.dk (2008-06-24)
Re: predictive parsing and non-recursive predictive parsing max@gustavus.edu (Max Hailperin) (2008-06-24)
Re: predictive parsing and non-recursive predictive parsing james.harris.1@googlemail.com (James Harris) (2008-06-24)
Re: predictive parsing and non-recursive predictive parsing max@gustavus.edu (2008-06-24)
Re: predictive parsing and non-recursive predictive parsing gene.ressler@gmail.com (Gene) (2008-06-25)
Re: predictive parsing and non-recursive predictive parsing unix.sh@gmail.com (2008-06-25)
Re: predictive parsing and non-recursive predictive parsing ang.usenet@gmail.com (Aaron Gray) (2008-06-27)
Re: predictive parsing and non-recursive predictive parsing torbenm@pc-003.diku.dk (2008-06-27)
Re: predictive parsing and non-recursive predictive parsing kamalpr@hp.com (kamal) (2008-06-27)
[6 later articles]
| List of all articles for this month |
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.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.