Content deleted Content added
Adroitwhiz (talk | contribs) Undid revision 1235143786 by Dotched (talk): The linked tutorial is almost certainly generated by ChatGPT and has very little pedagogical value |
m homogenized hyphenation of "operator-precedence parser" |
||
Line 1:
{{Short description|Bottom-up parser that interprets an operator-precedence grammar}}
In [[computer science]], an '''operator
[[Edsger Dijkstra]]'s [[shunting yard algorithm]] is commonly used to implement operator
== Relationship to other parsers ==
Line 10:
Operator-precedence parsers are not used often in practice; however they do have some properties that make them useful within a larger design. First, they are simple enough to write by hand, which is not generally the case with more sophisticated right shift-reduce parsers. Second, they can be written to consult an operator table at [[Run time (program lifecycle phase)|run time]], which makes them suitable for languages that can add to or change their operators while parsing. (An example is [[Haskell (programming language)|Haskell]], which allows user-defined infix operators with custom associativity and precedence; consequently, an operator-precedence parser must be run on the program ''after'' parsing of all referenced modules.)
[[Raku (programming language)|Raku]] sandwiches an operator-precedence parser between two [[recursive descent parser]]s in order to achieve a balance of speed and dynamism. [[GNU Compiler Collection|GCC]]'s C and C++ parsers, which are hand-coded recursive descent parsers, are both sped up by an operator-precedence parser that can quickly examine arithmetic expressions. Operator
== Precedence climbing method ==
|