That was my first thought, but then I thought maybe I should actually write the test for it--but after almost finishing that (hitting a few bugs), I think I agree with you--but are there other lexers that don't define yylineno? I guess we'll find out.

David

On Thu, Jul 03, 2003 at 07:22:07AM -0600, David Thompson wrote:
 Looking at the change logs for flex, it appears that yylineno support
 was added in 2.5.4 with the -l flag. Before that it didn't exist. I
 bet you are getting the -l flag set somehow. From the info I've read,
 using yylineno from flex gives a performance hit (just so you know).

The performance hit was solved in 2.5.11, according to the changelog,
even though the documentation mentioned it until 2.5.20. From my reading
of the logs, yylineno support in flex is much older, though, introduced
in 2.4.1 (Nov. 93). The problem seems to be that flex nowadays always
defines yylineno, even when -l isn't given. (Maybe 'reentrant' is now on
by default?)

 I agree that it needs to be tested for and I will try and write an
 autoconf test for it today.

Thinking more about it, how about always calling flex as 'flex -l' and
defining yylineno as extern in Network.C? This should work with any flex
that's less than ten years old. In other words (untested):

Index: configure.ac
===================================================================
RCS file: /src/master/dx/Attic/configure.ac,v
retrieving revision 1.1.2.16
diff -u -r1.1.2.16 configure.ac
--- configure.ac        2 Jul 2003 16:05:47 -0000       1.1.2.16
+++ configure.ac        3 Jul 2003 15:47:24 -0000
@@ -963,6 +963,7 @@
 AC_PROG_LEX
 if test "$LEX" == "flex"; then
     AC_DEFINE(USING_FLEX, 1, [Define to 1 if using flex])
+    LEX="flex -l"
 fi

 dnl Check yaccer.  Don't use standard AQC_PROG_YACC... We're going


Regards,

Daniel.


--
.............................................................................
David L. Thompson                   Visualization and Imagery Solutions, Inc.
mailto:[EMAIL PROTECTED]    5515 Skyway Drive, Missoula, MT 59804
                                    Phone : (406)756-7472

Reply via email to