Related articles |
---|
a tool for partial parsing? briank@leland.Stanford.EDU (1995-11-14) |
Re: a tool for partial parsing? mtimmerm@microstar.com (1995-11-20) |
Newsgroups: | comp.compilers |
From: | mtimmerm@microstar.com (Matt Timmermans) |
Keywords: | parse, yacc |
Organization: | Microstar Software Ltd. |
References: | 95-11-123 |
Date: | Mon, 20 Nov 1995 15:35:28 GMT |
(briank@leland.Stanford.EDU (Brian E Korver))
| I'd like a version of (something like) yacc that will return and allow
| reentrance mid-parse. In other words, instead of having the parser
| drive the whole program, I want a front end to drive the parser.
Table-driven parsers, like those generated by yacc, naturally lend
themselves to running in a push-fed manner. If you look at the code
generated for yy_parse(), you'll find it relatively easy to rewrite in the
form yyparse(int token). We had to do this here for unmentionable reasons.
Further, the code generated for yy_parse() is always the same except, of
course, for the big switch statement that handles the actions. Depending
on your implementation of yacc, you should find this code stored simply as
a bunch of strings in the yacc source, which you can replace with your new
version.
</Matt>
--------------------------------------------------------------
Matt Timmermans | Phone: +1 613 727-5696
Microstar Software Ltd. | Fax: +1 613 727-9491
34 Colonnade Rd. North | BBS: +1 613 727-5272
Nepean Ontario CANADA K2E-7J6 | E-mail: mtimmerm@microstar.com
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.