Expr <- Sum Sum <- Product (('+' / '-') Product)* Product <- Power (('*' / '/') Power)* Power <- Value ('^' Power)? Value <- [0-9]+ / '(' Expr ')'