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

rec dbg = body; with an optional and RecDecl::next. More...

#include <mim/ast/ast.h>

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

Public Member Functions

 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
virtual void bind_decl (Scopes &) const
virtual void bind_body (Scopes &) const
void emit (Emitter &) const override
virtual void emit_decl (Emitter &) const
virtual void emit_body (Emitter &) const
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

virtual void stream_ (fe::Tab &, std::ostream &) const
 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

rec dbg = body; with an optional and RecDecl::next.

Definition at line 1023 of file ast.h.

Constructor & Destructor Documentation

◆ RecDecl()

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

Member Function Documentation

◆ annex_sub()

std::pair< AnnexInfo *, sub_t > mim::ast::RecDecl::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 1044 of file ast.h.

◆ bind()

void mim::ast::RecDecl::bind ( Scopes & s) const
overridevirtual

Implements mim::ast::ValDecl.

Definition at line 442 of file bind.cpp.

◆ bind_body()

void mim::ast::RecDecl::bind_body ( Scopes & s) const
virtual

Reimplemented in mim::ast::LamDecl.

Definition at line 459 of file bind.cpp.

References body().

◆ bind_decl()

void mim::ast::RecDecl::bind_decl ( Scopes & s) const
virtual

◆ body()

◆ dbg()

Dbg mim::ast::RecDecl::dbg ( ) const
inlineoverridevirtual

◆ emit()

void mim::ast::RecDecl::emit ( Emitter & e) const
overridevirtual

Implements mim::ast::ValDecl.

Definition at line 553 of file emit.cpp.

Referenced by mim::ast::LamDecl::emit_body().

◆ emit_body()

void mim::ast::RecDecl::emit_body ( Emitter & e) const
virtual

Reimplemented in mim::ast::LamDecl.

Definition at line 566 of file emit.cpp.

References body(), dbg(), mim::ast::Decl::def_, and mim::ast::Node::loc().

◆ emit_decl()

void mim::ast::RecDecl::emit_decl ( Emitter & e) const
virtual

Reimplemented in mim::ast::LamDecl.

Definition at line 560 of file emit.cpp.

References body(), dbg(), mim::ast::Decl::def_, and mim::ast::Node::loc().

◆ next()

const RecDecl * mim::ast::RecDecl::next ( ) const
inline

Definition at line 1033 of file ast.h.

References RecDecl().

Referenced by mim::ast::LamDecl::LamDecl(), RecDecl(), and stream().

◆ stream()

void mim::ast::RecDecl::stream ( fe::Tab & tab,
std::ostream & os ) const
overridevirtual

Implements mim::ast::Node.

Definition at line 262 of file stream.cpp.

References mim::ast::ValDecl::mods(), next(), and stream_().

◆ stream_()

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

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

Reimplemented in mim::ast::LamDecl.

Definition at line 273 of file stream.cpp.

References body(), dbg(), and mim::ast::S::S().

Referenced by stream().


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