lexer python

Page 1 of 1

1 Replies - 626 Views - Last Post: 04 April 2009 - 09:55 AM Rate Topic: -----

#1 srk619  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-April 09

lexer python

Posted 04 April 2009 - 08:33 AM


as im new to python i dont how to do this question can some help me out, the question is:

Write a lexer to read in decimal numbers. Think hard about how to do this. 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? Make sure you have an algorithm that works correctly
on paper before you start coding and draw a state transition diagram for the scanning part
of your lexer.

i noticed on the website you guys have code snippets so can some point me into the right dirrect of code or if some has already answer this question plz show their post so that i can get an idea

Is This A Good Question/Topic? 0
  • +

Replies To: lexer python

#2 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 736
  • View blog
  • Posts: 8,646
  • Joined: 14-September 07

Re: lexer python

Posted 04 April 2009 - 09:55 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1