protected:
virtual int LexerInput( char* buf, int max_size );
virtual void LexerOutput( const char* buf, int size );
+ virtual void LexerError( const char* msg );
void yyunput( int c, char* buf_ptr );
int yyinput();
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
+%-
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+%+
+#define YY_FATAL_ERROR(msg) LexerError( msg )
+%*
#endif
/* Default declaration of generated scanner - a define so the user can
}
default:
-#ifdef FLEX_DEBUG
-%-
- printf( "action # %d\n", yy_act );
-%+
- cout << "action # " << yy_act << '\n';
-%*
-#endif
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
}
+%-
#ifdef YY_USE_PROTOS
static void yy_fatal_error( const char msg[] )
#else
char msg[];
#endif
{
-%-
(void) fprintf( stderr, "%s\n", msg );
+ exit( 1 );
+ }
+
%+
+
+void yyFlexLexer::LexerError( const char msg[] )
+ {
cerr << msg << '\n';
-%*
exit( 1 );
}
+%*
/* Redefine yyless() so it works in section 3 code. */