(no subject)

[email protected]
Newsgroups gmane.comp.lex.flex.general
Message-ID <[email protected]>
Hi,
I have created a tool for parsing buffers with flex. I just did the
following:

long STDCALL scanner(char* pBuffer)
{
    YY_BUFFER_STATE handle = yy_scan_string(pBuffer);
    long ret = yylex();
    yy_delete_buffer(handle);
    return ret;
}

Now to make it reentrant I use the -+ option and tried to make a workaround
for yy_scan_string:

long STDCALL scanner(std::istream* ist)
{
    FlexLexer* lexer = new yyFlexLexer();
    YY_BUFFER_STATE handle = lexer->yy_create_buffer((istream*)ist,100);
    long ret = lexer->yylex();
    lexer->yy_delete_buffer(handle);
    return ret;
}

The problem is that the lexer->yylex(); does not return a value. I`m not
really sure wheter there is another function for yy_scan_string or not.

thx in advance

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.