help-flex
[Top][All Lists]
Advanced

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

Re: Parsing input from a string...


From: John W. Millaway
Subject: Re: Parsing input from a string...
Date: Thu, 31 Jan 2002 07:52:24 -0800 (PST)

> >> #define YYPARSE_PARAM parm #define YYLEX_PARAM parm
> >> 
> >> See also YY_DECL in flex.
> >> 
> Dave> Right, I'm using these already.  The problem I'm having is that
> Dave> I can't access the 'parm' variable passed to the function that
> Dave> YY_INPUT gets inserted, consequently I can't reference 'parm' in
> Dave> my YY_INPUT.  The way flex does buffering internally is not well
> Dave> documented, it seems.  Do you know how this stuff works?

YY_INPUT is a macro, so you may access 'parm' directly from within YY_INPUT.

What do you want to know about the buffering? By default, flex requests as many
bytes "up front" as it can get, or as much as it needs to match something.
Obviously, you can change this behavior by returning a different # of bytes
from YY_INPUT than flex requested. 

In the next release, you will be able to change the initial buffer size.
Currently, people do this with sed/perl by redefining YY_BUF_SIZE, which is by
default 16k.


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com



reply via email to

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