bug-bison
[Top][All Lists]
Advanced

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

Re: New line character is not matching in flex++ scanner


From: Laurence Finston
Subject: Re: New line character is not matching in flex++ scanner
Date: Tue, 4 Jan 2005 13:37:27 +0100 (MET)

Hello Krishna,

I had a similar problem with Flex when using it to generate
a C++ scanner class.  In my case, it swallowed the
semi-colons at the end of `expressions'.  I wasn't able to
figure out why, or make it stop.  The problem didn't
occur when generating a C scanner function.  I finally
stopped using Flex for this part of my project, and wrote my
`yylex()' by hand.

The advice of the Flex developers was to use the most recent
beta version.  I believe it can be used to generate a
reentrant C scanner function, but I don't remember the
specifics.  Perhaps they've released a new stable version in
the meantime, I don't know.

So far, I've found that I prefer using Flex and Bison
separately rather than together.  I've had good results
using the  "category code" approach to scanning rather than regular
expressions, so I don't think it's always necessary to use
Flex to generate `yylex()'.

Laurence

On Tue, 4 Jan 2005, Krishna Murthy Gudipati wrote:

>
> I have  a peculiar problem with the flex++.
>
> I have a set of regular expressions for flex which includes rule to
> recognise the new line character like :
>
> [\n]          { printf("ENDLINE"); }
>
> We have used the flex and bison to generate 'C' scanner and parser and it
> could recognize new characters in the input file. But due to some reentrant
> issues we moved to flex++ and bison++ and generated C++ scanner and parser.
> The problem is the flexx++ generated scanner is not recognizing the '\n'
> character at the end of the line in the input file. I am really wondering
> what is this problem is because as such there is not difference id the
> definition of regular expressions and the grammar which is defined for
> flex/binson and flex++/bison++.





reply via email to

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