As a guy who writes compiler the answer for this is it depends on the type of parser you are using.
LL and LR parser generates different derivation, and as such it is deterministically non-deterministic, hence UB.
But you can still change the parser to output the expression in the AST (or otherwise) so it is evaluated left to right or right to left. Just that doing it in a way that is not natural for the algorithm will require extra code.
But you can still change the parser to output the expression in the AST (or otherwise) so it is evaluated left to right or right to left. Just that doing it in a way that is not natural for the algorithm will require extra code.