TBlockDeclaration

Declaration

TBlockDeclaration = class(TDeclaration)

Visibility

global

Immediate ancestor

TDeclaration

Immediate descendants

TClassDeclaration, TRootDeclaration, TUnitDeclaration, TInterfaceDeclaration

Source

defdriver.pas on line 280

Description

A declaration containing other declarations. This class is abstract. It should never be instantiated.

Members

Name

Type

Visibility

Synopsis

Create

constructor

public

Destroy

destructor

public

WriteOut

procedure

public

HasDeclarations

function

protected

Returns true if self contains some declarations, i.e. some declarations were declared in the block of self.

LastDeclaration

function

protected

Returns the most recently added declaration or nil if self contains no declarations.

FindDeclaration

function

protected

Finds a declaration with the name name in the declarations in the current block only.

SearchDeclaration

function

protected

Searches a declaration in all declarations starting from self.

FetchRelatedComment

function

protected

Fetches a related comment by calling SearchRelated.

IsDerivedFrom

function

protected

Returns true if decl is present among the ancestors of self.

WriteFromHashTable

procedure

protected

Writes links to declarations which are associated in the table with the name of self.

FillMap

procedure

protected

map Is a map of strings to TListAdt's.

StringsToDeclarations

procedure

protected

For each string in strs tires to find a declaration with this name by calling SearchDeclaration.

SortDeclarations

procedure

protected

Sorts decls according to the symbolType field as the primary key and to the Name fileld as the secondary key.

WriteDeclarations

procedure

protected

Writes out the declarations decl.

AddDeclaration

procedure

protected

Adds a declaration to the block declaration.

SearchRelated

procedure

protected

Searches for the nearest methods above and including self in the class hierarchy and with the name name.

PushAncestorsAtFront

procedure

protected

Should push all declarations considered to be ancestors of self at the front of deque.

WriteHead

procedure

protected

WriteMiddle

procedure

protected

WriteTail

procedure

protected

TBlockDeclaration

defdriver



TBlockDeclaration.Create

Declaration

constructor Create(adecl : TTextObject; aname : String; aancestors : TStrings; avisibility : String; avisibilitytype : TVisibilityType; asymboltype : String; alinenum : Cardinal; acomment : TComment; asection : TSection; aparentDecl : TBlockDeclaration);

Visibility

public

Related methods

TDeclaration.Create, TBasicDeclaration.Create

Source

defdriver.pas on line 362

Create

TBlockDeclaration

defdriver


TBlockDeclaration.Destroy

Declaration

destructor Destroy; override;

Visibility

public

Related methods

TDeclaration.Destroy, TBasicDeclaration.Destroy

Source

defdriver.pas on line 368

Destroy

TBlockDeclaration

defdriver


TBlockDeclaration.WriteOut

Declaration

procedure WriteOut; override;

Visibility

public

Related methods

TDeclaration.WriteOut

Source

defdriver.pas on line 369

WriteOut

TBlockDeclaration

defdriver


TBlockDeclaration.HasDeclarations

Declaration

function HasDeclarations : Boolean;

Visibility

protected

Source

defdriver.pas on line 330

Description

Returns true if self contains some declarations, i.e. some declarations were declared in the block of self.

HasDeclarations

TBlockDeclaration

defdriver


TBlockDeclaration.LastDeclaration

Declaration

function LastDeclaration : TDeclaration;

Visibility

protected

Source

defdriver.pas on line 333

Description

Returns the most recently added declaration or nil if self contains no declarations.

LastDeclaration

TBlockDeclaration

defdriver


TBlockDeclaration.FindDeclaration

Declaration

function FindDeclaration(name : String) : TDeclaration;

Visibility

protected

Source

defdriver.pas on line 338

Description

Finds a declaration with the name name in the declarations in the current block only.

FindDeclaration

TBlockDeclaration

defdriver


TBlockDeclaration.SearchDeclaration

Declaration

function SearchDeclaration(aname : String) : TBasicDeclaration;

Visibility

protected

Source

defdriver.pas on line 344

Description

Searches a declaration in all declarations starting from self. Performs a breadth-first search on the whole tree of all declarations, treating it as a graph and starting from self. (In fact, AllDeclarations table is used to speed up the search, bu the effect is roughly the same).

SearchDeclaration

TBlockDeclaration

defdriver


TBlockDeclaration.FetchRelatedComment

Declaration

function FetchRelatedComment(aname : String) : TComment;

Visibility

protected

Source

defdriver.pas on line 350

Description

Fetches a related comment by calling SearchRelated.

FetchRelatedComment

TBlockDeclaration

defdriver


TBlockDeclaration.IsDerivedFrom

Declaration

function IsDerivedFrom(decl : TBasicDeclaration) : Boolean;

Visibility

protected

Source

defdriver.pas on line 352

Description

Returns true if decl is present among the ancestors of self.

IsDerivedFrom

TBlockDeclaration

defdriver


TBlockDeclaration.WriteFromHashTable

Declaration

procedure WriteFromHashTable(table : TMap; heading : String);

Visibility

protected

Source

defdriver.pas on line 298

Description

Writes links to declarations which are associated in the table with the name of self. Writes a declaration only if it is either an immediate descendant of self or if self is an interface and the declaration implements it.

WriteFromHashTable

TBlockDeclaration

defdriver


TBlockDeclaration.FillMap

Declaration

procedure FillMap(map : TMap; strs : TStrings; decl : TDeclaration);

Visibility

protected

Source

defdriver.pas on line 305

Description

map Is a map of strings to TListAdt's. The procedure adds decl to each list mapped to by one of the strings in strs. If some strings in strs does not have an associated item in map, then creates a list for this item and inserts it into the map.

FillMap

TBlockDeclaration

defdriver


TBlockDeclaration.StringsToDeclarations

Declaration

procedure StringsToDeclarations(var decls : TArrayAdt; var unrecognized : TStrings; var strs : TStrings);

Visibility

protected

Source

defdriver.pas on line 312

Description

For each string in strs tires to find a declaration with this name by calling SearchDeclaration. If found adds this declaration to decls, otherwise adds the string to unrecognized. If decls or unrecognized is nil then creates them. Destroys strs.

StringsToDeclarations

TBlockDeclaration

defdriver


TBlockDeclaration.SortDeclarations

Declaration

procedure SortDeclarations;

Visibility

protected

Source

defdriver.pas on line 318

Description

Sorts decls according to the symbolType field as the primary key and to the Name fileld as the secondary key.

SortDeclarations

TBlockDeclaration

defdriver


TBlockDeclaration.WriteDeclarations

Declaration

procedure WriteDeclarations;

Visibility

protected

Source

defdriver.pas on line 326

Description

Writes out the declarations decl. First writes a table with the synopsis'es of all the declarations. Then writes a navigation panel and then the declarations themselves. The argument should be a vector of TDeclaration objects. Decls must be non-nil. Parent is the delaration to which decls belong. If there is no such declaration (i.e. decls are unit-level declarations), then parent should be nil.

WriteDeclarations

TBlockDeclaration

defdriver


TBlockDeclaration.AddDeclaration

Declaration

procedure AddDeclaration(decl : TDeclaration);

Visibility

protected

Source

defdriver.pas on line 335

Description

Adds a declaration to the block declaration.

AddDeclaration

TBlockDeclaration

defdriver


TBlockDeclaration.SearchRelated

Declaration

procedure SearchRelated(name : String; decls : TArrayAdt);

Visibility

protected

Source

defdriver.pas on line 348

Description

Searches for the nearest methods above and including self in the class hierarchy and with the name name. Adds found declarations to decls.

SearchRelated

TBlockDeclaration

defdriver


TBlockDeclaration.PushAncestorsAtFront

Declaration

procedure PushAncestorsAtFront(deque : TDequeAdt); virtual;

Visibility

protected

Source

defdriver.pas on line 355

Description

Should push all declarations considered to be ancestors of self at the front of deque.

PushAncestorsAtFront

TBlockDeclaration

defdriver


TBlockDeclaration.WriteHead

Declaration

procedure WriteHead; override;

Visibility

protected

Related methods

TDeclaration.WriteHead

Source

defdriver.pas on line 357

WriteHead

TBlockDeclaration

defdriver


TBlockDeclaration.WriteMiddle

Declaration

procedure WriteMiddle; override;

Visibility

protected

Related methods

TDeclaration.WriteMiddle

Source

defdriver.pas on line 358

WriteMiddle

TBlockDeclaration

defdriver


TBlockDeclaration.WriteTail

Declaration

procedure WriteTail; override;

Visibility

protected

Related methods

TDeclaration.WriteTail

Source

defdriver.pas on line 359

WriteTail

TBlockDeclaration

defdriver