comparison mc-parse.c @ 332:ce85d6106119

bit field continue. (code generation done)
author kono
date Thu, 24 Jun 2004 15:21:43 +0900 (2004-06-24)
parents f25aa4f03198
children d488b72254fb
comparison
equal deleted inserted replaced
331:f25aa4f03198 332:ce85d6106119
803 n->dsp=arg; 803 n->dsp=arg;
804 } else if(sym==COLON) { /* bit-field */ 804 } else if(sym==COLON) { /* bit-field */
805 if (mode==GSDECL||mode==GUDECL||mode==LSDECL||mode==LUDECL) { 805 if (mode==GSDECL||mode==GUDECL||mode==LSDECL||mode==LUDECL) {
806 if (scalar(type) || type==LONGLONG || type==ULONGLONG) { 806 if (scalar(type) || type==LONGLONG || type==ULONGLONG) {
807 getsym(0); 807 getsym(0);
808 type = n->ty = 808 type = list4(BIT_FIELD,type,0 /* bit offset */,symval);
809 list4(BIT_FIELD,type,0 /* bit offset */,symval);
810 getsym(0); 809 getsym(0);
811 } 810 }
812 } else 811 } else
813 error(DCERR); 812 error(DCERR);
814 return n; 813 return n;
2261 return(list3(FPREINC,e,dir)); 2260 return(list3(FPREINC,e,dir));
2262 if(type==DOUBLE) 2261 if(type==DOUBLE)
2263 return(list3(DPREINC,e,dir)); 2262 return(list3(DPREINC,e,dir));
2264 #endif 2263 #endif
2265 if(type>0 && car(type)==BIT_FIELD) 2264 if(type>0 && car(type)==BIT_FIELD)
2266 return(list3(BPREINC,e,dir)); 2265 return(list4(BPREINC,e,dir,type));
2267 if(car(type)!=POINTER) 2266 if(car(type)!=POINTER)
2268 error(TYERR); 2267 error(TYERR);
2269 return(list4(UPREINC,e, 2268 return(list4(UPREINC,e,
2270 op==INC?size(cadr(type)):-size(cadr(type)),size_of_int )); 2269 op==INC?size(cadr(type)):-size(cadr(type)),size_of_int ));
2271 case MUL: /* *p */ 2270 case MUL: /* *p */
2408 return(list3(LPOSTINC,e,dir)); 2407 return(list3(LPOSTINC,e,dir));
2409 if(type==ULONGLONG) 2408 if(type==ULONGLONG)
2410 return(list3(LUPOSTINC,e,dir)); 2409 return(list3(LUPOSTINC,e,dir));
2411 #endif 2410 #endif
2412 if(type>0 && car(type)==BIT_FIELD) 2411 if(type>0 && car(type)==BIT_FIELD)
2413 return(list3(BPOSTINC,e,dir)); 2412 return(list4(BPOSTINC,e,dir,type));
2414 if(car(type)!=POINTER) 2413 if(car(type)!=POINTER)
2415 error(TYERR); 2414 error(TYERR);
2416 return(list4(UPOSTINC,e, 2415 return(list4(UPOSTINC,e,
2417 op==INC?size(cadr(type)):-size(cadr(type)),size_of_int )); 2416 op==INC?size(cadr(type)):-size(cadr(type)),size_of_int ));
2418 } 2417 }