Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Backus-Naur Form Parse Tree. Question 2 1. A certain magazine distributor stores each subscription it distributes in a database and assigns each subscription a code

Backus-Naur Form Parse Tree. Question 2

image text in transcribed

1. A certain magazine distributor stores each subscription it distributes in a database and assigns each subscription a code number. That code number looks like: JI PO 81#0301870189018901900190019178 Here the first three letters of the code are the first three letters of the subscriber's last name. The next three characters are the first three numbers in the street address. This field is omitted if there is no street address (for example, in the case where the address is a post office box). The next character is always a number sign ("#"). The next two characters indicate the number of subscription terms, which can be an integer from 1 to 99. The following four characters indicate the starting date of the first subscription term in the format mmyy. A pair of start/end dates is given for each subscription term. The last two characters in the code form a two-digit ID code for the magazine. In the above sample code, the fields would be interpreted as follows: JIP First three letters of subscribers last name 081 First three digits of street address # Number sign 03 Number of subscription terms 0187 Start date of term 1 0189 End date of term 1 0189 Start date of term 2 0190 End date of term 2 0190 Start date of term 3 0790 End date of term 3 78 Magazine ID code Give a specification for a language that recognizes all forms of subscription code numbers using BNF and syntax diagrams (not EBNF). Be sure your language accepts exactly what is specified earlier nothing more or less. You may have to invent a few names for nonterminal symbols. You may assume that and are nonterminal symbols and are predefined for your use 2. Consider your specification for Exercise 1. For each of the following strings, give a parse tree. (a) JIP081#0301870189058906900591129278 (b) SMI #010719128733 1. A certain magazine distributor stores each subscription it distributes in a database and assigns each subscription a code number. That code number looks like: JI PO 81#0301870189018901900190019178 Here the first three letters of the code are the first three letters of the subscriber's last name. The next three characters are the first three numbers in the street address. This field is omitted if there is no street address (for example, in the case where the address is a post office box). The next character is always a number sign ("#"). The next two characters indicate the number of subscription terms, which can be an integer from 1 to 99. The following four characters indicate the starting date of the first subscription term in the format mmyy. A pair of start/end dates is given for each subscription term. The last two characters in the code form a two-digit ID code for the magazine. In the above sample code, the fields would be interpreted as follows: JIP First three letters of subscribers last name 081 First three digits of street address # Number sign 03 Number of subscription terms 0187 Start date of term 1 0189 End date of term 1 0189 Start date of term 2 0190 End date of term 2 0190 Start date of term 3 0790 End date of term 3 78 Magazine ID code Give a specification for a language that recognizes all forms of subscription code numbers using BNF and syntax diagrams (not EBNF). Be sure your language accepts exactly what is specified earlier nothing more or less. You may have to invent a few names for nonterminal symbols. You may assume that and are nonterminal symbols and are predefined for your use 2. Consider your specification for Exercise 1. For each of the following strings, give a parse tree. (a) JIP081#0301870189058906900591129278 (b) SMI #010719128733

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_2

Step: 3

blur-text-image_3

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

3 How the market system answers four fundamental questions.

Answered: 1 week ago

Question

5 The mechanics of the circular flow model.

Answered: 1 week ago