]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/ContextSensitivityInfo.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / ContextSensitivityInfo.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/DecisionEventInfo.h"
9
10 namespace antlr4 {
11 namespace atn {
12
13   /// <summary>
14   /// This class represents profiling event information for a context sensitivity.
15   /// Context sensitivities are decisions where a particular input resulted in an
16   /// SLL conflict, but LL prediction produced a single unique alternative.
17   ///
18   /// <para>
19   /// In some cases, the unique alternative identified by LL prediction is not
20   /// equal to the minimum represented alternative in the conflicting SLL
21   /// configuration set. Grammars and inputs which result in this scenario are
22   /// unable to use <seealso cref="PredictionMode#SLL"/>, which in turn means they cannot use
23   /// the two-stage parsing strategy to improve parsing performance for that
24   /// input.</para>
25   /// </summary>
26   /// <seealso cref= ParserATNSimulator#reportContextSensitivity </seealso>
27   /// <seealso cref= ANTLRErrorListener#reportContextSensitivity
28   ///
29   /// @since 4.3 </seealso>
30   class ANTLR4CPP_PUBLIC ContextSensitivityInfo : public DecisionEventInfo {
31   public:
32     /// <summary>
33     /// Constructs a new instance of the <seealso cref="ContextSensitivityInfo"/> class
34     /// with the specified detailed context sensitivity information.
35     /// </summary>
36     /// <param name="decision"> The decision number </param>
37     /// <param name="configs"> The final configuration set containing the unique
38     /// alternative identified by full-context prediction </param>
39     /// <param name="input"> The input token stream </param>
40     /// <param name="startIndex"> The start index for the current prediction </param>
41     /// <param name="stopIndex"> The index at which the context sensitivity was
42     /// identified during full-context prediction </param>
43     ContextSensitivityInfo(size_t decision, ATNConfigSet *configs, TokenStream *input, size_t startIndex, size_t stopIndex);
44   };
45
46 } // namespace atn
47 } // namespace antlr4