P4C
The P4 Compiler
Loading...
Searching...
No Matches
printUtils.h
1/*
2 * Copyright 2021 Intel Corporation
3 * SPDX-FileCopyrightText: 2021 Intel Corporation
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef BACKENDS_DPDK_PRINTUTILS_H_
9#define BACKENDS_DPDK_PRINTUTILS_H_
10
11#include <iostream>
12
13#include "ir/dbprint.h"
14#include "ir/ir.h"
15#include "ir/visitor.h"
16
17namespace P4::DPDK {
21cstring toStr(const IR::Node *const);
22
23class ConvertToString : public Inspector {
24 public:
25 std::ostringstream out;
26 bool preorder(const IR::Expression *e);
27 bool preorder(const IR::Type *t);
28 bool preorder(const IR::PropertyValue *p);
29 bool preorder(const IR::Constant *c);
30 bool preorder(const IR::BoolLiteral *b);
31 bool preorder(const IR::Member *m);
32 bool preorder(const IR::PathExpression *p);
33 bool preorder(const IR::TypeNameExpression *p);
34 bool preorder(const IR::MethodCallExpression *m);
35 bool preorder(const IR::Cast *e);
36 bool preorder(const IR::ArrayIndex *e);
37 bool preorder(const IR::Type_Specialized *type);
38 bool preorder(const IR::Type_Name *type);
39 bool preorder(const IR::Type_Boolean *type);
40 bool preorder(const IR::Type_Bits *type);
41 bool preorder(const IR::ExpressionValue *property);
42};
43} // namespace P4::DPDK
44
45#endif /* BACKENDS_DPDK_PRINTUTILS_H_ */
Definition printUtils.h:23
Definition dpdk/backend.cpp:26
cstring toStr(const IR::Node *const n)
Definition printUtils.cpp:103