NaturalDocs:: SymbolTable:: SymbolA class representing a symbol or a potential symbol. Summary | A class representing a symbol or a potential symbol. | | | | The class is implemented as a blessed arrayref. | | | | Creates and returns a new object. | | Adds a symbol definition. | | Changes the information about an existing definition. | | Removes a symbol definition. | | Adds a reference that can be interpreted as this symbol. | | Deletes a reference that can be interpreted as this symbol. | | Removes all references that can be interpreted as this symbol. | | | | Returns whether the symbol is defined anywhere or not. | | Returns whether the symbol is defined in the passed file. | | Returns an array of all the files that define this symbol. | | Returns the file that contains the global definition of this symbol, or undef if the symbol isn’t defined. | | Returns the type of symbol defined in the passed file, or undef if it’s not defined in that file. | | Returns the type of the global definition. | | Returns the prototype of symbol defined in the passed file, or undef if it doesn’t exist or is not defined in that file. | | Returns the prototype of the global definition. | | Returns the summary of symbol defined in the passed file, or undef if it doesn’t exist or is not defined in that file. | | Returns the summary of the global definition. | | Returns whether the symbol can be interpreted as any references. | | Returns an array of all the references that can be interpreted as this symbol. | | Returns a hash of all the references that can be interpreted as this symbol and their scores. |
MembersThe 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 file names, and the values are NaturalDocs::SymbolTable::SymbolDefinition objects. If no files define this symbol, this item will be undef. | | GLOBAL_DEFINITION | The name of the file 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. |
NewCreates and returns a new object. AddDefinition| 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. Parameters| file | The file that defines the symbol. | | type | The topic type of the definition. One of <Topic Types>. | | prototype | The prototype of the definition, if applicable. Undef otherwise. | | summary | The summary for the definition, if applicable. Undef otherwise. |
ChangeDefinition| sub ChangeDefinition # | ( | file, | | | type, prototype, | | | summary | ) | |
|
Changes the information about an existing definition. Parameters| file | The file that defines the symbol. Must exist. | | type | The new topic type of the definition. One of <Topic Types>. | | prototype | The new prototype of the definition, if applicable. Undef otherwise. | | summary | The new summary of the definition, if applicable. Undef otherwise. |
DeleteDefinitionsub DeleteDefinition #(file) |
Removes a symbol definition. If the definition served as the global definition, a new one will be selected. Parameters| file | The definition to delete. |
AddReference| sub AddReference # | ( | referenceString, | | | score | ) | |
|
Adds a reference that can be interpreted as this symbol. It can be, but not necessarily is. Parameters| referenceString | The string of the reference. | | score | The score of this interpretation. |
DeleteReferencesub DeleteReference #(referenceString) |
Deletes a reference that can be interpreted as this symbol. Parameters| referenceString | The string of the reference to delete. |
DeleteAllReferencesRemoves all references that can be interpreted as this symbol. IsDefinedReturns whether the symbol is defined anywhere or not. If it’s not, that means it’s just a potential interpretation of a reference. IsDefinedInReturns whether the symbol is defined in the passed file. DefinitionsReturns an array of all the files that define this symbol. If none do, will return an empty array. GlobalDefinitionReturns the file that contains the global definition of this symbol, or undef if the symbol isn’t defined. TypeDefinedInsub TypeDefinedIn #(file) |
Returns the type of symbol defined in the passed file, or undef if it’s not defined in that file. GlobalTypeReturns the type of the global definition. Will be one of <Topic Types> or undef if the symbol isn’t defined. PrototypeDefinedInsub PrototypeDefinedIn #(file) |
Returns the prototype of symbol defined in the passed file, or undef if it doesn’t exist or is not defined in that file. GlobalPrototypeReturns the prototype of the global definition. Will be undef if it doesn’t exist or the symbol isn’t defined. SummaryDefinedInsub SummaryDefinedIn #(file) |
Returns the summary of symbol defined in the passed file, or undef if it doesn’t exist or is not defined in that file. GlobalSummaryReturns the summary of the global definition. Will be undef if it doesn’t exist or the symbol isn’t defined. HasReferencesReturns whether the symbol can be interpreted as any references. ReferencesReturns an array of all the references that can be interpreted as this symbol. If none, will return an empty array. ReferencesAndScoresReturns a hash of all the references that can be interpreted as this symbol and their scores. The keys are the reference strings, and the values are the scores. If none, will return an empty hash. |