need help on this question:
Write a lexer to read in decimal numbers. If your input is
the following string: “12345.9876” what do you have to do to each character in the string
to generate your float? How are the numbers before the decimal point different to the
numbers after the decimal point? and draw a state transition diagram for the scanning part
of your lexer.
is this coding right:
input = raw_input () # Grab raw keyboard input
4 int_string = "12345.9876"
6 for c in input :
7 if c. isdigit (): # state : digit
8 int_string = int_string + c
9 else : # state : accept