Re: re-enterant flex scanner
1 Dec 1999 23:43:48 -0500

          From comp.compilers

Related articles
re-enterant flex scanner (Amnon Cohen) (1999-11-16)
Re: re-enterant flex scanner (1999-12-01)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 1 Dec 1999 23:43:48 -0500
Organization: - Before you buy.
References: 99-11-079
Keywords: lex

    "Amnon Cohen" <> wrote:
> What is the easiest way to write a re-entrant scanner using flex?
> The C++ mode provides reentrancy, but not parsing from a string
> (yy_scan_buffer) which I need.

There are two ways you may achieve this:

(a) sub-classing yyFlexLexer and overriding the method LexerInput() so
that the first parameter of LexerInput() holds the string you want to

(b) creating an istrstream from the string you want to parse
(myInStream) and using the constructor yyFlexLexer(myInStream) to
obtain your tokenizer.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.