Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw a state diagram to recognize floating-point constants in C, which are defined by the following EBNF rules: [ ] [ ] | [ ]

Draw a state diagram to recognize floating-point constants in C, which are defined by the following EBNF rules:

[ ] [ ] | [ ]

[ ] . | .

e [ ] | E [ ]

+ | - | 0|1|2|3|4|5|6|7|8|9 f|l|F|L

Use as few states as possible. States that are legal ending points for floating-point constants should be drawn as double circles (see the states labeled id and int in Figure 4.1 of Sebesta). To save space, omit the addchar; getChar labels and return actions shown in Sebestas diagrams. You may use the name Digit to represent the characters listed in the rule and Suffix to represent the characters in the rule.

An Example of a state diagram is in figure 4.1 in Sebesta located below:

image text in transcribed

Preview File Edit View Go Tools Window Help Sort by: Search Rank Page Order PLC. pdl Figure 4.1 A state diagram to recognize names, parentheses, and arithmetic operators 73 174 0.4 KB/s 66.2GB A 60%D Tue Mar 7 11:43 AM O 29% 0.2KB's 6.20GB 934, PLC pdf a Search Draw 4.2 Lexical Analysis 173 Erase Letter Digit add Char getchar Letter Start id add Char: getchar Digit return Int Lit add char getchar Dig add char: getcha te-lookup (nextchar) Done return t. Function declarations void addChar void get Char void getNonBlank i int lex 0; Character c lasses #define LETTER O tide DIGIT 1

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

What is the relationship between diversity, inclusion, and equity?

Answered: 1 week ago