#include <stdlib.h>
%+
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)
-#define THROW_NIL throw()
-#define STD std::
-#include <iosfwd>
-#else
-#define THROW_NIL
-#define STD
-#include <iostream.h>
+#ifdef __CPLUSPLUS
+#define FLEX_STD std::
+#include <iostream>
%*
#include <unistd.h>
%-
YY_G(yyin) = stdin;
%+
- yyin = &cin;
+ yyin = & FLEX_STD cin;
%*
if ( ! YY_G(yyout) )
%-
YY_G(yyout) = stdout;
%+
- yyout = &cout;
+ yyout = & FLEX_STD cout;
%*
if ( ! YY_G(yy_current_buffer) )
yy_delete_buffer( yy_current_buffer YY_CALL_LAST_ARG);
}
-void yyFlexLexer::switch_streams( STD istream* new_in, ostream* new_out )
+void yyFlexLexer::switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out )
{
if ( new_in )
{
YY_DECL_LAST_ARG
#endif
%+
-void yyFlexLexer::yyrestart( STD istream* input_file )
+void yyFlexLexer::yyrestart( FLEX_STD istream* input_file )
%*
{
if ( ! YY_G(yy_current_buffer) )
YY_DECL_LAST_ARG
#endif
%+
-YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( STD istream* file, int size )
+YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( FLEX_STD istream* file, int size )
%*
{
YY_BUFFER_STATE b;
#ifndef YY_NEVER_INTERACTIVE
extern "C" int isatty YY_PROTO(( int )) THROW_NIL ;
#endif
-void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, STD istream* file )
+void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, FLEX_STD istream* file )
%*
{
void yyFlexLexer::LexerError( yyconst char msg[] )
{
- cerr << msg << '\n';
+ FLEX_STD cerr << msg << '\n';
exit( YY_EXIT_FAILURE );
}
%*
defs1_offset = prolog_offset = action_offset = action_index = 0;
action_array[0] = '\0';
+ /* Enable C++ if program name ends with '+'. */
program_name = argv[0];
if ( program_name[0] != '\0' &&
{
arg = argv[0];
+ /* Stop at first non-option. */
if ( arg[0] != '-' || arg[1] == '\0' )
break;