Open rbbarbosa opened 10 months ago
Otherwise, generate an Unknown parent node, then: foreach child addchild(program, child) or modify the category from Unknown to Program
A good way to address this is to update tutorial IV according to:
program: program function | function function: IDENTIFIER '(' parameters ')' '=' expression
This exposes the problem of creating lists of nodes. Initially, the "function" production creates a Program node directly, because it is the top-level start production.
In tutorial IV, should we include an example where node lists are created and placed on the value stack? Example:
%union{ char lexeme; struct node node; struct node_list *node_list; }