
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
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__ --> |