X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/9f94b672a5dc32da5ad01742bd4e976315a30d9c..c6ad2948bb98d42f8e0883ef82cd14cd2d5eda60:/antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/ParseInfo.h
diff --git a/antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/ParseInfo.h b/antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/ParseInfo.h
new file mode 100644
index 0000000..7ced7de
--- /dev/null
+++ b/antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/ParseInfo.h
@@ -0,0 +1,102 @@
+/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+ * Use of this file is governed by the BSD 3-clause license that
+ * can be found in the LICENSE.txt file in the project root.
+ */
+
+#pragma once
+
+#include "atn/DecisionInfo.h"
+
+namespace antlr4 {
+namespace atn {
+
+ class ProfilingATNSimulator;
+
+ /// This class provides access to specific and aggregate statistics gathered
+ /// during profiling of a parser.
+ class ANTLR4CPP_PUBLIC ParseInfo {
+ public:
+ ParseInfo(ProfilingATNSimulator *atnSimulator);
+ ParseInfo(ParseInfo const&) = default;
+ virtual ~ParseInfo();
+
+ ParseInfo& operator=(ParseInfo const&) = default;
+
+ ///
+ /// Gets an array of instances containing the profiling
+ /// information gathered for each decision in the ATN.
+ ///
+ /// An array of instances, indexed by decision
+ /// number.
+ virtual std::vector getDecisionInfo();
+
+ ///
+ /// Gets the decision numbers for decisions that required one or more
+ /// full-context predictions during parsing. These are decisions for which
+ /// is non-zero.
+ ///
+ /// A list of decision numbers which required one or more
+ /// full-context predictions during parsing.
+ virtual std::vector getLLDecisions();
+
+ ///
+ /// Gets the total time spent during prediction across all decisions made
+ /// during parsing. This value is the sum of
+ /// for all decisions.
+ ///
+ virtual long long getTotalTimeInPrediction();
+
+ ///
+ /// Gets the total number of SLL lookahead operations across all decisions
+ /// made during parsing. This value is the sum of
+ /// for all decisions.
+ ///
+ virtual long long getTotalSLLLookaheadOps();
+
+ ///
+ /// Gets the total number of LL lookahead operations across all decisions
+ /// made during parsing. This value is the sum of
+ /// for all decisions.
+ ///
+ virtual long long getTotalLLLookaheadOps();
+
+ ///
+ /// Gets the total number of ATN lookahead operations for SLL prediction
+ /// across all decisions made during parsing.
+ ///
+ virtual long long getTotalSLLATNLookaheadOps();
+
+ ///
+ /// Gets the total number of ATN lookahead operations for LL prediction
+ /// across all decisions made during parsing.
+ ///
+ virtual long long getTotalLLATNLookaheadOps();
+
+ ///
+ /// Gets the total number of ATN lookahead operations for SLL and LL
+ /// prediction across all decisions made during parsing.
+ ///
+ ///
+ /// This value is the sum of and
+ /// .
+ ///
+ virtual long long getTotalATNLookaheadOps();
+
+ ///
+ /// Gets the total number of DFA states stored in the DFA cache for all
+ /// decisions in the ATN.
+ ///
+ virtual size_t getDFASize();
+
+ ///
+ /// Gets the total number of DFA states stored in the DFA cache for a
+ /// particular decision.
+ ///
+ virtual size_t getDFASize(size_t decision);
+
+ protected:
+ const ProfilingATNSimulator *_atnSimulator; // non-owning, we are created by this simulator.
+ };
+
+} // namespace atn
+} // namespace antlr4