logo

Crowdly

Browser

Add to Chrome

1A student wrote two context-free grammars G1 and G2 for generating a single C-...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

1A student wrote

two context-free grammars G1 and G2 for generating a single C-like array

declaration. The dimension of the array is at least one. For example,

                  

int a[10][3];

 The grammars use D

as the start

symbol, and use six terminal symbols int ; id [ ] num.

          

Grammar

G1                           Grammar G2

               D

int

L;                                 D

int L;

               Lid [E                                     L id E

               E num ]                                 E E [num]

               E num] [ E                             E [num]

     Which of the grammars correctly generate

the declaration mentioned above?

 

0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on lms.vit.ac.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome