-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstruct.h
More file actions
131 lines (120 loc) · 2.94 KB
/
struct.h
File metadata and controls
131 lines (120 loc) · 2.94 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* Format of a token returned by get_token().
*/
typedef struct TOKEN {
/* Class of token (see below) */
int token_class;
/* Type of token (see below) */
int token_type;
/* Converted token name (when applicable) */
char token_name[MAX_TOKEN_LENGTH];
/* Pointer to start of token in text_buffer */
char *token_start;
/* Number of characters token_start points to */
int token_length;
/* Pointer to start of white space in text_buffer */
char *white_space_start;
/* Pointer to char after end of white space in text_buffer */
char *white_space_end;
#ifdef LINKED_TOKENS
/* Pointer for use in linked list */
struct TOKEN *next_token;
#endif
} TOKEN;
/*
* Format of a procedure parameter list
*/
typedef struct PARAM_LIST {
/* Parameter name */
TOKEN param;
/* Pointer for use in linked list */
struct PARAM_LIST *next_param;
} PARAM_LIST;
/*
* Format of a variable in a DECLARE statement.
*/
typedef struct DECL_ID {
/* Variable name */
TOKEN *name;
/* BASED identifier token */
TOKEN *based_name;
/* If declared AT in another module */
BOOLEAN is_ext_at;
/* Pointer for use in linked list */
struct DECL_ID *next_var;
} DECL_ID;
/*
* Format of an element in a DECLARE statement.
*/
typedef struct DECL_MEMBER {
/* Linked list of identifiers of designated type */
DECL_ID *name_list;
/* LITERALLY string */
char *literal;
#ifdef PARSE_LITERALS
/* Parsed LITERAL token */
TOKEN *literal_token;
#endif
/* Array bound token */
TOKEN *array_bound;
/* Type of variable (INTEGER, WORD, LABEL, LITERALLY, etc.) */
TOKEN *type;
/* Attributes (NONE, EXTERNAL or PUBLIC) */
int attributes;
/* Initialization attribute (NONE, INITIAL or DATA) */
/* If PROCEDURE, DATA if has parameters */
int initialization;
/* Pointer to linked list of structure elements */
struct DECL_MEMBER *struct_list;
/* Pointer to parsed AT expression */
char *at_ptr;
/* Pointer in text_buffer to start of INITIAL/DATA values */
char *init_ptr;
/* Pointer for use in linked list */
struct DECL_MEMBER *next_member;
} DECL_MEMBER;
/*
* Format of a DECLARE statement.
*/
typedef struct DECL {
/* DECLARE token */
TOKEN *decl_token;
/* Linked list of DECL_MEMBERs */
DECL_MEMBER *decl_list;
/* Pointer for use in linked list */
struct DECL *next_decl;
} DECL;
/*
* Format of a context element
*/
typedef struct CONTEXT {
/* Type of context (MODULE, PROCEDURE or DO) */
int context_type;
/* Name of module or procedure */
TOKEN *context_name;
/* Pointer to linked list of declaration members */
DECL_MEMBER *decl_head;
/* Pointer for use in linked list */
struct CONTEXT *next_context;
} CONTEXT;
/*
* Format of a PL/M identifier equivalent
*/
typedef struct {
char *id_name, *new_id;
} CVT_ID;
/*
* Format of a PL/M reserved word
*/
typedef struct {
char *name;
int token;
} RESERVED_WORD;
/*
* Format of a PL/M reserved operator
*/
typedef struct {
char *operator;
char *cvt_operator;
int name;
} RESERVED_OPERATOR;