Re:Operator precedence by textual substitution
by ufo on Monday May 16, 2022 @09:18AM
(#31396726)
Pretty neat! Takes advantage of the fact that the parser needs to use a recursion or stack to handle parenthesis. If it can handle parenthesis, it has all the tools necessary to handle operator precedence. If we think of how a recursive descent parser would implement operator precedence, by means of one level of recursion per each precedence level, this trick is basically encoding that in terms of parenthesis.
[ Parent
| on HN ]
There are no comments on this comment yet.