Apply cpp naming to files
This commit is contained in:
parent
430ba869d0
commit
9a9262f6d0
73 changed files with 160 additions and 160 deletions
28
Objects/private/interpreter/OperandsStack.cpp
Normal file
28
Objects/private/interpreter/OperandsStack.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
#include "interpreter/OperandsStack.hpp"
|
||||
|
||||
using namespace obj;
|
||||
|
||||
OperandStack::OperandStack() {
|
||||
mBuff = new Operand[MAX_STACK_SIZE];
|
||||
mIdx = 0;
|
||||
}
|
||||
|
||||
void OperandStack::push(Operand operand) {
|
||||
ASSERT(MAX_STACK_SIZE - 1 > mIdx && "stack overflow");
|
||||
mBuff[mIdx] = operand;
|
||||
mIdx++;
|
||||
}
|
||||
|
||||
void OperandStack::pop() {
|
||||
ASSERT(mIdx != NULL && "stack overflow");
|
||||
mIdx--;
|
||||
}
|
||||
|
||||
Operand OperandStack::getOperand() {
|
||||
auto ret = mBuff[mIdx - 1];
|
||||
mIdx--;
|
||||
return ret;
|
||||
}
|
||||
|
||||
OperandStack::~OperandStack() { delete[] mBuff; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue