Re:Why I write recursive descent parsers (despite their issues)
by ogogmad on Monday July 28, 2025 @12:31AM
(#44707250)
Have people heard of the following top-down parsing algorithm for mathematical expressions:
It's easy to speed up step 2 by keeping a table of all the operators in an expression, sorted by their precedence levels. For this table to work properly, the positions of all the tokens must never change.
[ Parent
| on HN ]
Re:Why I write recursive descent parsers (despite their issues)
by da-bacon on Monday July 28, 2025 @04:44AM
(#44708696)
For 2, I don’t think you can break ties however you like because this would give you random left or right associativity https://en.m.wikipedia.org/wiki/Operator_associativity For example 2-4-7 would be either (2-4)-7 or 2-(4-7), depending on how you broke the tie.