O'Reilly logo

Compilers: Principles and Practice by Himanshu B. Dave, Parag H. Dave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.5 Symbol Table Handling

We already had a preliminary discussion about Symbol Tables in Chapter 3, Section 3.2. A Symbol Table exists throughout the compilation steps. Major operations required for a symbol table are:

  • insertion,
  • search,
  • modify contents of a node,
  • deletions are purely logical (depending on scope and visibility) and not physical,
  • keywords are often stored in the symbol table before the compilation process begins, so that Scanner and Parser are able to trap them.

The Symbol Table is accessed at every stage of the compilation process:

Scanning: Insertion of new identifiers.

Parsing: Access to ensure that an operand exists.

Semantic analysis:

  • Determination of types of identifiers from declarations,
  • Type checking to ensure that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required