A class representing a symbol or a potential symbol.
NaturalDocs:: | A class representing a symbol or a potential symbol. |
Implementation | |
Members | The class is implemented as a blessed arrayref. |
Modification Functions | |
New | Creates and returns a new object. |
AddDefinition | Adds a symbol definition. |
ChangeDefinition | Changes the information about an existing definition. |
DeleteDefinition | Removes a symbol definition. |
AddReference | Adds a reference that can be interpreted as this symbol. |
DeleteReference | Deletes a reference that can be interpreted as this symbol. |
DeleteAllReferences | Removes all references that can be interpreted as this symbol. |
Information Functions | |
IsDefined | Returns whether the symbol is defined anywhere or not. |
IsDefinedIn | Returns whether the symbol is defined in the passed FileName. |
Definitions | Returns an array of all the FileNames that define this symbol. |
GlobalDefinition | Returns the FileName that contains the global definition of this symbol, or undef if the symbol isn’t defined. |
TypeDefinedIn | Returns the TopicType of the symbol defined in the passed FileName, or undef if it’s not defined in that file. |
GlobalType | Returns the TopicType of the global definition, or undef if the symbol isn’t defined. |
PrototypeDefinedIn | Returns the prototype of symbol defined in the passed FileName, or undef if it doesn’t exist or is not defined in that file. |
GlobalPrototype | Returns the prototype of the global definition. |
SummaryDefinedIn | Returns the summary of symbol defined in the passed FileName, or undef if it doesn’t exist or is not defined in that file. |
GlobalSummary | Returns the summary of the global definition. |
HasReferences | Returns whether the symbol can be interpreted as any references. |
References | Returns an array of all the reference strings that can be interpreted as this symbol. |
ReferencesAndScores | Returns a hash of all the references that can be interpreted as this symbol and their scores. |
The class is implemented as a blessed arrayref. The following constants are its members.
DEFINITIONS | A hashref of all the files which define this symbol. The keys are the FileNames, and the values are NaturalDocs::SymbolTable::SymbolDefinition objects. If no files define this symbol, this item will be undef. |
GLOBAL_DEFINITION | The FileName which defines the global version of the symbol, which is what is used if a file references the symbol but does not have its own definition. If there are no definitions, this item will be undef. |
REFERENCES | A hashref of the references that can be interpreted as this symbol. This doesn’t mean these references necessarily are. The keys are the reference strings, and the values are the scores of the interpretations. If no references can be interpreted as this symbol, this item will be undef. |
sub AddDefinition #( file, type, prototype, summary )
Adds a symbol definition. If this is the first definition for this symbol, it will become the global definition. If the definition already exists for the file, it will be ignored.
file | The FileName that defines the symbol. |
type | The TopicType of the definition. |
prototype | The prototype of the definition, if applicable. Undef otherwise. |
summary | The summary for the definition, if applicable. Undef otherwise. |
Whether this provided the first definition for this symbol.
sub ChangeDefinition #( file, type, prototype, summary )
Changes the information about an existing definition.
file | The FileName that defines the symbol. Must exist. |
type | The new TopicType of the definition. |
prototype | The new prototype of the definition, if applicable. Undef otherwise. |
summary | The new summary of the definition, if applicable. Undef otherwise. |
sub DeleteDefinition #( file )
Removes a symbol definition. If the definition served as the global definition, a new one will be selected.
file | The FileName which contains definition to delete. |
Whether that was the only definition, and the symbol is now undefined.
sub IsDefinedIn #( file )
Returns whether the symbol is defined in the passed FileName.
sub Definitions
Returns an array of all the FileNames that define this symbol. If none do, will return an empty array.
sub GlobalDefinition
Returns the FileName that contains the global definition of this symbol, or undef if the symbol isn’t defined.
sub GlobalType
Returns the TopicType of the global definition, or undef if the symbol isn’t defined.
sub PrototypeDefinedIn #( file )
Returns the prototype of symbol defined in the passed FileName, or undef if it doesn’t exist or is not defined in that file.
sub SummaryDefinedIn #( file )
Returns the summary of symbol defined in the passed FileName, or undef if it doesn’t exist or is not defined in that file.
Creates and returns a new object.
sub New
Adds a symbol definition.
sub AddDefinition #( file, type, prototype, summary )
Changes the information about an existing definition.
sub ChangeDefinition #( file, type, prototype, summary )
Removes a symbol definition.
sub DeleteDefinition #( file )
Adds a reference that can be interpreted as this symbol.
sub AddReference #( referenceString, score )
Deletes a reference that can be interpreted as this symbol.
sub DeleteReference #( referenceString )
Removes all references that can be interpreted as this symbol.
sub DeleteAllReferences
Returns whether the symbol is defined anywhere or not.
sub IsDefined
Returns whether the symbol is defined in the passed FileName.
sub IsDefinedIn #( file )
Returns an array of all the FileNames that define this symbol.
sub Definitions
Returns the FileName that contains the global definition of this symbol, or undef if the symbol isn’t defined.
sub GlobalDefinition
Returns the TopicType of the symbol defined in the passed FileName, or undef if it’s not defined in that file.
sub TypeDefinedIn #( file )
Returns the TopicType of the global definition, or undef if the symbol isn’t defined.
sub GlobalType
Returns the prototype of symbol defined in the passed FileName, or undef if it doesn’t exist or is not defined in that file.
sub PrototypeDefinedIn #( file )
Returns the prototype of the global definition.
sub GlobalPrototype
Returns the summary of symbol defined in the passed FileName, or undef if it doesn’t exist or is not defined in that file.
sub SummaryDefinedIn #( file )
Returns the summary of the global definition.
sub GlobalSummary
Returns whether the symbol can be interpreted as any references.
sub HasReferences
Returns an array of all the reference strings that can be interpreted as this symbol.
sub References
Returns a hash of all the references that can be interpreted as this symbol and their scores.
sub ReferencesAndScores