Class TToken

Unit

Declaration

type TToken = class(TObject)

Description

Stores the exact type and additional information on one token.

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 BeginPosition: Int64 read FBeginPosition;
Public property EndPosition: Int64 read FEndPosition;

Description

Fields

Public Data: string;

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

Public MyType: TTokenType;

the type of this token as TTokenType

Public Info: record

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

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] = '$'.

Public StringContent: string;

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

Methods

Public constructor Create(const TT: TTokenType);

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

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

Does MyType is TOK_SYMBOL and Info.SymbolType is ASymbolType ?

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

Does MyType is TOK_KEYWORD and Info.KeyWord is AKeyWord ?

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

Does MyType is TOK_IDENTIFIER and Info.StandardDirective is AStandardDirective ?

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.

Properties

Public property StreamName: string read FStreamName;

StreamName is the name of the TStream from which this TToken was read. It is currently used to set TRawDescriptionInfo.StreamName.

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.

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.


Generated by PasDoc 0.16.0.