The primary sources of semantic errors are undeclared names and type incompatibilities. Recovery from an undeclared name is rather straightforward. The first time the undeclared name is encountered , an entry can be made in the symbol table for that name with an attribute that is appropriate to the current context. For example, if missing declaration error of x is encountered, then the error-recovery routine enters the appropriate attribute for x in x 's symbol table, depending on the current context of x . A flag is then set in the x symbol table record to indicate that an attribute has been added, and to recover from an error or not in response to the declaration of x .