Re: Is that difficult to write a Shift-Reduce parser

Tony Finch <dot@dotat.at>
04 May 2010 15:55:30 +0100 (BST)

          From comp.compilers

Related articles
Is that difficult to write a Shift-Reduce parser kuangpma@gmail.com (kuangpma) (2010-04-29)
Re: Is that difficult to write a Shift-Reduce parser kym@sdf.lonestar.org (russell kym horsell) (2010-05-01)
Is that difficult to write a Shift-Reduce parser chakaram@auth.gr (Chariton Karamitas) (2010-05-02)
Re: Is that difficult to write a Shift-Reduce parser rpw3@rpw3.org (2010-05-01)
Re: Is that difficult to write a Shift-Reduce parser cfc@shell01.TheWorld.com (Chris F Clark) (2010-05-02)
Re: Is that difficult to write a Shift-Reduce parser dot@dotat.at (Tony Finch) (2010-05-04)
Re: Is that difficult to write a Shift-Reduce parser sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-05-07)
Re: Is that difficult to write a Shift-Reduce parser rpw3@rpw3.org (2010-05-09)
| List of all articles for this month |

From: Tony Finch <dot@dotat.at>
Newsgroups: comp.compilers
Date: 04 May 2010 15:55:30 +0100 (BST)
Organization: dotat labs
References: 10-04-072 10-05-003 10-05-014
Keywords: parse
Posted-Date: 05 May 2010 13:33:17 EDT

rpw3@rpw3.org (Rob Warnock) wrote:
>
>The "trick" to hybridizing this with recursive descent is to assign
>*very* high operator priorities to the start tokens of control expressions
>[e.g., "keywords" such as BEGIN, IF, WHILE, etc.] and *very* low priorities
>to the ends of expressions ["stoppers" such as END, ELSE, FI, right-paren,
>right-bracket, comma, semicolon, &c]. This causes the simple operator
>precedence parser to quite naturally behave as a recursive descent parser
>when it encounters any of those constructs. ;-}


This sounds a bit like the top-down operator precedence parser
that Douglas Crockford is particularly fond of.
http://javascript.crockford.com/tdop/tdop.html


Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/


Post a followup to this message

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