-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprog.h
58 lines (38 loc) · 1.03 KB
/
prog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* prog.h
*/
#ifndef PROG_H
#define PROG_H
#include <stdarg.h>
#include "scan.h"
/*
* DATA TYPES
*/
typedef void (instructionExecuteFunc)(void *);
typedef char * (instructionFormatFunc)(void *);
typedef void (instructionFreeFunc)(void *);
typedef struct instructionType {
struct instructionType *next;
keywords keyword;
instructionExecuteFunc *executeFunc;
instructionFormatFunc *formatFunc;
instructionFreeFunc *freeFunc;
} instructionType;
typedef struct progLineType {
struct progLineType *next;
instructionType *firstInstruction;
instructionType *lastInstruction;
instructionType *currentInstruction;
long int lineNum;
} progLineType;
/*
* GLOBAL FUNCTIONS
*/
extern int progAppendInstruction(progLineType *p, keywords k, ...);
extern void progDeleteExpression(symbolType *s);
extern void progDeleteInstructions(instructionType *p);
extern void progDeleteLine(progLineType *p);
extern void progExecuteLine(progLineType *p);
extern int progInit(void);
extern progLineType *progInsertLine(int l);
#endif /* PROG_H */