Blender V5.3
blender::gpu::shader::parser::Token Struct Reference

#include <token.hh>

Inherits lexit::Token.

Public Member Functions

 Token (const lexit::Token &tok)
 Token (const ParserBase &data, int64_t index)
 Token (const ParserBase &data)
Token prev (int i=1) const
Token next (int i=1) const
Token find_next (TokenType type) const
Token namespace_start () const
std::string full_symbol_name () const
Scope scope () const
size_t str_index_start () const
size_t str_index_last () const
size_t str_index_last_no_whitespace () const
size_t line_start () const
size_t line_end () const
std::string_view str_with_whitespace () const
std::string_view str () const
size_t line_number (bool at_end=false) const
size_t char_number () const
std::string filename () const
std::string line_str () const
TokenType type () const
Scope attribute_before () const
Scope attribute_after () const
bool operator== (TokenType type) const
bool operator!= (TokenType type) const
bool operator== (char type) const
bool operator!= (char type) const
Public Member Functions inherited from lexit::Token
 Token (const TokenBuffer *buf, int32_t index)
 operator int32_t () const
bool is_valid () const
bool is_invalid () const
const TokenType & type () const
const TokenAtom & atom () const
std::string_view str () const
std::string_view str_with_whitespace () const
bool followed_by_whitespace () const
Token next (int i=1) const
Token prev (int i=1) const

Additional Inherited Members

Static Public Member Functions inherited from lexit::Token
static Token invalid (const TokenBuffer *buf)
Public Attributes inherited from lexit::Token
const TokenBuffer * buf_
int32_t index_
int32_t flag = 0

Detailed Description

Semantic token adding access to ParserBase data. It is also safer than lexit::Token as invalid token will not result invalid behavior.

Definition at line 22 of file token.hh.

Constructor & Destructor Documentation

◆ Token() [1/3]

◆ Token() [2/3]

Definition at line 25 of file token.hh.

References blender::data, and Token().

◆ Token() [3/3]

Definition at line 27 of file token.hh.

References blender::data, and Token().

Member Function Documentation

◆ attribute_after()

Scope blender::gpu::shader::parser::Token::attribute_after ( ) const

◆ attribute_before()

Scope blender::gpu::shader::parser::Token::attribute_before ( ) const

◆ char_number()

size_t blender::gpu::shader::parser::Token::char_number ( ) const
inline

◆ filename()

std::string blender::gpu::shader::parser::Token::filename ( ) const
inline

◆ find_next()

Token blender::gpu::shader::parser::Token::find_next ( TokenType type) const
inline

Definition at line 38 of file token.hh.

References lexit::Token::is_valid(), next(), lexit::Token::next(), Token(), and type().

◆ full_symbol_name()

std::string blender::gpu::shader::parser::Token::full_symbol_name ( ) const
inline

◆ line_end()

size_t blender::gpu::shader::parser::Token::line_end ( ) const
inline

Definition at line 100 of file token.hh.

References lexit::Token::buf_, lexit::TokenBuffer::str_, and str_index_start().

◆ line_number()

size_t blender::gpu::shader::parser::Token::line_number ( bool at_end = false) const
inline

◆ line_start()

size_t blender::gpu::shader::parser::Token::line_start ( ) const
inline

Definition at line 93 of file token.hh.

References lexit::Token::buf_, lexit::TokenBuffer::str_, and str_index_start().

◆ line_str()

std::string blender::gpu::shader::parser::Token::line_str ( ) const
inline

◆ namespace_start()

Token blender::gpu::shader::parser::Token::namespace_start ( ) const
inline

Definition at line 48 of file token.hh.

References lexit::Token::is_valid(), lexit::Token::prev(), Token(), and lexit::Word.

Referenced by full_symbol_name().

◆ next()

Definition at line 33 of file token.hh.

References next(), and Token().

Referenced by attribute_after(), find_next(), and next().

◆ operator!=() [1/2]

bool blender::gpu::shader::parser::Token::operator!= ( char type) const
inline

Definition at line 184 of file token.hh.

References type().

◆ operator!=() [2/2]

bool blender::gpu::shader::parser::Token::operator!= ( TokenType type) const
inline

Definition at line 176 of file token.hh.

References type().

◆ operator==() [1/2]

bool blender::gpu::shader::parser::Token::operator== ( char type) const
inline

Definition at line 180 of file token.hh.

References type().

◆ operator==() [2/2]

bool blender::gpu::shader::parser::Token::operator== ( TokenType type) const
inline

Definition at line 172 of file token.hh.

References type().

◆ prev()

Definition at line 29 of file token.hh.

References prev(), and Token().

Referenced by attribute_before(), and prev().

◆ scope()

Scope blender::gpu::shader::parser::Token::scope ( ) const

Definition at line 98 of file intermediate.cc.

References lexit::Token::index_, and lexit::Token::is_invalid().

◆ str()

std::string_view blender::gpu::shader::parser::Token::str ( ) const
inline

Definition at line 114 of file token.hh.

References lexit::Token::is_invalid(), and str().

Referenced by str().

◆ str_index_last()

size_t blender::gpu::shader::parser::Token::str_index_last ( ) const
inline

Definition at line 82 of file token.hh.

References lexit::Token::buf_, lexit::Token::index_, and lexit::TokenBuffer::offsets_.

Referenced by line_number().

◆ str_index_last_no_whitespace()

size_t blender::gpu::shader::parser::Token::str_index_last_no_whitespace ( ) const
inline

Definition at line 87 of file token.hh.

References lexit::Token::buf_, lexit::Token::index_, and lexit::TokenBuffer::offsets_end_.

Referenced by full_symbol_name(), and line_number().

◆ str_index_start()

size_t blender::gpu::shader::parser::Token::str_index_start ( ) const
inline

◆ str_with_whitespace()

Definition at line 106 of file token.hh.

References lexit::Token::is_invalid(), and str_with_whitespace().

Referenced by str_with_whitespace().

◆ type()


The documentation for this struct was generated from the following files: