aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/antlr4_cpp_runtime/src/LexerInterpreter.h
blob: 3787c1d0d57a470b7bd7f9f75ac1ada518767d50 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
 * Use of this file is governed by the BSD 3-clause license that
 * can be found in the LICENSE.txt file in the project root.
 */

#pragma once

#include "Lexer.h"
#include "atn/PredictionContext.h"
#include "atn/PredictionContextCache.h"
#include "Vocabulary.h"

namespace antlr4 {

  class ANTLR4CPP_PUBLIC LexerInterpreter : public Lexer {
  public:
    LexerInterpreter(const std::string &grammarFileName, const dfa::Vocabulary &vocabulary,
                     const std::vector<std::string> &ruleNames, const std::vector<std::string> &channelNames,
                     const std::vector<std::string> &modeNames, const atn::ATN &atn, CharStream *input);

    ~LexerInterpreter();

    virtual const atn::ATN& getATN() const override;
    virtual std::string getGrammarFileName() const override;
    virtual const std::vector<std::string>& getRuleNames() const override;
    virtual const std::vector<std::string>& getChannelNames() const override;
    virtual const std::vector<std::string>& getModeNames() const override;

    virtual const dfa::Vocabulary& getVocabulary() const override;

  protected:
    const std::string _grammarFileName;
    const atn::ATN &_atn;

    const std::vector<std::string> &_ruleNames;
    const std::vector<std::string> &_channelNames;
    const std::vector<std::string> &_modeNames;
    std::vector<dfa::DFA> _decisionToDFA;

    atn::PredictionContextCache _sharedContextCache;

  private:
    dfa::Vocabulary _vocabulary;
  };

} // namespace antlr4