Question: PLEASE ANSWER ALL THE QUESTION 1. Given the grammar below try drawing the parse tree for the following statement (include your parse tree as far

PLEASE ANSWER ALL THE QUESTION

PLEASE ANSWER ALL THE QUESTION 1. Given the grammar below try drawing

1. Given the grammar below try drawing the parse tree for the following statement (include your parse tree as far as you can). [2 marks] 2 = x + y + + 2 ::= = ::= | + ::= x | y | 2 a) Why does this fail? [1 mark] 2. Write a BNF grammar for University of Auckland logins (or UPIs) e.g. abcd025. There must be at least 2 letters in the first part up to a maximum of 4 letters and the number part consists of exactly 3 digits. Only use the letters a, b, c and d, but do use all 10 digits. [3 marks] a) Using your grammar draw the parse tree for ab 025. [1 mark] 1. Given the grammar below try drawing the parse tree for the following statement (include your parse tree as far as you can). [2 marks] 2 = x + y + + 2 ::= = ::= | + ::= x | y | 2 a) Why does this fail? [1 mark] 2. Write a BNF grammar for University of Auckland logins (or UPIs) e.g. abcd025. There must be at least 2 letters in the first part up to a maximum of 4 letters and the number part consists of exactly 3 digits. Only use the letters a, b, c and d, but do use all 10 digits. [3 marks] a) Using your grammar draw the parse tree for ab 025. [1 mark]

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!