Symbol Table Design

Michael.Schneider@sdrc.com (Michael Schneider)
Mon, 1 Aug 1994 14:49:48 GMT

          From comp.compilers

Related articles
Symbol Table Design Michael.Schneider@sdrc.com (1994-08-01)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Michael.Schneider@sdrc.com (Michael Schneider)
Keywords: design, question
Organization: Compilers Central
Date: Mon, 1 Aug 1994 14:49:48 GMT
Status: RO

I'm gathering information to create an Abstract Data Type definition
for a symbol table. I'm looking for information on two levels:




Rough Requirements:


-Support Block Scoping
-Support Nested Data Types (Struct that contains Struct that Contains Struct..)
-Export/Import of Data in Nested Structure (C++ public, private, protected)
-Support User Defined Types
-Support Functions (pass by Value, pass by Reference,
                                        return of function and environment)
-Support Overloading of Function Names






LEVEL 1: Client Interface to symbol table data


This level defines the interface to the symbol table package.


Issues:
    - Interface for block scope


              StartBlock()
              EndBlock() ???


    - Interface for "named scope"
            Struct
                        {
                              int x;
                              struct
                                        {
                                              double x;
                                        }
                        }


    - Provide Type Definition for identifier
                Class - Varible, Function, Constant
                Type - Integer, Float, Struct, ...
                Type Modifier - const, static, .....






Level 2 : Implementation


How do you represent data shown above. I am interested in the
different methods to manage access to struct items (C++ public, private,
protected).


I am also interested in different methods to represent types for a symbol
table entry.


Rough Start ______________


Symbol Table(Symbol Table Nodes) - Hash table based on Identifier


Symbol Table Node (Identifier + SymbolTableNodeDef)


Numeric Symbol Table Node Def (Scope Id + (value) + Mem location )


Function Symbol Table Node Def ( ....) ?????????????


Structure Symbol Table Node Def (.....) ?????????????


Structure Item Symbol Table Node Def (.......) ??????????????


......




Thanks in advance for any pointer to articles, or personal experience


Mike


Mail @ Michael.Schneider@sdrc.com
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.