Consider the grammar G1 that is shown below: G1: * ::= + | ::= *

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Consider the grammar G1 that is shown below: G1: * ::= + | ::= *

Post by answerhappygod »

Consider the grammar G1 that is shown below:
G1: <exp>* ::= <exp> + <mulexp>
| <mulexp>
<mulexp> ::=
<mulexp> * <rootexp> | <rootexp>
<rootexp> ::= ( <exp>
)
|
a | b | c
(3 points) Modify the above grammar by adding the
equality operator (==) with the lowest precedence of all operators
in the grammar and is left associative.
2. (5 points) With the modifications
you made to this grammar, is this grammar G1 ambiguous? Why or why
not?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply