logoalt Hacker News

kazinator • today at 3:55 AM • 1 reply • view on HN

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.


Replies

renjipanicker • today at 4:18 AM

Right, mid-rule actions genuinely let you shuttle state into a child before it's parsed, so it's not nothing.

But as you said, it's still one linear left-to-right pass. Appreciate you drawing the line precisely.