P4C
The P4 Compiler
Loading...
Searching...
No Matches
deparser.h
1
/*
2
Copyright 2013-present Barefoot Networks, Inc.
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
#ifndef BACKENDS_BMV2_COMMON_DEPARSER_H_
18
#define BACKENDS_BMV2_COMMON_DEPARSER_H_
19
20
#include "backend.h"
21
#include "expression.h"
22
#include "frontends/common/resolveReferences/referenceMap.h"
23
#include "frontends/p4/typeMap.h"
24
#include "ir/ir.h"
25
#include "lib/json.h"
26
27
namespace
BMV2 {
28
29
class
DeparserConverter
:
public
Inspector {
30
ConversionContext
*ctxt;
31
cstring
name;
32
P4::P4CoreLibrary
&corelib;
33
34
protected
:
35
Util::IJson
*convertDeparser(
const
IR::P4Control *
ctrl
);
36
void
convertDeparserBody(
const
IR::Vector<IR::StatOrDecl>
*body,
Util::JsonArray
*order,
37
Util::JsonArray
*
primitives
);
38
39
public
:
40
bool
preorder(
const
IR::P4Control *
ctrl
)
override
;
41
42
explicit
DeparserConverter
(
ConversionContext
*ctxt,
cstring
name =
"deparser"
)
43
: ctxt(ctxt), name(name), corelib(P4::P4CoreLibrary::instance()) {
44
setName
(
"DeparserConverter"
);
45
}
46
};
47
48
}
// namespace BMV2
49
50
#endif
/* BACKENDS_BMV2_COMMON_DEPARSER_H_ */
BMV2::DeparserConverter
Definition
deparser.h:29
BMV2::SharedActionSelectorCheck
Definition
sharedActionSelectorCheck.h:40
IR::Vector
Definition
externInstance.h:33
P4::P4CoreLibrary
Definition
coreLibrary.h:100
Util::IJson
Definition
json.h:40
Util::JsonArray
Definition
json.h:111
cstring
Definition
cstring.h:72
BMV2::ConversionContext
Definition
helpers.h:261
backends
bmv2
common
deparser.h
Generated on Tue Mar 26 2024 for