Mercurial > minori
view dep/anitomy/anitomy/tokenizer.h @ 222:b9f111d84d95
*: move to semver, remove old macos build, add library files
I'm retarded and can't commit files right
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 08 Jan 2024 13:22:09 -0500 |
parents | 5c0397762b53 |
children |
line wrap: on
line source
/* ** Copyright (c) 2014-2017, Eren Okka ** ** This Source Code Form is subject to the terms of the Mozilla Public ** License, v. 2.0. If a copy of the MPL was not distributed with this ** file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include "element.h" #include "options.h" #include "string.h" #include "token.h" namespace anitomy { class Tokenizer { public: Tokenizer(const string_t& filename, Elements& elements, const Options& options, token_container_t& tokens); Tokenizer(const Tokenizer&) = delete; Tokenizer& operator=(const Tokenizer&) = delete; bool Tokenize(); private: void AddToken(TokenCategory category, bool enclosed, const TokenRange& range); void TokenizeByBrackets(); void TokenizeByPreidentified(bool enclosed, const TokenRange& range); void TokenizeByDelimiters(bool enclosed, const TokenRange& range); string_t GetDelimiters(const TokenRange& range) const; void ValidateDelimiterTokens(); Elements& elements_; const string_t& filename_; const Options& options_; token_container_t& tokens_; }; } // namespace anitomy