Python's own internal compiler can parse this, if you use Python notation.
If your change the notation slightly, you'll be happier.
import compiler
eq= "sin(x)*x**2"
ast= compiler.parse( eq )
You get an abstract syntax tree that you can work with.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…