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

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

Draw a state diagram to recognize floating-point constants in C, which are defined by the following EBNF rules: rightarrow [] [] | | ] | . |. rightarrow e[] |E[] rightarrow 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 rightarrow 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 Sebesta's diagrams. You may use the name Digit to represent the characters listed in the --digit-- rule and Suffix to represent the characters in the rule. Using the syntax of C, write a recursive descent subprogram that corresponds to the following EBNF production (taken from the specification of Java): rightarrow [final] {' }; {, }, [, and] are metasymbols. Assume that the token codes for final, the comma, and the semicolon are FINAL_CODE, COMMA_CODS, and SEMICOLON_CODE, respectively. Also assume that recursive-descent subprograms named type and variable_declarator already exist

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!