Class TScanner
Unit
PasDoc_Scanner
Declaration
type TScanner = class(TObject)
Description
This class scans one unit using one or more TTokenizer objects to scan the unit and all nested include files.
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
procedure DoError(const AMessage: string; const AArguments: array of const); |
|
 |
procedure DoMessage(const AVerbosity: Cardinal; const MessageType: TPasDocMessageType; const AMessage: string; const AArguments: array of const); |
|
 |
constructor Create( const s: TStream; const OnMessageEvent: TPasDocMessageEvent; const VerbosityLevel: Cardinal; const AStreamName, AStreamPath: string; const AHandleMacros: boolean); |
Creates a TScanner object that scans the given input stream.
Note that the stream S will be freed by this object (at destruction or when we will read all it's tokens), so after creating TScanner you should leave the stream to be managed completely by this TScanner.
|
 |
destructor Destroy; override; |
|
 |
procedure AddSymbol(const Name: string); |
Adds Name to the list of symbols (as a normal symbol, not macro).
|
 |
procedure AddSymbols(const NewSymbols: TStringVector); |
Adds all symbols in the NewSymbols collection by calling AddSymbol for each of the strings in that collection.
|
 |
procedure AddMacro(const Name, Value: string); |
Adds Name as a symbol that is a macro, that expands to Value.
|
 |
procedure ConsumeToken; |
Gets next token and throws it away.
|
 |
function GetToken: TToken; |
Returns next token. Always non-nil (will raise exception in case of any problem).
|
 |
function GetStreamInfo: string; |
Returns the name of the file that is currently processed and the line number. Good for meaningful error messages.
|
 |
procedure UnGetToken(var t: TToken); |
Place T in the buffer. Next time you will call GetToken you will get T. This also sets T to nil (because you shouldn't free T anymore after ungetting it). Note that the buffer has room only for 1 token, so you have to make sure that you will never unget more than two tokens. Practically, always call UnGetToken right after some GetToken.
|
Properties
 |
property IncludeFilePaths: TStringVector read FIncludeFilePaths
write SetIncludeFilePaths; |
Paths to search for include files. When you assign something to this property it causes Assign(Value) call, not a real reference copy.
|
 |
property Verbosity: Cardinal read FVerbosity write FVerbosity; |
|
 |
property HandleMacros: boolean read FHandleMacros; |
|
Generated by PasDoc 0.15.0.
|