[Uml-user] Problems with tokenizer.l, flex, and ISO C++ compliant Compilers

Andreas Borchert borchert at mathematik.uni-ulm.de
Mon Oct 21 07:45:05 UTC 2002


Hello,

UML 1.1 beta [12] comes with tokenizer.l which requires flex to
be translated to tokenizer.cc. UML 1.1 beta 1 was shipped with a
working tokenizer.cc.  UML 1.1 beta 2, however, was shipped just with
tokenizer.l. Hence, tokenizer.cc must be rebuild.

Unfortunately, the last official release of flex I am aware of (2.5.4a,
released in July 1997, to be found in the non-gnu/flex subdirectory
of all GNU mirrors) is not prepared to work with ISO C++ compliant
compilers like g++ 3.2, i.e.

  - it includes <iostream.h> instead of <iostream>, and
  - it does not take care of name spaces.

This problem is well-known and was discussed several times on the flex
mailing list <help-flex at gnu.org>. John W. Millaway told this ``is in the
works for the next release of flex'' in August 2001 [1] but apparently no
new version was released since then. Curtis L. Janssen provided a quick
patch [2] that, as I found out, does not solve all the problems with g++
3.2. To be able to compile ULM 1.1 beta 2, I extended the flex patch [3].

tokenizer.cc as shipped with ULM 1.1 beta 1 was not generated by an
unpatched release of 2.5.4a. Apparently, some Linux distributors tried to
solve this problem as well. There flex patch is however less portable as
it attempts to fix the problem using a flooding ``using namespace std''
declaration and it does not attempt to support older g++ releases that
do not provide <iostream> instead of <iostream.h>.

I would recommend to address this problem in the INSTALL file.

Andreas.

References:
[1] Comment by John W. Millaway
    http://www.geocrawler.com/archives/3/353/2001/8/0/6474874/
[2] Flex Patch by Curtis L. Janssen:
    http://www.geocrawler.com/archives/3/353/2001/8/0/6350956/
[3] My Patch for flex 2.5.4a:
    ftp://ftp.mathematik.uni-ulm.de/pub/soft/flex/flex.patch

-- 
Dr. Andreas F. Borchert, SAI, Universitaet Ulm | One should make everything
http://www.mathematik.uni-ulm.de/sai/borchert/ | as simple as possible, but
Helmholtzstrasse 18, E02, Tel +49 731 50-23572 | no simpler. -- A. Einstein




More information about the umbrello mailing list