Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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||
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

=+g. Does it deliver one, instantly understandable message?

Answered: 1 week ago

Question

=+e. Does it entertain, inform and/or engage the reader?

Answered: 1 week ago

Question

=+h. Do all of the related materials project one cohesive message?

Answered: 1 week ago