Click here to Skip to main content
14,878,761 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every body could you plz Help me with this flex program because I am no familiar with flex environment the question is:

"You have to make a flex file, this file should be used to generate a lexical scanner that will match the following patterns:
It's a string of characters without any gaps, it consists of three parts:
1. Integer part: It's a string of digits (at least one digit). It mustn’t begin with 0 except if the value of the string equal to zero so it has to consist of only one digit (0). Optionally the string can be preceded by (+) or (-) sign.
2. Fractional part: this part is optional; it begins with (.), then a string of digits (at least one digit).
3. Exponential part: this part is also optional, it begins with (e) or (E) then (+) or (-) to define the sign of the exponential, then a string of digits (at least one digit), this string mustn’t begin with (0) or equal to (0).
 .54E4, 94.E34, 09.45E3, 00.43E5, 4.53E, 24.4E, 34.3E0, 34.3E09 are not DOUBLE.
 2.43E9, 34E-9, 0E+24, -24.4, +90.000e+34 are DOUBLE."

plz help.

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
elfuego81 5-Nov-12 6:21am
I know it's not difficult but it's a one day homework and it's not the only question it has many questions I only need help with one so I do the others.
elfuego81 5-Nov-12 6:23am
I did some programs by now on flex but there is some syntax i didn't understand like yylex() and yywrap() what they used for??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900