|How can I 'unroll' a YACC generated parser? firstname.lastname@example.org (1998-03-12)|
|Re: How can I 'unroll' a YACC generated parser? email@example.com (resslere) (1998-03-15)|
|Re: How can I 'unroll' a YACC generated parser? firstname.lastname@example.org (Orlando Llanes) (1998-03-18)|
|Date:||15 Mar 1998 00:24:19 -0500|
I think it would not be too hard to modify the skeleton of bison to do
Alternately, you might think about running a looping parser in a
separate thread drawing input from a queue. Then an "API" call would
just put tokens in the queue.
> What I need to do is 'unroll' a Yacc generated parser, so that the
> entrypoint of the parser is where the next token is provided. This
> would allow the API caller to pass a single token to the parser with
> each invocation.
[I'd think it's mostly a matter of moving all the stack temporaries into
statics, then reorganizing the parser so that it returns in the places
where now it calls yylex(). I do agree that on systems that support
threads, it's probably a lot easier to use a thread than to turn the
parser inside out. -John]
Return to the
Search the comp.compilers archives again.