Click to See Complete Forum and Search --> : a little (f)lex problem


spizkapa
08-27-2002, 06:35 AM
Hi,

in my software I need to get a number of processes to read a file with various options. On each line there is an option and a setting for it, for example:

experiment_no: 12

If the line above was read, I expect a variable in my code to be set to 12. Now, I can do this using scanf and friends (as has been going on for over a year now) but now that the file format is changing and becoming more complicated, I think I ought to use a text scanner like flex.

Has anyone used flex and is willing to give me a hand? Any help massively appreciated, getting this should bring my software almost up to release 1. Thanks.

Rüpel
08-27-2002, 08:03 AM
never used (f)lex, but used google sometimes ;)

http://www.cs.ccu.edu.tw/~naiwei/cs5605/LexFlex.html

maybe this helps, maybe not ;)

spizkapa
08-27-2002, 08:05 AM
Been there, done that. I wouldn't have posted if the problem was easy enough for google to find an answer. I had already fount the link but thanks anyway.