Examples of operator precedence and associativity. At the top, the two panels show one example each for operator precedence or operator associativity. A mixed example is given at the bottom of the figure showing the relationship between operator precedence and operator associativity. In the lower right part there is a short list with symbols for only a few operators. In this list, the vertical order of the operators indicates operator precedence and the symbols found on the same level have equal precedence. Notice that in all panels there is a well-established and numbered sequence of computations that is based on precedence and associativity.
Paul A. Gagniuc. An Introduction to Programming Languages: Simultaneous Learning in Multiple Coding Environments. Synthesis Lectures on Computer Science. Springer International Publishing, 2023, pp. 1-280.
Paul A. Gagniuc. An Introduction to Programming Languages: Simultaneous Learning in Multiple Coding Environments. Synthesis Lectures on Computer Science. Springer International Publishing, 2023, pp. 1-280.