MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches

rewrite rules rule (x:T, y:T) : x+y => y+x (when ); all meta variables have to be introduced More...

#include <mim/ast/ast.h>

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

Public Member Functions

 RuleDecl (Loc loc, Dbg dbg, Ptr< Ptrn > &&var, Ptr< Expr > &&lhs, Ptr< Expr > &&rhs, Ptr< Expr > &&guard, bool is_normalizer)
Dbg dbg () const
const Ptrnvar () const
const Exprlhs () const
const Exprrhs () const
const Exprguard () const
bool is_normalizer () const
void bind (Scopes &) const override
std::ostream & stream (Tab &, std::ostream &) const override
Public Member Functions inherited from mim::ast::Decl
const Defdef () const
Public Member Functions inherited from mim::ast::Node
Loc loc () const
void dump () const

Private Member Functions

void emit (Emitter &) const override

Additional Inherited Members

Protected Member Functions inherited from mim::ast::ValDecl
 ValDecl (Loc loc)
Protected Member Functions inherited from mim::ast::Decl
 Decl (Loc loc)
Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)
virtual ~Node ()
Protected Attributes inherited from mim::ast::Decl
const Defdef_ = nullptr

Detailed Description

rewrite rules rule (x:T, y:T) : x+y => y+x (when ); all meta variables have to be introduced

Definition at line 1043 of file ast.h.

Constructor & Destructor Documentation

◆ RuleDecl()

mim::ast::RuleDecl::RuleDecl ( Loc loc,
Dbg dbg,
Ptr< Ptrn > && var,
Ptr< Expr > && lhs,
Ptr< Expr > && rhs,
Ptr< Expr > && guard,
bool is_normalizer )
inline

Member Function Documentation

◆ bind()

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

Implements mim::ast::ValDecl.

Definition at line 388 of file bind.cpp.

References dbg(), guard(), lhs(), rhs(), and var().

◆ dbg()

Dbg mim::ast::RuleDecl::dbg ( ) const
inline

Definition at line 1054 of file ast.h.

Referenced by bind(), and RuleDecl().

◆ emit()

void mim::ast::RuleDecl::emit ( Emitter & e) const
overrideprivatevirtual

Implements mim::ast::ValDecl.

Definition at line 534 of file emit.cpp.

References mim::ast::Decl::def_, guard(), lhs(), mim::ast::Node::loc(), rhs(), and var().

◆ guard()

const Expr * mim::ast::RuleDecl::guard ( ) const
inline

Definition at line 1058 of file ast.h.

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

◆ is_normalizer()

bool mim::ast::RuleDecl::is_normalizer ( ) const
inline

Definition at line 1059 of file ast.h.

Referenced by RuleDecl().

◆ lhs()

const Expr * mim::ast::RuleDecl::lhs ( ) const
inline

Definition at line 1056 of file ast.h.

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

◆ rhs()

const Expr * mim::ast::RuleDecl::rhs ( ) const
inline

Definition at line 1057 of file ast.h.

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

◆ stream()

std::ostream & mim::ast::RuleDecl::stream ( Tab & tab,
std::ostream & os ) const
overridevirtual

Implements mim::ast::Node.

Definition at line 242 of file stream.cpp.

References guard(), lhs(), mim::print(), rhs(), and var().

◆ var()

const Ptrn * mim::ast::RuleDecl::var ( ) const
inline

Definition at line 1055 of file ast.h.

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


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