Mercurial > hg > CbC > old > device
view mc.h @ 81:f94ca1168520
float first try...
author | kono |
---|---|
date | Mon, 03 Mar 2003 20:59:51 +0900 |
parents | 8418d4b7caa7 |
children | 25654dc29ecc |
line wrap: on
line source
/* Micro-C header file */ #define DEBUG error(-1) /*#include "CCLIB.TXT" */ #ifdef __micro_c__ #include "stdio.h" #else #include <stdio.h> #endif #define SIZE_INT 4 #define INT (-1) #define CHAR (-2) #define UNSIGNED (-3) #define POINTER (-4) #define ARRAY (-5) #define STRUCT (-6) #define UNION (-7) #define FUNCTION (-8) #define EMPTY (-9) #define STATIC (-10) #define GOTO (-11) #define RETURN (-12) #define BREAK (-13) #define CONTINUE (-14) #define IF (-15) #define ELSE (-16) #define FOR (-17) #define DO (-18) #define WHILE (-19) #define SWITCH (-20) #define CASE (-21) #define DEFAULT (-22) #define RESERVE (-23) #define TAG (-24) #define FIELD (-25) #define IDENT (-26) #define STRING (-27) #define MACRO (-28) #define BLABEL (-29) #define FLABEL (-30) #define TYPEDEF (-31) #define SIZEOF (-32) #define TYPE (-33) #define LONG (-34) #define SHORT (-35) #define EXTRN (-36) #define VOID (-37) #define REGISTER (-38) #define CODE (-39) #define ENVIRONMENT (-40) #define DEFINED (-41) #define KONST (-42) #define FMACRO (-43) #define LMACRO (-44) #define DOTS (-45) #define FLOAT (-46) #define DOUBLE (-47) #define LONGLONG (-48) #define TOP 0 #define GDECL 1 #define GSDECL 2 #define GUDECL 3 #define ADECL 4 #define LDECL 5 #define LSDECL 6 #define LUDECL 7 #define STADECL 8 #define STAT 9 #define GTDECL 10 #define LTDECL 11 #define IFDEF 12 #define MDECL 13 #define GVAR 1 #define RGVAR 2 #define CRGVAR 3 #define LVAR 4 #define RLVAR 5 #define CRLVAR 6 #define CONST 7 #define FNAME 8 #define INDIRECT 9 #define RINDIRECT 10 #define CRINDIRECT 11 #define ADDRESS 12 #define MINUS 13 #define LNOT 14 #define BNOT 15 #define INC 16 #define POSTINC 17 #define PREINC 18 #define CPOSTINC 19 #define CPREINC 20 #define DEC 21 #define CPOSTDEC 22 #define CPREDEC 23 #define MUL 24 #define UMUL 25 #define DIV 26 #define UDIV 27 #define MOD 28 #define UMOD 29 #define ADD 30 #define SUB 31 #define RSHIFT 32 #define URSHIFT 33 #define LSHIFT 34 #define ULSHIFT 35 #define GT 36 #define UGT 37 #define GE 38 #define UGE 39 #define LT 40 #define ULT 41 #define LE 42 #define ULE 43 #define EQ 44 #define NEQ 45 #define BAND 46 #define EOR 47 #define BOR 48 #define LAND 49 #define LOR 50 #define COND 51 #define ASS 52 #define CASS 53 #define ASSOP 54 #define CASSOP 55 #define COMMA 56 #define LPAR 57 #define RPAR 58 #define LBRA 59 #define RBRA 60 #define LC 61 #define RC 62 #define COLON 63 #define SM 64 #define PERIOD 65 #define ARROW 66 #define CNAME 67 #define SASS 68 #define RSTRUCT 69 #define FASSOP 70 #define DASSOP 71 #define DMINUS 73 #define DMUL 74 #define DDIV 75 #define DADD 76 #define DSUB 77 #define LMUL 78 #define LDIV 79 #define LADD 80 #define LSUB 81 #define FRGVAR 82 #define FRLVAR 83 #define FRINDIRECT 84 #define DRGVAR 85 #define DRLVAR 86 #define DRINDIRECT 87 #define LRGVAR 88 #define LRLVAR 89 #define LRINDIRECT 90 #define DCONST 91 #define LCONST 92 #define DASS 93 #define FASS 94 #define LASS 95 #define SHASS 96 #define I2D 97 #define D2I 98 #define US 1 #define AS 200 #define DOP 300 #define FILERR 1 #define DCERR 2 #define STERR 3 #define EXERR 4 #define CNERR 5 #define CHERR 6 #define GSERR 7 #define LSERR 8 #define STRERR 9 #define LNERR 10 #define EOFERR 11 #define MCERR 12 #define INCERR 13 #define HPERR 14 #define TYERR 15 #define LVERR 16 #define UDERR 17 #define OPTION 18 #define REG_ERR 19 #define CODE_ERR 20 #define MSERR 21 #define GSYMS 9000 #define LSYMS 500 #define MSYMS 3000 #define HEAPSIZE 10000 /* #define CHEAPSIZE 3000 */ #define CHEAPSIZE 256000 #define LBUFSIZE 4096 #define MACROSIZE 16000 #define FILES 10 #define OUTPUT_FILE_NAME "mcout.s" EXTERN int sym,ch,type,mode,stmode,gfree,lfree,mflag,lineno,glineno; EXTERN int labelno,gpc,disp,reg_var,debug; EXTERN int symval,args,init_vars,heap[HEAPSIZE]; EXTERN int blabel,clabel,dlabel,cslabel,ilabel,control,ac,ac2,lsrc,chk,asmf; EXTERN int MAX_REGISTER_VAR; EXTERN double dsymval; EXTERN unsigned hash; EXTERN int chsave; EXTERN char *chptrsave; EXTERN char linebuf[LBUFSIZE],namebuf[LBUFSIZE],*chptr; EXTERN char *name,*cheapp,**av,/*obuf[320],*/*sptr,escape(void); EXTERN int arg_offset,stat_no,size_of_int,disp_offset,endian,csvalue1; EXTERN int code_arg_offset; EXTERN int size_of_double,size_of_float,size_of_longlong; EXTERN int retlabel,retpending,retcont; EXTERN int arglist; EXTERN FILE *obuf; typedef struct nametable { char *nm; int sc,ty,dsp; } NMTBL; EXTERN NMTBL mtable[MSYMS]; EXTERN NMTBL ntable[GSYMS+LSYMS]; EXTERN NMTBL *nptr,*gnptr; EXTERN NMTBL *fnptr; EXTERN int typedefed,gtypedefed; EXTERN struct {int fd,ln;char *name0;FILE *fcb;} *filep,filestack[FILES]; EXTERN char cheap[CHEAPSIZE]; EXTERN char *macropp,macro_buf[MACROSIZE]; extern void error(int n); extern int size(int t); extern int scalar(int t); extern int dlist2(int e1, double e2); extern int list2(int e1, int e2); extern int list3(int e1, int e2, int e3); extern int list4(int e1, int e2, int e3,int e4); extern int reverse0(int t1); extern int assign_data(int e, int t, NMTBL *n,int offset); extern int assign_expr0(int e1,int e2,int t,int type) ; extern int assign_expr(int e1,int e2,int t,int type) ; extern int append4(int p,int a1,int a2,int a3); #define car(e) (heap[(int)(e)]) #define cadr(e) (heap[((int)(e))+1]) #define caddr(e) (heap[((int)(e))+2]) #define cadddr(e) (heap[((int)(e))+3]) #define dcadr(e) (*(double*)&heap[((int)(e))+1]) #define dcaddr(e) (*(double*)&heap[((int)(e))+2]) #include "conv/conv.h" #include "conv/c.h" /* #include "conv/c2cbc.h" #include "conv/cbc2c.h" #include "conv/null.h" */ extern Converter *conv; EXTERN void error(int n); EXTERN int append4(int p,int a1,int a2,int a3); EXTERN int assign_expr(int e1,int e2,int t,int type); EXTERN int assign_expr0(int e1,int e2,int t,int type); EXTERN int backdef(void); EXTERN int fwdlabel(void); EXTERN int get_register_var(void); EXTERN int glist2(int e1,int e2); EXTERN int integral(int t); EXTERN int list2(int e1, int e2); EXTERN int list3(int e1, int e2, int e3); EXTERN int list4(int e1, int e2, int e3, int e4); EXTERN int reverse0(int t1); EXTERN int rplacad(int e, int n); EXTERN int rplacadd(int e, int n); EXTERN int rvalue_t(int e,int type); EXTERN int scalar(int t); EXTERN void bexpr(int e1, char cond, int l1); EXTERN void def_label(int cslabel, int dlabel); EXTERN void display_ntable(NMTBL *n, char *s); EXTERN void exit(int l); EXTERN void fwddef(int l); /* end */