nixd
Toggle main menu visibility
Loading...
Searching...
No Matches
libnixf
include
nixf
Sema
PrimOpInfo.h
Go to the documentation of this file.
1
#include <cstdint>
2
#include <map>
3
#include <string>
4
#include <vector>
5
6
namespace
nixf
{
7
8
/**
9
* Info about a primitive operation, but omit the implementation.
10
*/
11
struct
PrimOpInfo
{
12
/**
13
* Names of the parameters of a primop, for primops that take a
14
* fixed number of arguments to be substituted for these parameters.
15
*/
16
std::vector<std::string>
Args
;
17
18
/**
19
* Aritiy of the primop.
20
*
21
* If `args` is not empty, this field will be computed from that
22
* field instead, so it doesn't need to be manually set.
23
*/
24
size_t
Arity
= 0;
25
26
/**
27
* Optional free-form documentation about the primop.
28
*/
29
std::string
Doc
;
30
31
/**
32
* If true, this primop is not exposed to the user.
33
*/
34
bool
Internal
;
35
};
36
37
extern
std::map<std::string, nixf::PrimOpInfo>
PrimOpsInfo
;
38
39
/// \brief Result of looking up a primop by name.
40
enum class
PrimopLookupResult
: std::uint8_t {
41
/// The primop was found with an exact match.
42
Found
,
43
/// The primop was found, but needs "builtin." prefix.
44
PrefixedFound
,
45
/// The primop was not found.
46
NotFound
,
47
};
48
49
/// \brief Look up information about a global primop by name.
50
PrimopLookupResult
lookupGlobalPrimOpInfo
(
const
std::string &Name);
51
52
}
// namespace nixf
nixf
Definition
Diagnostic.h:19
nixf::lookupGlobalPrimOpInfo
PrimopLookupResult lookupGlobalPrimOpInfo(const std::string &Name)
Look up information about a global primop by name.
Definition
PrimOpLookup.cpp:5
nixf::PrimOpsInfo
std::map< std::string, nixf::PrimOpInfo > PrimOpsInfo
nixf::PrimopLookupResult
PrimopLookupResult
Result of looking up a primop by name.
Definition
PrimOpInfo.h:40
nixf::PrimopLookupResult::PrefixedFound
@ PrefixedFound
The primop was found, but needs "builtin." prefix.
Definition
PrimOpInfo.h:44
nixf::PrimopLookupResult::NotFound
@ NotFound
The primop was not found.
Definition
PrimOpInfo.h:46
nixf::PrimopLookupResult::Found
@ Found
The primop was found with an exact match.
Definition
PrimOpInfo.h:42
nixf::PrimOpInfo
Definition
PrimOpInfo.h:11
nixf::PrimOpInfo::Args
std::vector< std::string > Args
Definition
PrimOpInfo.h:16
nixf::PrimOpInfo::Internal
bool Internal
Definition
PrimOpInfo.h:34
nixf::PrimOpInfo::Arity
size_t Arity
Definition
PrimOpInfo.h:24
nixf::PrimOpInfo::Doc
std::string Doc
Definition
PrimOpInfo.h:29
Generated by
1.17.0