comparison mc.h @ 0:d35df41eac69

Initial revision
author kono
date Thu, 13 Jan 2000 02:41:41 +0900
parents
children ca8e268dd7d4
comparison
equal deleted inserted replaced
-1:000000000000 0:d35df41eac69
1 /* Micro-C header file */
2
3 #define DEBUG error(-1)
4
5 /*#include "CCLIB.TXT" */
6 #include "stdio.h"
7
8 #define SIZE_INT 4
9
10 #define INT (-1)
11 #define CHAR (-2)
12 #define UNSIGNED (-3)
13 #define POINTER (-4)
14 #define ARRAY (-5)
15 #define STRUCT (-6)
16 #define UNION (-7)
17 #define FUNCTION (-8)
18 #define EMPTY (-9)
19
20 #define STATIC (-10)
21 #define GOTO (-11)
22 #define RETURN (-12)
23 #define BREAK (-13)
24 #define CONTINUE (-14)
25 #define IF (-15)
26 #define ELSE (-16)
27 #define FOR (-17)
28 #define DO (-18)
29 #define WHILE (-19)
30 #define SWITCH (-20)
31 #define CASE (-21)
32 #define DEFAULT (-22)
33 #define RESERVE (-23)
34 #define TAG (-24)
35 #define FIELD (-25)
36 #define IDENT (-26)
37 #define STRING (-27)
38 #define MACRO (-28)
39 #define BLABEL (-29)
40 #define FLABEL (-30)
41 #define TYPEDEF (-31)
42 #define SIZEOF (-32)
43 #define TYPE (-33)
44 #define LONG (-34)
45 #define SHORT (-35)
46 #define EXTRN (-36)
47 #define VOID (-37)
48 #define REGISTER (-38)
49 #define CODE (-39)
50 #define ENVIRONMENT (-40)
51
52 #define TOP 0
53 #define GDECL 1
54 #define GSDECL 2
55 #define GUDECL 3
56 #define ADECL 4
57 #define LDECL 5
58 #define LSDECL 6
59 #define LUDECL 7
60 #define STADECL 8
61 #define STAT 9
62 #define GTDECL 10
63 #define LTDECL 11
64
65 #define GVAR 1
66 #define RGVAR 2
67 #define CRGVAR 3
68 #define LVAR 4
69 #define RLVAR 5
70 #define CRLVAR 6
71 #define CONST 7
72 #define FNAME 8
73 #define INDIRECT 9
74 #define RINDIRECT 10
75 #define CRINDIRECT 11
76 #define ADDRESS 12
77 #define MINUS 13
78 #define LNOT 14
79 #define BNOT 15
80 #define INC 16
81 #define POSTINC 17
82 #define PREINC 18
83 #define CPOSTINC 19
84 #define CPREINC 20
85 #define DEC 21
86 #define CPOSTDEC 22
87 #define CPREDEC 23
88 #define MUL 24
89 #define UMUL 25
90 #define DIV 26
91 #define UDIV 27
92 #define MOD 28
93 #define UMOD 29
94 #define ADD 30
95 #define SUB 31
96 #define RSHIFT 32
97 #define URSHIFT 33
98 #define LSHIFT 34
99 #define ULSHIFT 35
100 #define GT 36
101 #define UGT 37
102 #define GE 38
103 #define UGE 39
104 #define LT 40
105 #define ULT 41
106 #define LE 42
107 #define ULE 43
108 #define EQ 44
109 #define NEQ 45
110 #define BAND 46
111 #define EOR 47
112 #define BOR 48
113 #define LAND 49
114 #define LOR 50
115 #define COND 51
116 #define ASS 52
117 #define CASS 53
118 #define ASSOP 54
119 #define CASSOP 55
120 #define COMMA 56
121 #define LPAR 57
122 #define RPAR 58
123 #define LBRA 59
124 #define RBRA 60
125 #define LC 61
126 #define RC 62
127 #define COLON 63
128 #define SM 64
129 #define PERIOD 65
130 #define ARROW 66
131 #define CNAME 67
132 #define SASS 68
133 #define DOTS 69
134
135 #define US 1
136 #define AS 100
137
138 #define FILERR 1
139 #define DCERR 2
140 #define STERR 3
141 #define EXERR 4
142 #define CNERR 5
143 #define CHERR 6
144 #define GSERR 7
145 #define LSERR 8
146 #define STRERR 9
147 #define LNERR 10
148 #define EOFERR 11
149 #define MCERR 12
150 #define INCERR 13
151 #define HPERR 14
152 #define TYERR 15
153 #define LVERR 16
154 #define UDERR 17
155 #define OPTION 18
156 #define REG_ERR 19
157 #define CODE_ERR 20
158
159 #define GSYMS 9000
160 #define LSYMS 500
161
162 #define HEAPSIZE 10000
163 /* #define CHEAPSIZE 3000 */
164 #define CHEAPSIZE 256000
165 #define LBUFSIZE 4096
166
167 #define FILES 3
168 #define OUTPUT_FILE_NAME "mcout.s"
169
170 EXTERN int sym,ch,chsave,type,mode,stmode,gfree,lfree,mflag,lineno,glineno;
171 EXTERN int labelno,gpc,disp,reg_var,debug;
172 EXTERN int symval,args,init_vars,heap[HEAPSIZE];
173 EXTERN int blabel,clabel,dlabel,cslabel,ilabel,control,ac,ac2,lsrc,chk,asmf;
174 EXTERN int MAX_REGISTER_VAR;
175
176 EXTERN unsigned hash;
177
178 EXTERN char linebuf[LBUFSIZE],namebuf[LBUFSIZE],*chptr,*chptrsave;
179 EXTERN char *name,*cheapp,**av,/*obuf[320],*/*sptr,escape(void);
180 EXTERN int arg_offset,stat_no,int_size,disp_offset,endian,csvalue,csvalue1;
181 EXTERN int code_arg_offset;
182 EXTERN int retlabel,retpending,retcont;
183
184 EXTERN FILE *obuf;
185
186 typedef struct nametable {
187 char *nm;
188 int sc,ty,dsp; } NMTBL;
189
190 EXTERN NMTBL ntable[GSYMS+LSYMS],*nptr,*gnptr,*decl0(void),*decl1(void),*lsearch(char *name),*gsearch(void);
191 EXTERN NMTBL *fnptr;
192
193 EXTERN struct {int fd,ln;/*char fcb[320]*/FILE *fcb;} *filep,filestack[FILES];
194 EXTERN char cheap[CHEAPSIZE];
195