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

axm dbg: type, normalizer, curry, trip; or a family axm (name, ...): type, normalizer, curry, trip;. More...

#include <mim/ast/ast.h>

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

Classes

class  Name
 dbg = alias_0 = ... = alias_n-1 - one axiom of the family, which each of its names binds to. More...

Public Types

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

Public Member Functions

 AxmDecl (Loc l, Vis v, Dbg mod, Scope *members, bool is_family, Ptr< Expr > type, Dbg normalizer, Tok curry, Tok trip)
Dbg dbg () const override
 The mod. prefix, if any.
const Scope * scope () const override
 Non-nullptr if this Decl is a module whose members a Path may walk into.
auto names () const
bool is_family () const
 Whether the names are spelled as a parenthesized list, even if it is just one.
const Expr * type () const
Dbg normalizer () const
Tok curry () const
Tok trip () const
void bind (Scopes &) const override
void emit (Emitter &) const override
void stream (fe::Tab &, std::ostream &) const override
 axm is always anx, so only priv is ever printed.
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 Mods & mods () const
Public Member Functions inherited from mim::ast::Decl
const Def * def () const
virtual std::pair< AnnexInfo *, sub_t > annex_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 Def * def_ = nullptr

Detailed Description

axm dbg: type, normalizer, curry, trip; or a family axm (name, ...): type, normalizer, curry, trip;.

A family prefixed with tag. binds as a module and nests its names as subtags of the annex tag.

Definition at line 1073 of file ast.h.

Member Typedef Documentation

◆ VLA_Types

using mim::ast::AxmDecl::VLA_Types = std::tuple<Ptr<Name>>

Definition at line 1098 of file ast.h.

Constructor & Destructor Documentation

◆ AxmDecl()

mim::ast::AxmDecl::AxmDecl ( Loc l,
Vis v,
Dbg mod,
Scope * members,
bool is_family,
Ptr< Expr > type,
Dbg normalizer,
Tok curry,
Tok trip )
inline

Definition at line 1100 of file ast.h.

References curry(), is_family(), normalizer(), trip(), type(), and mim::ast::ValDecl::ValDecl().

Member Function Documentation

◆ bind()

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

◆ curry()

Tok mim::ast::AxmDecl::curry ( ) const
inline

Definition at line 1118 of file ast.h.

Referenced by AxmDecl(), and stream().

◆ dbg()

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

The mod. prefix, if any.

Reimplemented from mim::ast::Decl.

Definition at line 1111 of file ast.h.

Referenced by bind().

◆ emit()

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

Implements mim::ast::ValDecl.

Definition at line 882 of file emit.cpp.

References mim::Axm::infer_curry_and_trip(), mim::ast::Node::loc(), names(), and type().

◆ is_family()

bool mim::ast::AxmDecl::is_family ( ) const
inline

Whether the names are spelled as a parenthesized list, even if it is just one.

Definition at line 1115 of file ast.h.

Referenced by AxmDecl(), and stream().

◆ names()

auto mim::ast::AxmDecl::names ( ) const
inline

Definition at line 1113 of file ast.h.

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

◆ normalizer()

Dbg mim::ast::AxmDecl::normalizer ( ) const
inline

Definition at line 1117 of file ast.h.

Referenced by AxmDecl(), bind(), and stream().

◆ scope()

const Scope * mim::ast::AxmDecl::scope ( ) const
inlineoverridevirtual

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

Reimplemented from mim::ast::Decl.

Definition at line 1112 of file ast.h.

◆ stream()

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

axm is always anx, so only priv is ever printed.

Implements mim::ast::Node.

Definition at line 277 of file stream.cpp.

References curry(), is_family(), names(), normalizer(), mim::ast::Priv, mim::ast::R< T >::R(), mim::ast::S::S(), trip(), type(), and mim::ast::ValDecl::vis().

◆ trip()

Tok mim::ast::AxmDecl::trip ( ) const
inline

Definition at line 1119 of file ast.h.

Referenced by AxmDecl(), and stream().

◆ type()

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

Definition at line 1116 of file ast.h.

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


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