How to formally define this language?

56 Views Asked by At

Suppose we are given an alphabet $\{x,+,*,(,)\}$. I want to define a language of terms in this alphabet where outermost parentheses are omitted, multiplication and addition are done left to right, and multiplication takes precedence over addition. So, for example, $x$, $x+x+x$, and $x*(x+x)$ would be legal terms, but neither $(x+x)$, $x+(x+x)$, $(x+x)+x$ nor $(x*x)+x$ would be allowed. Basically, I want to know how to formally define a language where some operations are given implicit precedence over others.