A symbol table maps the names visible at a point of the program to their declarations. For block structure it supports four operations: open a scope, close it (forgetting what it declared), declare a name in the innermost scope, and look a name up, finding the innermost declaration.
main at three points, top of the stack up; x:15 is the x declared on line 15. At line 18 the lookup of x finds the inner one, declared on line 17; at line 20 the inner block has been popped and the outer x is visible again.