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

let ptrn = value; More...

#include <mim/ast/ast.h>

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

Public Member Functions

 LetDecl (Loc loc, Mods mods, Ptr< Ptrn > ptrn, Ptr< Expr > value)
const Ptrnptrn () const
const Exprvalue () const
void bind (Scopes &) const override
void emit (Emitter &) const override
void stream (fe::Tab &, std::ostream &) const override
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 Dbg dbg () const
 The name this Decl introduces; anonymous if it has none.
virtual const Scopescope () const
 Non-nullptr if this Decl is a module whose members a Path may walk into.
virtual std::pair< AnnexInfo *, sub_tannex_sub () const
 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::Node
Loc loc () const
void dump () const

Additional Inherited Members

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)
Protected Attributes inherited from mim::ast::Decl
const Defdef_ = nullptr

Detailed Description

let ptrn = value;

Definition at line 945 of file ast.h.

Constructor & Destructor Documentation

◆ LetDecl()

mim::ast::LetDecl::LetDecl ( Loc loc,
Mods mods,
Ptr< Ptrn > ptrn,
Ptr< Expr > value )
inline

Member Function Documentation

◆ bind()

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

◆ emit()

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

Implements mim::ast::ValDecl.

Definition at line 546 of file emit.cpp.

References mim::ast::Decl::def_, mim::ast::Node::loc(), ptrn(), and value().

◆ ptrn()

const Ptrn * mim::ast::LetDecl::ptrn ( ) const
inline

Definition at line 952 of file ast.h.

Referenced by bind(), emit(), LetDecl(), and stream().

◆ stream()

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

Implements mim::ast::Node.

Definition at line 258 of file stream.cpp.

References mim::ast::ValDecl::mods(), ptrn(), mim::ast::S::S(), and value().

◆ value()

const Expr * mim::ast::LetDecl::value ( ) const
inline

Definition at line 953 of file ast.h.

Referenced by bind(), emit(), LetDecl(), and stream().


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