]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/PredicateEvalInfo.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / PredicateEvalInfo.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 semantic predicate
15   /// evaluations which occur during prediction.
16   /// </summary>
17   /// <seealso cref= ParserATNSimulator#evalSemanticContext
18   ///
19   /// @since 4.3 </seealso>
20   class ANTLR4CPP_PUBLIC PredicateEvalInfo : public DecisionEventInfo {
21   public:
22     /// The semantic context which was evaluated.
23     const Ref<SemanticContext> semctx;
24
25     /// <summary>
26     /// The alternative number for the decision which is guarded by the semantic
27     /// context <seealso cref="#semctx"/>. Note that other ATN
28     /// configurations may predict the same alternative which are guarded by
29     /// other semantic contexts and/or <seealso cref="SemanticContext#NONE"/>.
30     /// </summary>
31     const size_t predictedAlt;
32
33     /// The result of evaluating the semantic context <seealso cref="#semctx"/>.
34     const bool evalResult;
35
36     /// <summary>
37     /// Constructs a new instance of the <seealso cref="PredicateEvalInfo"/> class with the
38     /// specified detailed predicate evaluation information.
39     /// </summary>
40     /// <param name="decision"> The decision number </param>
41     /// <param name="input"> The input token stream </param>
42     /// <param name="startIndex"> The start index for the current prediction </param>
43     /// <param name="stopIndex"> The index at which the predicate evaluation was
44     /// triggered. Note that the input stream may be reset to other positions for
45     /// the actual evaluation of individual predicates. </param>
46     /// <param name="semctx"> The semantic context which was evaluated </param>
47     /// <param name="evalResult"> The results of evaluating the semantic context </param>
48     /// <param name="predictedAlt"> The alternative number for the decision which is
49     /// guarded by the semantic context {@code semctx}. See <seealso cref="#predictedAlt"/>
50     /// for more information. </param>
51     /// <param name="fullCtx"> {@code true} if the semantic context was
52     /// evaluated during LL prediction; otherwise, {@code false} if the semantic
53     /// context was evaluated during SLL prediction
54     /// </param>
55     /// <seealso cref= ParserATNSimulator#evalSemanticContext(SemanticContext, ParserRuleContext, int, boolean) </seealso>
56     /// <seealso cref= SemanticContext#eval(Recognizer, RuleContext) </seealso>
57     PredicateEvalInfo(size_t decision, TokenStream *input, size_t startIndex, size_t stopIndex,
58                       Ref<SemanticContext> const& semctx, bool evalResult, size_t predictedAlt, bool fullCtx);
59   };
60
61 } // namespace atn
62 } // namespace antlr4