
28 Feb
2005
28 Feb
'05
9:44 a.m.
Is it widely accepted that the precedence of infix operators is defined by numbers? The numbers look arbitrary to me and it is not possible to introduce infix operators with interim precedences. What about defining relations such as "(*) has precedence over (+)"? The compiler could construct a topographically ordered graph from these relations. This way it would also be possible that from two infix operators none has precedence over the other (although the have not the _same_ precedence), thus the sub-expressions with these operators must be enclosed in parentheses.