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

dbg: type More...

#include <mim/ast/ast.h>

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

Public Member Functions

 IdPtrn (Loc loc, Dbg dbg, Ptr< Expr > type)
Dbg dbg () const override
 The name this Decl introduces; anonymous if it has none.
const Exprtype () const
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.
Vis vis () const override
 Mirrors the enclosing LetDecl::vis/is_anx, since a let's Ptrn - not the LetDecl - is what a Path resolves to.
bool is_anx () const override
 Whether this decl is registered as a compiler-exposed annex (anx).
void bind (Scopes &, bool rebind, bool quiet) const override
const Defemit_value (Emitter &, const Def *) const override
const Defemit_type (Emitter &) const override
void stream (fe::Tab &, std::ostream &) const override
Public Member Functions inherited from mim::ast::Ptrn
 Ptrn (Loc loc)
virtual bool is_implicit () const
const Defemit_proj (Emitter &, const Def *def, size_t n, size_t i) const
 Ptrn::emit_value on def's i-th of n projections - with this Ptrn's Loc, so the projection is blamed on the binder it introduces instead of on the enclosing pattern.
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.
virtual bool is_extern () const
 Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.
Public Member Functions inherited from mim::ast::Node
Loc loc () const
void dump () const

Static Public Member Functions

static Ptr< IdPtrnmake_id (AST &ast, Dbg dbg, Ptr< Expr > type)
Static Public Member Functions inherited from mim::ast::Ptrn
static Ptr< Exprto_expr (AST &, Ptr< Ptrn >)

Friends

class LetDecl

Additional Inherited Members

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

dbg: type

Definition at line 311 of file ast.h.

Constructor & Destructor Documentation

◆ IdPtrn()

mim::ast::IdPtrn::IdPtrn ( Loc loc,
Dbg dbg,
Ptr< Expr > type )
inline

Definition at line 313 of file ast.h.

References dbg(), mim::ast::Node::loc(), mim::ast::Ptrn::Ptrn(), and type().

Referenced by make_id().

Member Function Documentation

◆ annex_sub()

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

◆ bind()

void mim::ast::IdPtrn::bind ( Scopes & s,
bool rebind,
bool quiet ) const
overridevirtual

Implements mim::ast::Ptrn.

Definition at line 163 of file bind.cpp.

References mim::ast::Expr::bind(), dbg(), and type().

Referenced by mim::ast::LetDecl::bind().

◆ dbg()

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

The name this Decl introduces; anonymous if it has none.

Reimplemented from mim::ast::Decl.

Definition at line 318 of file ast.h.

Referenced by bind(), emit_value(), IdPtrn(), make_id(), stream(), and mim::ast::Ptrn::to_expr().

◆ emit_type()

const Def * mim::ast::IdPtrn::emit_type ( Emitter & e) const
overridevirtual

Implements mim::ast::Ptrn.

Definition at line 98 of file emit.cpp.

References mim::ast::Expr::emit(), mim::ast::Node::loc(), and type().

Referenced by mim::ast::GrpPtrn::emit_type(), and emit_value().

◆ emit_value()

const Def * mim::ast::IdPtrn::emit_value ( Emitter & e,
const Def * def ) const
overridevirtual

Implements mim::ast::Ptrn.

Definition at line 68 of file emit.cpp.

References dbg(), mim::ast::Decl::def(), mim::ast::Decl::def_, emit_type(), and mim::Def::set().

◆ is_anx()

bool mim::ast::IdPtrn::is_anx ( ) const
inlineoverridevirtual

Whether this decl is registered as a compiler-exposed annex (anx).

Reimplemented from mim::ast::Decl.

Definition at line 323 of file ast.h.

◆ make_id()

Ptr< IdPtrn > mim::ast::IdPtrn::make_id ( AST & ast,
Dbg dbg,
Ptr< Expr > type )
inlinestatic

Definition at line 325 of file ast.h.

References dbg(), IdPtrn(), mim::ast::Node::loc(), and type().

◆ stream()

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

Implements mim::ast::Node.

Definition at line 86 of file stream.cpp.

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

◆ type()

const Expr * mim::ast::IdPtrn::type ( ) const
inline

Definition at line 319 of file ast.h.

Referenced by bind(), emit_type(), IdPtrn(), make_id(), and stream().

◆ vis()

Vis mim::ast::IdPtrn::vis ( ) const
inlineoverridevirtual

Mirrors the enclosing LetDecl::vis/is_anx, since a let's Ptrn - not the LetDecl - is what a Path resolves to.

Reimplemented from mim::ast::Decl.

Definition at line 322 of file ast.h.

◆ LetDecl

friend class LetDecl
friend

Definition at line 343 of file ast.h.

References LetDecl.

Referenced by LetDecl.


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