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:52:52 +0200

At 17:32 +0200 2002/10/23, Hans-Bernhard Broeker wrote:
>So, IMHO, the code was broken for a long while--- it just went by
>unnoticed because the compilers hadn't caught up to the definition of the
>language, yet.  Now that they have, the problems show up.

I think this is important to point out, namely people get confused when C++
compilers finally catch up with the C++ standard:

A similar situation happened with the Bison C parser that was made so that
it compiled under C++ as well. Then people often could use its %union
feature under C++ compilers, as early C++ compilers did not check properly
that this in fact is illegal C++ for types having non-trivial constructors.
Then, when one switches to a C++ compiler that does the proper checks, the
code does not work anymore.

This C skeleton file also had some other problems with it, for example its
C stack would not invoke C++ copy constructors properly.

Such problems eventually led up to the current M4 approach, which opens up
the door not only for properly written C++ parsers, but also for other
languages, like Java, and perhaps for some functional languages as well.
Also, it becomes easier to implement different parser algorithms.

The problems for Flex should be much less, because it does not need to make
use of C++ containers and such and keep track of semantic values other that
copy over what the user writes down.

  Hans Aberg






reply via email to

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