There are many ways to handle clouds in a symbol table. One very simple way is to have a separate table for each area and maintain a list of active areas.
Whenever a new area is introduced, you can create a table for it and add it to the top of the list of active areas. When you leave the scope, simply remove the header of the active scope list.
Usually I find that you do not want to destroy the table when you finish parsing the area. You may need this later to perform semantic analysis, create debugging information, etc.
source share