Changeset 41 in dev for BasicCompiler_Common
- Timestamp:
- Jan 28, 2007, 5:28:43 AM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/BasicFixed.h
r40 r41 54 54 #define NATURAL_TYPE(t) ((t)&MASK_NATURAL) 55 55 #define MAKE_PTR_TYPE(t,p) ((t)|((p)<<8)) 56 #define PTR_LEVEL_UP(t) MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)+1) 56 #define PTR_LEVEL_UP(t) MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)+1) 57 #define PTR_LEVEL_DOWN(t) MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)-1) 57 58 58 59 #define DEF_PTR_BYTE MAKE_PTR_TYPE(DEF_BYTE,1) … … 105 106 #define CALC_INTQUOTIENT 63 //整数除算 106 107 #define CALC_AS 71 // As 108 #define CALC_BYVAL 72 // ByVal 107 109 #define CALC_MINUSMARK 81 // -x 108 110 #define CALC_POWER 91 // ^ -
BasicCompiler_Common/NumOpe_GetType.cpp
r38 r41 163 163 case CALC_AS: 164 164 if((type[sp-1]&FLAG_CAST)==0){ 165 //型名が指定されていないときはエラー 166 SetError(47,NULL,cp); 167 return 0; 168 } 169 break; 170 171 case CALC_BYVAL: 172 if(type[sp-1]&FLAG_CAST){ 165 173 //型名が指定されていないときはエラー 166 174 SetError(47,NULL,cp); … … 601 609 sp--; 602 610 break; 611 612 case CALC_BYVAL: 613 //ポインタ型→参照型 614 if( PTR_LEVEL( type[sp-1] ) <= 0 ){ 615 //ポインタ型ではないとき 616 SetError( 3, NULL, cp ); 617 goto error; 618 } 619 620 type[sp-1] = PTR_LEVEL_DOWN( type[sp-1] ); 621 break; 603 622 } 604 623 } -
BasicCompiler_Common/StrOperation.cpp
r31 r41 652 652 lstrcpy(name,"As"); 653 653 break; 654 case CALC_BYVAL: 655 lstrcpy(name,"ByVal"); 656 break; 654 657 case CALC_MINUSMARK: 655 658 lstrcpy(name,"-"); -
BasicCompiler_Common/calculation.cpp
r36 r41 39 39 Command[p]=='='||Command[p]=='<'||Command[p]=='>'|| 40 40 IsJudgMark(Command,p)|| 41 (Command[p]==1&&Command[p+1]==ESC_AS)) return 1; 41 (Command[p]==1&&Command[p+1]==ESC_AS)|| 42 (Command[p]==1&&Command[p+1]==ESC_BYVAL)) return 1; 42 43 return 0; 43 44 } … … 775 776 else if(Command[i]=='^') i3=CALC_POWER; 776 777 else if(Command[i]==1&&Command[i+1]==ESC_AS) i3=CALC_AS; 778 else if(Command[i]==1&&Command[i+1]==ESC_BYVAL) i3=CALC_BYVAL; 777 779 778 780 i3+=PareNum*100; … … 889 891 sp--; 890 892 break; 893 case CALC_BYVAL: 894 //エラー 895 break; 891 896 } 892 897 } … … 1404 1409 else if(Command[0]=='^') return CALC_POWER; 1405 1410 else if(Command[0]==1&&Command[1]==ESC_AS) return CALC_AS; 1411 else if(Command[0]==1&&Command[1]==ESC_BYVAL) return CALC_BYVAL; 1406 1412 1407 1413 return 0; … … 1480 1486 } 1481 1487 else{ 1482 if(!(Command[i]=='+'||Command[i]=='-'||(Command[i]==1&&Command[i+1]==ESC_NOT))){ 1483 SetError(1,NULL,cp); 1484 return 0; 1488 if(!( 1489 Command[i]=='+'|| 1490 Command[i]=='-'|| 1491 (Command[i]==1&&Command[i+1]==ESC_NOT)|| 1492 (Command[i]==1&&Command[i+1]==ESC_BYVAL) 1493 )){ 1494 SetError(1,NULL,cp); 1495 return 0; 1485 1496 } 1486 1497 if(Command[i]=='+'){
Note:
See TracChangeset
for help on using the changeset viewer.