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

#include <mim/ast/ast.h>

Public Member Functions

 AST ()=default
 
 AST (World &world)
 
 AST (AST &&other)
 
 ~AST ()
 
template<class T , class... Args>
auto ptr (Args &&... args)
 
void bootstrap (Sym plugin, std::ostream &h)
 
Getters
Worldworld ()
 
Driverdriver ()
 
Errorerror ()
 
const Errorerror () const
 
Sym
Sym sym (const char *s)
 
Sym sym (std::string_view s)
 
Sym sym (const std::string &s)
 
Sym sym_anon ()
 "_".
 
Sym sym_return ()
 "return".
 
Sym sym_error ()
 "_error_".
 
Formatted Output
template<class... Args>
Errorerror (Loc loc, const char *fmt, Args &&... args) const
 
template<class... Args>
Errorwarn (Loc loc, const char *fmt, Args &&... args) const
 
template<class... Args>
Errornote (Loc loc, const char *fmt, Args &&... args) const
 
Manage Annex
AnnexInfoname2annex (Dbg dbg, sub_t *)
 
const auto & plugin2annexes (Sym plugin)
 

Friends

void swap (AST &a1, AST &a2) noexcept
 

Detailed Description

Definition at line 48 of file ast.h.

Constructor & Destructor Documentation

◆ AST() [1/3]

mim::ast::AST::AST ( )
default

◆ AST() [2/3]

mim::ast::AST::AST ( World & world)
inline

Definition at line 51 of file ast.h.

◆ AST() [3/3]

mim::ast::AST::AST ( AST && other)
inline

Definition at line 53 of file ast.h.

References swap.

◆ ~AST()

mim::ast::AST::~AST ( )

Definition at line 9 of file ast.cpp.

References error().

Member Function Documentation

◆ bootstrap()

void mim::ast::AST::bootstrap ( Sym plugin,
std::ostream & h )

Definition at line 52 of file ast.cpp.

References mim::Annex::mangle(), plugin2annexes(), mim::print(), mim::Tab::print(), and sym().

◆ driver()

Driver & mim::ast::AST::driver ( )
inline

Definition at line 62 of file ast.h.

References mim::World::driver(), and world().

Referenced by mim::ast::Parser::driver(), mim::ast::Scopes::driver(), name2annex(), sym(), sym(), and sym().

◆ error() [1/3]

◆ error() [2/3]

const Error & mim::ast::AST::error ( ) const
inline

Definition at line 64 of file ast.h.

◆ error() [3/3]

template<class... Args>
Error & mim::ast::AST::error ( Loc loc,
const char * fmt,
Args &&... args ) const
inline

Definition at line 84 of file ast.h.

References mim::Error::error(), and mim::fmt().

◆ name2annex()

AnnexInfo * mim::ast::AST::name2annex ( Dbg dbg,
sub_t * sub_id )

Definition at line 14 of file ast.cpp.

References driver(), error(), mim::Annex::mangle(), mim::Annex::split(), and sym_error().

◆ note()

template<class... Args>
Error & mim::ast::AST::note ( Loc loc,
const char * fmt,
Args &&... args ) const
inline

Definition at line 86 of file ast.h.

References mim::fmt(), and mim::Error::note().

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

◆ plugin2annexes()

const auto & mim::ast::AST::plugin2annexes ( Sym plugin)
inline

Definition at line 93 of file ast.h.

Referenced by bootstrap().

◆ ptr()

template<class T , class... Args>
auto mim::ast::AST::ptr ( Args &&... args)
inline

◆ sym() [1/3]

Sym mim::ast::AST::sym ( const char * s)
inline

Definition at line 69 of file ast.h.

References driver().

Referenced by bootstrap(), sym_anon(), sym_error(), and sym_return().

◆ sym() [2/3]

Sym mim::ast::AST::sym ( const std::string & s)
inline

Definition at line 71 of file ast.h.

References driver().

◆ sym() [3/3]

Sym mim::ast::AST::sym ( std::string_view s)
inline

Definition at line 70 of file ast.h.

References driver().

◆ sym_anon()

Sym mim::ast::AST::sym_anon ( )
inline

"_".

Definition at line 72 of file ast.h.

References sym().

Referenced by mim::ast::IdPtrn::mk_type().

◆ sym_error()

Sym mim::ast::AST::sym_error ( )
inline

"_error_".

Definition at line 74 of file ast.h.

References sym().

Referenced by name2annex().

◆ sym_return()

Sym mim::ast::AST::sym_return ( )
inline

"return".

Definition at line 73 of file ast.h.

References sym().

Referenced by mim::ast::PiExpr::Dom::add_ret().

◆ warn()

template<class... Args>
Error & mim::ast::AST::warn ( Loc loc,
const char * fmt,
Args &&... args ) const
inline

Definition at line 85 of file ast.h.

References mim::fmt(), and mim::Error::warn().

◆ world()

World & mim::ast::AST::world ( )
inline

Definition at line 61 of file ast.h.

Referenced by driver(), and mim::ast::Emitter::world().

Friends And Related Symbol Documentation

◆ swap

void swap ( AST & a1,
AST & a2 )
friend

Definition at line 98 of file ast.h.

Referenced by AST().


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