Common operator notation: Difference between revisions

Content deleted Content added
Rriegs (talk | contribs)
Changes examples to tt to fix apparent spacing problems; removed confusing last example
Disambiguated: operatoroperator (programming)
Line 2:
{{Unreferenced|date=August 2009}}
{{Cleanup-reorganize|date=July 2007}}
In [[programming languages]], '''common operator notation''' is just one way of notating mathematical expressions as a linear sequence of tokens, or [[operator (programming)|operator]]s, but this is not the only way. The use of operator precedence classes and associativities is just one way. However, it is not the most general way: this model cannot give an operator more precedence when competing with '−' than it can when competing with '+', while still giving '+' and '−' equivalent precedences and associativities. <!-- speculation... Can it be demonstrated that this is the only sensible way? I do not know, but any such demonstration would be welcome. --> A generalized version of this model (in which each operator can be given independent left and right precedences) can be found at [http://compilers.iecc.com/comparch/article/01-07-068].
 
In this model, tokens are divided into two classes: operators and operands.