Blender V5.3
blender::gpu::TokenPastingBuffer Struct Reference

Inherits lexit::TokenBuffer.

Public Member Functions

 TokenPastingBuffer ()
BLI_INLINE_METHOD TokenMut paste_token (const std::string &tok_str, const TokenType type, const bool followed_by_space)
Public Member Functions inherited from lexit::TokenBuffer
 TokenBuffer ()=default
 TokenBuffer (const std::string_view str, const CharClass char_class_table[128])
void process (const std::string_view str, const CharClass char_class_table[128])
void clear ()
 Discard all currently held data. Does not reallocate.
void reserve (const uint32_t count)
 Allocate backing memory for the given number of tokens and move currently held data.
void tokenize (const CharClass char_class_table[128])
 Tokenizes the input string by grouping contiguous characters of the same class.
void merge_complex_literals (bool bsl_template_angle_bracket_lexing=false)
 Merge complex literals such as floats, strings and comments.
void atomize_words (IdentifierMap &identifiers, const KeywordTable &keywords)
 Assign keyword types and atoms for a small set of identifier.
void compute_lengths ()
 Compute small token length for speeding up certain tasks.
uint32_t size () const
 Return the amount of token inside the buffer.
std::string_view substr (const Token &start, const Token &end, const bool with_trailing_whitespaces=false) const
 Return the substring between the start and end tokens (included).
void append (TokenType type, TokenAtom atom, int32_t str_size, int32_t str_size_with_witespaces)
 Append a Token at the end of the buffer.
Token operator[] (int index) const
TokenMut operator[] (int index)
TokenIt begin ()
TokenIt end ()
Token front ()
Token back ()

Additional Inherited Members

Public Attributes inherited from lexit::TokenBuffer
std::string_view str_
AlignedArrayPtr< TokenType > types_
AlignedArrayPtr< uint32_t > offsets_
AlignedArrayPtr< uint32_t > offsets_end_
AlignedArrayPtr< uint8_t > lengths_
AlignedArrayPtr< TokenAtom > atoms_
uint32_t size_ = 0
uint32_t allocated_size_ = 0

Detailed Description

Definition at line 38 of file gpu_shader_preprocessor.cc.

Constructor & Destructor Documentation

◆ TokenPastingBuffer()

blender::gpu::TokenPastingBuffer::TokenPastingBuffer ( )
inline

Member Function Documentation

◆ paste_token()

BLI_INLINE_METHOD TokenMut blender::gpu::TokenPastingBuffer::paste_token ( const std::string & tok_str,
const TokenType type,
const bool followed_by_space )
inline

tok_str is the final token string with the optional added space at the end.

Definition at line 60 of file gpu_shader_preprocessor.cc.

References lexit::TokenBuffer::append(), BLI_INLINE_METHOD, lexit::TokenBuffer::size_, lexit::TokenBuffer::str_, and lexit::TokenMut::TokenMut().

Referenced by blender::gpu::AtomicLexer::paste_token().


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