Changeset 11 in dev for BasicCompiler_Common
- Timestamp:
- Dec 8, 2006, 3:25:27 AM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/NumOpe_GetType.cpp
r7 r11 301 301 BOOL bLiteralCalculation=1; 302 302 303 double dbl;304 303 int sp; 305 304 int type[255]; -
BasicCompiler_Common/Variable.cpp
r7 r11 815 815 } 816 816 817 BOOL GetVarOffsetReadOnly(char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){ 818 //読み取り専用で変数へアクセス 819 return GetVarOffset( 820 true, //エラー表示有効 821 false, //書き込みアクセスは無し 822 NameBuffer, 823 pType, 824 pRelativeVar, 825 plpIndex, 826 pss); 827 } 828 BOOL GetVarOffsetReadWrite(char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){ 829 //読み書き両用で変数へアクセス 830 return GetVarOffset( 831 true, //エラー表示有効 832 true, //書き込みアクセス 833 NameBuffer, 834 pType, 835 pRelativeVar, 836 plpIndex, 837 pss); 838 } 839 817 840 818 841 … … 1017 1040 1018 1041 lstrcpy(pVar->name,name); 1019 if(dwFlag & DIMFLAG_CONST) pVar->bConst = 1;1020 else pVar->bConst = 0;1042 if(dwFlag & DIMFLAG_CONST) pVar->bConst = true; 1043 else pVar->bConst = false; 1021 1044 if(SubScripts[0]==-1) pVar->bArray=0; 1022 1045 else pVar->bArray=1; … … 1054 1077 AllInitGlobalVarSize); 1055 1078 if(InitBuf[0]){ 1079 //初期代入時のみ、書き込みアクセスを許可する 1080 bool bConstBack = pVar->bConst; 1081 pVar->bConst = false; 1082 1056 1083 int result = SetInitGlobalData(pVar->offset, 1057 1084 pVar->type, … … 1066 1093 OpcodeCalc(temporary); 1067 1094 } 1095 1096 pVar->bConst = bConstBack; 1068 1097 } 1069 1098 -
BasicCompiler_Common/calculation.cpp
r7 r11 1299 1299 1300 1300 //変数 1301 RELATIVE_VAR RelativeVar;1302 1301 CClass *pobj_Class; 1303 if(!GetVarOffset(1,Command+i2,&type,&RelativeVar,(LONG_PTR *)&pobj_Class)){ 1302 type = GetVarType(Command+i2,(LONG_PTR *)&pobj_Class,1); 1303 if(type==-1 || type ==0){ 1304 1304 //エラー 1305 1305 return -1; -
BasicCompiler_Common/common.h
r7 r11 166 166 167 167 //定数変数かどうか 168 BOOLbConst;168 bool bConst; 169 169 170 170 BOOL bArray; … … 386 386 #include "../BasicCompiler_Common/DebugSection.h" 387 387 #include "../BasicCompiler_Common/LexicalScoping.h" 388 #include "../BasicCompiler_Common/Variable.h" 388 389 389 390 … … 413 414 SUBINFO **GetOverloadObjectSubHash(char *name,CClass *pobj_c, int *pNum); 414 415 SUBINFO **GetOverloadSubHash(char *name,int *pNum); 415 416 //Variable.cpp417 BOOL IsVariableTopChar(char c);418 BOOL IsVariableChar(char c);419 BOOL IsPtrType(int type);420 BOOL IsSignedType(int type);421 BOOL IsNaturalWholeNumberType(int type);422 BOOL IsWholeNumberType(int type);423 BOOL IsRealNumberType(int type);424 BOOL Is64Type(int type);425 int GetSignedType(int type);426 int GetUnsignedType(int type);427 int GetTypeSize(int type,LONG_PTR lpIndex);428 int GetPtrType(int type,LONG_PTR lpIndex);429 int GetTypeFixed(char *TypeName,LONG_PTR *lpNum);430 void GetOriginalTypeName(char *buffer);431 BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name);432 BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,int *pRefType);433 void GetArrayElement(char *buffer,char *variable,char *array_element);434 BOOL CheckVarNameError(char *name,int NowLine);435 int JumpSubScripts(int *ss);436 void GetArrange(char *variable,char *variAnswer,int *SubScripts);437 int GetTypeFromSimpleName(char *variable);438 int GetVarType(char *NameBuffer,LONG_PTR *plpIndex,BOOL bError);439 BOOL GetDimentionFormat(char *buffer,char *VarName,int *SubScripts,TYPEINFO *pTypeInfo,char *InitBuf,char *ConstractParameter);440 BOOL GetNowStaticVarFullName(char *VarName,char *FullName);441 void AddGlobalVariable(char *name,int *SubScripts,TYPEINFO *pTypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlag);442 416 443 417 //Object.cpp -
BasicCompiler_Common/error.cpp
r4 r11 142 142 if(num==59) sprintf(msg,"マニフェスト ファイル \"%s\" の読み込みに失敗。",KeyWord); 143 143 if(num==60) lstrcpy(msg,"Staticステートメントはグローバル領域では使用できません。"); 144 if(num==61) sprintf(msg,"\"%s\" Const定義の変数には書き込めません。",KeyWord); 144 145 145 146 -
BasicCompiler_Common/gc.cpp
r5 r11 24 24 OpcodeDim(temporary,0); 25 25 26 GetVarOffset (1,"_System_gc_GlobalRoot_StartPtr",&type,&RelativeVar,&lpIndex);26 GetVarOffsetReadWrite("_System_gc_GlobalRoot_StartPtr",&type,&RelativeVar,&lpIndex); 27 27 28 28 //mov rax,ptr … … 44 44 OpcodeDim(temporary,0); 45 45 46 GetVarOffset (1,"_System_gc_GlobalRoot_Size",&type,&RelativeVar,&lpIndex);46 GetVarOffsetReadWrite("_System_gc_GlobalRoot_Size",&type,&RelativeVar,&lpIndex); 47 47 48 48 //mov rax,ptr … … 65 65 OpcodeDim(temporary,0); 66 66 67 GetVarOffset (1,"_System_gc_StackRoot_StartPtr",&type,&RelativeVar,&lpIndex);67 GetVarOffsetReadWrite("_System_gc_StackRoot_StartPtr",&type,&RelativeVar,&lpIndex); 68 68 69 69 //mov rax,rsp
Note:
See TracChangeset
for help on using the changeset viewer.