You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lab2, we have many classes and derived classes, this seems like a linked list type structure and it is shown to create an AST but I can't find where it does this, like the actual linking of nodes and creation of the tree.
Is it done in the parser where we do things like $$ = $1 ? Is this linking the node to the previous one from the grammar>?
The text was updated successfully, but these errors were encountered:
Yes, the parser is the one that generates the AST. You do that by allocating new nodes wherever they are needed, and otherwise just assigning the pointer that was already constructed by one of the nodes lower down in the parser returned ($$ = $1).
I wouldn't call it a linked list though, it's just a tree structure, with various different nodes that link to more nodes.
In lab2, we have many classes and derived classes, this seems like a linked list type structure and it is shown to create an AST but I can't find where it does this, like the actual linking of nodes and creation of the tree.
Is it done in the parser where we do things like $$ = $1 ? Is this linking the node to the previous one from the grammar>?
The text was updated successfully, but these errors were encountered: