]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/misc/InterpreterDataReader.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / misc / InterpreterDataReader.h
1 /* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
2  * Use of this file is governed by the BSD 3-clause license that
3  * can be found in the LICENSE.txt file in the project root.
4  */
5
6 #pragma once
7
8 #include "antlr4-common.h"
9
10 namespace antlr4 {
11 namespace misc {
12
13   struct InterpreterData {
14     atn::ATN atn;
15     dfa::Vocabulary vocabulary;
16     std::vector<std::string> ruleNames;
17     std::vector<std::string> channels; // Only valid for lexer grammars.
18     std::vector<std::string> modes; // ditto
19
20     InterpreterData() {}; // For invalid content.
21     InterpreterData(std::vector<std::string> const& literalNames, std::vector<std::string> const& symbolicNames);
22   };
23
24   // A class to read plain text interpreter data produced by ANTLR.
25   class ANTLR4CPP_PUBLIC InterpreterDataReader {
26   public:
27     static InterpreterData parseFile(std::string const& fileName);
28   };
29
30 } // namespace atn
31 } // namespace antlr4