Compilers
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives FAQs Compilers

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 26th, 2008, 07:00 PM
Aaron Gray
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
predictive parsing and non-recursive predictive parsing

usually covered. But there is a less-known, elegant recursive
formulation for LR parsers as well. Google "recursive LR parser" for
a few papers.

Is this what is refered to as Recursive Ascent ?

Aaron


Reply With Quote
  #2  
Old July 1st, 2008, 11:40 PM
Aaron Gray
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
predictive parsing and non-recursive predictive parsing

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


Reply With Quote
Reply

Viewing: Web Development Archives FAQs Compilers > predictive parsing and non-recursive predictive parsing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway