Class TToken

Unit

Declaration

type TToken = class(TObject)

Description

Stores the exact type and additional information on one token.

Source: source/component/PasDoc_Tokenizer.pas (line 241).

Hierarchy

Overview

Fields

Public Data: string;
Public MyType: TTokenType;
Public Info: record
Public CommentContent: string;
Public StringContent: string;

Methods

Public constructor Create(const TT: TTokenType);
Public function GetTypeName: string;
Public function IsSymbol(const ASymbolType: TSymbolType): Boolean;
Public function IsKeyWord(const AKeyWord: TKeyWord): Boolean;
Public function IsStandardDirective( const AStandardDirective: TStandardDirective): Boolean;
Public function Description: string;

Properties

Public property StreamName: string read FStreamName;
Public property StreamAbsoluteFileName: string read FStreamAbsoluteFileName;
Public property BeginPosition: Int64 read FBeginPosition;
Public property EndPosition: Int64 read FEndPosition;
Public property Line: Integer read FLine;

Description

Fields

Public Data: string;

the exact character representation of this token as it was found in the input file

Source: source/component/PasDoc_Tokenizer.pas (line 251).

Public MyType: TTokenType;

the type of this token as TTokenType

Source: source/component/PasDoc_Tokenizer.pas (line 254).

Public Info: record

additional information on this token as a variant record depending on the token's MyType

Source: source/component/PasDoc_Tokenizer.pas (line 258).

Public CommentContent: string;

Contents of a comment token. This is defined only when MyType is in TokenCommentTypes or is TOK_DIRECTIVE. This is the text within the comment without comment delimiters. For TOK_DIRECTIVE you can safely assume that CommentContent[1] = '$'.

Source: source/component/PasDoc_Tokenizer.pas (line 273).

Public StringContent: string;

Contents of the string token, that is: the value of the string literal. D only when MyType is TOK_STRING.

Source: source/component/PasDoc_Tokenizer.pas (line 277).

Methods

Public constructor Create(const TT: TTokenType);

Create a token of and assign the argument token type to MyType

Source: source/component/PasDoc_Tokenizer.pas (line 280).

Public function GetTypeName: string;

This item has no description.

Source: source/component/PasDoc_Tokenizer.pas (line 281).

Public function IsSymbol(const ASymbolType: TSymbolType): Boolean;

Does MyType is TOK_SYMBOL and Info.SymbolType is ASymbolType ?

Source: source/component/PasDoc_Tokenizer.pas (line 284).

Public function IsKeyWord(const AKeyWord: TKeyWord): Boolean;

Does MyType is TOK_KEYWORD and Info.KeyWord is AKeyWord ?

Source: source/component/PasDoc_Tokenizer.pas (line 287).

Public function IsStandardDirective( const AStandardDirective: TStandardDirective): Boolean;

Does MyType is TOK_IDENTIFIER and Info.StandardDirective is AStandardDirective ?

Source: source/component/PasDoc_Tokenizer.pas (line 291).

Public function Description: string;

Few words long description of this token. Describes MyType and Data (for those tokens that tend to have short Data). Starts with lower letter.

Source: source/component/PasDoc_Tokenizer.pas (line 297).

Properties

Public property StreamName: string read FStreamName;

Informative to user name of the stream from which this token was read. This can be a filename (relative or absolute, however user specified it), but it also can be something arbitrary like "$if / $elseif condition". So don't treat it like a reliable filename.

It is currently used to set TRawDescriptionInfo.StreamName.

Source: source/component/PasDoc_Tokenizer.pas (line 305).

Public property StreamAbsoluteFileName: string read FStreamAbsoluteFileName;

Filename, always absolute, of the underlying file of this stream. Empty ('') if this is not a file stream.

Source: source/component/PasDoc_Tokenizer.pas (line 309).

Public property BeginPosition: Int64 read FBeginPosition;

BeginPosition is the position in the stream of the start of the token. It is currently used to set TRawDescriptionInfo.BeginPosition.

Source: source/component/PasDoc_Tokenizer.pas (line 313).

Public property EndPosition: Int64 read FEndPosition;

EndPosition is the position in the stream of the character immediately after the end of the token. It is currently used to set TRawDescriptionInfo.EndPosition.

Source: source/component/PasDoc_Tokenizer.pas (line 318).

Public property Line: Integer read FLine;

Line number (1-based) in the stream where this token starts.

Source: source/component/PasDoc_Tokenizer.pas (line 321).


Generated by PasDoc 0.17.0.snapshot.