Question: a) Construct a phrase-structure grammar that generates all signed decimal numbers, consisting of a sign, either + or ; a nonnegative integer; and a decimal

a) Construct a phrase-structure grammar that generates all signed decimal numbers, consisting of a sign, either + or −; a nonnegative integer; and a decimal fraction that is either the empty string or a decimal point followed by a positive integer, where initial zeros in an integer are allowed.
b) Give the Backus-Naur form of this grammar.
c) Construct a derivation tree for−31.4 in this grammar.

Step by Step Solution

3.40 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a A string such as 34 is not allowed by this definition but a string such as 02 780 is This is prett... View full answer

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

Document Format (1 attachment)

Word file Icon

923-M-C-M-S (2649).docx

120 KBs Word File

Students Have Also Explored These Related Statistics Questions!