Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::Tok Class Reference

#include <thorin/fe/tok.h>

Public Member Functions

 Tok ()
 
 Tok (Loc loc, Tag tag)
 
 Tok (Loc loc, char8_t c)
 
 Tok (Loc loc, u64 u)
 
 Tok (Loc loc, s64 s)
 
 Tok (Loc loc, f64 f)
 
 Tok (Loc loc, const Lit *i)
 
 Tok (Loc loc, Tag tag, Sym sym)
 
bool isa (Tag tag) const
 
Tag tag () const
 
Dbg dbg () const
 
Loc loc () const
 
 operator bool () const
 
const Litlit_i () const
 
char8_t lit_c () const
 
u64 lit_u () const
 
Sym sym () const
 

Precedence

enum class  Prec { CODE }
 
static constexpr std::array< Prec, 2 > prec (Prec p)
 
static Prec prec (const Def *)
 

Tag

enum class  Tag {
  Nil ,
  CODE ,
  K_module ,
  K_import ,
  K_plugin ,
  K_ax ,
  K_def ,
  K_let ,
  K_ret ,
  K_Nat ,
  K_Idx ,
  K_extern ,
  K_Sigma ,
  K_Type ,
  K_Univ ,
  K_Cn ,
  K_Fn ,
  K_Pi ,
  K_con ,
  K_fun ,
  K_lam ,
  K_cn ,
  K_fn ,
  K_ff ,
  K_tt ,
  K_ins ,
  K_i1 ,
  K_i8 ,
  K_i16 ,
  K_i32 ,
  K_i64 ,
  K_Bool ,
  K_I1 ,
  K_I8 ,
  K_I16 ,
  K_I32 ,
  K_I64 ,
  EoF ,
  L_s ,
  L_u ,
  L_i ,
  L_f ,
  L_c ,
  M_id ,
  M_anx ,
  M_str ,
  D_angle_l ,
  D_angle_r ,
  D_brace_l ,
  D_brace_r ,
  D_brckt_l ,
  D_brckt_r ,
  D_paren_l ,
  D_paren_r ,
  D_quote_l ,
  D_quote_r ,
  T_Pi ,
  T_arrow ,
  T_assign ,
  T_at ,
  T_backtick ,
  T_bang ,
  T_bot ,
  T_top ,
  T_box ,
  T_colon ,
  T_colon_colon ,
  T_comma ,
  T_dollar ,
  T_dot ,
  T_extract ,
  T_lm ,
  T_semicolon ,
  T_star
}
 
static std::string_view tag2str (Tok::Tag)
 
static constexpr Tok::Tag delim_l2r (Tag tag)
 

Detailed Description

Definition at line 115 of file tok.h.

Member Enumeration Documentation

◆ Prec

enum class thorin::Tok::Prec
strong
Enumerator
CODE 

Definition at line 119 of file tok.h.

◆ Tag

enum class thorin::Tok::Tag
strong
Enumerator
Nil 
CODE 
K_module 
K_import 
K_plugin 
K_ax 
K_def 
K_let 
K_ret 
K_Nat 
K_Idx 
K_extern 
K_Sigma 
K_Type 
K_Univ 
K_Cn 
K_Fn 
K_Pi 
K_con 
K_fun 
K_lam 
K_cn 
K_fn 
K_ff 
K_tt 
K_ins 
K_i1 
K_i8 
K_i16 
K_i32 
K_i64 
K_Bool 
K_I1 
K_I8 
K_I16 
K_I32 
K_I64 
EoF 
L_s 
L_u 
L_i 
L_f 
L_c 
M_id 
M_anx 
M_str 
D_angle_l 
D_angle_r 
D_brace_l 
D_brace_r 
D_brckt_l 
D_brckt_r 
D_paren_l 
D_paren_r 
D_quote_l 
D_quote_r 
T_Pi 
T_arrow 
T_assign 
T_at 
T_backtick 
T_bang 
T_bot 
T_top 
T_box 
T_colon 
T_colon_colon 
T_comma 
T_dollar 
T_dot 
T_extract 
T_lm 
T_semicolon 
T_star 

Definition at line 139 of file tok.h.

Constructor & Destructor Documentation

◆ Tok() [1/8]

thorin::Tok::Tok ( )
inline

Definition at line 152 of file tok.h.

◆ Tok() [2/8]

thorin::Tok::Tok ( Loc  loc,
Tag  tag 
)
inline

Definition at line 153 of file tok.h.

◆ Tok() [3/8]

thorin::Tok::Tok ( Loc  loc,
char8_t  c 
)
inline

Definition at line 156 of file tok.h.

◆ Tok() [4/8]

thorin::Tok::Tok ( Loc  loc,
u64  u 
)
inline

Definition at line 160 of file tok.h.

◆ Tok() [5/8]

thorin::Tok::Tok ( Loc  loc,
s64  s 
)
inline

Definition at line 164 of file tok.h.

◆ Tok() [6/8]

thorin::Tok::Tok ( Loc  loc,
f64  f 
)
inline

Definition at line 168 of file tok.h.

◆ Tok() [7/8]

thorin::Tok::Tok ( Loc  loc,
const Lit i 
)
inline

Definition at line 172 of file tok.h.

◆ Tok() [8/8]

thorin::Tok::Tok ( Loc  loc,
Tag  tag,
Sym  sym 
)
inline

Definition at line 176 of file tok.h.

References tag().

Member Function Documentation

◆ dbg()

Dbg thorin::Tok::dbg ( ) const
inline

Definition at line 185 of file tok.h.

References loc(), and sym().

◆ delim_l2r()

static constexpr Tok::Tag thorin::Tok::delim_l2r ( Tag  tag)
inlinestaticconstexpr

Definition at line 147 of file tok.h.

References tag().

◆ isa()

bool thorin::Tok::isa ( Tag  tag) const
inline

Definition at line 183 of file tok.h.

References tag().

Referenced by lit_c(), lit_i(), lit_u(), and sym().

◆ lit_c()

char8_t thorin::Tok::lit_c ( ) const
inline

Definition at line 190 of file tok.h.

References isa().

◆ lit_i()

const Lit * thorin::Tok::lit_i ( ) const
inline

Definition at line 189 of file tok.h.

References isa().

◆ lit_u()

u64 thorin::Tok::lit_u ( ) const
inline

Definition at line 191 of file tok.h.

References isa().

◆ loc()

Loc thorin::Tok::loc ( ) const
inline

Definition at line 186 of file tok.h.

Referenced by dbg().

◆ operator bool()

thorin::Tok::operator bool ( ) const
inlineexplicit

Definition at line 187 of file tok.h.

◆ prec() [1/2]

Tok::Prec thorin::Tok::prec ( const Def def)
static

Definition at line 31 of file tok.cpp.

◆ prec() [2/2]

static constexpr std::array< Prec, 2 > thorin::Tok::prec ( Prec  p)
inlinestaticconstexpr

Definition at line 125 of file tok.h.

References CODE, and THORIN_PREC.

◆ sym()

Sym thorin::Tok::sym ( ) const
inline

Definition at line 192 of file tok.h.

References isa().

Referenced by dbg().

◆ tag()

Tag thorin::Tok::tag ( ) const
inline

Definition at line 184 of file tok.h.

Referenced by delim_l2r(), isa(), tag2str(), and Tok().

◆ tag2str()

std::string_view thorin::Tok::tag2str ( Tok::Tag  tag)
static

Definition at line 10 of file tok.cpp.

References CODE, tag(), THORIN_KEY, and THORIN_TOK.


The documentation for this class was generated from the following files: