MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
family.h File Reference

Families of Tok::Tag as reusable case labels; include this in *.cpp files only. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define C_PRIMARY
#define C_ID   M_id
#define C_LIT
#define C_LIT_NUM
 Numeric literals that a leading sign may be applied to.
#define C_SIGN
 Leading sign of a numeric literal.
#define C_LIT_TYPED
 Literals that already determine their type and hence must not be ascribed one.
#define C_LAM
#define C_RULE
#define C_IMPORT
#define C_DECL
#define C_DS
 Direct-style binders; all other binders are CPS.
#define C_CN
 Binders whose domain binds as tight as a Cn, i.e. no codomain follows.
#define C_FN
 Binders that receive an implicit ret continuation.
#define C_SEQ
#define C_PI
#define C_LM
#define C_EXPR
#define C_CURRIED_B
#define C_CURRIED_P
#define ISA(tag, family)
 Turns such a family into a predicate - a case label is of no use outside of a switch.

Detailed Description

Families of Tok::Tag as reusable case labels; include this in *.cpp files only.

A family expands to first: case Tag::second: ... and hence must be used as case Tag::C_FAMILY:. Families compose: a family may name another one. The including file must provide using Tag = Tok::Tag;.

Definition in file family.h.

Macro Definition Documentation

◆ C_CN

#define C_CN
Value:
K_Cn: \
case Tag::K_cn: \
case Tag::K_con

Binders whose domain binds as tight as a Cn, i.e. no codomain follows.

Definition at line 89 of file family.h.

Referenced by mim::ast::PiExpr::bind(), and mim::ast::LamDecl::bind_decl().

◆ C_CURRIED_B

#define C_CURRIED_B
Value:
D_brace_l: \
case Tag::D_brckt_l: \
case Tag::D_quote_l

Definition at line 130 of file family.h.

◆ C_CURRIED_P

#define C_CURRIED_P
Value:
D_brace_l: \
case Tag::D_brckt_l: \
case Tag::D_paren_l

Definition at line 135 of file family.h.

◆ C_DECL

#define C_DECL
Value:
K_axm: \
case Tag::K_let: \
case Tag::K_mod: \
case Tag::K_rec: \
case Tag::K_use: \
case Tag::C_IMPORT: \
case Tag::C_RULE: \
case Tag::C_LAM

Definition at line 73 of file family.h.

◆ C_DS

#define C_DS
Value:
T_lm: \
case Tag::K_lam

Direct-style binders; all other binders are CPS.

Definition at line 84 of file family.h.

Referenced by mim::ast::LamDecl::bind_decl(), and mim::ast::LamDecl::emit_decl().

◆ C_EXPR

#define C_EXPR
Value:
case Tag::C_ID: \
case Tag::C_LIT: \
case Tag::C_DECL: \
case Tag::C_PI: \
case Tag::C_LM: \
case Tag::K_Type: \
case Tag::K_Rule: \
case Tag::K_match: \
case Tag::K_ret: \
case Tag::C_SEQ: \
case Tag::D_brckt_l: \
case Tag::D_curly_l: \
case Tag::D_paren_l
#define C_PRIMARY
Definition family.h:10

Definition at line 114 of file family.h.

◆ C_FN

#define C_FN
Value:
K_Fn: \
case Tag::K_fn: \
case Tag::K_fun

Binders that receive an implicit ret continuation.

Definition at line 95 of file family.h.

◆ C_ID

#define C_ID   M_id

Definition at line 30 of file family.h.

◆ C_IMPORT

#define C_IMPORT
Value:
K_import: \
case Tag::K_plugin

Definition at line 69 of file family.h.

◆ C_LAM

#define C_LAM
Value:
K_lam: \
case Tag::K_con: \
case Tag::K_fun

Definition at line 60 of file family.h.

◆ C_LIT

#define C_LIT
Value:
T_bot: \
case Tag::T_top: \
case Tag::L_str: \
case Tag::L_c: \
case Tag::L_s: \
case Tag::L_u: \
case Tag::L_f: \
case Tag::L_i

Definition at line 32 of file family.h.

◆ C_LIT_NUM

#define C_LIT_NUM
Value:
L_s: \
case Tag::L_u: \
case Tag::L_f: \
case Tag::L_i

Numeric literals that a leading sign may be applied to.

Definition at line 43 of file family.h.

◆ C_LIT_TYPED

#define C_LIT_TYPED
Value:
L_str: \
case Tag::L_c: \
case Tag::L_i

Literals that already determine their type and hence must not be ascribed one.

Definition at line 55 of file family.h.

Referenced by mim::ast::LitExpr::bind().

◆ C_LM

#define C_LM
Value:
T_lm: \
case Tag::K_cn: \
case Tag::K_fn

Definition at line 109 of file family.h.

◆ C_PI

#define C_PI
Value:
D_brace_l: \
case Tag::K_Cn: \
case Tag::K_Fn

Definition at line 104 of file family.h.

◆ C_PRIMARY

#define C_PRIMARY
Value:
K_Univ: \
case Tag::K_Nat: \
case Tag::K_Idx: \
case Tag::K_Bool: \
case Tag::K_ff: \
case Tag::K_tt: \
case Tag::K_i1: \
case Tag::K_i8: \
case Tag::K_i16: \
case Tag::K_i32: \
case Tag::K_i64: \
case Tag::K_I1: \
case Tag::K_I8: \
case Tag::K_I16: \
case Tag::K_I32: \
case Tag::K_I64: \
case Tag::T_star: \
case Tag::T_box

Definition at line 10 of file family.h.

◆ C_RULE

#define C_RULE
Value:
K_norm: \
case Tag::K_rule

Definition at line 65 of file family.h.

◆ C_SEQ

#define C_SEQ
Value:
D_angle_l: \
case Tag::D_quote_l

Definition at line 100 of file family.h.

◆ C_SIGN

#define C_SIGN
Value:
T_add: \
case Tag::T_sub

Leading sign of a numeric literal.

Definition at line 50 of file family.h.

◆ ISA

#define ISA ( tag,
family )
Value:
([&] { \
switch (tag) { \
case Tok::Tag::family: return true; \
default: return false; \
} \
}())

Turns such a family into a predicate - a case label is of no use outside of a switch.

Definition at line 142 of file family.h.

Referenced by mim::ast::LitExpr::bind(), mim::ast::PiExpr::bind(), mim::ast::LamDecl::bind_decl(), and mim::ast::LamDecl::emit_decl().