17#ifndef FRONTENDS_P4_ENUMINSTANCE_H_
18#define FRONTENDS_P4_ENUMINSTANCE_H_
20#include "frontends/p4/typeMap.h"
22#include "methodInstance.h"
30 : name(name), type(type), typeMap(typeMap) {}
39 static EnumInstance *
resolve(
const IR::Expression *expression,
const P4::TypeMap *typeMap);
40 bool equals(
const EnumInstance *other)
const {
41 return typeMap->equivalent(type, other->type) && name.name == other->name.name;
48class SimpleEnumInstance :
public EnumInstance {
50 SimpleEnumInstance(
const IR::Type_Enum *type,
const IR::ID name,
const P4::TypeMap *typeMap)
51 : EnumInstance(name, type, typeMap) {}
53 DECLARE_TYPEINFO(SimpleEnumInstance, EnumInstance);
58class SerEnumInstance :
public EnumInstance {
60 const IR::Expression *value;
61 SerEnumInstance(
const IR::Type_SerEnum *type,
const IR::ID name,
const IR::Expression *value,
63 : EnumInstance(name, type, typeMap), value(value) {}
65 DECLARE_TYPEINFO(SerEnumInstance, EnumInstance);
static EnumInstance * resolve(const IR::Expression *expression, const P4::TypeMap *typeMap)
Definition enumInstance.cpp:22
Definition methodInstance.h:27
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24