Search CTRL + K

Operator-precedence Parser

运算符优先级解析器(operator-precedence parser) 负责解析运算表达式,将人类可读的 中缀表达式 处理为便于处理计算的格式,比如 逆波兰表达式

主要有三种算法 [1]

补全算法

Wikipedia

In computer science, an operator precedence parser is a bottom-up parser that interprets an operator-precedence grammar. For example, most calculators use operator precedence parsers to convert from the human-readable infix notation relying on order of operations to a format that is optimized for evaluation such as Reverse Polish notation (RPN).[2]


  1. https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing ↩︎

  2. https://en.wikipedia.org/wiki/Operator-precedence_parser ↩︎