NaturalDocs::SymbolTable::Reference

A class representing a symbol or a potential symbol.

Summary
NaturalDocs::SymbolTable::ReferenceA class representing a symbol or a potential symbol.
Implementation
MembersThe class is implemented as a blessed arrayref.
Modification Functions
NewCreates and returns a new object.
AddDefinitionAdds a reference definition.
DeleteDefinitionRemoves a reference definition.
AddInterpretationAdds a symbol that this reference can be interpreted as.
DeleteInterpretationDeletes a symbol that this reference can be interpreted as.
DeleteAllInterpretationsButCurrentDeletes all interpretations except for the current one.
SetCurrentInterpretationChanges the current interpretation.
Information Functions
DefinitionsReturns an array of all the FileNames that define this reference.
IsDefinedReturns whether the reference has any definitions or not.
IsDefinedInReturns whether the reference is defined in the passed FileName.
InterpretationsReturns an array of all the SymbolStrings that this reference can be interpreted as.
InterpretationsAndScoresReturns a hash of all the SymbolStrings that this reference can be interpreted as and their scores.
HasCurrentInterpretationReturns whether the reference has a current interpretation or not.
CurrentInterpretationReturns the SymbolString of the current interpretation, or undef if none.
CurrentScoreReturns the score of the current interpretation, or undef if none.

Implementation

Members

The class is implemented as a blessed arrayref.  The following constants are its members.

DEFINITIONSAn existence hashref of the FileNames that define this reference.
INTERPRETATIONSA hashref of the possible interpretations of this reference.  The keys are the SymbolStrings and the values are the scores.
CURRENT_INTERPRETATIONThe 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.

Modification Functions

New

sub New

Creates and returns a new object.

AddDefinition

sub AddDefinition #(file)

Adds a reference definition.

Parameters

fileThe FileName that defines the reference.

DeleteDefinition

sub DeleteDefinition #(file)

Removes a reference definition.

Parameters

fileThe FileName which has the definition to delete.

AddInterpretation

sub AddInterpretation #(symbol,
score)

Adds a symbol that this reference can be interpreted as.

Parameters

symbolThe SymbolString.
scoreThe score of this interpretation.

DeleteInterpretation

sub DeleteInterpretation #(symbol)

Deletes a symbol that this reference can be interpreted as.

Parameters

symbolThe SymbolString to delete.

DeleteAllInterpretationsButCurrent

sub DeleteAllInterpretationsButCurrent

Deletes all interpretations except for the current one.

SetCurrentInterpretation

sub SetCurrentInterpretation #(symbol)

Changes the current interpretation.  The new one must already have been added via AddInterpretation().

Parameters

symbolThe <SymbolString>l to make the current interpretation.  Can be set to undef to clear it.

Information Functions

Definitions

sub Definitions

Returns an array of all the FileNames that define this reference.  If none do, returns an empty array.

IsDefined

sub IsDefined

Returns whether the reference has any definitions or not.

IsDefinedIn

sub IsDefinedIn #(file)

Returns whether the reference is defined in the passed FileName.

Interpretations

sub Interpretations

Returns an array of all the SymbolStrings that this reference can be interpreted as.  If none, returns an empty array.

InterpretationsAndScores

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.

HasCurrentInterpretation

sub HasCurrentInterpretation

Returns whether the reference has a current interpretation or not.

CurrentInterpretation

sub CurrentInterpretation

Returns the SymbolString of the current interpretation, or undef if none.

CurrentScore

sub CurrentScore

Returns the score of the current interpretation, or undef if none.

sub New
Creates and returns a new object.
sub AddDefinition #(file)
Adds a reference definition.
sub DeleteDefinition #(file)
Removes a reference definition.
sub AddInterpretation #(symbol,
score)
Adds a symbol that this reference can be interpreted as.
sub DeleteInterpretation #(symbol)
Deletes a symbol that this reference can be interpreted as.
sub DeleteAllInterpretationsButCurrent
Deletes all interpretations except for the current one.
sub SetCurrentInterpretation #(symbol)
Changes the current interpretation.
sub Definitions
Returns an array of all the FileNames that define this reference.
A string representing the absolute, platform-dependent path to a file.
sub IsDefined
Returns whether the reference has any definitions or not.
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.
A scalar which encodes a normalized array of identifier strings representing a full or partially-resolved symbol.
sub InterpretationsAndScores
Returns a hash of all the SymbolStrings that this reference can be interpreted as and their scores.
sub HasCurrentInterpretation
Returns whether the reference has a current interpretation or not.
sub CurrentInterpretation
Returns the SymbolString of the current interpretation, or undef if none.
sub CurrentScore
Returns the score of the current interpretation, or undef if none.
Close