Rendered at 04:06:02 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
kazinator 11 minutes ago [-]
Yacc has mid-rule actions which can be used to propagate information from left siblings to right siblings, as well as to children (embedded nonterminal symbols).
Of course, it's not the same as having the parse tree all done from a previous pass and just walking it to do semantics.
The main purpose of Yacc-like programs is to let the programmer decide on how to build the tree: what details to include and how to represent it, or perhaps not to build one at all.
I just remembered that someone posted a number of times to the GNU Bison mailing list about some (Bison-like?) generator that builds the abstract syntax tree. It's proving challenging finding this in the archive. I will have to dig in my own inbox.
Of course, it's not the same as having the parse tree all done from a previous pass and just walking it to do semantics.
The main purpose of Yacc-like programs is to let the programmer decide on how to build the tree: what details to include and how to represent it, or perhaps not to build one at all.
I just remembered that someone posted a number of times to the GNU Bison mailing list about some (Bison-like?) generator that builds the abstract syntax tree. It's proving challenging finding this in the archive. I will have to dig in my own inbox.