Class TTokenizer
Unit
PasDoc_Tokenizer
Declaration
type TTokenizer = class(TObject)
Description
Converts an input TStream to a sequence of TToken objects.
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
|
FVerbosity: Cardinal; |
|
|
BufferedChar: Char; |
if IsCharBuffered is true, this field contains the buffered character
|
|
EOS: Boolean; |
true if end of stream Stream has been reached, false otherwise
|
|
IsCharBuffered: Boolean; |
if this is true, BufferedChar contains a buffered character; the next call to GetChar or PeekChar will return this character, not the next in the associated stream Stream
|
|
Row: Integer; |
current row in stream Stream; useful when giving error messages
|
|
Stream: TStream; |
the input stream this tokenizer is working on
|
|
FStreamName: string; |
|
|
FStreamPath: string; |
|
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); |
|
|
procedure CheckForDirective(const t: TToken); |
|
|
procedure ConsumeChar; |
|
|
function CreateSymbolToken(const st: TSymbolType; const s: string): TToken; overload; |
|
|
function CreateSymbolToken(const st: TSymbolType): TToken; overload; |
Uses default symbol representation, from SymbolNames[st]
|
|
function GetChar(out c: AnsiChar): Integer; |
Returns 1 on success or 0 on failure
|
|
function PeekChar(out c: Char): Boolean; |
|
|
function ReadCommentType1: TToken; |
|
|
function ReadCommentType2: TToken; |
|
|
function ReadCommentType3: TToken; |
|
|
function ReadAttAssemblerRegister: TToken; |
|
|
function ReadLiteralString(var t: TToken): Boolean; |
|
|
constructor Create( const AStream: TStream; const OnMessageEvent: TPasDocMessageEvent; const VerbosityLevel: Cardinal; const AStreamName, AStreamPath: string); |
Creates a TTokenizer and associates it with given input TStream. Note that AStream will be freed when this object will be freed.
|
|
destructor Destroy; override; |
Releases all dynamically allocated memory.
|
|
function HasData: Boolean; |
|
|
function GetStreamInfo: string; |
|
|
function GetToken(const NilOnEnd: Boolean = false): TToken; |
|
|
procedure UnGetToken(var T: TToken); |
Makes the token T next to be returned by GetToken. Also sets T to Nil , to prevent you from freeing it accidentally.
You cannot have more than one "unget" token. If you only call UnGetToken after some GetToken, you are safe.
|
|
function SkipUntilCompilerDirective: TToken; |
Skip all chars until it encounters some compiler directive, like $ELSE or $ENDIF. Returns either Nil or a token with MyType = TOK_DIRECTIVE.
|
Properties
|
property StreamPath: string read FStreamPath; |
This is the path where the underlying file of this stream is located.
It may be an absolute path or a relative path. Relative paths are always resolved vs pasdoc current directory. This way user can give relative paths in command-line when writing Pascal source filenames to parse.
In particular, this may be '' to indicate current dir.
It's always specified like it was processed by IncludeTrailingPathDelimiter, so it has trailing PathDelim included (unless it was '', in which case it remains empty).
|
Generated by PasDoc 0.16.0.