MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
tok.h File Reference
#include <fe/assert.h>
#include "mim/util/dbg.h"
Include dependency graph for tok.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mim::ast::Tok

Namespaces

namespace  mim
namespace  mim::ast

Macros

#define CODE(name, ...)
#define CODE(name, assoc)
#define MIM_KEY(m)
#define CODE(t, str)
#define MIM_TOK(m)
#define MIM_SUBST(m)
#define CODE(t, str)
Precedence Table

X-macro listing all expression precedences from lowest to highest.

Each entry is m(name, assoc) where assoc is L, R, or N.

#define MIM_PREC(m)

Enumerations

enum class  mim::ast::Assoc {
  mim::ast::N ,
  mim::ast::L ,
  mim::ast::R
}
 Associativity of an infix expression. More...
enum class  mim::ast::Prec
 Expression precedences used by the parser and the dumper; ordered low to high. More...

Functions

constexpr Assoc mim::ast::prec_assoc (Prec p)
 Associativity of precedence level p.
constexpr bool mim::ast::is_rassoc (Prec p)
constexpr bool mim::ast::is_lassoc (Prec p)
constexpr bool mim::ast::should_reduce (Prec curr, Prec op)
 Should a Pratt parser reduce when the current binding power is curr and the infix operator has precedence op?

Variables

constexpr auto mim::ast::Num_Keys = size_t(0) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1) + size_t(1)

Macro Definition Documentation

◆ CODE [1/4]

#define CODE ( name,
assoc )
Value:
case Prec::name: return Assoc::assoc;

Definition at line 38 of file tok.h.

◆ CODE [2/4]

#define CODE ( name,
... )

◆ CODE [3/4]

#define CODE ( t,
str )
Value:
t,

Definition at line 38 of file tok.h.

◆ CODE [4/4]

#define CODE ( t,
str )
Value:
+ size_t(1)

Definition at line 38 of file tok.h.

◆ MIM_KEY

#define MIM_KEY ( m)

Definition at line 61 of file tok.h.

Referenced by mim::ast::Lexer::Lexer(), and mim::ast::Tok::tag2str().

◆ MIM_PREC

#define MIM_PREC ( m)
Value:
m(Err, N) \
m(Bot, N) \
m(Where, L) \
m(Arrow, R) \
m(Pi, N) \
m(Inj, R) \
m(App, L) \
m(Union, L) \
m(Extract, L) \
m(Lit, N)

Definition at line 19 of file tok.h.

Referenced by mim::ast::prec_assoc().

◆ MIM_SUBST

#define MIM_SUBST ( m)
Value:
m("lm", T_lm ) \
m("bot", T_bot ) \
m("top", T_top ) \
m("insert", K_ins ) \

Definition at line 157 of file tok.h.

Referenced by mim::ast::Lexer::Lexer().

◆ MIM_TOK

#define MIM_TOK ( m)

Definition at line 113 of file tok.h.

Referenced by mim::ast::Tok::tag2str().