Question: 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:

 Draw a state diagram to recognize floating-point constants in C, which

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

1 Expert Approved Answer
Step: 1 Unlock 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

Students Have Also Explored These Related Databases Questions!