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:
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
An Example of a state diagram is in figure 4.1 in Sebesta located below:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started