The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 438 Weeks Ago, 1 Day Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
The expressions of the grammar in Fig. 11.22 have two levels of precedence; + and − at one level, and ∗ and / at a second, higher level. In general, we can handle expressions with k levels of precedence by using k + 1 syntactic categories. Modify the grammar of Fig. 11.22 to include the exponentiation operator ^, which is at a level of precedence higher than * and /. As a hint, define a primary to be an operand or a parenthesized expression, and redefine a factor to be one or more primaries connected by the exponentiation operator. Note that exponentiation groups from the right, not the left, and 2^3^4 means 2^(3^4), rather than (2^3)^4. How do we force grouping from the right among primaries?

Fig. 11.22. Unambiguous grammar for arithmetic expressions.7
-----------