MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::ast Namespace Reference

Classes

struct  AnnexInfo
class  AST
class  Node
class  Expr
class  Decl
class  ValDecl
class  Ptrn
class  ErrorPtrn
class  IdPtrn
 dbg: type More...
class  GrpPtrn
 If you have x1 x2 x3 x4: T it consists of 3 GrpPtrns and 1 IdPtrn while each GrpPtrn references the last IdPtrn. More...
class  AliasPtrn
 ptrn as id More...
class  TuplePtrn
 (ptrn_0, ..., ptrn_n-1), [ptrn_0, ..., ptrn_n-1], or {ptrn_0, ..., ptrn_n-1} More...
class  ErrorExpr
class  HoleExpr
class  IdExpr
 sym More...
class  PrimaryExpr
 tag More...
class  LitExpr
 tok:type More...
class  DeclExpr
 decls e or e where decls if where is true. More...
class  TypeExpr
 Type level More...
class  RuleExpr
 Reform (type of a rule) Rule type. More...
class  UnionExpr
 t1 ∪ t2 More...
class  InjExpr
 value inj t1 ∪ t2 More...
class  MatchExpr
class  ArrowExpr
 dom -> codom More...
class  PiExpr
 One of: More...
class  LamExpr
 Wraps a LamDecl as Expr. More...
class  AppExpr
 callee arg More...
class  RetExpr
 ret ptrn = callee $ arg; body More...
class  SigmaExpr
 Just wraps TuplePtrn as Expr. More...
class  TupleExpr
 (elem_0, ..., elem_n-1) More...
class  SeqExpr
 «dbg: arity; body» or ‹dbg: arity; body› More...
class  ExtractExpr
 tuple#index More...
class  InsertExpr
 ins(tuple, index, value) More...
class  UniqExpr
 ⦃ expr ⦄ More...
class  LetDecl
 let ptrn: type = value; More...
class  AxmDecl
 axm ptrn: type = value; More...
class  RecDecl
 .rec dbg: type = body More...
class  LamDecl
 One of: More...
class  CDecl
 cfun dbg dom -> codom More...
class  RuleDecl
 rewrite rules rule (x:T, y:T) : x+y => y+x (when ); all meta variables have to be introduced More...
class  Import
class  Module
class  Lexer
class  Parser
 Parses Mim code as AST. More...
class  Tok
class  DummyDecl
class  Scopes
class  Emitter
struct  S
struct  R
struct  AnnexInfo.sym
struct  AnnexInfo.id

Typedefs

template<class T>
using Ptr = fe::Arena::Ptr<const T>
template<class T>
using Ptrs = std::deque<Ptr<T>>
using Dbgs = std::deque<Dbg>
using Tag = Tok::Tag

Enumerations

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

Functions

AST load_plugins (World &, View< Sym >)
AST load_plugins (World &w, View< std::string > plugins)
AST load_plugins (World &w, Sym sym)
AST load_plugins (World &w, const std::string &plugin)
constexpr Assoc prec_assoc (Prec p)
 Associativity of precedence level p.
constexpr bool is_rassoc (Prec p)
constexpr bool is_lassoc (Prec p)
constexpr bool 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?
std::ostream operator
std::ostream & operator<< (std::ostream &os, Tok tok)

Variables

constexpr size_t Look_Ahead = 2
constexpr auto 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)

Class Documentation

◆ mim::ast::AnnexInfo.sym

struct mim::ast::AnnexInfo.sym

Definition at line 34 of file ast.h.

Class Members
Sym plugin
Sym tag

◆ mim::ast::AnnexInfo.id

struct mim::ast::AnnexInfo.id

Definition at line 37 of file ast.h.

Class Members
uint8_t curry
plugin_t plugin
tag_t tag
uint8_t trip

Typedef Documentation

◆ Dbgs

using mim::ast::Dbgs = std::deque<Dbg>

Definition at line 25 of file ast.h.

◆ Ptr

template<class T>
using mim::ast::Ptr = fe::Arena::Ptr<const T>

Definition at line 22 of file ast.h.

◆ Ptrs

template<class T>
using mim::ast::Ptrs = std::deque<Ptr<T>>

Definition at line 24 of file ast.h.

◆ Tag

Definition at line 7 of file bind.cpp.

Enumeration Type Documentation

◆ Assoc

enum class mim::ast::Assoc
strong

Associativity of an infix expression.

Enumerator

Definition at line 34 of file tok.h.

◆ Prec

enum class mim::ast::Prec
strong

Expression precedences used by the parser and the dumper; ordered low to high.

Definition at line 37 of file tok.h.

Function Documentation

◆ is_lassoc()

bool mim::ast::is_lassoc ( Prec p)
constexpr

Definition at line 54 of file tok.h.

References L, and prec_assoc().

◆ is_rassoc()

bool mim::ast::is_rassoc ( Prec p)
constexpr

Definition at line 53 of file tok.h.

References prec_assoc(), and R.

Referenced by should_reduce().

◆ load_plugins() [1/4]

AST mim::ast::load_plugins ( World & world,
View< Sym > plugins )

◆ load_plugins() [2/4]

AST mim::ast::load_plugins ( World & w,
const std::string & plugin )
inline

Definition at line 1139 of file ast.h.

References load_plugins().

◆ load_plugins() [3/4]

AST mim::ast::load_plugins ( World & w,
Sym sym )
inline

Definition at line 1138 of file ast.h.

References load_plugins().

◆ load_plugins() [4/4]

AST mim::ast::load_plugins ( World & w,
View< std::string > plugins )
inline

Definition at line 1135 of file ast.h.

References load_plugins().

◆ operator<<()

std::ostream & mim::ast::operator<< ( std::ostream & os,
Tok tok )

Definition at line 30 of file tok.cpp.

◆ prec_assoc()

Assoc mim::ast::prec_assoc ( Prec p)
constexpr

Associativity of precedence level p.

Definition at line 44 of file tok.h.

References CODE, and MIM_PREC.

Referenced by is_lassoc(), and is_rassoc().

◆ should_reduce()

bool mim::ast::should_reduce ( Prec curr,
Prec op )
constexpr

Should a Pratt parser reduce when the current binding power is curr and the infix operator has precedence op?

Definition at line 58 of file tok.h.

References is_rassoc().

Variable Documentation

◆ Look_Ahead

size_t mim::ast::Look_Ahead = 2
constexpr

Definition at line 10 of file parser.h.

◆ Num_Keys

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)
constexpr

Definition at line 110 of file tok.h.