Class TParser
Unit
Declaration
type TParser = class(TObject)
Description
Parser class that will process a complete unit file and all of its include files, regarding directives. When creating this object constructor Create takes as an argument an input stream and a list of directives. Parsing work is done by calling ParseUnitOrProgram method. If no errors appear, should return a TPasUnit object with all information on the unit. Else exception is raised.
Things that parser inits in items it returns:
Of every TPasItem : Name, RawDescription, Visibility, HintDirectives, DeprecatedNote, FullDeclararation (note: for now not all items get sensible FullDeclararation, but the intention is to improve this over time; see TPasItem.FullDeclaration to know where FullDeclararation is available now).
Note to IsDeprecated: parser inits it basing on hint directive "deprecated" presence in source file; it doesn't handle the fact that @deprecated tag may be specified inside RawDescription.
Note to RawDescription: parser inits them from user's comments that preceded given item in source file. It doesn't handle the fact that @member and @value tags may also assign RawDescription for some item.
Of TPasCio: Ancestors, Fields, Methods, Properties, MyType.
Of TPasEnum: Members, FullDeclararation.
Of TPasMethod: What.
Of TPasVarConst: FullDeclaration.
Of TPasProperty: IndexDecl, FullDeclaration. PropType (only if was specified in property declaration). It was intended that parser will also set Default, NoDefault, StoredId, DefaultId, Reader, Writer attributes, but it's still not implemented.
Of TPasUnit; UsesUnits, Types, Variables, CIOs, Constants, FuncsProcs.
It doesn't init other values. E.g. AbstractDescription or DetailedDescription of TPasItem should be inited while expanding this item's tags. E.g. SourceFileDateTime and SourceFileName of TPasUnit must be set by other means.
Hierarchy
- TObject
- TParser
Overview
Methods
constructor Create( const InputStream: TStream; const Directives: TStringVector; const IncludeFilePaths: TStringVector; const OnMessageEvent: TPasDocMessageEvent; const VerbosityLevel: Cardinal; const AStreamName, AStreamPath: string; const AHandleMacros: boolean); |
|
destructor Destroy; override; |
|
procedure ParseUnitOrProgram(var U: TPasUnit); |
Properties
property OnMessage: TPasDocMessageEvent read FOnMessage write FOnMessage; |
|
property CommentMarkers: TStringList read FCommentMarkers write SetCommentMarkers; |
|
property MarkersOptional: boolean read fMarkersOptional write fMarkersOptional; |
|
property IgnoreLeading: string read FIgnoreLeading write FIgnoreLeading; |
|
property IgnoreMarkers: TStringList read FIgnoreMarkers write SetIgnoreMarkers; |
|
property ShowVisibilities: TVisibilities
read FShowVisibilities write FShowVisibilities; |
|
property ImplicitVisibility: TImplicitVisibility
read FImplicitVisibility write FImplicitVisibility; |
|
property AutoBackComments: boolean read FAutoBackComments write FAutoBackComments; |
|
property InfoMergeType: TInfoMergeType read FInfoMergeType write FInfoMergeType; |
Description
Methods
constructor Create( const InputStream: TStream; const Directives: TStringVector; const IncludeFilePaths: TStringVector; const OnMessageEvent: TPasDocMessageEvent; const VerbosityLevel: Cardinal; const AStreamName, AStreamPath: string; const AHandleMacros: boolean); |
|
Create a parser, initialize the scanner with input stream S. All strings in SD are defined compiler directives. |
destructor Destroy; override; |
|
Release all dynamically allocated memory. |
procedure ParseUnitOrProgram(var U: TPasUnit); |
|
This does the real parsing work, creating U unit and parsing InputStream and filling all U properties. |
Properties
property OnMessage: TPasDocMessageEvent read FOnMessage write FOnMessage; |
|
property CommentMarkers: TStringList read FCommentMarkers write SetCommentMarkers; |
|
property MarkersOptional: boolean read fMarkersOptional write fMarkersOptional; |
|
property IgnoreLeading: string read FIgnoreLeading write FIgnoreLeading; |
|
property IgnoreMarkers: TStringList read FIgnoreMarkers write SetIgnoreMarkers; |
|
property ShowVisibilities: TVisibilities
read FShowVisibilities write FShowVisibilities; |
|
property ImplicitVisibility: TImplicitVisibility
read FImplicitVisibility write FImplicitVisibility; |
|
See command-line option --implicit-visibility documentation at [https://github.com/pasdoc/pasdoc/wiki/ImplicitVisibilityOption] |
property AutoBackComments: boolean read FAutoBackComments write FAutoBackComments; |
|
See command-line option --auto-back-comments documentation at [https://github.com/pasdoc/pasdoc/wiki/AutoBackComments] |
property InfoMergeType: TInfoMergeType read FInfoMergeType write FInfoMergeType; |
|
TODO comment |
Generated by PasDoc 0.16.0.