aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson/tokenizer.h
blob: c4449f590ce2be7c8321508e47d85d2bc7b77d35 (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