Related articles |
---|
[10 earlier articles] |
Re: predictive parsing and non-recursive predictive parsing kamalpr@hp.com (kamal) (2008-06-27) |
Re: predictive parsing and non-recursive predictive parsing max@gustavus.edu (Max Hailperin) (2008-06-28) |
Re: predictive parsing and non-recursive predictive parsing DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-06-28) |
Re: predictive parsing and non-recursive predictive parsing ang.usenet@gmail.com (Aaron Gray) (2008-06-28) |
Re: predictive parsing and non-recursive predictive parsing max@gustavus.edu (Max Hailperin) (2008-06-28) |
Re: predictive parsing and non-recursive predictive parsing torbenm@pc-003.diku.dk (2008-06-30) |
Re: predictive parsing and non-recursive predictive parsing ang.usenet@gmail.com (Aaron Gray) (2008-06-30) |
From: | "Aaron Gray" <ang.usenet@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Mon, 30 Jun 2008 17:44:34 +0100 |
Organization: | Compilers Central |
References: | 08-06-053 08-06-056 08-06-064 08-06-067 08-06-069 08-06-076 08-06-079 |
Keywords: | parse |
Posted-Date: | 02 Jul 2008 00:17:54 EDT |
>>>> Is this what is refered to as Recursive Ascent ?
>>>
>>> It is indeed.
>
>> 1) How does it work as I cannot remember, it was used in Philip's Elegant
>> Compiler compiler infrastructure, which I looked at some eight years ago.
>> Would you please give a description of how it works for those who don't
>> know.
>
> Basically, you use the call stack as a replacement of the explicit
> stack. A shift is a call and a reduce is a return (through several
> stack levels).
>
> A reasonably good account can be found in "The Essense of LR Parsing"
> by Sperber and Thiemann (PEPM'95, ACM Press). It includes several
> different implementations in Scheme and a description of how you can
> use partial evaluation to generate specialised parsers from the
> general parser.
Thanks.
>> 2) Is it limited to LR(1) lookahead wise ?
>
> No.
This is very interesting. So you could implement lookahead before
doing the shift as a "guard". So you could get a very fast LR(k)
parser using this technique, although there is the problem of error
recovery which a no recursive table driven parser does much easier.
Interesting diversion :)
Aaron
Return to the
comp.compilers page.
Search the
comp.compilers archives again.