ReactOS 0.4.16-dev-401-g45b008d
TokenList Class Reference

#include <tokenizer.hpp>

Collaboration diagram for TokenList:

Public Member Functions

 TokenList (const Tokenizer &tokenizer, const std::string &text)
 
size_t size () const
 
Token operator[] (size_t n) const
 

Private Types

using TOKEN_REF = typename Tokenizer::TOKEN_REF
 

Private Attributes

const Tokenizerm_tokenizer
 
const std::string & m_text
 
std::vector< TOKEN_REFm_tokens
 

Detailed Description

Definition at line 211 of file tokenizer.hpp.

Member Typedef Documentation

◆ TOKEN_REF

Definition at line 213 of file tokenizer.hpp.

Constructor & Destructor Documentation

◆ TokenList()

TokenList::TokenList ( const Tokenizer tokenizer,
const std::string &  text 
)
inline

Definition at line 221 of file tokenizer.hpp.

222 : m_tokenizer(tokenizer),
223 m_text(text)
224 {
225 size_t startpos = 0;
226 size_t len = m_text.size();
227 std::smatch matches;
228
229 m_tokens.reserve(len / 5);
230
231 while (startpos < len)
232 {
233 TOKEN_REF tref = m_tokenizer.match(matches, m_text, startpos);
234 m_tokens.push_back(tref);
235 startpos += tref.len;
236 };
237 }
std::vector< TOKEN_REF > m_tokens
Definition: tokenizer.hpp:217
const Tokenizer & m_tokenizer
Definition: tokenizer.hpp:215
typename Tokenizer::TOKEN_REF TOKEN_REF
Definition: tokenizer.hpp:213
const std::string & m_text
Definition: tokenizer.hpp:216
const WCHAR * text
Definition: package.c:1794
GLenum GLsizei len
Definition: glext.h:6722
#define matches(FN)
Definition: match.h:70
TOKEN_REF match(std::smatch &matches, const std::string &str) const
Definition: tokenizer.hpp:162

Member Function Documentation

◆ operator[]()

Token TokenList::operator[] ( size_t  n) const
inline

Definition at line 244 of file tokenizer.hpp.

245 {
247 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729

◆ size()

Member Data Documentation

◆ m_text

const std::string& TokenList::m_text
private

Definition at line 216 of file tokenizer.hpp.

Referenced by operator[](), and TokenList().

◆ m_tokenizer

const Tokenizer& TokenList::m_tokenizer
private

Definition at line 215 of file tokenizer.hpp.

Referenced by TokenList().

◆ m_tokens

std::vector<TOKEN_REF> TokenList::m_tokens
private

Definition at line 217 of file tokenizer.hpp.

Referenced by operator[](), size(), and TokenList().


The documentation for this class was generated from the following file: