473,698 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

flex for windows

I am trying to contribute to a large project and am running into a bit
of a problem.

One of the lex files uses %option reentrant, which flex refuses to
compile. I am running version 2.5.4 under windows. From what I can
gather, this is a rather old version, but I have not been able to find
newer binaries.
Is there a download out there for version 2.5.33? Also, can someone
confirm that %option reentrant works with 2.5.33?

Thanks a million, and sorry if this is a FAQ.

Dec 12 '07
16 7952
In comp.compilers Hans-Peter Diettrich <Dr**********@a ol.comwrote:
I don't think that a tool like flex really depends on special POSIX
features, apart from the file handling. More problems will result from
....a little more than that (2.5.4a only relies on file handling and is
very portable), the new (since 2002) version spawns a copy of m4 to
process some macros.

(coincidentally , I was looking at the .33 this morning, to see if it
addressed locales - 2.5.4a's rather limited) and found that aspect was not
improved in the newer version as well (lots of additional ifdef's, but
no new solutions). Perhaps someone will get interested in making flex's
parsing know about locales...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Jan 6 '08 #11
Cygwin configures and builds current flex "out of the box," and I get
only 1 adverse indication in the testsuite.
Unfortunately that's not entirely true. If you're using Cygwin's
"text mode mounts", current flex will compile fine, but the scanners
it generates are uncompilable, due to our old friend "The Inability Of
21st Century Computer Science To Solve The Clearly Intractable And
Apparently NP-Hard "\r\n" Vs. "\n" EOL Problem". For reasons I've
been unable to determine or correct, no matter what you do the
generated source has extra EOLs and "Pseudo-EOLs" (things like
"\r\r\n").
Your recommendation to
use linux amounts to using a posix environment, more so than
cygwin. So, I'm not convinced by any of these suggestions that
avoiding posix emulations makes it easier.
True enough, but step 1 is that it has to generate usable output.
Jan 6 '08 #12
Gary R. Van Sickle wrote:
>Cygwin configures and builds current flex "out of the box," and I get
only 1 adverse indication in the testsuite.

Unfortunately that's not entirely true. If you're using Cygwin's
"text mode mounts", current flex will compile fine, but the scanners
it generates are uncompilable, due to our old friend "The Inability Of
21st Century Computer Science To Solve The Clearly Intractable And
Apparently NP-Hard "\r\n" Vs. "\n" EOL Problem". For reasons I've
been unable to determine or correct, no matter what you do the
generated source has extra EOLs and "Pseudo-EOLs" (things like
"\r\r\n").
>Your recommendation to use linux amounts to using a posix
environment, more so than cygwin. So, I'm not convinced by any of
these suggestions that avoiding posix emulations makes it easier.
True enough, but step 1 is that it has to generate usable output.
I'm not enough of a masochist to attempt Windows text mode. I haven't
heard of anyone but you telling us that anything but NotePad
compatible text in Windows is "cheating." Linux doesn't support this
kind of text mode; why should we make it impossibly difficult on
Windows?

Jan 7 '08 #13
Gary R. Van Sickle wrote:
Apparently NP-Hard "\r\n" Vs. "\n" EOL Problem".
What's the problem?

AFAIK a single "\r" is nowhere used for EOL, so it should be possible to
skip \r, and treat \n as EOL.

DoDi
[That's pretty typical, ignore the \r and look for the \n. But this doesn't
have much to do with compilers, as opposed to general Windows programming,
any more. -John]

Jan 7 '08 #14
Hans-Peter Diettrich <Dr**********@a ol.comwrites:
Gary R. Van Sickle wrote:
>Apparently NP-Hard "\r\n" Vs. "\n" EOL Problem".

What's the problem?

AFAIK a single "\r" is nowhere used for EOL, so it should be possible to
skip \r, and treat \n as EOL.

DoDi
[That's pretty typical, ignore the \r and look for the \n. But this doesn't
have much to do with compilers, as opposed to general Windows programming,
any more. -John]
Doesn't MacOS use a single \r to represent EOL rather than single \n?

However, the issue is more whether any given tool treats the
combinations of \r and \n characters in your file the way that you (or
some other tool you use) intended them to be treated (as a result I
have my own version of u2d and d2u that cannonicalizes them in the
ways that the tools I use accept them), so as our moderator said it
isn't much of a compiler question as a global question, with the
problem being that there is no universally accepted standard. Yes,
there are standards, but they aren't universally followed.

BTW, anyone who wants my copy of u2d/d2u and/or the Yacc++ grammar I
used in writing them, (Yes, I wrote a grammar to "parse" the problem.)
can get a free copy by writing me.

Hope this helps,
-Chris

*************** *************** *************** *************** *************** **
Chris Clark Internet : co*****@world.s td.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
Jan 8 '08 #15
Chris F Clark <cf*@shell01.Th eWorld.comwrote :
Hans-Peter Diettrich <Dr**********@a ol.comwrites:
Gary R. Van Sickle wrote:
Apparently NP-Hard "\r\n" Vs. "\n" EOL Problem".
What's the problem?

AFAIK a single "\r" is nowhere used for EOL, so it should be possible to
skip \r, and treat \n as EOL.

DoDi
[That's pretty typical, ignore the \r and look for the \n. But this doesn't
have much to do with compilers, as opposed to general Windows programming,
any more. -John]

Doesn't MacOS use a single \r to represent EOL rather than single \n?
No. MacOS uses a single ASCII CR as EOL, while Unixen use LF and MS
OSes use CRLF. In a file opened as a text stream in C, though, all of
those will be represented in that text stream as '\n'. (And obviously,
they should also be represented as '\n' in any code-reading tool (as
opposed to, e.g., binary editors) written in ISO C.)

Richard

Jan 9 '08 #16
Doesn't MacOS use a single \r to represent EOL rather than single \n?

It did. But Mac OS X switched to the Unix convention, so all is well.
Stefan
..

Jan 21 '08 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6588
by: olig9 | last post by:
Hello, is there a way to feed an ifstream to a parser generated with flex and bison? I could see that flex wants a FILE* for reading, but I only have an ifstream (actually and ifstream*) for input. It seems that flex++ can use an ifstream; but how does the generated lexer then work with bison? Or is there a (portable) way to get a FILE* from an ifstream? Thanks in advance, Oliver Gerlich
2
287
by: skulkrinbait | last post by:
Hello, I need some help please. I need to migrate some applications from OS2 to Windows, the source code is C. I believe this can be done using Lex and Yacc and have installed Cygwin with Flex and Bison which I believe are compatible but I'm having trouble getting Flex to process the C file. I assume that I need to write some rules for Flex to use but as I'm not familiar with C I've no idea what the rules should be. Apologies for...
6
15475
by: Volker Hetzer | last post by:
Hi! We are finding ourselves in a situation where we have to parse several more or less free format text files. In the past, on linux, we had flex and bison for generating very fast parsers for these files. Is there any equivalent in the visual studio world? Lots of Greetings! Volker --
2
2519
by: James Calivar | last post by:
Hi, I'm trying to compile PHP v5.1.6 under Windows XP using cygwin. I get the following error when I run ./configure. Can anyone help please? $ ./configure loading cache ./config.cache checking for Cygwin environment... yes checking for mingw32 environment... no
5
1520
by: Ronald S. Cook | last post by:
I need ideas on how to best design a Windows form for my particular situation. On a cattle feeding yard there will be between about 300 and 600 pens. On my "Pen Feeding Sequence" form, I want the user to be able to setup and maintain the order in which the pens should be fed (ultimately in the Pen table is a column named Sequence that gets an interger value). So on the form...
5
5943
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to say "Hello World" in a Flash enabled web page rendered via ASP.NET. Can any one let me get started? ---
13
3110
by: treble54 | last post by:
I need to build PHP from source with the pdo_ibm extension and I am having an issue with it. Firstly, I am using Visual Studio .NET 2003 and I am building PHP from source through the Visual Studio Command Prompt. When I get to the nmake step, it gets through everything until it hits the zend_language_scanner.l file. Then I get these errors: zend_language_scanner.l(24) : warning C4005: 'yyleng' : macro redefinition...
10
6719
by: Jules Winfield | last post by:
Guys, I've been designing applications for the financial services industry using MSFT technologies for many years (Win32 API, MFC, and now .NET WinForms). All applications are Internet-based, with a "thick client" which makes calls to my grid of servers via a socket or remoting connection. Customers are pleased with my work but it seems that over the past twelve months or so, those same customers have expressed a strong demand to...
0
1282
by: Benny the Guard | last post by:
I have code that uses FLEX and Bison on windows to generate a parser. It was configured awhile back by a colleague using FLEX 2.5.4a and builds on Solaris, Windows and Linux using FLEX 2.5.4. Things worked fine until I started adding symbols to my lexer now I get and error about "32000 NFA states". As I wold rather not limit myself to limits imposed by 1997 software, I looked and found an update which is 2.5.33. However, no where can I...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.