help-flex
[Top][All Lists]
Advanced

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

flex 2.5.4a -- Bug?


From: Nikos Balkanas
Subject: flex 2.5.4a -- Bug?
Date: Fri, 1 Dec 2000 03:32:57 +0200

Hi folks,
 
I've come across a rather strange behaviour which I would like to run with you. It seems to be system dependent. It didn't manifest on AIX or Solaris, but it did on Linux.
 
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.
 
Any Ideas?
 
Thanks, Nikos.

reply via email to

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