Precedence based parsing

Jeff Kenton <Jeffrey.Kenton@comcast.net>
3 Dec 2003 20:29:46 -0500

          From comp.compilers

Related articles
Precedence based parsing Jeffrey.Kenton@comcast.net (Jeff Kenton) (2003-12-03)
Re: Precedence based parsing torbenm@diku.dk (2003-12-08)
Re: Precedence based parsing jmcenerney@austin.rr.com (John McEnerney) (2003-12-08)
Re: Precedence based parsing haberg@matematik.su.se (2003-12-08)
Re: Precedence based parsing freitag@alancoxonachip.com (Andi Kleen) (2003-12-08)
Re: Precedence based parsing toby@telegraphics.com.au (2003-12-13)
Re: Precedence based parsing robert.thorpe@antenova.com (Rob Thorpe) (2003-12-13)
[5 later articles]
| List of all articles for this month |
From: Jeff Kenton <Jeffrey.Kenton@comcast.net>
Newsgroups: comp.compilers
Date: 3 Dec 2003 20:29:46 -0500
Organization: Comcast Online
Keywords: parse
Posted-Date: 03 Dec 2003 20:29:46 EST

I have been writing parsers and compilers for over 30 years, and one technique
I have used for parsing expressions seems to have disappeared from recent
books. It involves comparing the precedence of the newest operator with that
of the previous operator, in order to decide whether to shift or reduce. To
me, it seems very intuitive, and easy to construct a parser by hand this way
(even with 17 levels of operator precedence), but none of the new books
mention it, and some very experienced colleagues have never heard of it.


Comments? Reasons to prefer other techniques?
-------------------------------------------------------------------------
= Jeff Kenton Consulting and software development =
= http://home.comcast.net/~jeffrey.kenton =
-------------------------------------------------------------------------
[Operator precedence parsing is a classic technique, but you're right, the
recent books I looked at don't discuss it. I guess it's not as cool as
LR(1) or Tomita. -John]





Post a followup to this message

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