This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
semantic_tutorial [2015/11/09 21:31] deva [Step 5: Type checking] |
semantic_tutorial [2015/11/09 22:11] deva [Step 6: Fixing the memory leaks] |
||
---|---|---|---|
Line 130: | Line 130: | ||
==== Step 6: Fixing the memory leaks ==== | ==== Step 6: Fixing the memory leaks ==== | ||
+ | |||
+ | All the semantic values were created using the ''new'' keyword of C++. This means we have to delete them in order to avoid memory leakage. | ||
+ | * Review all the rules and delete the semantic values of the symbols on the right-hand side at the end of the corresponding C++ code fragments (change ''i'' to the appropriate number): | ||
+ | <code> | ||
+ | delete $i; | ||
+ | </code> | ||
+ |