Classes | |
| class | AliasDecl |
| anx dbg = path; - a compiler-exposed alias sharing its target's annex slot. More... | |
| class | AliasPtrn |
| ptrn as dbg More... | |
| struct | AnnexInfo |
| Bookkeeping of an annex introduced by an AxmDecl. More... | |
| class | AppExpr |
| callee arg More... | |
| class | AST |
| Owns the arena all AST nodes live in as well as the AnnexInfos of all plugins. More... | |
| class | AxmDecl |
| axm dbg: type, normalizer, curry, trip; More... | |
| struct | Bind |
| One name in a Scope: the Decl it introduces and the Vis of this binding. More... | |
| class | Decl |
| Base class of all declarations; caches the emitted Decl::def. More... | |
| class | DeclExpr |
| decls expr or expr where decls if DeclExpr::is_where. More... | |
| class | DummyDecl |
| class | Emitter |
| class | ErrorExpr |
| Erroneous expression. More... | |
| class | ErrorPtrn |
| Erroneous pattern. More... | |
| class | Expr |
| Base class of all expressions. More... | |
| class | File |
| The AST of one source file: an anonymous ModDecl that a UseDecl binds under a name of its own. More... | |
| class | GrpPtrn |
| dbg of a group dbg_0 ... dbg_n-1: type that refers to the trailing IdPtrn::id. More... | |
| class | HoleExpr |
| ? More... | |
| class | IdPtrn |
| dbg: type More... | |
| class | InfixExpr |
| lhs op rhs; InfixExpr::op picks the meaning - see MIM_INFIX. More... | |
| class | LamDecl |
| tag dbg dom_0 ... dom_n-1: codom = body; with LamDecl::tag lam/con/fun or anonymous λ/cn/fn. More... | |
| class | LamExpr |
| Wraps a LamDecl as Expr. More... | |
| class | LetDecl |
| let ptrn = value; More... | |
| class | Lexer |
| class | LitExpr |
| tok:type More... | |
| class | MatchExpr |
| match scrutinee with | arm_0 | ... | arm_n-1 More... | |
| class | ModDecl |
| mod dbg { decls }; also the base of the anonymous File. More... | |
| struct | Mods |
| Raw, unvalidated combination of priv/pub/extern/anx modifiers written before a declaration. More... | |
| class | Node |
| Base class of all AST nodes. More... | |
| class | Parser |
| Parses Mim code as AST. More... | |
| class | Path |
| dbg_0.....dbg_n-1. More... | |
| class | PathExpr |
| path More... | |
| class | PiExpr |
| dom → codom, Cn dom, or Fn dom → codom depending on PiExpr::tag. More... | |
| class | PrimaryExpr |
| tag More... | |
| class | Ptrn |
| Base class of all patterns. More... | |
| struct | R |
| class | RecDecl |
| rec dbg = body; with an optional and RecDecl::next. More... | |
| class | RetExpr |
| ret ptrn = callee $ arg; body More... | |
| class | RuleDecl |
| rule dbg var: lhs when guard => rhs; or norm instead of rule if RuleDecl::is_normalizer. More... | |
| class | RuleExpr |
| Rule dom More... | |
| struct | S |
| class | Scopes |
| class | SeqExpr |
| «arity; body» or ‹arity; body› if SeqExpr::is_pack. More... | |
| class | SigmaExpr |
| Wraps a TuplePtrn as Expr. More... | |
| class | Tok |
| class | TupleExpr |
| (elem_0, ..., elem_n-1) More... | |
| class | TuplePtrn |
| (ptrn_0, ..., ptrn_n-1), [ptrn_0, ..., ptrn_n-1], or {ptrn_0, ..., ptrn_n-1} More... | |
| class | TypeExpr |
| Type level More... | |
| class | UniqExpr |
| ⦃inhabitant⦄ More... | |
| class | UseDecl |
| import "file"|name [as alias|*];, plugin name [as alias|*];, or use path [as alias|*]; as * splices instead of naming; a use without an as is sugar for as *. More... | |
| class | ValDecl |
| Base class of all declarations that bind values. More... | |
Typedefs | |
| template<class T> | |
| using | Ptr = fe::Arena::Ref<const T> |
| Nodes live in the AST's Arena and are never destroyed, so this merely points at one. | |
| using | Scope = fe::SymMap<Bind> |
| Maps a name to the Binding introducing it. | |
| using | Tag = Tok::Tag |
Ptrs/Dbgs | |
Scratch buffers the Parser fills before it creates a node; a node keeps its own lists right behind itself - see fe::VLA - and hands them out as a fe::View. | |
| template<class T> | |
| using | Ptrs = fe::Vector<Ptr<T>> |
| using | Dbgs = fe::Vector<Dbg> |
Enumerations | |
| enum class | Vis { Priv , Pub } |
| Visibility tier of a ValDecl. More... | |
| 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 &, fe::View< std::string >) |
| AST | load_plugin (World &w, std::string_view 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? | |
| static std::optional< nat_t > | isa_math_f (Emitter &e, const Def *type) |
If type is a math.F type of known precision/exponent, yields its bit width. | |
| static u64 | encode_f (Emitter &e, Loc loc, const Def *t, u64 bits) |
A float Tok stores its value as mim::f64 bits; re-encode them for the width of the annotated type t. | |
| static void | emit_union (Emitter &e, const Expr *expr, DefVec &types) |
| a ∪ b ∪ c is one n-ary Join, so flatten the left spine the left-associative parse built. | |
| static Tok | negate (Tok tok) |
| Applies a leading - to a numeric literal Tok. | |
| template<class T> | |
| static void | stream_decls (fe::Tab &tab, std::ostream &os, fe::View< Ptr< T > > decls) |
| static std::string_view | vis2str (Vis vis) |
| static std::ostream & | operator<< (std::ostream &os, const Mods &mods) |
| Prints vis/extern/anx, skipping vis if it's the modifier-nudged Mods::default_vis. | |
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) + size_t(1) |
| constexpr auto | Num_Subst = size_t(0) + size_t(1) + size_t(1) + size_t(1) |
| struct mim::ast::Bind |
| using mim::ast::Dbgs = fe::Vector<Dbg> |
| using mim::ast::Ptr = fe::Arena::Ref<const T> |
| using mim::ast::Ptrs = fe::Vector<Ptr<T>> |
| using mim::ast::Scope = fe::SymMap<Bind> |
| using mim::ast::Tag = Tok::Tag |
|
strong |
|
strong |
|
strong |
Visibility tier of a ValDecl.
Priv is only visible inside its enclosing mod; Pub is visible via a path/use from outside. Orthogonal to this, a ValDecl may independently be extern (Decl::is_extern) and/or anx (Decl::is_anx); either one nudges the default visibility to Pub unless priv is given explicitly.
| Enumerator | |
|---|---|
| Priv | |
| Pub | |
a ∪ b ∪ c is one n-ary Join, so flatten the left spine the left-associative parse built.
Definition at line 271 of file emit.cpp.
References mim::ast::Expr::emit(), emit_union(), and mim::ast::InfixExpr::isa_op().
Referenced by mim::ast::InfixExpr::emit_(), and emit_union().
A float Tok stores its value as mim::f64 bits; re-encode them for the width of the annotated type t.
Definition at line 217 of file emit.cpp.
References encode_f(), and isa_math_f().
Referenced by mim::ast::LitExpr::emit_(), and encode_f().
|
constexpr |
Definition at line 68 of file tok.h.
References is_lassoc(), L, and prec_assoc().
Referenced by is_lassoc().
|
constexpr |
Definition at line 67 of file tok.h.
References is_rassoc(), prec_assoc(), and R.
Referenced by is_rassoc(), and should_reduce().
If type is a math.F type of known precision/exponent, yields its bit width.
Note that libmim must not depend on the generated math plugin header, so lookup the Axm at runtime instead.
Definition at line 204 of file emit.cpp.
References mim::App::callee(), and isa_math_f().
Referenced by encode_f(), and isa_math_f().
Definition at line 1228 of file ast.h.
References load_plugin(), and load_plugins().
Referenced by load_plugin().
Definition at line 208 of file ast.cpp.
References mim::ast::AST::AST(), mim::Flags::bootstrap, mim::ast::File::compile(), mim::World::driver(), mim::Driver::flags(), load_plugins(), and mim::ast::Parser::Parser().
Referenced by load_plugin(), and load_plugins().
Applies a leading - to a numeric literal Tok.
Definition at line 369 of file parser.cpp.
References mim::ast::Tok::lit_i(), mim::ast::Tok::lit_u(), mim::ast::Tok::loc(), negate(), and mim::ast::Tok::tag().
Referenced by negate().
|
static |
Prints vis/extern/anx, skipping vis if it's the modifier-nudged Mods::default_vis.
Definition at line 203 of file stream.cpp.
References mim::ast::Mods::default_vis(), mim::ast::Mods::is_anx, mim::ast::Mods::is_extern, operator<<(), mim::ast::Mods::resolved_vis(), and vis2str().
| std::ostream & mim::ast::operator<< | ( | std::ostream & | os, |
| Tok | tok ) |
Definition at line 30 of file tok.cpp.
Referenced by operator<<().
Associativity of precedence level p.
Definition at line 57 of file tok.h.
References CODE, MIM_PREC, and prec_assoc().
Referenced by is_lassoc(), is_rassoc(), and prec_assoc().
Should a Pratt parser reduce when the current binding power is curr and the infix operator has precedence op?
Definition at line 72 of file tok.h.
References is_rassoc(), and should_reduce().
Referenced by should_reduce().
|
static |
Definition at line 61 of file stream.cpp.
References mim::ast::S::S(), and stream_decls().
Referenced by mim::ast::DeclExpr::stream(), mim::ast::File::stream(), mim::ast::ModDecl::stream(), and stream_decls().
|
static |
Definition at line 194 of file stream.cpp.
References Priv, Pub, and vis2str().
Referenced by operator<<(), and vis2str().
|
constexpr |
Definition at line 125 of file tok.h.
Referenced by mim::ast::Tok::is_key().