-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDoda.h
55 lines (47 loc) · 1.41 KB
/
Doda.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
#ifndef __DODA_H_
#define __DODA_H_
#include <string>
using namespace std;
typedef enum { typeConChar,typeConBool,typeConFloat,typeCon, typeId,typeArg, typeOpr } nodeEnum;
/* constants */
typedef struct {
int value; /* value of constant */
} conNodeType;
/* constants */
typedef struct {
float value; /* value of constant */
} floatConNodeType;
typedef struct {
bool value; /* value of constant */
} boolConNodeType;
typedef struct {
char value; /* value of constant */
} charConNodeType;
/* identifiers */
typedef struct {
string i; /* subscript to sym array */
} idNodeType;
/* identifiers */
typedef struct {
string i; /* subscript to sym array */
} argNodeType;
/* operators */
typedef struct {
int oper; /* operator */
int nops; /* number of operands */
struct nodeTypeTag *op[1]; /* operands, extended at runtime */
} oprNodeType;
typedef struct nodeTypeTag {
nodeEnum type; /* type of node */
union {
conNodeType con; /* int */
idNodeType id; /* identifiers */
oprNodeType opr; /* operators */
floatConNodeType conF; /* float */
boolConNodeType conB; /* bool */
charConNodeType conC;
argNodeType arg;
};
} nodeType;
//extern int sym[26];
#endif