]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/LookaheadEventInfo.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / LookaheadEventInfo.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   /// This class represents profiling event information for tracking the lookahead
14   /// depth required in order to make a prediction.
15   class ANTLR4CPP_PUBLIC LookaheadEventInfo : public DecisionEventInfo {
16   public:
17     /// The alternative chosen by adaptivePredict(), not necessarily
18     ///  the outermost alt shown for a rule; left-recursive rules have
19     ///  user-level alts that differ from the rewritten rule with a (...) block
20     ///  and a (..)* loop.
21     size_t predictedAlt = 0;
22
23     /// <summary>
24     /// Constructs a new instance of the <seealso cref="LookaheadEventInfo"/> class with
25     /// the specified detailed lookahead information.
26     /// </summary>
27     /// <param name="decision"> The decision number </param>
28     /// <param name="configs"> The final configuration set containing the necessary
29     /// information to determine the result of a prediction, or {@code null} if
30     /// the final configuration set is not available </param>
31     /// <param name="input"> The input token stream </param>
32     /// <param name="startIndex"> The start index for the current prediction </param>
33     /// <param name="stopIndex"> The index at which the prediction was finally made </param>
34     /// <param name="fullCtx"> {@code true} if the current lookahead is part of an LL
35     /// prediction; otherwise, {@code false} if the current lookahead is part of
36     /// an SLL prediction </param>
37     LookaheadEventInfo(size_t decision, ATNConfigSet *configs, size_t predictedAlt, TokenStream *input, size_t startIndex,
38                        size_t stopIndex, bool fullCtx);
39   };
40
41 } // namespace atn
42 } // namespace antlr4