News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Arrays And The Symbol Table

Started by cman, October 27, 2009, 09:04:14 PM

Previous topic - Next topic

cman

Is it generally a good idea to add an entry into the symbol table for each member of an array? I've implemented a table using a record that maintains a linked list for each array name that contains information for each element. I'm starting to think this was a bad idea....

dedndave

without seeing your example, i can only guess what you mean - lol
if you have an array that has a large number of elements, it is not necessary to name each one
this is especially true for arrays that may grow dynamically

jj2007

As Dave wrote, it is unclear what you mean. If you have a string array of the type My$(1000), then I would expect a table containing two dword entries per element: start address and length. Why should you "name" each entry?

tenkey

cman,

I think that in your compiler designs, you are opting for replicating information instead of sharing information. It may seem easier to work with, but any speed advantages (if there are any) are outweighed by the tremendous data bloat you're creating.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

cman

Thanks for the input everyone! I thinking of storing information like "liveness" and "next use" data in the symbol table. I think now that would be best stored in the data struction holding the instructions ......