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 reference definition. |
DeleteDefinition | Removes a reference definition. |
AddInterpretation | Adds a symbol that this reference can be interpreted as. |
DeleteInterpretation | Deletes a symbol that this reference can be interpreted as. |
DeleteAllInterpretationsButCurrent | Deletes all interpretations except for the current one. |
SetCurrentInterpretation | Changes the current interpretation. |
Information Functions | |
Definitions | Returns an array of all the FileNames that define this reference. |
IsDefined | Returns whether the reference has any definitions or not. |
IsDefinedIn | Returns whether the reference is defined in the passed FileName. |
Interpretations | Returns an array of all the SymbolStrings that this reference can be interpreted as. |
InterpretationsAndScores | Returns a hash of all the SymbolStrings that this reference can be interpreted as and their scores. |
HasCurrentInterpretation | Returns whether the reference has a current interpretation or not. |
CurrentInterpretation | Returns the SymbolString of the current interpretation, or undef if none. |
CurrentScore | Returns the score of the current interpretation, or undef if none. |
The class is implemented as a blessed arrayref. The following constants are its members.
DEFINITIONS | An existence hashref of the FileNames that define this reference. |
INTERPRETATIONS | A hashref of the possible interpretations of this reference. The keys are the SymbolStrings and the values are the scores. |
CURRENT_INTERPRETATION | The interpretation currently used as the reference target. It will be the interpretation with the highest score that is actually defined. If none are defined, this item will be undef. |
sub AddDefinition #( file )
Adds a reference definition.
file | The FileName that defines the reference. |
sub DeleteDefinition #( file )
Removes a reference definition.
file | The FileName which has the definition to delete. |
sub AddInterpretation #( symbol, score )
Adds a symbol that this reference can be interpreted as.
symbol | The SymbolString. |
score | The score of this interpretation. |
sub DeleteInterpretation #( symbol )
Deletes a symbol that this reference can be interpreted as.
symbol | The SymbolString to delete. |
sub SetCurrentInterpretation #( symbol )
Changes the current interpretation. The new one must already have been added via AddInterpretation().
symbol | The <SymbolString>l to make the current interpretation. Can be set to undef to clear it. |
sub Definitions
Returns an array of all the FileNames that define this reference. If none do, returns an empty array.
sub IsDefinedIn #( file )
Returns whether the reference is defined in the passed FileName.
sub Interpretations
Returns an array of all the SymbolStrings that this reference can be interpreted as. If none, returns an empty array.
sub InterpretationsAndScores
Returns a hash of all the SymbolStrings that this reference can be interpreted as and their scores. The keys are the SymbolStrings and the values are the scores. If none, returns an empty hash.
sub CurrentInterpretation
Returns the SymbolString of the current interpretation, or undef if none.
Creates and returns a new object.
sub New
Adds a reference definition.
sub AddDefinition #( file )
Removes a reference definition.
sub DeleteDefinition #( file )
Adds a symbol that this reference can be interpreted as.
sub AddInterpretation #( symbol, score )
Deletes a symbol that this reference can be interpreted as.
sub DeleteInterpretation #( symbol )
Deletes all interpretations except for the current one.
sub DeleteAllInterpretationsButCurrent
Changes the current interpretation.
sub SetCurrentInterpretation #( symbol )
Returns an array of all the FileNames that define this reference.
sub Definitions
Returns whether the reference has any definitions or not.
sub IsDefined
Returns whether the reference is defined in the passed FileName.
sub IsDefinedIn #( file )
Returns an array of all the SymbolStrings that this reference can be interpreted as.
sub Interpretations
Returns a hash of all the SymbolStrings that this reference can be interpreted as and their scores.
sub InterpretationsAndScores
Returns whether the reference has a current interpretation or not.
sub HasCurrentInterpretation
Returns the SymbolString of the current interpretation, or undef if none.
sub CurrentInterpretation
Returns the score of the current interpretation, or undef if none.
sub CurrentScore