Flex -- Differing Compiler Behaviors...

pollarda@hawaii.edu (Art Pollard)
20 Jul 1998 16:59:04 -0400

          From comp.compilers

Related articles
Flex -- Differing Compiler Behaviors... pollarda@hawaii.edu (1998-07-20)
| List of all articles for this month |

From: pollarda@hawaii.edu (Art Pollard)
Newsgroups: comp.compilers
Date: 20 Jul 1998 16:59:04 -0400
Organization: University of Hawaii
Keywords: lex, question, comment


I am in the process of using Flex to parse XML marked up data. The
flex regexps are quite simple however, after banging my head all day
yesterday trying to get it to work using Borland C++ 5.2, I tried
using M$VC in which case it ran fine.

The Borland compiled version didn't recognize a regexp of the form:

<MyStartState>\<\/[mM][yY][tT][aA][gG][Nn][aA][mM][eE]([ \n\r])*\>

And then my regexp of the form:


had unpredictable behavior sometimes only matching a fraction of the
potential match. (4-5 characters instead of 10 or more)

Since this seems to run just fine under M$VC but Borland's compiler has a
different behavior, I would think that a simple compiler switch should
take care of the problem.

Has anyone run into this sort of problem? Does anyone know what factors
might influence Flex?


Art Pollard <PollardA@Hawaii.edu>
Moderator for Comp.Theory.Info-Retrieval
List Maintainer for the Hyper-Theory (Hypertext Theory) mailing list.
[You need to tell us what version of flex you're using, but I can't
recall the last time I saw a portability bug. You may well have
another bug that's stomping the lexer tables or something like
that. -John]

Post a followup to this message

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