[fpc-devel] Differences between 'tsym' and 'tdef'

Paul Ishenin paul.ishenin at gmail.com
Fri May 18 00:30:02 CEST 2012


18.05.12 5:32, Joost van der Sluis wrote:

> Now I'm wondering if I should make this new field of Tpropertysym a TDef
> or a TSym(table). I know that Tsym can store itself to a ppu while a
> TDef does not. But There was something else, too. But I don't remember
> exactly.

TSym is about symbol and TDef is about definition. Each symbol is just 
an identifier which compiler founds during parse which may have > 1 
definitions (overloaded functions for example). A definition does not 
have a name (generally) but instead have information how to work with 
it. It may refer to no symbol at all. Both are stored in a TSymTable and 
ppu (look at TStoredDef).

A property does not have a definition of itself - only a symbol and list 
of fields/procedures for read,write,stored.

> So two questions: how should I extend the Tpropertysym for the extended
> attributes, and what is the dfference/use of Tdef and Tsym.

Does any symbol in delphi may have this information? If property has 
this information and you created a descendant property - will it have 
the same attributes as an ancestor property?

For now if only property may have this information then choose 
TPropertySym for storing it.

Best regards,
Paul Ishenin



More information about the fpc-devel mailing list