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

Base class of all declarations; caches the emitted Decl::def. More...

#include <mim/ast/ast.h>

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

Public Member Functions

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.
virtual Vis vis () const
 A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores.
virtual bool is_extern () const
 Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.
virtual bool is_anx () const
 Whether this decl is registered as a compiler-exposed annex (anx).
Public Member Functions inherited from mim::ast::Node
Loc loc () const
virtual void stream (fe::Tab &, std::ostream &) const =0
void dump () const

Protected Member Functions

 Decl (Loc loc)
Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)

Protected Attributes

const Defdef_ = nullptr

Detailed Description

Base class of all declarations; caches the emitted Decl::def.

Definition at line 230 of file ast.h.

Constructor & Destructor Documentation

◆ Decl()

mim::ast::Decl::Decl ( Loc loc)
inlineprotected

Definition at line 232 of file ast.h.

References mim::ast::Node::loc(), and mim::ast::Node::Node().

Referenced by mim::ast::DummyDecl::DummyDecl(), and mim::ast::Ptrn::Ptrn().

Member Function Documentation

◆ annex_sub()

virtual std::pair< AnnexInfo *, sub_t > mim::ast::Decl::annex_sub ( ) const
inlinevirtual

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

Reimplemented in mim::ast::AliasDecl, mim::ast::AxmDecl, mim::ast::AxmDecl::Sibling, mim::ast::IdPtrn, mim::ast::LamDecl, and mim::ast::RecDecl.

Definition at line 243 of file ast.h.

◆ dbg()

virtual Dbg mim::ast::Decl::dbg ( ) const
inlinevirtual

◆ def()

◆ is_anx()

virtual bool mim::ast::Decl::is_anx ( ) const
inlinevirtual

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

Reimplemented in mim::ast::IdPtrn, and mim::ast::ValDecl.

Definition at line 249 of file ast.h.

◆ is_extern()

virtual bool mim::ast::Decl::is_extern ( ) const
inlinevirtual

Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.

Reimplemented in mim::ast::ValDecl.

Definition at line 247 of file ast.h.

◆ scope()

virtual const Scope * mim::ast::Decl::scope ( ) const
inlinevirtual

Non-nullptr if this Decl is a module whose members a Path may walk into.

Reimplemented in mim::ast::ModDecl, and mim::ast::UseDecl.

Definition at line 241 of file ast.h.

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

◆ vis()

virtual Vis mim::ast::Decl::vis ( ) const
inlinevirtual

A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores.

Reimplemented in mim::ast::IdPtrn, and mim::ast::ValDecl.

Definition at line 245 of file ast.h.

References mim::ast::Pub.

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

Member Data Documentation

◆ def_


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