help-flex
[Top][All Lists]
Advanced

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

flex-2.5.26 Error


From: Stevens, Del
Subject: flex-2.5.26 Error
Date: Wed, 29 Jan 2003 10:02:01 -0800

In using this version of flex, if found a generator problem that only rears
its head only if you redefine the YY_INPUT macro. There is an extra "\"
prior to the #endif that causes a compiler error.

This is what I did to cause the error:

In *.l file,

#undef YY_INPUT
#define YY_INPUT(a,b,c) (my_input(a,b,c))

This following to be generated in lex.yy.c (whether YY_INPUT redefined or
not).

#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
    if ( YY_G(yy_current_buffer)->yy_is_interactive ) \
        { \
        int c = '*'; \
        size_t n; \
        for ( n = 0; n < max_size && \
                 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
            buf[n] = (char) c; \
        if ( c == '\n' ) \
            buf[n++] = (char) c; \
        if ( c == EOF && ferror( yyin ) ) \
            YY_FATAL_ERROR( "input in flex scanner failed" ); \
        result = n; \
        } \
    else \
        { \
        errno=0; \
        while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)
) \
            { \
            if( errno != EINTR) \
                { \
                YY_FATAL_ERROR( "input in flex scanner failed" ); \
                break; \
                } \
            errno=0; \
            clearerr(yyin); \
            } \
        }
\ <=========== ERROR
#endif

The problem is in scan.c and can be fixed by removing the "\" line prior to
the #endif.

Del Stevens
Siemens Network Convergence, LLP
+1 561 981 7035
==






reply via email to

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