johnl@ima.UUCP (Compilers mailing list) (07/02/86)
I am trying to write a few retargetable code generators this summer, and I thought it would be real helpful if I had an attribute grammar parser generator to help. Specifically, I am looking for a YACC look-a-like that will allow a boolean variable to be associated with each production. At generation time there will be several ambiguous productions that will be resolved at run time by the boolean flags. This will enable/disable productions based upon semantic information. I have half an inkling to hack YACC to do this. But before I go off on a tangent, can someone point me towards an existing program/system that will do what I have described? I am not certain, but I suspect that a reasonable price for such a system can be accomodated. Jon Loeliger jdl@Purdue.ARPA Dept. of Computer Science jdl@mordred.cs.purdue.edu Purdue University {ihnp4, decvax, ucbvax,...}!purdue!jdl W. Lafayette, IN 47907 (317) 494-6180 [I did something like this in about 1978 with plain old ordinary yacc. The trick was to invent a bunch of fake tokens, and to write the ambiguous productions like this: thing ::= fake1 prod1 | fake2 prod2 | ... The lexer returned a fake token at appropriate times to guide the parser. It was the only way I could figure to parse Fortran, and it worked. -John] -- Send compilers mail to ima!compilers or, in a pinch to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbncca}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request