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 250).

Hierarchy

Show Additional Members:

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 260).

Public MyType: TTokenType;

the type of this token as TTokenType

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

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 267).

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 282).

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 286).

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 289).

Public function GetTypeName: string;

This item has no description.

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

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

Does MyType is TOK_SYMBOL and Info.SymbolType is ASymbolType ?

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

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

Does MyType is TOK_KEYWORD and Info.KeyWord is AKeyWord ?

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

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

Does MyType is TOK_IDENTIFIER and Info.StandardDirective is AStandardDirective ?

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

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 306).

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 314).

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 318).

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 322).

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 327).

Public property Line: Integer read FLine;

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

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


Generated by PasDoc 1.0.2.