[Top][All Lists]

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

Reentrant yy_scan_string impossible?

From: Bart Kus
Subject: Reentrant yy_scan_string impossible?
Date: Mon, 06 Sep 2010 21:07:43 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20100802 Thunderbird/3.1.2


Using flex 2.5.35 and bison 2.4.2.  Setting up a yy_scan_string() like so:

    yyscan_t scanner;
    YY_BUFFER_STATE lex_buff = cli_scan_string(cmd, scanner);
        clierror(*this, cmd);
    cli_delete_buffer(lex_buff, scanner);

Prefix="cli" for both flex and bison. Get a segfault on first operation tried. When running through gdb, the fault is hit in the flex code, but it seems like a user issue, or less likely, a bison design issue. cliparse() calls clilex() with what seems like its own yyscanner variable. Looking at the call syntax, there's no place in where I tell cliparse(), "hey, use this yyscanner when talking to clilex". It's probably just trying to read from yyin, instead of processing my buffer.

How do I tell bison about my custom flex scanner instance?


reply via email to

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