P4C
The P4 Compiler
Loading...
Searching...
No Matches
parserMetrics.h
1/*
2Collects parser metrics by applying the CC calculator to each state,
3and collecting the number of states of each encountered parser
4*/
5
6#ifndef FRONTENDS_P4_METRICS_PARSERMETRICS_H_
7#define FRONTENDS_P4_METRICS_PARSERMETRICS_H_
8
9#include "frontends/p4/metrics/cyclomaticComplexity.h"
10#include "frontends/p4/metrics/metricsStructure.h"
11#include "ir/ir.h"
12
13namespace P4 {
14
15class ParserMetricsPass : public Inspector {
16 private:
17 ParserMetrics &metrics;
18
19 public:
20 explicit ParserMetricsPass(Metrics &metricsRef) : metrics(metricsRef.parserMetrics) {
21 setName("ParserMetricsPass");
22 }
23
24 bool preorder(const IR::P4Parser *parser) override;
25};
26
27} // namespace P4
28
29#endif /* FRONTENDS_P4_METRICS_PARSERMETRICS_H_ */
Definition visitor.h:413
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition metricsStructure.h:119
Definition metricsStructure.h:92