Higher precedence operators should appear further away from the root node than the lower precedence ones when doing the parse tree so they can get evaluated first. That’s why you make the least precedence operators first in the start symbol in the grammar definition and operators with higher priority deeper down in the grammar rule definition.

To fix the ambiguity related to associativity, we simply only make one part recursive, and usually it is the left part if we are solving left associative. The reason for this is to make the left part get deeper into the tree.

This type of grouping is called precedence cascade

The Dangling else problem

Syntax diagrams