Home
last modified time | relevance | path

Searched refs:TokenDatabase (Results 1 – 10 of 10) sorted by relevance

/external/pigweed/pw_tokenizer/
Dtoken_database_test.cc30 alignas(TokenDatabase::RawEntry) constexpr char kBasicData[] =
39 alignas(TokenDatabase::RawEntry) constexpr char kEmptyData[] =
42 alignas(TokenDatabase::RawEntry) constexpr char kBadMagic[] =
47 alignas(TokenDatabase::RawEntry) constexpr char kBadVersion[] =
50 alignas(TokenDatabase::RawEntry) constexpr char kBadEntryCount[] =
55 alignas(TokenDatabase::RawEntry) constexpr signed char kSignedWithTopBit[] =
80 constexpr TokenDatabase kBasicDatabase = TokenDatabase::Create<kBasicData>();
83 TEST(TokenDatabase, EntryCount) { in TEST() argument
84 static_assert(TokenDatabase::Create<kBasicData>().size() == 3u); in TEST()
85 static_assert(TokenDatabase::Create(kEmptyData).size() == 0u); in TEST()
[all …]
Dtoken_database.cc19 TokenDatabase::Entry TokenDatabase::Entries::operator[](size_t index) const { in operator []()
27 TokenDatabase::Entries TokenDatabase::Find(const uint32_t token) const { in Find()
Ddetokenize_test.cc31 alignas(TokenDatabase::RawEntry) constexpr char kBasicData[] =
46 Detokenize() : detok_(TokenDatabase::Create<kBasicData>()) {} in Detokenize()
100 alignas(TokenDatabase::RawEntry) constexpr char kDataWithArguments[] =
123 constexpr TokenDatabase kWithArgs = TokenDatabase::Create<kDataWithArguments>();
189 alignas(TokenDatabase::RawEntry) constexpr char kDataWithCollisions[] =
225 constexpr TokenDatabase kWithCollisions =
226 TokenDatabase::Create<kDataWithCollisions>();
Dtoken_database_fuzzer.cc52 void IterateOverDatabase(TokenDatabase* const database) { in IterateOverDatabase()
53 for (TokenDatabase::Entry entry : *database) { in IterateOverDatabase()
121 auto token_database = TokenDatabase::Create<std::span<uint8_t>>(data_span); in LLVMFuzzerTestOneInput()
Ddetokenize_fuzzer.cc47 alignas(TokenDatabase::RawEntry) constexpr char kBasicData[] =
63 static Detokenizer detokenizer(TokenDatabase::Create<kBasicData>()); in LLVMFuzzerTestOneInput()
Ddetokenize.cc100 Detokenizer::Detokenizer(const TokenDatabase& database) { in Detokenizer()
Ddocs.rst803 ``TokenDatabase::Create``, and construct a detokenizer.
807 Detokenizer detokenizer(TokenDatabase::Create(token_database_array));
813 The ``TokenDatabase`` class verifies that its data is valid before using it. If
814 it is invalid, the ``TokenDatabase::Create`` returns an empty database for which
821 constexpr TokenDatabase kDefaultDatabase = TokenDatabase::Create<kData>();
826 TokenDatabase database = TokenDatabase::Create(data);
829 // TokenDatabase that failed to load (it will be empty), but it may be
/external/pigweed/pw_tokenizer/public/pw_tokenizer/
Dtoken_database.h54 class TokenDatabase {
172 static constexpr TokenDatabase Create() { in Create()
180 return TokenDatabase(std::data(kDatabaseBytes)); in Create()
191 static constexpr TokenDatabase Create(const ByteArray& database_bytes) { in Create()
193 ? TokenDatabase(std::data(database_bytes)) in Create()
194 : TokenDatabase(); // Invalid database. in Create()
197 constexpr TokenDatabase() : begin_{.data = nullptr}, end_{.data = nullptr} {} in TokenDatabase() function
283 constexpr TokenDatabase(const Byte bytes[]) in TokenDatabase() function
284 : TokenDatabase(bytes + sizeof(Header), in TokenDatabase()
293 constexpr TokenDatabase(const char* begin, const char* end) in TokenDatabase() function
[all …]
Ddetokenize.h79 Detokenizer(const TokenDatabase& database);
/external/pigweed/pw_tokenizer/java/dev/pigweed/tokenizer/
Ddetokenizer.cc60 TokenDatabase tokens = TokenDatabase::Create(std::span(data, size)); in DETOKENIZER_METHOD()
62 PointerToHandle(new Detokenizer(tokens.ok() ? tokens : TokenDatabase())); in DETOKENIZER_METHOD()