engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FTokenStream类 参考

A token stream wraps up a raw string, providing accessors into it for consuming tokens 更多...

#include <ExpressionParserTypes.h>

Public 成员函数

int32 CharsRemaining () const
 Get the number of characters remaining in the stream after the current read position
 
 FTokenStream (const TCHAR *In)
 Constructor. 更多...
 
TOptional< FStringToken > GenerateToken (int32 NumChars, FStringToken *Accumulate=nullptr) const
 Generate a token for the specified number of chars, at the current read position (or end of Accumulate)
 
FString GetErrorContext () const
 Get the error context from the current read position
 
int32 GetPosition () const
 Get the current read position from the start of the stream
 
bool IsEmpty () const
 Check if the stream is empty
 
bool IsReadPosValid (const TCHAR *InPos, int32 MinNumChars=1) const
 Check if it is valid to read (the optional number of characters) from the specified position
 
TOptional< FStringToken > ParseSymbol (FStringToken *Accumulate=nullptr) const
 Return a string token for the next character in the stream (or accumulating into the specified existing token)
 
TOptional< FStringToken > ParseSymbol (TCHAR Symbol, FStringToken *Accumulate=nullptr) const
 Attempt parse out the specified pre-defined string from the current read position (or accumulating into the specified existing token)
 
TOptional< FStringToken > ParseToken (const TCHAR *Symbol, FStringToken *Accumulate=nullptr) const
 Attempt parse out the specified pre-defined string from the current read position (or accumulating into the specified existing token)
 
TOptional< FStringToken > ParseToken (TFunctionRef< EParseState(TCHAR)> Pred, FStringToken *Accumulate=nullptr) const
 Parse out a token using the supplied predicate. 更多...
 
TOptional< FStringToken > ParseWhitespace (FStringToken *Accumulate=nullptr) const
 Parse a whitespace token
 
TCHAR PeekChar (int32 Offset=0) const
 Peek at the character at the specified offset from the current read position
 
void SetReadPos (const FStringToken &Token)
 Set the current read position to the character proceeding the specified token
 

详细描述

A token stream wraps up a raw string, providing accessors into it for consuming tokens

构造及析构函数说明

◆ FTokenStream()

FTokenStream::FTokenStream ( const TCHAR *  In)

Constructor.

The stream is only valid for the lifetime of the string provided

成员函数说明

◆ ParseToken()

TOptional< FStringToken > FTokenStream::ParseToken ( TFunctionRef< EParseState(TCHAR)>  Pred,
FStringToken *  Accumulate = nullptr 
) const

Parse out a token using the supplied predicate.

Will keep consuming characters into the resulting token provided the predicate returns EParseState::Continue or EParseState::StopAfter. Optionally supply a token to accumulate into Returns a string token for the stream, or empty on error


该类的文档由以下文件生成: