P4C
The P4 Compiler
Loading...
Searching...
No Matches
parserMetrics.h
1
/*
2
Collects parser metrics by applying the CC calculator to each state,
3
and 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
13
namespace
P4
{
14
15
class
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_ */
P4::Inspector
Definition
visitor.h:413
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:24
P4::Metrics
Definition
metricsStructure.h:119
P4::ParserMetrics
Definition
metricsStructure.h:92
frontends
p4
metrics
parserMetrics.h
Generated by
1.13.2