help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: flex 2.5.4a -- Bug?


From: Nikos Balkanas
Subject: Re: flex 2.5.4a -- Bug?
Date: Tue, 4 Dec 2001 12:01:10 +0200

----- Original Message -----
From: John W. Millaway <address@hidden>
To: Nikos Balkanas <address@hidden>; <address@hidden>
Sent: Sunday, December 02, 2001 7:52 AM
Subject: Re: flex 2.5.4a -- Bug?


> --- Nikos Balkanas <address@hidden> wrote:
> > Specs: Linux Suse 6.2, kernel 2.2.10, flex 2.5.4 distribution, or 2.5.4a
> > compliled from source, egcs-2.91.66.
> >
> > Code:
> >
> > %{
> > #include <stdio.h>
> > #include <ctype.h>
> > #include <string.h>
> >
> > int lineno = 1;
> > %}
> >
> > space [ \t]
> > sp {space}+
> > ws {space}*
> > newline \n
> >
> > %option nounput
> > %option noyymore
> > %%
> >
> > {newline}             { printf("Hello!\n"); }
> > \n                       { printf("Wrong-->\n"); }
> > .                         { ECHO; }
> >
> > %%
> >
> > Caveat: {newline} never expands correctly. Name of pattern doesn't
matter.
> > Output consists of echoed text + "Wrong->" in place of newlines. I
traced it
> > to the yy_accept array, which seems to be wrong. If I change the
particular
> > entry (from 2 to 1) and compile, I get lots of "Hello!"'s.
>
>
> Flex issues a warning for the second rule, "\n", since it can never be
matched.
> The first rule, "{newline}" is the same as the second rule! Nevertheless,
I
> compiled flex version 2.5.4a and compiled the above input file, ignoring
the
> warning from flex. I saw the correct output, "Hello!", at the end of each
line.
>
> -John
>
>
That should be the correct behaviour. My question is whether anyone else has
observed similar problems on the given platform. It is not windows, so I
would expect the problem to be replicated across the distribution. Has
anyone noticed compatibility problems with egcs-2.91.66? If so, maybe a
patch or a warning would be appropriate.

Nikos





reply via email to

[Prev in Thread] Current Thread [Next in Thread]