Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following grammar generates strings of symbols over the alphabet { 1 , 0 , . } : S - > T . T S

The following grammar generates strings of symbols over the alphabet {1,0,.}:
S -> T.T
S -> T
T -> TB
T -> B
B ->0
B ->1
(The variables are S, T, and B; S is the starting variable; the terminals are 0,1, and .).
The grammar generates binary numbers (like 0,00,1,101,00111100, etc.) or binary fractions (like 0.01,1.00,0111.11001, etc.).
Write a syntax-directed definition (SDD) of type L to compute the property value.S, whose value is the numerical value of the string derived from S.
For example, the numerical value of 0 is 0, the numerical value of 00 is 0, the numerical value of 1 is 1, the numerical value of 101 is 5, the numerical value of 00111100 is 60, the numerical value of 0.01 is 0.25(a quarter), the numerical value of 1.00 is 1, the numerical value of 0111.11001 is 7.78125(7+ half + quarter +1/32).
Define additional properties as necessary.
Explain in detail, in prose, the SDD you constructed.

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions