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

| ctor_0: type_0 | ... | ctor_n-1: type_n-1; a constructor without a type carries []. More...

#include <mim/ast/ast.h>

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

Classes

class  Ctor
 dbg: type of a VariantExpr. More...

Public Types

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

Public Member Functions

 VariantExpr (Loc loc)
auto ctors () const
const Ctor * ctor (size_t i) const
size_t num_ctors () const
void bind (Scopes &) const override
void stream (fe::Tab &, std::ostream &) const override
Public Member Functions inherited from mim::ast::Expr
const Def * emit (Emitter &) const
const Def * emit_decl (Emitter &, const Def *type) const
void emit_body (Emitter &, const Def *decl) const
Public Member Functions inherited from mim::ast::Node
Loc loc () const
void dump () const

Private Member Functions

const Def * emit_ (Emitter &) const override
const Def * emit_decl_ (Emitter &, const Def *type) const override
void emit_body_ (Emitter &, const Def *decl) const override

Additional Inherited Members

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

Detailed Description

| ctor_0: type_0 | ... | ctor_n-1: type_n-1; a constructor without a type carries [].

Definition at line 742 of file ast.h.

Member Typedef Documentation

◆ VLA_Types

Definition at line 762 of file ast.h.

Constructor & Destructor Documentation

◆ VariantExpr()

mim::ast::VariantExpr::VariantExpr ( Loc loc)
inline

Definition at line 764 of file ast.h.

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

Member Function Documentation

◆ bind()

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

Implements mim::ast::Expr.

Definition at line 276 of file bind.cpp.

References ctor(), and ctors().

◆ ctor()

const Ctor * mim::ast::VariantExpr::ctor ( size_t i) const
inline

Definition at line 768 of file ast.h.

References ctors().

Referenced by mim::ast::Emitter::add_ctors(), bind(), and stream().

◆ ctors()

auto mim::ast::VariantExpr::ctors ( ) const
inline

Definition at line 767 of file ast.h.

Referenced by bind(), ctor(), num_ctors(), and stream().

◆ emit_()

const Def * mim::ast::VariantExpr::emit_ ( Emitter & e) const
overrideprivatevirtual

Implements mim::ast::Expr.

Definition at line 819 of file emit.cpp.

◆ emit_body_()

void mim::ast::VariantExpr::emit_body_ ( Emitter & e,
const Def * decl ) const
overrideprivatevirtual

Reimplemented from mim::ast::Expr.

Definition at line 829 of file emit.cpp.

References mim::Def::as_mut(), and mim::Variant::set().

◆ emit_decl_()

const Def * mim::ast::VariantExpr::emit_decl_ ( Emitter & e,
const Def * type ) const
overrideprivatevirtual

Reimplemented from mim::ast::Expr.

Definition at line 825 of file emit.cpp.

References num_ctors().

◆ num_ctors()

size_t mim::ast::VariantExpr::num_ctors ( ) const
inline

Definition at line 769 of file ast.h.

References ctors().

Referenced by mim::ast::Emitter::add_ctors(), emit_decl_(), and stream().

◆ stream()

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

Implements mim::ast::Node.

Definition at line 185 of file stream.cpp.

References ctor(), ctors(), num_ctors(), and mim::ast::S::S().


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