Reorganize code some more so it will build on the GS
This commit is contained in:
parent
5ba0e3bcc7
commit
7bee84757f
18
Make.engine
18
Make.engine
|
@ -1,10 +1,14 @@
|
|||
OBJS=abCalc.o expr/abCExpr.o expr/abCExpReal.o expr/abCExprInt.o abCStack.o \
|
||||
abCMode.o abCMain.o ops/abCOp.o abCError.o ops/abCOpAdd.o \
|
||||
ops/abCOpSubtr.o ops/abCOpMult.o ops/abCOpDiv.o ops/abCOpPower.o \
|
||||
ops/abCOpAnd.o ops/abCOpOr.o ops/abCOpXor.o ops/abCOpNot.o \
|
||||
ops/abCOpBin.o ops/abCOpOct.o ops/abCOpDec.o ops/abCOpHex.o ops/abCOpStws.o \
|
||||
ops/abCOpRcws.o ops/abCOpSl.o ops/abCOpRl.o ops/abCOpSr.o ops/abCOpRr.o \
|
||||
ops/abCOpAsr.o
|
||||
CALC_OBJS=abCalc.o abCStack.o abCMode.o abCError.o
|
||||
|
||||
EXPR_OBJS=expr/abCExpr.o expr/abCExpReal.o expr/abCExprInt.o
|
||||
|
||||
OPS_OBJS=ops/abCOp.o ops/abCOpAdd.o ops/abCOpSubtr.o ops/abCOpMult.o \
|
||||
ops/abCOpDiv.o ops/abCOpPower.o ops/abCOpAnd.o ops/abCOpOr.o ops/abCOpXor.o \
|
||||
ops/abCOpNot.o ops/abCOpBin.o ops/abCOpOct.o ops/abCOpDec.o ops/abCOpHex.o \
|
||||
ops/abCOpStws.o ops/abCOpRcws.o ops/abCOpSl.o ops/abCOpRl.o ops/abCOpSr.o \
|
||||
ops/abCOpRr.o ops/abCOpAsr.o
|
||||
|
||||
OBJS=abCMain.o $(CALC_OBJS) $(EXPR_OBJS) $(OPS_OBJS)
|
||||
|
||||
abCMain.o: abCalc.h abCStack.h expr/abCExpr.h ops/abCOp.h abCError.h
|
||||
|
||||
|
|
11
Makefile
11
Makefile
|
@ -9,7 +9,14 @@ $(NAME): $(OBJS)
|
|||
|
||||
clean:
|
||||
cp -p rm -f $(NAME) $(OBJS) $(NAME).r $(NAME).root
|
||||
cp -p rm -f *.root
|
||||
cp -p rm -f expr/*.root
|
||||
cp -p rm -f ops/*.root
|
||||
|
||||
fixtype:
|
||||
chtyp -l CC *.c *.h
|
||||
chtyp -l CC expr/*.c expr/*.h
|
||||
chtyp -l CC ops/*.c ops/*.h
|
||||
|
||||
%.o: %.c
|
||||
chtyp -l CC $<
|
||||
occ -c $<
|
||||
occ $(CFLAGS) -c $<
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "abCalc.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCStack.h"
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
|
||||
|
||||
char gBuffer[AB_CALC_EXPR_STRING_MAX];
|
||||
abCalcExpr gExpr;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define ABCMODE_H
|
||||
|
||||
|
||||
#include "abCExpr.h"
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
|
||||
typedef enum abCalcModeIntBase
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#define ABCSTACK_H
|
||||
|
||||
|
||||
#include "abCExpr.h"
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
|
||||
void abCalcStackInit(void);
|
||||
|
||||
|
|
10
abCalc.c
10
abCalc.c
|
@ -4,14 +4,16 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCMode.h"
|
||||
#include "abCStack.h"
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
|
||||
|
||||
void abCalcInit(void)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "abCExpr.h"
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
|
||||
static abCalcExpr *abCalcExprRealParse(abCalcExpr *expr, char *buffer);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "abCExpr.h"
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
|
||||
static abCalcExprCallbacks *gCallbacks[abCalcExprTypeMax];
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "abCExpr.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
|
||||
static abCalcExpr *abCalcExprIntParse(abCalcExpr *expr, char *buffer);
|
||||
static char *abCalcExprIntFormat(abCalcExpr *expr, char *buffer);
|
||||
|
|
46
ops/abCOp.c
46
ops/abCOp.c
|
@ -7,33 +7,35 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCError.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "abCOpAdd.h"
|
||||
#include "abCOpSubtr.h"
|
||||
#include "abCOpMult.h"
|
||||
#include "abCOpDiv.h"
|
||||
#include "abCOpPower.h"
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
#include "abCOpAnd.h"
|
||||
#include "abCOpOr.h"
|
||||
#include "abCOpXor.h"
|
||||
#include "abCOpNot.h"
|
||||
#include "abCOpSl.h"
|
||||
#include "abCOpRl.h"
|
||||
#include "abCOpSr.h"
|
||||
#include "abCOpRr.h"
|
||||
#include "abCOpAsr.h"
|
||||
#include "ops/abCOp.h"
|
||||
|
||||
#include "abCOpBin.h"
|
||||
#include "abCOpOct.h"
|
||||
#include "abCOpDec.h"
|
||||
#include "abCOpHex.h"
|
||||
#include "abCOpStws.h"
|
||||
#include "abCOpRcws.h"
|
||||
#include "ops/abCOpAdd.h"
|
||||
#include "ops/abCOpSubtr.h"
|
||||
#include "ops/abCOpMult.h"
|
||||
#include "ops/abCOpDiv.h"
|
||||
#include "ops/abCOpPower.h"
|
||||
|
||||
#include "ops/abCOpAnd.h"
|
||||
#include "ops/abCOpOr.h"
|
||||
#include "ops/abCOpXor.h"
|
||||
#include "ops/abCOpNot.h"
|
||||
#include "ops/abCOpSl.h"
|
||||
#include "ops/abCOpRl.h"
|
||||
#include "ops/abCOpSr.h"
|
||||
#include "ops/abCOpRr.h"
|
||||
#include "ops/abCOpAsr.h"
|
||||
|
||||
#include "ops/abCOpBin.h"
|
||||
#include "ops/abCOpOct.h"
|
||||
#include "ops/abCOpDec.h"
|
||||
#include "ops/abCOpHex.h"
|
||||
#include "ops/abCOpStws.h"
|
||||
#include "ops/abCOpRcws.h"
|
||||
|
||||
|
||||
#define AB_CALC_MAX_OPS 128
|
||||
|
|
|
@ -6,15 +6,17 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpAdd.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpAdd.h"
|
||||
|
||||
|
||||
#define OP_NAME "+"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpAnd.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpAnd.h"
|
||||
|
||||
|
||||
#define OP_NAME "AND"
|
||||
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpAsr.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCMode.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpAsr.h"
|
||||
|
||||
|
||||
#define OP_NAME "ASR"
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpBin.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpBin.h"
|
||||
|
||||
|
||||
#define OP_NAME "BIN"
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpDec.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpDec.h"
|
||||
|
||||
|
||||
#define OP_NAME "DEC"
|
||||
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpDiv.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpDiv.h"
|
||||
|
||||
|
||||
#define OP_NAME "/"
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpHex.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpHex.h"
|
||||
|
||||
|
||||
#define OP_NAME "HEX"
|
||||
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpMult.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpMult.h"
|
||||
|
||||
|
||||
#define OP_NAME "*"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpNot.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpNot.h"
|
||||
|
||||
|
||||
#define OP_NAME "NOT"
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpOct.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpOct.h"
|
||||
|
||||
|
||||
#define OP_NAME "OCT"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpOr.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpOr.h"
|
||||
|
||||
|
||||
#define OP_NAME "OR"
|
||||
|
||||
|
|
|
@ -7,14 +7,15 @@
|
|||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpPower.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpPower.h"
|
||||
|
||||
|
||||
#define OP_NAME "^"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpRcws.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCStack.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpRcws.h"
|
||||
|
||||
|
||||
#define OP_NAME "RCWS"
|
||||
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpRl.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCMode.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpRl.h"
|
||||
|
||||
|
||||
#define OP_NAME "RL"
|
||||
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpRr.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCMode.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpRr.h"
|
||||
|
||||
|
||||
#define OP_NAME "RR"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpSl.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpSl.h"
|
||||
|
||||
|
||||
#define OP_NAME "SL"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpSr.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpSr.h"
|
||||
|
||||
|
||||
#define OP_NAME "SR"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpStws.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCError.h"
|
||||
#include "abCStack.h"
|
||||
#include "abCMode.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpStws.h"
|
||||
|
||||
|
||||
#define OP_NAME "STWS"
|
||||
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpSubtr.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExpReal.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExpReal.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpSubtr.h"
|
||||
|
||||
|
||||
#define OP_NAME "-"
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "abCOpXor.h"
|
||||
|
||||
#include "abCOp.h"
|
||||
#include "abCError.h"
|
||||
#include "abCExpr.h"
|
||||
#include "abCExprInt.h"
|
||||
#include "abCStack.h"
|
||||
|
||||
#include "expr/abCExpr.h"
|
||||
#include "expr/abCExprInt.h"
|
||||
|
||||
#include "ops/abCOp.h"
|
||||
#include "ops/abCOpXor.h"
|
||||
|
||||
|
||||
#define OP_NAME "XOR"
|
||||
|
||||
|
|
Loading…
Reference in New Issue