Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Precedence based parsing



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]





<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.