7.0 Introduction

7.1 Symbol Attributes

7.2 Symbol Table Operations

7.3 External Data Structures

7.4 Internal Data Structures

7.5 Other Symbol Table Techniques

7.6 Summary

Web References

Exercises

Class and Related Attributes

A name in a program can represent a variable, a constant, a parameter, a record or union type, a field in a record or union, a procedure or function, a macro, an array, a label, or a file, to name just a few possibilities. These are values for a symbol's class. Of course, not all languages have all these possibilities - FORTRAN has no records - or they may be described using other terms - C uses the term union while Pascal uses the term record.

Once a name's class is known, the rest of the information may vary depending on the value of the class attribute. For example, if a name is of class variable, or constant, or parameter, to name a few, there is another attribute which records the name's type.

For a name whose class is procedure or function, there are other attributes which indicate the number of parameters, the parameters, themselves, and the result type for functions.

For a name whose class is array, other reasonable attributes are the number of dimensions and the array bounds (if known).

For a name whose class is file, other attributes might be the record size, the record type, (sequential) etc.

Again, the possible classes for a name vary with the language, as do the other attributes. (See Exercise 1.

Send questions and comments to: Karen Lemone