School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 306,813 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,689 people online right now. Registration is fast and FREE... Join Now!




lexer python

 

lexer python

srk619

4 Apr, 2009 - 07:33 AM
Post #1

New D.I.C Head
*

Joined: 4 Apr, 2009
Posts: 5

hi,

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



User is offlineProfile CardPM
+Quote Post


Nykc

RE: Lexer Python

4 Apr, 2009 - 08:55 AM
Post #2

This script is cheap!
Group Icon

Joined: 14 Sep, 2007
Posts: 6,561



Thanked: 44 times
Dream Kudos: 375
My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/20/09 09:56PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month