Essentially you take note of the first operator's precedence and keep consuming input until you reach an operator with lower precedence than you currently have. The precedence you use for comparison is updated each step.
Here's some code that does that: https://github.com/uibk-dps-teaching/ps_cc_2021/blob/0ad022c...
Only thing you have to watch here: with a recursive descent parser you might need an extra step to fix the associativity (right-to-left vs. left-to-right) if that's important for your application.
Here's that: https://github.com/uibk-dps-teaching/ps_cc_2021/blob/0ad022c...