Re: attribute grammars

Derk Gwen <derkgwen@HotPOP.com>
1 Nov 2003 12:01:00 -0500

          From comp.compilers

Related articles
attribute grammars rosing@peakNOSPAMfive.com (MattR) (2003-10-31)
Re: attribute grammars derkgwen@HotPOP.com (Derk Gwen) (2003-11-01)
Attribute grammars compilers@ima.UUCP (1986-01-13)
attribute grammars vestal@src.honeywell.com (1989-11-08)
| List of all articles for this month |

From: Derk Gwen <derkgwen@HotPOP.com>
Newsgroups: comp.compilers
Date: 1 Nov 2003 12:01:00 -0500
Organization: Quick STOP Groceries
References: 03-10-149
Keywords: parse, attribute
Posted-Date: 01 Nov 2003 12:01:00 EST

# Hi, I'm looking at easier ways to write attribute grammars for a
# preprocessor I have. Speed is not as important as being able to just
# quickly write the grammar (this is for a preprocessor and changing
# attribution is common). Currently I just manually walk over the ast


Create a prolog program from the attribute equations. Do the context
free parse to create the parse tree, and use that tree as input to
create the attribute decorated parse tree with unification and
resolution. You don't have to worry what's synthesised and what's
inheritted, or how many passes you need.


I have code to do this from vW2 grammars, but it's too slow and crufty
to release yet.
--
Derk Gwen http://derkgwen.250free.com/html/index.html


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.