diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/yson/lexer.cpp | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/yson/lexer.cpp')
-rw-r--r-- | library/cpp/yson/lexer.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/library/cpp/yson/lexer.cpp b/library/cpp/yson/lexer.cpp new file mode 100644 index 00000000000..5eae94273bf --- /dev/null +++ b/library/cpp/yson/lexer.cpp @@ -0,0 +1,43 @@ +#include "lexer.h" +#include "lexer_detail.h" +#include "token.h" + +#include <util/generic/ptr.h> + +namespace NYson { + //////////////////////////////////////////////////////////////////////////////// + + class TStatelessLexer::TImpl { + private: + THolder<TStatelessYsonLexerImplBase> Impl; + + public: + TImpl(bool enableLinePositionInfo = false) + : Impl(enableLinePositionInfo + ? static_cast<TStatelessYsonLexerImplBase*>(new TStatelesYsonLexerImpl<true>()) + : static_cast<TStatelessYsonLexerImplBase*>(new TStatelesYsonLexerImpl<false>())) + { + } + + size_t GetToken(const TStringBuf& data, TToken* token) { + return Impl->GetToken(data, token); + } + }; + + //////////////////////////////////////////////////////////////////////////////// + + TStatelessLexer::TStatelessLexer() + : Impl(new TImpl()) + { + } + + TStatelessLexer::~TStatelessLexer() { + } + + size_t TStatelessLexer::GetToken(const TStringBuf& data, TToken* token) { + return Impl->GetToken(data, token); + } + + //////////////////////////////////////////////////////////////////////////////// + +} // namespace NYson |