Letter/Digit addChar; getChar Letter Start id return lookup (lexeme) addChar; getChar Digit +/- int return Int Lit addChar; getChar return Float Lit addchar; getchar Digit addChar; getChar A Digit addchar; getchar DOT (.) addchar, getchar DOT (.) addchar; getchar float Digit addchar; getchar

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter3: Understanding Structure
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

Try recognizing the following tokens with the given state diagram. For each part, describe how the token is accepted or reject.

a) -.453

b) 0.000032 

Letter/Digit
addChar; getChar
Letter
Start
id
return lookup (lexeme)
addChar; getChar
Digit
+/-
int
return Int Lit
addChar; getChar
return Float Lit
addchar; getchar
Digit
addChar; getChar
A
Digit
addchar; getchar
DOT (.)
addchar, getchar
DOT (.)
addchar; getchar
float
Digit
addchar; getchar
Transcribed Image Text:Letter/Digit addChar; getChar Letter Start id return lookup (lexeme) addChar; getChar Digit +/- int return Int Lit addChar; getChar return Float Lit addchar; getchar Digit addChar; getChar A Digit addchar; getchar DOT (.) addchar, getchar DOT (.) addchar; getchar float Digit addchar; getchar
Expert Solution
steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage