[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parsing input from a stream...
From: |
John W. Millaway |
Subject: |
Re: Parsing input from a stream... |
Date: |
Thu, 31 Jan 2002 14:30:04 -0800 (PST) |
> > that you can pass extra data along in a reentrant lexer, but I'm having
> > trouble because I don't know the exact contract for the buffer
> > functions. (For example, should I assume that YY_INPUT will only ever
> > be called from a single place? How can I access the extra data from
> > that place? Is that data placed into a flex buffer? Is there a more
> > low level way of getting input to the lexer, since my MT buffers will be
> > around anyway?)
To answer all of these questions...
Assume YY_INPUT will be called when flex needs more bytes, but not called "from
one place"... why should that matter? YY_INPUT is called from within yylex() so
you can access any "extra data" that can be accessed from within actions. Yes,
there is a low-level way to get input into the lexer: yy_scan_buffer (you can't
get much more direct than this!)
> > Are there any plans/thoughts about making the buffer system
> > extensible and abstract? Do you think it would be possible/desirable
> > for me to attempt this, and could it be done without sacrificing
> > performance?
What kind of extensibility/abstraction are you thinking of? It's best to throw
out some ideas before diving in.
__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com