Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago