Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Below is a grammar for floating-point literals. Note, only one token is being defined here: float. The other non-terminals simply help define float's structure. float::digits
Below is a grammar for floating-point literals. Note, only one token is being defined here: float. The other non-terminals simply help define float's structure. float::digits | digits"[digits] digits ::: digit(digit) digit:::: "0" I "1" I "2" I "3" I "4" I "S" I "6" I "7" I "8" | "9" Recall: [x) means "X is optional" (ie, x appears 0 or 1 times) x3 means "a sequence of zero or more x's Examples of lexemes that can be generated using this grammar: 23. 3.123 Examples of strings that cannot be generated using this grammar 1.2.3 123 English description of a floating-point literal: the string must have exactly one decimal point and must have at least one digit, either before or after the decimal place. Instructions Draw a state diagram that recognizes floating point lexemes You must have a state labeled start. You must have at least one state that has a double border. A double bordered state is an accepting state. If the state machine is in an accepting state after processing a string, it accepts/recognizes the lexeme. If the state machine ends in any other state, then it does not accept/recognize the string as a lexeme. For example, in Figure 4.1 of the text id, int, and unknown are accepting states. The others are not
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