P4C
The P4 Compiler
Loading...
Searching...
No Matches
printUtils.h
1/* Copyright 2021 Intel Corporation
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14*/
15
16#ifndef BACKENDS_DPDK_PRINTUTILS_H_
17#define BACKENDS_DPDK_PRINTUTILS_H_
18
19#include <iostream>
20
21#include "ir/dbprint.h"
22#include "ir/ir.h"
23#include "ir/visitor.h"
24
25namespace P4::DPDK {
29cstring toStr(const IR::Node *const);
30
31class ConvertToString : public Inspector {
32 public:
33 std::ostringstream out;
34 bool preorder(const IR::Expression *e);
35 bool preorder(const IR::Type *t);
36 bool preorder(const IR::PropertyValue *p);
37 bool preorder(const IR::Constant *c);
38 bool preorder(const IR::BoolLiteral *b);
39 bool preorder(const IR::Member *m);
40 bool preorder(const IR::PathExpression *p);
41 bool preorder(const IR::TypeNameExpression *p);
42 bool preorder(const IR::MethodCallExpression *m);
43 bool preorder(const IR::Cast *e);
44 bool preorder(const IR::ArrayIndex *e);
45 bool preorder(const IR::Type_Specialized *type);
46 bool preorder(const IR::Type_Name *type);
47 bool preorder(const IR::Type_Boolean *type);
48 bool preorder(const IR::Type_Bits *type);
49 bool preorder(const IR::ExpressionValue *property);
50};
51} // namespace P4::DPDK
52
53#endif /* BACKENDS_DPDK_PRINTUTILS_H_ */
Definition printUtils.h:31
Definition visitor.h:400
Definition dpdk/backend.cpp:36
cstring toStr(const IR::Node *const n)
Definition printUtils.cpp:113