annotate mc.h @ 18:df7fa8cee67b

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