bisqwit / compiler_series

Material for the Creating a Compiler video lesson series.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the confusing $6 here, there seams to be only 5 parts to the rule

JamesWP opened this issue · comments

functions: functions identifier1 { ctx.defun($2); ++ctx; } paramdecls colon1 stmt1 { ctx.add_function(M($2), M($6)); --ctx; }

what am I missing here?

functions identifier1 { ctx.defun($2); ++ctx; } paramdecls colon1 stmt1

does { ctx.defun($2); ++ctx; } count as a part?

Yes, the semantic action counts as a part.