MimIR
0.5-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
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
7
namespace
mim
{
8
namespace
plug::option
{
9
10
static
constexpr
plugin_t
Plugin_Id
= 0x41154a40f0000000;
11
12
/// @name `option.Opt`
13
///@{
14
enum class
Opt
:
flags_t
{
15
};
16
17
/// The ctors of `option.Opt`, by index.
18
struct
Opt_ctor
{ enum :
nat_t
{
None
= 0,
Some
= 1, }; };
19
20
///@}
21
22
/// @name `option.some_if`
23
///@{
24
enum class
some_if
:
flags_t
{
25
};
26
27
///@}
28
29
/// @name `option.is_some`
30
///@{
31
enum class
is_some
:
flags_t
{
32
};
33
34
///@}
35
36
/// @name `option.unwrap_unsafe`
37
///@{
38
enum class
unwrap_unsafe
:
flags_t
{
39
};
40
41
const
Def
*
normalize_unwrap_unsafe
(
const
Def
*,
const
Def
*,
const
Def
*);
42
///@}
43
44
/// @name `option.unwrap_or`
45
///@{
46
enum class
unwrap_or
:
flags_t
{
47
};
48
49
///@}
50
51
void
register_normalizers
(
Normalizers
& normalizers);
52
53
#define MIM_option_NORMALIZER_IMPL \
54
void register_normalizers(Normalizers& normalizers) {\
55
normalizers[flags_t(Annex::Base<unwrap_unsafe>)] = &normalize_unwrap_unsafe; \
56
}
57
}
// namespace plug::option
58
59
#ifndef DOXYGEN
// don't include in Doxygen documentation
60
61
template
<>
constexpr
flags_t
Annex::Base<plug::option::Opt>
= 0x41154a40f0000000;
62
template
<>
constexpr
size_t
Annex::Num<plug::option::Opt>
= 0;
63
template
<>
constexpr
flags_t
Annex::Base<plug::option::some_if>
= 0x41154a40f0000100;
64
template
<>
constexpr
size_t
Annex::Num<plug::option::some_if>
= 0;
65
template
<>
constexpr
flags_t
Annex::Base<plug::option::is_some>
= 0x41154a40f0000200;
66
template
<>
constexpr
size_t
Annex::Num<plug::option::is_some>
= 0;
67
template
<>
constexpr
flags_t
Annex::Base<plug::option::unwrap_unsafe>
= 0x41154a40f0000300;
68
template
<>
constexpr
size_t
Annex::Num<plug::option::unwrap_unsafe>
= 0;
69
template
<>
constexpr
flags_t
Annex::Base<plug::option::unwrap_or>
= 0x41154a40f0000400;
70
template
<>
constexpr
size_t
Annex::Num<plug::option::unwrap_or>
= 0;
71
72
template
<>
struct
Axm::IsANode
<
plug
::option::Opt> {
using
type
=
Axm
; };
73
template
<>
struct
Axm::IsANode
<
plug
::option::some_if> {
using
type
=
Axm
; };
74
template
<>
struct
Axm::IsANode
<
plug
::option::is_some> {
using
type
=
Axm
; };
75
template
<>
struct
Axm::IsANode
<
plug
::option::unwrap_or> {
using
type
=
Axm
; };
76
77
#endif
78
}
// namespace mim
79
80
#ifndef DOXYGEN
// don't include in Doxygen documentation
81
82
83
#endif
axm.h
mim::Axm::IsANode::type
App type
Definition
axm.h:70
mim::Axm::IsANode
Definition
axm.h:69
mim::Def
Base class for all Defs.
Definition
def.h:289
mim::plug::option
The option Plugin
Definition
normalizers.cpp:5
mim::plug::option::Plugin_Id
static constexpr plugin_t Plugin_Id
Definition
autogen.h:10
mim::plug::option::unwrap_or
unwrap_or
Definition
autogen.h:46
mim::plug::option::is_some
is_some
Definition
autogen.h:31
mim::plug::option::Opt
Opt
Definition
autogen.h:14
mim::plug::option::unwrap_unsafe
unwrap_unsafe
Definition
autogen.h:38
mim::plug::option::normalize_unwrap_unsafe
const Def * normalize_unwrap_unsafe(const Def *, const Def *, const Def *arg)
Definition
normalizers.cpp:7
mim::plug::option::some_if
some_if
Definition
autogen.h:24
mim::plug::option::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug
Definition
affine.h:10
mim
Definition
ast.h:16
mim::nat_t
u64 nat_t
Definition
types.h:37
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::Normalizers
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition
plugin.h:27
mim::plugin_t
u64 plugin_t
Definition
types.h:40
mim::Node::Axm
@ Axm
Definition
def.h:125
plugin.h
mim::Annex::Num
static constexpr size_t Num
Number of Axm::subtags.
Definition
plugin.h:273
mim::Annex::Base
static constexpr flags_t Base
Definition
plugin.h:274
mim::plug::option::Opt_ctor
The ctors of option.Opt, by index.
Definition
autogen.h:18
mim::plug::option::Opt_ctor::None
@ None
Definition
autogen.h:18
mim::plug::option::Opt_ctor::Some
@ Some
Definition
autogen.h:18
build
include
mim
plug
option
autogen.h
Generated by
1.18.0