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

3.2 Symbol Tables and a Scanner

Though as suggested above and in Figs. 3.1 and 3.2, Symbol Tables are created during the Scanner phase of a compiler, their real use and manipulations will be needed during the semantic analysis phase and as such we postpone full discussion of Symbol Table handling techniques till Section 5.5 in Chapter 5. However, the Scanner does initiate building up of the Symbol Table and here we discuss building a skeleton Symbol Table, with whatever information is available with the Scanner.

A general discussion about Symbol Tables is given in Appendix B, Section B.2.3.

In anticipation of later developments, we build the Symbol Table as a binary search tree (BST). Though a BST can have worst-case search time as bad as a linked ...

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