Blender V5.3
lexit::IdentifierMap Struct Reference

#include <identifier.hh>

Classes

struct  Identifier

Public Member Functions

 IdentifierMap ()
void reserve (int token_count)
TokenAtom max_atom_value () const
template<typename StringT>
INLINE_METHOD TokenAtom lookup_or_add (StringT str)
TokenAtom add_after (uint32_t hash, std::string_view str, Identifier *id=nullptr)
Keyword make_keyword (std::string_view str, TokenType type)

Static Public Member Functions

static constexpr uint32_t str_hash (std::string_view s)

Public Attributes

lexit::Vector< Identifier > identifier_buffer
std::array< uint16_t, hash_table_size > hash_table

Static Public Attributes

static constexpr uint32_t hash_table_size = 16384
static constexpr uint32_t hash_table_index_mask = (hash_table_size - 1)

Detailed Description

Definition at line 79 of file identifier.hh.

Constructor & Destructor Documentation

◆ IdentifierMap()

lexit::IdentifierMap::IdentifierMap ( )
inline

Definition at line 113 of file identifier.hh.

References hash_table.

Member Function Documentation

◆ add_after()

TokenAtom lexit::IdentifierMap::add_after ( uint32_t hash,
std::string_view str,
Identifier * id = nullptr )
inline

◆ lookup_or_add()

template<typename StringT>
INLINE_METHOD TokenAtom lexit::IdentifierMap::lookup_or_add ( StringT str)
inline

◆ make_keyword()

Keyword lexit::IdentifierMap::make_keyword ( std::string_view str,
TokenType type )
inline

Definition at line 185 of file identifier.hh.

References lexit::Keyword::Keyword(), lookup_or_add(), and str.

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

◆ max_atom_value()

TokenAtom lexit::IdentifierMap::max_atom_value ( ) const
inline

◆ reserve()

void lexit::IdentifierMap::reserve ( int token_count)
inline

Definition at line 119 of file identifier.hh.

References identifier_buffer, and lexit::Vector< T >::reserve().

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

◆ str_hash()

constexpr uint32_t lexit::IdentifierMap::str_hash ( std::string_view s)
inlinestaticconstexpr

Definition at line 130 of file identifier.hh.

References hash.

Referenced by lookup_or_add().

Member Data Documentation

◆ hash_table

std::array<uint16_t, hash_table_size> lexit::IdentifierMap::hash_table

Definition at line 111 of file identifier.hh.

Referenced by add_after(), IdentifierMap(), and lookup_or_add().

◆ hash_table_index_mask

uint32_t lexit::IdentifierMap::hash_table_index_mask = (hash_table_size - 1)
staticconstexpr

Definition at line 110 of file identifier.hh.

Referenced by add_after(), and lookup_or_add().

◆ hash_table_size

uint32_t lexit::IdentifierMap::hash_table_size = 16384
staticconstexpr

Definition at line 109 of file identifier.hh.

◆ identifier_buffer

lexit::Vector<Identifier> lexit::IdentifierMap::identifier_buffer

Definition at line 106 of file identifier.hh.

Referenced by add_after(), lookup_or_add(), max_atom_value(), and reserve().


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