MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/axm.h>
4#include <mim/plugin.h>
5
6/// @namespace mim::plug::option @ref option
7namespace mim {
8namespace plug::option {
9
10static constexpr plugin_t Plugin_Id = 0x41154a40f0000000;
11
12/// @name %%option.Opt
13///@{
14enum class Opt : flags_t {
15};
16
17///@}
18
19/// @name %%option.some
20///@{
21enum class some : flags_t {
22};
23
24///@}
25
26/// @name %%option.none
27///@{
28enum class none : flags_t {
29};
30
31///@}
32
33/// @name %%option.is_some
34///@{
35enum class is_some : flags_t {
36};
37
38///@}
39
40/// @name %%option.unwrap_unsafe
41///@{
42enum class unwrap_unsafe : flags_t {
43};
44
45const Def* normalize_unwrap_unsafe(const Def*, const Def*, const Def*);
46///@}
47
48/// @name %%option.unwrap_or
49///@{
50enum class unwrap_or : flags_t {
51};
52
53///@}
54
56
57#define MIM_option_NORMALIZER_IMPL \
58 void register_normalizers(Normalizers& normalizers) {\
59 normalizers[flags_t(Annex::Base<unwrap_unsafe>)] = &normalize_unwrap_unsafe; \
60 }
61} // namespace plug::option
62
63#ifndef DOXYGEN // don't include in Doxygen documentation
64
65template<> constexpr flags_t Annex::Base<plug::option::Opt> = 0x41154a40f0000000;
66template<> constexpr size_t Annex::Num<plug::option::Opt> = 0;
67template<> constexpr flags_t Annex::Base<plug::option::some> = 0x41154a40f0000100;
68template<> constexpr size_t Annex::Num<plug::option::some> = 0;
69template<> constexpr flags_t Annex::Base<plug::option::none> = 0x41154a40f0000200;
70template<> constexpr size_t Annex::Num<plug::option::none> = 0;
71template<> constexpr flags_t Annex::Base<plug::option::is_some> = 0x41154a40f0000300;
72template<> constexpr size_t Annex::Num<plug::option::is_some> = 0;
73template<> constexpr flags_t Annex::Base<plug::option::unwrap_unsafe> = 0x41154a40f0000400;
74template<> constexpr size_t Annex::Num<plug::option::unwrap_unsafe> = 0;
75template<> constexpr flags_t Annex::Base<plug::option::unwrap_or> = 0x41154a40f0000500;
76template<> constexpr size_t Annex::Num<plug::option::unwrap_or> = 0;
77
78template<> struct Axm::IsANode<plug::option::Opt> { using type = Axm; };
79template<> struct Axm::IsANode<plug::option::some> { using type = Axm; };
80template<> struct Axm::IsANode<plug::option::none> { using type = Axm; };
81template<> struct Axm::IsANode<plug::option::is_some> { using type = Axm; };
82template<> struct Axm::IsANode<plug::option::unwrap_or> { using type = Axm; };
83
84#endif
85} // namespace mim
86
87#ifndef DOXYGEN // don't include in Doxygen documentation
88
89
90#endif
Base class for all Defs.
Definition def.h:252
The option Plugin
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_unwrap_unsafe(const Def *, const Def *, const Def *arg)
void register_normalizers(Normalizers &normalizers)
Definition ast.h:14
u64 flags_t
Definition types.h:46
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:47
@ Axm
Definition def.h:115
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:116
static constexpr flags_t Base
Definition plugin.h:117