2013-07-25 02:28:20 +00:00
|
|
|
/*
|
2013-07-25 14:42:02 +00:00
|
|
|
abCOpSl.c
|
2013-07-25 02:28:20 +00:00
|
|
|
By: Jeremy Rand
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2013-07-25 14:42:02 +00:00
|
|
|
#include "abCOpSl.h"
|
2013-07-25 02:28:20 +00:00
|
|
|
|
2013-07-25 14:42:02 +00:00
|
|
|
#include "abCOp.h"
|
|
|
|
#include "abCError.h"
|
|
|
|
#include "abCExpr.h"
|
|
|
|
#include "abCExprInt.h"
|
|
|
|
#include "abCStack.h"
|
2013-07-25 02:28:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define OP_NAME "SL"
|
|
|
|
|
|
|
|
|
|
|
|
static void slExecute(void);
|
|
|
|
|
|
|
|
|
|
|
|
void abCalcOpSlInit(void)
|
|
|
|
{
|
|
|
|
abCalcOpRegister(OP_NAME, slExecute);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void slExecute(void)
|
|
|
|
{
|
|
|
|
abCalcExpr result;
|
|
|
|
AB_CALC_OP_ONE_ARG(OP_NAME);
|
|
|
|
|
|
|
|
if (expr->type != abCalcExprTypeInt) {
|
|
|
|
abCalcRaiseError(abCalcBadArgTypeError, OP_NAME);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
abCalcExprIntSet(&result, (expr->u.integer << 1));
|
|
|
|
|
|
|
|
abCalcStackExprPop(NULL);
|
|
|
|
abCalcStackExprPush(&result);
|
|
|
|
}
|