17#ifndef BACKENDS_EBPF_EBPFPARSER_H_
18#define BACKENDS_EBPF_EBPFPARSER_H_
20#include "ebpfObject.h"
21#include "ebpfProgram.h"
23#include "frontends/p4/methodInstance.h"
39 virtual void compileExtractField(
const IR::Expression *expr,
const IR::StructField *field,
40 unsigned hdrOffsetBits,
EBPFType *type);
41 virtual void compileExtract(
const IR::Expression *destination);
42 virtual void compileLookahead(
const IR::Expression *destination);
44 void compileVerify(
const IR::MethodCallExpression *expression);
54 bool preorder(
const IR::ParserState *state)
override;
55 bool preorder(
const IR::SelectCase *selectCase)
override;
56 bool preorder(
const IR::SelectExpression *expression)
override;
57 bool preorder(
const IR::Member *expression)
override;
58 bool preorder(
const IR::MethodCallExpression *expression)
override;
59 bool preorder(
const IR::MethodCallStatement *stat)
override {
60 visit(stat->methodCall);
61 builder->endOfStatement(
true);
64 bool preorder(
const IR::AssignmentStatement *stat)
override;
69 const IR::ParserState *state;
73 : state(state), parser(parser) {}
83 const IR::ParserBlock *parserBlock;
84 std::vector<EBPFParserState *> states;
85 const IR::Parameter *packet;
86 const IR::Parameter *headers;
87 const IR::Parameter *user_metadata;
92 std::map<cstring, EBPFValueSet *> valueSets;
96 virtual void emitDeclaration(
CodeBuilder *builder,
const IR::Declaration *decl);
101 virtual void emitValueSetInstances(
CodeBuilder *builder);
102 virtual void emitRejectState(
CodeBuilder *builder);
Definition ebpf/codeGen.h:33
Definition ebpf/codeGen.h:41
Base class for EBPF objects.
Definition ebpfObject.h:31
Definition ebpfParser.h:79
Definition ebpfParser.h:67
Definition ebpfProgram.h:39
Base class for EBPF types.
Definition ebpfType.h:29
Definition ebpfTable.h:171
Definition ebpfParser.h:31
cstring selectValue
Stores the result of evaluating the select argument.
Definition ebpfParser.h:34
Definition methodInstance.h:194
Definition methodInstance.h:168
Definition coreLibrary.h:103
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition codeGen.cpp:25
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24