Related articles |
---|
YACC embedded actions mark_doherty@my-deja.com (1999-09-20) |
Re: YACC embedded actions anton@mips.complang.tuwien.ac.at (1999-09-20) |
Re: YACC embedded actions world!cfc@uunet.uu.net (Chris F Clark) (1999-09-24) |
From: | mark_doherty@my-deja.com |
Newsgroups: | comp.lang.ada,comp.compilers |
Date: | 20 Sep 1999 12:03:58 -0400 |
Organization: | Deja.com - Share what you know. Learn what you don't. |
Keywords: | yacc, question, comment |
I'm a writting an application that make use of 'expressions'
At the moment I can compute the expression. What I want to do is
extract the expression string.
This is so that the application I am writting, simple auto code
generator, can insert the expression string into the code and not the
evaluation of the expression (as it currently does).
I think I want to make use of embedded actions but I can find no
examples of this.
The expression rule I am using has been defined using recursion and
%left / %right / %noassoc directives.
This is NOT homework!
[There's really no easy automated way to do it. Have each token carry its
string representation along and glue the pieces together in each reduction.
Embedded rules wouldn't be useful here. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.