help-flex
[Top][All Lists]
Advanced

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

Re: Flex 2.5.23 beta and C++


From: Hans Aberg
Subject: Re: Flex 2.5.23 beta and C++
Date: Wed, 23 Oct 2002 18:40:18 +0200

At 10:53 -0400 2002/10/23, W. L. Estes wrote:
>> Are you writing code for eternity? :-)
>
>No, but the current flex c++ code used to be valid c++.

The current C++ standard ISO+IEC+14882-1998 is the one and only one that
ever has existed. Before it, there were only some drafts.

> I find it
>annoying that the c++ standard broke code I'm now responsible for.

They did throw in a couple of things at the very end right before the
current C++ standard was created. One such thing was the namespaces,
another the STL (standard template library), which provides containers such
as std::vector, std::list, std::deque, std::map, std::set, etc, plus some
C++ style generic algorithms.

But those changes are not very radical, and things pretty quickly settled
down after the standard was accepted in 1998.

>> I recall that the current FlexLexer.h file has some esoteric construction
>> where it can be read twice, but I do not recall what that was for. -- If
>> possible such stuff should be removed, I think.
>
>Maybe you're referring to the ability to use the FlexLexer.h header to
>define distinct scanner classes? (The ability to define scanners for
>different languages.)

Possibly. -- It would be probably be better to have a separate header for
each scanner. But then one would probably end up with the Bison M4 approach.

I like the Bison M4 approach: In part because it then becomes easier to
produce skeletons for multiple languages, as the skeletons behave as just
another source code file, rather than something absolute. And in part
because I had made a macro language for one of my parsers that outputted
C++ code -- the Bison folks seems to have picked up the idea in the M4 form.

  Hans Aberg






reply via email to

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