Which stages of the compilation process of an input language solve the problem for priorities in arithmetic expressions (i.e. () -> *,/ -> +,-)? I know that code generators usually exploit Polish notation to produce code for a stack machine. But is it necessary to regard the priorities of operations into the grammar of the language syntax?