P4C
The P4 Compiler
Loading...
Searching...
No Matches
simplifyParsers.h
1/*
2 * Copyright 2016 VMware, Inc.
3 * SPDX-FileCopyrightText: 2016 VMware, Inc.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef FRONTENDS_P4_SIMPLIFYPARSERS_H_
9#define FRONTENDS_P4_SIMPLIFYPARSERS_H_
10
11#include "ir/ir.h"
12
13namespace P4 {
14
27class SimplifyParsers : public Transform {
28 bool warnUnreachableStates;
29
30 public:
31 explicit SimplifyParsers(bool warnUnreachableStates = true)
32 : warnUnreachableStates(warnUnreachableStates) {
33 setName("SimplifyParsers");
34 }
35
36 const IR::Node *preorder(IR::P4Parser *parser) override;
37 const IR::Node *preorder(IR::P4Control *control) override {
38 prune();
39 return control;
40 }
41};
42
43} // namespace P4
44
45#endif /* FRONTENDS_P4_SIMPLIFYPARSERS_H_ */
Definition node.h:44
Definition visitor.h:433
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13