I am trying to write an algorithm for converting formulas in first order (predicate) logic to abstract syntax trees. For propositional logic, I used the shunting-yard algorithm, but it does not work out of the box for first order logic since parenthesis may be used either in grouping or specifying the scope of predicates (or functions). Is there a generalization of the shunting-yard algorithm that can deal with this particular complication?
For reference, the strings I'm trying to parse look something like this:
"AxEy(P(x) & R(x,y)) -> R(f(a),b)"