On Sat, Apr 06, 2002 at 07:56:56AM -0500, Jim Jagielski wrote: > Aaron Bannert wrote: > > > > I think a good way to take advantage of the filter system would be > > to break the input stream into buckets of two types: constant strings > > and PHP script code. As flex/bison needs to be fed more data (from the > > yyinput function I think it's called) it could just read data out of > > buckets on the brigade. As it generates data, it could spit out buckets > > that are fed back into the brigade and passed downstream. The same > > would happen to the "constant string" data buckets: they could just > > be quickly passed down the filter chain. > > > > Is this feasible in the SAPI domain? I know very little about the > > SAPI, but will it allow me to override the equivalent of the yyinput > > function? > > > > Cept because of the design of PHP/Zend, the entire file needs to be > slurped... think compiled instead of interpreted.
Hmm..well I can't say I know PHP/Zend that well, but from my experience w/ bison we can override the yyinput() function to pull data from anywhere. Then we can allow that to read from the output brigade until it has sucked down all the PHP buckets (or gets a PHP-END sentinel), then parse and execute the script. As for compilation vs. interpretation, it seemed to me (from my gdb adventures through the bison code the other day) that Zend will parse the input, build a parse tree (an "annotated parse tree" in compiler lingo), and then it traverses that tree (aka "executes it"). Unless it's caching the annotated parse tree anywhere I don't see how this would prevent us from using yyinput() as I've described above. It would have access to all the stuff inside the <? ?> and similiar tags all at once. -aaron -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php