]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/LexerATNConfig.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / LexerATNConfig.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 "atn/ATNConfig.h"
9
10 namespace antlr4 {
11 namespace atn {
12
13   class ANTLR4CPP_PUBLIC LexerATNConfig : public ATNConfig {
14   public:
15     LexerATNConfig(ATNState *state, int alt, Ref<PredictionContext> const& context);
16     LexerATNConfig(ATNState *state, int alt, Ref<PredictionContext> const& context, Ref<LexerActionExecutor> const& lexerActionExecutor);
17
18     LexerATNConfig(Ref<LexerATNConfig> const& c, ATNState *state);
19     LexerATNConfig(Ref<LexerATNConfig> const& c, ATNState *state, Ref<LexerActionExecutor> const& lexerActionExecutor);
20     LexerATNConfig(Ref<LexerATNConfig> const& c, ATNState *state, Ref<PredictionContext> const& context);
21
22     /**
23      * Gets the {@link LexerActionExecutor} capable of executing the embedded
24      * action(s) for the current configuration.
25      */
26     Ref<LexerActionExecutor> getLexerActionExecutor() const;
27     bool hasPassedThroughNonGreedyDecision();
28
29     virtual size_t hashCode() const override;
30
31     bool operator == (const LexerATNConfig& other) const;
32
33   private:
34     /**
35      * This is the backing field for {@link #getLexerActionExecutor}.
36      */
37     const Ref<LexerActionExecutor> _lexerActionExecutor;
38     const bool _passedThroughNonGreedyDecision;
39
40     static bool checkNonGreedyDecision(Ref<LexerATNConfig> const& source, ATNState *target);
41   };
42
43 } // namespace atn
44 } // namespace antlr4