aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson/tokenizer.h
blob: 0576aace95c5245fcbc44e1c346f589dc0a24a18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "public.h"
#include "lexer.h"

namespace NYson {
    ////////////////////////////////////////////////////////////////////////////////

    class TTokenizer {
    public:
        explicit TTokenizer(const TStringBuf& input);

        bool ParseNext();
        const TToken& CurrentToken() const;
        ETokenType GetCurrentType() const;
        TStringBuf GetCurrentSuffix() const;
        const TStringBuf& CurrentInput() const;

    private:
        TStringBuf Input;
        TToken Token;
        TStatelessLexer Lexer;
        size_t Parsed;
    };

    ////////////////////////////////////////////////////////////////////////////////

} // namespace NYson