bz@compres.uucp (Barbara Zino) (03/19/91)
> Is there a way in which I can use yacc to parse a grammar > one sentence, a production which makes up a sentence, at a time? There is a newly released lexer and parser generator named Yacc++ which contains built-in features to solve your problem. Yacc++ generates lexer and parser objects instead of monolithic lexer and parser programs. 1) Lexer and parser objects created by Yacc++ can operate in a "call-back mode" which retain the state of the parser between calls. Call-back objects are reentrant. This enables the parser to pick up where it last left off. This also enables "back and forth" parsing of multiple files. 2) Parser objects can have multiple entry points into the parse tree. This allows parsing of a subset of the language that was defined. You can parse branches of the parse tree, not just the entire tree. 3) Yacc++ provides a "remove" declaration which gives you control of what stays on the parse stack. Yacc++ was recently announced on comp.newprod. It is currently being shipped on Sun-3 and Sun-4's. A single user license is priced at $995. Porting to other platforms is available. Barbara Zino voice: (508) 435-5016 Compiler Resources, Inc. fax: (508) 435-4847 3 Proctor Street email: primerd!compres!bz Hopkinton, MA 01748 crackers!compres!bz -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.