#include <mim/ast/tok.h>
Public Member Functions | |
| Tok () | |
| Tok (Loc loc, Tag tag) | |
| Tok (Loc loc, char8_t c) | |
| Tok (Loc loc, uint64_t u) | |
| Tok (Loc loc, int64_t s) | |
| Tok (Loc loc, double d) | |
| Tok (Loc loc, uint64_t size, uint64_t val) | |
size and val of an Idx literal; World::lit_idx makes a Lit of it at emit time. | |
| Tok (Loc loc, Tag tag, Sym sym) | |
| bool | isa (Tag tag) const |
| Tag | tag () const |
| bool | has_sym () const |
| Dbg | dbg () const |
| Loc | loc () const |
| operator bool () const | |
| std::pair< uint64_t, uint64_t > | lit_i () const |
| char8_t | lit_c () const |
| uint64_t | lit_u () const |
| Sym | sym () const |
| std::string | str () const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, Tok tok) |
| std::ostream & | operator<< (std::ostream &os, Tok::Tag tag) |
Tag | |
| enum class | Tag { Nil , K_Bool , K_Cn , K_Fn , K_I1 , K_I16 , K_I32 , K_I64 , K_I8 , K_Idx , K_Nat , K_Type , K_Univ , K_and , K_anx , K_as , K_axm , K_cn , K_con , K_end , K_extern , K_ff , K_fn , K_fun , K_i1 , K_i16 , K_i32 , K_i64 , K_i8 , K_import , K_inj , K_lam , K_let , K_match , K_mod , K_norm , K_plugin , K_priv , K_pub , K_rec , K_ret , K_rule , K_Rule , K_tt , K_use , K_when , K_where , K_with , EoF , L_s , L_u , L_i , L_f , L_c , L_str , M_id , D_angle_l , D_angle_r , D_brace_l , D_brace_r , D_brckt_l , D_brckt_r , D_curly_l , D_curly_r , D_paren_l , D_paren_r , D_quote_l , D_quote_r , T_add , T_arrow_r , T_fat_arrow , T_assign , T_at , T_bot , T_top , T_box , T_colon , T_comma , T_div , T_dollar , T_dot , T_eq , T_extract , T_ge , T_gt , T_arrow_l , T_le , T_lm , T_lt , T_ne , T_rem , T_semicolon , T_shl , T_shr , T_star , T_sub , T_union , T_pipe } |
| static const char * | tag2str (Tok::Tag) |
| static constexpr bool | is_key (Tag tag) |
Is tag something the keyword table yields? MIM_KEY occupies [1, Num_Keys]; MIM_SUBST adds a few more. | |
| static constexpr std::optional< Prec > | infix_prec (Tag tag) |
Precedence of the infix operator tag; std::nullopt if tag isn't one. | |
| static constexpr std::string_view | infix_sym (Tag tag) |
Name the infix operator tag desugars to - including the leading ` ; empty for MIM_INFIX_CORE. | |
| static constexpr Tok::Tag | delim_l2r (Tag tag) |
| static constexpr bool | is_delim_r (Tag tag) |
|
strong |
|
inline |
Definition at line 277 of file tok.h.
Referenced by operator<<.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 269 of file tok.h.
References tag().
Referenced by mim::ast::TuplePtrn::delim_r().
|
inline |
|
inlinestaticconstexpr |
Name the infix operator tag desugars to - including the leading ` ; empty for MIM_INFIX_CORE.
Definition at line 260 of file tok.h.
References CODE, MIM_INFIX_SUGAR, and tag().
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
Definition at line 317 of file tok.h.
References isa().
Referenced by mim::ast::LitExpr::emit_(), mim::ast::negate(), and mim::ast::LitExpr::stream().
|
inline |
Definition at line 319 of file tok.h.
References isa().
Referenced by mim::ast::negate(), and mim::ast::LitExpr::stream().
|
inline |
|
inline |
|
inline |
Definition at line 310 of file tok.h.
Referenced by delim_l2r(), infix_prec(), infix_sym(), is_delim_r(), is_key(), isa(), mim::ast::negate(), operator<<, operator<<, tag2str(), Tok(), and Tok().
|
static |
Definition at line 10 of file tok.cpp.
References CODE, MIM_KEY, MIM_TOK, and tag().
Referenced by mim::ast::InfixExpr::emit_(), operator<<, operator<<, and mim::ast::InfixExpr::stream().
|
friend |
Definition at line 30 of file tok.cpp.
References has_sym(), operator<<, sym(), tag(), tag2str(), and Tok().
Referenced by operator<<.
|
friend |