Question: Please watch the assignment instruction video before working on the assignment. You can write your assignment by hand on paper and then scan it ,

Please watch the assignment instruction video before working on the assignment. You can write your assignment by hand on paper and then scan it, or just prepare your assignment as a Word document.
(20 points) Do problem 7(a)(d) on page 157.(Please see the Word document below if you have a different version of the textbook.)
Note that you need to build a parse tree AND do a leftmost derivation for each one of the two statements.
2.(10 points) The following is a BNF description of the CC++ pointer and array declarations:
?**- int ?? char
?**
1 Declarators [ number]
I name
Prove that this grammar is ambiguous.
Hint: Find a sentence that can be generated using two different parse trees. Write down the sentence and then draw the two trees that generate this sentence.
Hint: Find a sentence that can be generated using two different parse trees. Write down the sentence and then draw the two trees that generate this sentence.
3.(10 points) Do problem 12 on page 158.(Please see the Word document below if you have a different version of the textbook.]
Nate: is the start symbol in this grammar.
EXAMPLE 3.4 An Unambiguous Grammar for Expressions
cassign >1
Using the grammar in Example 3.4, show a parse tree and a leflmost dervation for each of the following statements
(a)A={A+B}+c
b.2-B+C+A
c.=-=(B+C)
(d)A=3=(c+(A+B)]
Consider the following grammar:
??S>ac|1,b??A|
>c|C??B|
>d||
 Please watch the assignment instruction video before working on the assignment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!