RE: Converting from old sun4 lex and yacc to flex and bison on Linux
"Thurn, Martin" <[email protected]> Wed, 26 Apr 2006 14:48:36 -0400
| Newsgroups | gmane.comp.lex.flex.general |
|---|---|
| Message-ID | <[email protected]> |
There is a discussion of "Logical Nesting of Files" on pages 154-156 of the O'Reilly book, across all versions of lex/flex, I suggest you start there. Er, SURELY you own the O'Reilly book? http://www.oreilly.com/catalog/lex/ Buy it now, it will be the best 30 bucks Raytheon ever spent on you 8-) - - Martin P.S. Please send ONLY PLAIN TEXT email to mailing lists. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Laura E Fowler Sent: Wednesday, April 26, 2006 13:40 To: [email protected] Subject: Converting from old sun4 lex and yacc to flex and bison on Linux =09 =09 I'm now responsible for some old code (> 10 years old) that is used to generate documentation and header files. It uses lex and yacc and currently is compiled and run on an old sun4 system. I'm trying to compile it and run it on a Linux system (SGI Altix).=20 =09 Firstly, I'm not conversant in lex and yacc, so please be gentle. Basically, I needs some pointers in the right direction.=20 =09 I have gotten the code to compile and run. I managed to correct all of the warning and I also used the -l option when using flex. The resulting tool seems to work fairly well except for one major problem. The files used as input to this tool can include other files and when an include statement is read, that file should be opened and processed before continuing on with the rest of the current file. The problem is that when an include statement is read, the file is opened and put on a linked list, but not processed. When end of file is reached on the initial file, then the files are popped off of the linked list and processed. This results in them being processed in the wrong order. On the sun4, the files are processed in the correct order.=20 =09 Can anyone give me any hints of where to look to figure out why the included file is not being processed after it's opened. Also, some hints on how to debug the flex and bison code would be appreciated.=20 =09 I tried searching the archives, but didn't come up with anything that would help.=20 =09 Please let me know if you need more information.=20 =09 Thanks,=20 Laura=20