TDriver
Declaration
TDriver = class
Visibility
global
Immediate descendants
TDefaultDriver
Source
commonclasses.pas on line 387
Description
An abstract interface of a main program 'driver'. It performs all the basic high-level operations, parses comments, controls the generation of the document and provides the 'glue' to make everything work together. Drivers for specific languages should inherit from this class.
Members
Name
|
Type
|
Visibility
|
Synopsis
|
Create
|
constructor
|
public
|
asrcDirs - a list of directories to search for input files.
|
Destroy
|
destructor
|
public
|
|
RegisterUnit
|
function
|
public
|
Registeres the unit currently being parsed.
|
OpenUnit
|
function
|
public
|
Re-opens an already registered unit for parsing.
|
FindSection
|
function
|
public
|
Returns the section of the given declaration name or nil if not found.
|
OpenInputFile
|
function
|
public
|
Opens a file for reading and returns a file stream for this file.
|
ExistsInputFile
|
function
|
public
|
Returns true if a given file exists in one of the source directories.
|
ValidateInputFile
|
function
|
public
|
Validates the input file.
|
Run
|
procedure
|
public
|
Runs the driver.
|
RegisterFile
|
procedure
|
public
|
Registeres the given file to be processed.
|
ProvideUnitInfo
|
procedure
|
public
|
Provides additional information on the unit currently being parsed.
|
ProvideUnitImplementationInfo
|
procedure
|
public
|
Provides additional information on the implementation of the unit currently being parsed.
|
RegisterDeclaration
|
procedure
|
public
|
Registeres a declaration description.
|
RegisterDeclarations
|
procedure
|
public
|
The same as above, but for multiple symbols in one declaration.
|
StartClass
|
procedure
|
public
|
Starts registering a class declaration.
|
FinishClass
|
procedure
|
public
|
|
StartInterface
|
procedure
|
public
|
Starts registering an interface.
|
FinishInterface
|
procedure
|
public
|
|
SetIgnoreDeclarations
|
procedure
|
public
|
Indicated that num following decalrations should be ignored.
|
Error
|
procedure
|
public
|
Prints an error message msg.
|
Error
|
procedure
|
public
|
Prints an error message msg not associated with any particular line, but associated with some file.
|
Error
|
procedure
|
public
|
Prints an error message msg not associated with any file.
|
CommentError
|
procedure
|
public
|
Prints an error message msg.
|
Warn
|
procedure
|
public
|
Prints a warning.
|
Warn
|
procedure
|
public
|
Prints a warning.
|
CommentWarn
|
procedure
|
public
|
Prints a warning from inside a comment.
|
WriteMessage
|
procedure
|
public
|
Writes a message.
|
SetOption
|
procedure
|
public
|
Adds opt to Options.
|
ResetOption
|
procedure
|
public
|
Removes opt from Options.
|
Options
|
property
|
public
|
|
DocWriter
|
property
|
public
|
|
CommentParser
|
property
|
public
|
|
LanguageParser
|
property
|
public
|
|
SetCommentParser
|
procedure
|
protected
|
Sets FCommentParser.
|
SetLanguageParser
|
procedure
|
protected
|
Sets FLanguageParser.
|
|
TDriver.Create
Declaration
constructor Create(aoptions : TOptions; adocwriter : TDocWriter; asrcDirs : TStrings);
Visibility
public
Source
commonclasses.pas on line 406
Parameters
aoptions - the global options.
adocwriter - the documentation writer to use.
asrcDirs - a list of directories to search for input files.
TDriver.Destroy
Declaration
destructor Destroy; override;
Visibility
public
Source
commonclasses.pas on line 408
TDriver.RegisterUnit
Declaration
function RegisterUnit(name : String; unitComment : String) : Boolean; virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 425
Parameters
name - the name of the unit.
unitComment - the comment associated with the unit.
Description
Registeres the unit currently being parsed. This should be called as soon as the name of the unit is known and before anything else is registered. Returns true if the language parser should continue with parsing the unit, false if it should exit immediately.
TDriver.OpenUnit
Declaration
function OpenUnit(name : String) : Boolean; virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 431
Description
Re-opens an already registered unit for parsing. After calling this method all declarations are added to the opened unit. Returns true if the language parser should continue with parsing the unit, false if it should exit immediately.
TDriver.FindSection
Declaration
function FindSection(name : String) : TSection; virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 497
Description
Returns the section of the given declaration name or nil if not found.
TDriver.OpenInputFile
Declaration
function OpenInputFile(const path : String) : TFileStream;
Visibility
public
Source
commonclasses.pas on line 524
Description
Opens a file for reading and returns a file stream for this file. Returns nil if could not open.
TDriver.ExistsInputFile
Declaration
function ExistsInputFile(const path : String) : Boolean;
Visibility
public
Source
commonclasses.pas on line 527
Description
Returns true if a given file exists in one of the source directories.
TDriver.ValidateInputFile
Declaration
function ValidateInputFile(const path : String) : String;
Visibility
public
Source
commonclasses.pas on line 531
Description
Validates the input file. If it is a path to a file then adds the directory part to the source directories and returns the basename of the file.
TDriver.Run
Declaration
procedure Run(afilequeue : TStringDequeAdt); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 415
Description
Runs the driver. afilequeue Is a queue of files to be processed. The queue is owned by the driver and disposed by it. It should contain files in the order in which they should be processed. The Run method should be called only once from the main program;.
TDriver.RegisterFile
Declaration
procedure RegisterFile(filename : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 417
Description
Registeres the given file to be processed.
TDriver.ProvideUnitInfo
Declaration
procedure ProvideUnitInfo(ainterfaceUses : TStrings); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 436
Parameters
ainterfaceUses - the units the current unit uses in its interface.
Description
Provides additional information on the unit currently being parsed.
TDriver.ProvideUnitImplementationInfo
Declaration
procedure ProvideUnitImplementationInfo(aimplUses : TStrings; aunitImplComment : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 443
Parameters
aimplUses - the units the current unit uses in its implementation.
aunitImplComment - the comment associated with the implementation of the unit.
Description
Provides additional information on the implementation of the unit currently being parsed.
TDriver.RegisterDeclaration
Declaration
procedure RegisterDeclaration(decl : TTextObject; symbol : String; args : TStrings; visibility : String; visibilityType : TVisibilityType; symboltype : String; linenum : Integer; comment : String);
Visibility
public
Source
commonclasses.pas on line 457
Description
Registeres a declaration description. Decl is the whole text of the declaration. It is the responsibility of the language parser to format this text and highlight keywords. Symbol is the name of the symbol being declared. Args is a list of arguments if the symbol is a routine, may be empty. Visibility is the visibility of the symbol. SymbolType is the type of the symbol, i.e. variable, function, procedure, etc. Linenum is the line number at which the declaration appears in the source file. Comment is the comment associated with the declaration. The declaration string may be later formatted inside the routine, as well as the comment string.
TDriver.RegisterDeclarations
Declaration
procedure RegisterDeclarations(adecl : TTextObject; asymbols : TStrings; args : TStrings; avisibility : String; avisibilityType : TVisibilityType; asymboltype : String; alinenum : Integer; acomment : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 463
Description
The same as above, but for multiple symbols in one declaration.
TDriver.StartClass
Declaration
procedure StartClass(decl : TTextObject; name : String; ancestors : TStrings; interfaces : TStrings; visibility : String; visibilityType : TVisibilityType; symboltype : String; linenum : Integer; comment : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 476
Description
Starts registering a class declaration. Decl is the full text of the class'es heading (not necessarily the whole declaration, but only the part including the class'es name and inheritance info). Ancestors is a list of the immediate ancestors of the class. Interfaces is a list of the interfaced implemented by the class. linenum Is the line number at which the declaration appears in the source file. Comment is the comment associated with the class;.
TDriver.FinishClass
Declaration
procedure FinishClass; virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 481
TDriver.StartInterface
Declaration
procedure StartInterface(decl : TTextObject; name : String; ancestors : TStrings; id : String; visibility : String; visibilityType : TVisibilityType; symboltype : String; linenum : Integer; comment : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 485
Description
Starts registering an interface. Id is an optional id of the interface. In delphi it is the GUID of the interface.
See also
StartClass
TDriver.FinishInterface
Declaration
procedure FinishInterface; virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 491
TDriver.SetIgnoreDeclarations
Declaration
procedure SetIgnoreDeclarations(num : Cardinal); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 494
Description
Indicated that num following decalrations should be ignored.
TDriver.Error
Declaration
procedure Error(msg, filename : String; linenum : Cardinal); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 501
Description
Prints an error message msg. If there have been too many errors raises an exception.
TDriver.Error
Declaration
procedure Error(msg, filename : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 506
Description
Prints an error message msg not associated with any particular line, but associated with some file. If there have been too many errors raises an exception.
TDriver.Error
Declaration
procedure Error(msg : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 509
Description
Prints an error message msg not associated with any file. If there have been too many errors raises an exception.
TDriver.CommentError
Declaration
procedure CommentError(msg : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 512
Description
Prints an error message msg. Use this method if the error is encountered inside a comment.
See also
Error,
TDriver.Warn
Declaration
procedure Warn(msg, filename : String; line : Integer); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 514
Description
Prints a warning.
TDriver.Warn
Declaration
procedure Warn(msg : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 515
Description
Prints a warning.
TDriver.CommentWarn
Declaration
procedure CommentWarn(msg : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 517
Description
Prints a warning from inside a comment.
TDriver.WriteMessage
Declaration
procedure WriteMessage(msg : String); virtual; abstract;
Visibility
public
Source
commonclasses.pas on line 520
Description
Writes a message. Messages are written only if optVerbose is in Options.
TDriver.SetOption
Declaration
procedure SetOption(opt : TOption);
Visibility
public
Source
commonclasses.pas on line 533
Description
Adds opt to Options.
TDriver.ResetOption
Declaration
procedure ResetOption(opt : TOption);
Visibility
public
Source
commonclasses.pas on line 535
Description
Removes opt from Options.
TDriver.Options
Declaration
property Options : TOptions read FOptions;
Visibility
public
Source
commonclasses.pas on line 537
TDriver.DocWriter
Declaration
property DocWriter : TDocWriter read FDocWriter;
Visibility
public
Source
commonclasses.pas on line 538
TDriver.CommentParser
Declaration
property CommentParser : TCommentParser read FCommentParser;
Visibility
public
Source
commonclasses.pas on line 539
TDriver.LanguageParser
Declaration
property LanguageParser : TLanguageParser read FLanguageParser;
Visibility
public
Source
commonclasses.pas on line 540
TDriver.SetCommentParser
Declaration
procedure SetCommentParser(arg : TCommentParser); virtual;
Visibility
protected
Source
commonclasses.pas on line 397
Description
Sets FCommentParser. Destroyes the object previously stored there.
TDriver.SetLanguageParser
Declaration
procedure SetLanguageParser(arg : TLanguageParser); virtual;
Visibility
protected
Source
commonclasses.pas on line 399
Description
Sets FLanguageParser. Destroyes the object previously stored there.