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

lhs op rhs; InfixExpr::op picks the meaning - see MIM_INFIX. More...

#include <mim/ast/ast.h>

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

Public Member Functions

 InfixExpr (Loc loc, Ptr< Expr > lhs, Tok op, Ptr< Expr > rhs, Ptr< Expr > callee)
 callee is the `op a MIM_INFIX_SUGAR operator desugars to and nullptr for MIM_INFIX_CORE.
const Exprlhs () const
Tok op () const
const Exprrhs () const
const Exprcallee () const
void bind (Scopes &) const override
void stream (fe::Tab &, std::ostream &) const override
Public Member Functions inherited from mim::ast::Expr
const Defemit (Emitter &) const
const Defemit_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

Static Public Member Functions

static const InfixExprisa_op (Tok::Tag tag, const Expr *expr)

Private Member Functions

const Defemit_ (Emitter &) const override
const Defemit_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

lhs op rhs; InfixExpr::op picks the meaning - see MIM_INFIX.

Definition at line 594 of file ast.h.

Constructor & Destructor Documentation

◆ InfixExpr()

mim::ast::InfixExpr::InfixExpr ( Loc loc,
Ptr< Expr > lhs,
Tok op,
Ptr< Expr > rhs,
Ptr< Expr > callee )
inline

callee is the `op a MIM_INFIX_SUGAR operator desugars to and nullptr for MIM_INFIX_CORE.

Definition at line 597 of file ast.h.

References callee(), mim::ast::Expr::Expr(), lhs(), mim::ast::Node::loc(), op(), and rhs().

Referenced by isa_op().

Member Function Documentation

◆ bind()

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

Implements mim::ast::Expr.

Definition at line 244 of file bind.cpp.

References mim::ast::Expr::bind(), callee(), lhs(), op(), and rhs().

◆ callee()

const Expr * mim::ast::InfixExpr::callee ( ) const
inline

Definition at line 607 of file ast.h.

References mim::ast::Expr::Expr().

Referenced by bind(), emit_(), and InfixExpr().

◆ emit_()

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

◆ emit_body_()

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

Reimplemented from mim::ast::Expr.

Definition at line 265 of file emit.cpp.

References mim::ast::Expr::emit(), lhs(), and rhs().

◆ emit_decl_()

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

Reimplemented from mim::ast::Expr.

Definition at line 260 of file emit.cpp.

References op().

◆ isa_op()

const InfixExpr * mim::ast::InfixExpr::isa_op ( Tok::Tag tag,
const Expr * expr )
inlinestatic
Returns
expr if it is an InfixExpr whose operator is tag.

Definition at line 610 of file ast.h.

References mim::ast::Expr::Expr(), and InfixExpr().

Referenced by mim::ast::AxmDecl::bind(), mim::ast::RecDecl::bind_decl(), emit_(), and mim::ast::emit_union().

◆ lhs()

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

Definition at line 604 of file ast.h.

References mim::ast::Expr::Expr().

Referenced by bind(), emit_(), emit_body_(), InfixExpr(), and stream().

◆ op()

Tok mim::ast::InfixExpr::op ( ) const
inline

Definition at line 605 of file ast.h.

Referenced by bind(), emit_(), emit_decl_(), InfixExpr(), and stream().

◆ rhs()

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

Definition at line 606 of file ast.h.

References mim::ast::Expr::Expr().

Referenced by bind(), emit_(), emit_body_(), InfixExpr(), and stream().

◆ stream()

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

Implements mim::ast::Node.

Definition at line 142 of file stream.cpp.

References lhs(), op(), rhs(), mim::ast::S::S(), and mim::ast::Tok::tag2str().


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