help-flex
[Top][All Lists]
Advanced

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

Re: cin, cout, and cerr undefined


From: Hans Aberg
Subject: Re: cin, cout, and cerr undefined
Date: Sat, 2 Oct 2004 18:51:15 +0200

At 00:29 -0400 2004/10/02, Tim Zimmerlin wrote:
>I am using the c++ and nostdinit options with flex 2.5.4 on Cygwin on
>Windows Server 2003. I have written my own LexerInput() function, so
>yyin is not used. In fact stream IO is not used.

When Flex 2.5.4 was written, the C++ "namespace" construction did not
exist. In later C++, and compilers which support it, the standard streams
are named std::cin, etc. Therefore, in order to fix the problem, either
prefix those names in the Flex skeleton with "std::", or, alternatively,
you may try to throw in a "using namespace std" somewhere. If you change
the skeleton file, you can either make a new one, and call it explicitly
via a startup command, or change the one that Flex compiles into as text
and uses as default (then recompile Flex).

At 13:21 +0200 2004/10/02, Hans-Bernhard Broeker wrote:
>Both your source and the version of flex you're using are a good deal
>older than the compiler you're likely to have installed on that
>new server box.  While the C++ language hasn't changed in that time,
>the compiler's level of adherence to the language definition has.

So, in fact, C++ has changed since Flex 2.5.4 has been written. In
addition, there are two C++ standard revisions:
  ISO+IEC+14882-1998
  ISO/IEC 14882:2003(E).

There are in fact some differences between these revisions, significant
when implementing at least Bison skeleton files. For example, the latter
revision guarantees that the std::deque container is implemented in chunks,
and does not by not need to use operator=() in order to expand. So it seems
suitable to use this container for parser stack.

  Hans Aberg






reply via email to

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