MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::ast::LamDecl Class Reference

tag dbg dom_0 ... dom_n-1: codom = body; with LamDecl::tag lam/con/fun or anonymous λ/cn/fn. More...

#include <mim/ast/ast.h>

Inheritance diagram for mim::ast::LamDecl:
[legend]

Classes

class  Dom
 One dom of a LamDecl: ptrn@(filter) with an optional : ret type. More...

Public Types

using VLA_Types = std::tuple<Ptr<Dom>>

Public Member Functions

 LamDecl (Loc loc, Mods mods, Tok::Tag tag, Dbg dbg, Ptr< Expr > codom, Ptr< Expr > body, Ptr< RecDecl > next)
Tok::Tag tag () const
bool is_external () const
 extern without a body is a forward declaration whose implementation lives in a native translation unit.
auto doms () const
const Domdom (size_t i) const
size_t num_doms () const
const Exprcodom () const
void bind_decl (Scopes &) const override
void bind_body (Scopes &) const override
void emit_decl (Emitter &) const override
void emit_body (Emitter &) const override
std::pair< AnnexInfo *, sub_tannex_sub () const override
 The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one.
Public Member Functions inherited from mim::ast::RecDecl
 RecDecl (Loc loc, Mods mods, Dbg dbg, Ptr< Expr > body, Ptr< RecDecl > next)
Dbg dbg () const override
 The name this Decl introduces; anonymous if it has none.
const Exprbody () const
const RecDeclnext () const
void bind (Scopes &) const override
void emit (Emitter &) const override
void stream (fe::Tab &, std::ostream &) const override
std::pair< AnnexInfo *, sub_tannex_sub () const override
 The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one.
Public Member Functions inherited from mim::ast::ValDecl
Vis vis () const override
 A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores.
bool is_extern () const override
 Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.
bool is_anx () const override
 Whether this decl is registered as a compiler-exposed annex (anx).
const Modsmods () const
Public Member Functions inherited from mim::ast::Decl
const Defdef () const
virtual const Scopescope () const
 Non-nullptr if this Decl is a module whose members a Path may walk into.
Public Member Functions inherited from mim::ast::Node
Loc loc () const
void dump () const

Protected Member Functions

void stream_ (fe::Tab &, std::ostream &) const override
 Streams this declaration alone - without the leading rec/and and without the trailing ;.
Protected Member Functions inherited from mim::ast::ValDecl
 ValDecl (Loc loc, Mods mods={})
Protected Member Functions inherited from mim::ast::Decl
 Decl (Loc loc)
Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)

Additional Inherited Members

Protected Attributes inherited from mim::ast::Decl
const Defdef_ = nullptr

Detailed Description

tag dbg dom_0 ... dom_n-1: codom = body; with LamDecl::tag lam/con/fun or anonymous λ/cn/fn.

Definition at line 1059 of file ast.h.

Member Typedef Documentation

◆ VLA_Types

using mim::ast::LamDecl::VLA_Types = std::tuple<Ptr<Dom>>

Definition at line 1082 of file ast.h.

Constructor & Destructor Documentation

◆ LamDecl()

mim::ast::LamDecl::LamDecl ( Loc loc,
Mods mods,
Tok::Tag tag,
Dbg dbg,
Ptr< Expr > codom,
Ptr< Expr > body,
Ptr< RecDecl > next )
inline

Member Function Documentation

◆ annex_sub()

std::pair< AnnexInfo *, sub_t > mim::ast::LamDecl::annex_sub ( ) const
inlineoverridevirtual

The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one.

Reimplemented from mim::ast::Decl.

Definition at line 1101 of file ast.h.

◆ bind_body()

void mim::ast::LamDecl::bind_body ( Scopes & s) const
overridevirtual

Reimplemented from mim::ast::RecDecl.

Definition at line 496 of file bind.cpp.

References mim::ast::RecDecl::body(), dom(), and doms().

◆ bind_decl()

void mim::ast::LamDecl::bind_decl ( Scopes & s) const
overridevirtual

◆ codom()

const Expr * mim::ast::LamDecl::codom ( ) const
inline

Definition at line 1095 of file ast.h.

Referenced by bind_decl(), emit_decl(), LamDecl(), and stream_().

◆ dom()

const Dom * mim::ast::LamDecl::dom ( size_t i) const
inline

Definition at line 1093 of file ast.h.

References doms().

Referenced by bind_body(), bind_decl(), emit_body(), and emit_decl().

◆ doms()

auto mim::ast::LamDecl::doms ( ) const
inline

Definition at line 1092 of file ast.h.

Referenced by bind_body(), bind_decl(), dom(), emit_body(), emit_decl(), num_doms(), and stream_().

◆ emit_body()

◆ emit_decl()

void mim::ast::LamDecl::emit_decl ( Emitter & e) const
overridevirtual

◆ is_external()

bool mim::ast::LamDecl::is_external ( ) const
inline

extern without a body is a forward declaration whose implementation lives in a native translation unit.

Definition at line 1091 of file ast.h.

References mim::ast::ValDecl::is_extern().

Referenced by emit_body().

◆ num_doms()

size_t mim::ast::LamDecl::num_doms ( ) const
inline

Definition at line 1094 of file ast.h.

References doms().

Referenced by bind_decl(), emit_body(), and emit_decl().

◆ stream_()

void mim::ast::LamDecl::stream_ ( fe::Tab & tab,
std::ostream & os ) const
overrideprotectedvirtual

Streams this declaration alone - without the leading rec/and and without the trailing ;.

Reimplemented from mim::ast::RecDecl.

Definition at line 281 of file stream.cpp.

References mim::ast::RecDecl::body(), codom(), mim::ast::RecDecl::dbg(), doms(), mim::ast::R< T >::R(), mim::ast::S::S(), and tag().

◆ tag()

Tok::Tag mim::ast::LamDecl::tag ( ) const
inline

Definition at line 1089 of file ast.h.

Referenced by bind_decl(), LamDecl(), and stream_().


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