top | up | prev | next

BinaryInstruction Abstract Class

Definition at line 58 of Instruction.hpp

Constructors

BinaryInstruction(Value* left_, Value* right_)

Member Functions

Type* GetType(Context& context) override
void WriteArgs(CodeFormatter& formatter, Context& context)

Member Variables

Value* left
Value* right

Constructor Details

BinaryInstruction Constructor

cmsxi::BinaryInstruction::BinaryInstruction(Value * left_, Value * right_)

Definition at line 60 of Instruction.cpp :
 60 : Instruction()left(left_)right(right_)
 61 {
 62 }


Declaration at line 61 of Instruction.hpp


Member Function Details

GetType Member Function

Type * cmsxi::BinaryInstruction::GetType(Context & context) override

Definition at line 64 of Instruction.cpp :
 65 {
 66     Assert(left->GetType(context) == right->GetType(context)"types differ");
 67     return left->GetType(context);
 68 }


Declaration at line 62 of Instruction.hpp

Base class overridden functions: cmsxi::Instruction::GetType , cmsxi::Value::GetType

Derived class overrides: cmsxi::EqualInstruction::GetType , cmsxi::LessInstruction::GetType

Calls: cmsxi::Value::GetType


WriteArgs Member Function

void cmsxi::BinaryInstruction::WriteArgs(CodeFormatter& formatter, Context & context)

Definition at line 70 of Instruction.cpp :
 71 {
 72     formatter.Write(left->GetType(context)->Name());
 73     formatter.Write(" ");
 74     formatter.Write(left->Name(context));
 75     formatter.Write(", ");
 76     formatter.Write(right->GetType(context)->Name());
 77     formatter.Write(" ");
 78     formatter.Write(right->Name(context));
 79 }


Calls: cmsxi::Type::Name , cmsxi::Value::GetType , cmsxi::Value::Name

Called by: cmsxi::AddInstruction::Write , cmsxi::AndInstruction::Write , cmsxi::DivInstruction::Write , cmsxi::EqualInstruction::Write , cmsxi::LessInstruction::Write , cmsxi::ModInstruction::Write , cmsxi::MulInstruction::Write , cmsxi::OrInstruction::Write , cmsxi::ShlInstruction::Write , cmsxi::ShrInstruction::Write , cmsxi::SubInstruction::Write , cmsxi::XorInstruction::Write


top | up | prev | next