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

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)
 
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 1041 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 382 of file bind.cpp.

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

◆ emit()

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

Implements mim::ast::ValDecl.

Definition at line 528 of file emit.cpp.

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

◆ guard()

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

Definition at line 1055 of file ast.h.

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

◆ is_normalizer()

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

Definition at line 1056 of file ast.h.

Referenced by RuleDecl().

◆ lhs()

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

Definition at line 1053 of file ast.h.

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

◆ rhs()

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

Definition at line 1054 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 241 of file stream.cpp.

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

◆ var()

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

Definition at line 1052 of file ast.h.

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


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