mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
74217b4fe5
Model classes are now described by a YAML document, which is used to generate C++ headers containing classes and all the boilerplate required for YAML serialization/deserialization, usage in SortedVectors, etc. See the README in include/revng/Model for more info.
44 lines
1019 B
C++
44 lines
1019 B
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/Model/Identifier.h"
|
|
#include "revng/Model/VerifyHelper.h"
|
|
|
|
/* TUPLE-TREE-YAML
|
|
name: EnumEntry
|
|
doc: An entry in a model enum, with a name and a value
|
|
type: struct
|
|
fields:
|
|
- name: Value
|
|
type: uint64_t
|
|
- name: CustomName
|
|
type: Identifier
|
|
optional: true
|
|
- name: Aliases
|
|
sequence:
|
|
type: SortedVector
|
|
elementType: Identifier
|
|
key:
|
|
- Value
|
|
TUPLE-TREE-YAML */
|
|
|
|
#include "revng/Model/Generated/Early/EnumEntry.h"
|
|
|
|
class model::EnumEntry : public model::generated::EnumEntry {
|
|
public:
|
|
using generated::EnumEntry::EnumEntry;
|
|
|
|
public:
|
|
// The entry should have a non-empty name, the name should not be a valid
|
|
// alias, and there should not be empty aliases.
|
|
bool verify() const debug_function;
|
|
bool verify(bool Assert) const debug_function;
|
|
bool verify(VerifyHelper &VH) const;
|
|
void dump() const debug_function;
|
|
};
|
|
|
|
#include "revng/Model/Generated/Late/EnumEntry.h"
|