Re: Restarting lex portably

jksoutter@my-deja.com
8 Sep 2000 02:02:19 -0400

          From comp.compilers

Related articles
Restarting lex portably mcopenha@cs.ucsd.edu (Michael A Copenhafer) (2000-08-21)
Re: Restarting lex portably jksoutter@my-deja.com (2000-09-08)
| List of all articles for this month |

From: jksoutter@my-deja.com
Newsgroups: comp.compilers
Date: 8 Sep 2000 02:02:19 -0400
Organization: Deja.com - Before you buy.
References: 00-08-104
Keywords: lex

> [You can't really do it portably in lex. I'd suggest deciding that your
> favorite version of lex is flex, and shipping the lex.yy.c along with
> your C routines if you want to move the code to another system. -John]


The implication here, which I wanted to underline, is that flex does
not generate platform specific code. Flex's output file (e.g.
lex.yy.c) is dependent only on the input file, the command line
arguments and the version of flex. It is not dependent on the machine
running flex.


Hence, by necessity, the flex's lex.yy.c is portable.


I don't think this portability feature is documented in the flex
manual. I was surprised to discover the feature when reading flex's
source code.


Also note that flex itself ships with a flex output file (initscan.c
derived from scan.l).


James


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.