Re:Pratt Parsers: Expression Parsing Made Easy (2011)
by vidarh on Sunday January 21, 2024 @07:13AM
(#39077763)
You mean "f x y" instead of e.g. "f(x,y)"?
You can generalize that into handling operators of various arity both before and after the operator.
E.g. I once had a parser that would handle "x op y z". I don't recall why - it was 30+ years ago, but I can back up that it's a fairly simple modification to expand precedence based parsers this way.
You can generalize that into handling operators of various arity both before and after the operator.
E.g. I once had a parser that would handle "x op y z". I don't recall why - it was 30+ years ago, but I can back up that it's a fairly simple modification to expand precedence based parsers this way.