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: Tue, 22 Oct 2002 18:38:33 +0200

At 09:54 -0400 2002/10/22, W. L. Estes wrote:
>> >Um, I thought that functions like exit() and such worked under c++?
>>
>> No, they do not exist! -- Those that exist are called std::exit, etc.
>
>My interest in supporting c++ just dropped a lot. What idiot broke
>code that has been working for over a decade?

Well, Bjarne Stroustrup also made en error on this, and I corrected him, so
it must be the C++ standardization committee! :-)

I think though that the feature is quite convenient though, once one has
gotten used to it, because all those standard functions do not interfere
with ones own code. For example, the following becomes possible:

namespace flex {
  int main(...) {...}

  class list {...};
}
and there will be no interference between ::main and flex::main or
std::list and flex::list.

>> It was only those, size_t in four or five places, and the others only once.
>>
>> For now, I would flip them in, later perhaps making separate C/C++ skelton
>> files, like in Bison. -- You have some provisions for writing different
>> code for C/C++, you could use that as well or instead, writing out
>> std::exit etc. explicitly.
>
>Yes, there will be separate skeleton files--if c++ is still supported,
>that is. I've spent a lot of time trying to cope with the differences
>in various C platforms, but at least that seemed possible. If the c++
>standards people are going to act like morons, then I'm not interested
>in wasting my time with their stupidity.

Well, the C++ standard is already here and fixed, it is formally called
ISO+IEC+14882-1998 and the ANSI version sells for $18 at ANSI. And there
will be no new revision for another couple of years.

So what's there is there.

I am looking a bit at writing my own Bison C++ skeleton file (variation of
lalr1.cc). One reason for me compiling the new Flex version is that I want
to figure out what your current locations look like, so I can sync it with
my Bison skeleton file.

I think that under C++, the only thing that makes sense is a class pure
lexer/parser: I am not sure there is any point in doing a fully function
pure parser, as one then, when needed can make a new class instantiation.

  Hans Aberg






reply via email to

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