[4] | 1 | #include <windows.h>
|
---|
| 2 | #include <stdio.h>
|
---|
| 3 | #include <string.h>
|
---|
| 4 | #include <math.h>
|
---|
| 5 | #include <commctrl.h>
|
---|
| 6 | #include <time.h>
|
---|
| 7 | #include <limits.h>
|
---|
| 8 | #include <shlobj.h>
|
---|
| 9 | #include <vector>
|
---|
| 10 |
|
---|
| 11 | #ifdef _AMD64_
|
---|
| 12 | #include "../BasicCompiler64/resource.h"
|
---|
| 13 | #include "../BasicCompiler64/CommandValue.h"
|
---|
| 14 | #include "../BasicCompiler64/FunctionValue.h"
|
---|
| 15 | #else
|
---|
| 16 | #include "../BasicCompiler/resource.h"
|
---|
| 17 | #include "../BasicCompiler/CommandValue.h"
|
---|
| 18 | #include "../BasicCompiler/FunctionValue.h"
|
---|
| 19 | #endif
|
---|
| 20 |
|
---|
| 21 | #include "../BasicCompiler_Common/BasicFixed.h"
|
---|
| 22 | #include "../BasicCompiler_Common/NonVolatile.h"
|
---|
| 23 | #include "../BasicCompiler_Common/TypeDef.h"
|
---|
| 24 | #include "../BasicCompiler_Common/psapi.h"
|
---|
| 25 | #include "../BasicCompiler_Common/BreakPoint.h"
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | //バージョン
|
---|
| 30 | #define MAJOR_VER 5
|
---|
| 31 | #define MINOR_VER 00
|
---|
| 32 | #define REVISION_VER 00
|
---|
| 33 |
|
---|
| 34 | #ifdef _AMD64_
|
---|
| 35 | #define VER_INFO "β8 (x64)"
|
---|
| 36 | #else
|
---|
| 37 | #define VER_INFO "β8"
|
---|
| 38 | #endif
|
---|
| 39 |
|
---|
| 40 | #if defined(JPN)
|
---|
| 41 | //日本語
|
---|
| 42 | #include "common_msg_jpn.h"
|
---|
| 43 | #else
|
---|
| 44 | //英語
|
---|
| 45 | #include "common_msg_eng.h"
|
---|
| 46 | #endif
|
---|
| 47 |
|
---|
| 48 |
|
---|
| 49 | #pragma comment(lib, "psapi.lib")
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | #define PTR_SIZE sizeof(LONG_PTR)
|
---|
| 53 |
|
---|
| 54 | #define MAX_LEN 65535
|
---|
| 55 | #define VN_SIZE 512
|
---|
| 56 | #define DIGIT_SIZE 128
|
---|
| 57 | #define MAX_PARMS 64
|
---|
| 58 | #define MAX_ARRAYDIM 16
|
---|
| 59 | #define MAX_HASH 32761
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 | #ifdef _AMD64_
|
---|
| 63 | #define PLATFORM 64
|
---|
| 64 | #else
|
---|
| 65 | #define PLATFORM 32
|
---|
| 66 | typedef long LONG_PTR;
|
---|
| 67 | typedef DWORD ULONG_PTR;
|
---|
| 68 | #endif
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | //未定義の定数情報
|
---|
| 72 | #define IMAGE_FILE_MACHINE_AMD64 0x8664
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | extern HWND hOwnerEditor;
|
---|
| 77 | extern HANDLE hHeap;
|
---|
| 78 | extern char BasicSystemDir[MAX_PATH];
|
---|
| 79 | extern int cp;
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 | //////////////////////////////////////////
|
---|
| 84 | // BasicCompiler、ProjectEditor共通の定数
|
---|
| 85 | //////////////////////////////////////////
|
---|
| 86 |
|
---|
| 87 | //サイズ変更枠の太さ
|
---|
| 88 | #define LEVER_THICK 5
|
---|
| 89 |
|
---|
| 90 | #define WM_SHOWERROR WM_USER+70 //エラー表示メッセージ
|
---|
| 91 |
|
---|
| 92 | #define WM_SETCOMPILEVIEW WM_USER+71 //コンパイラウィンドウが表示されたとき
|
---|
| 93 | #define WM_DESTROYCOMPILEVIEW WM_USER+72 //コンパイラウィンドウが破棄されたとき
|
---|
| 94 |
|
---|
| 95 | #define WM_SETDEBUGGERBASE WM_USER+73 //デバッガベースウィンドウが表示されたとき
|
---|
| 96 | #define WM_DESTROYDEBUGGERBASE WM_USER+74 //デバッガベースウィンドウが破棄されたとき
|
---|
| 97 |
|
---|
| 98 | #define WM_SETDEBUGGERVIEW WM_USER+75 //デバッガウィンドウが表示されたとき
|
---|
| 99 | #define WM_DESTROYDEBUGGERVIEW WM_USER+76 //デバッガウィンドウが表示されたとき
|
---|
| 100 |
|
---|
| 101 | ///////////////////////////////////////////
|
---|
| 102 |
|
---|
| 103 |
|
---|
| 104 | #define WM_SHOWVARLIST WM_USER+80
|
---|
| 105 | #define WM_VARLIST_CLOSE WM_USER+81 //変数リストの終了メッセージ(破棄のみ、解放なし)
|
---|
| 106 |
|
---|
| 107 |
|
---|
| 108 |
|
---|
| 109 | ///////////////////////////////////////////
|
---|
| 110 | // デバッグ コマンド
|
---|
| 111 |
|
---|
| 112 | #define WM_DEBUG_CONTINUE WM_USER+200
|
---|
| 113 | #define WM_STEP_IN WM_USER+201
|
---|
| 114 | #define WM_STEP_OVER WM_USER+202
|
---|
| 115 | #define WM_STEP_CURSOR WM_USER+203
|
---|
| 116 | #define WM_DEBUG_STOP WM_USER+204
|
---|
| 117 | #define WM_DEBUG_PAUSE WM_USER+205
|
---|
| 118 | #define WM_CLOSE_DEBUGGER WM_USER+206
|
---|
| 119 |
|
---|
| 120 | ///////////////////////////////////////////
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 | #define FILE_ALIGNMENT 0x1000
|
---|
| 126 | #define MEM_ALIGNMENT 0x1000
|
---|
| 127 | #define EXE_HEADER_SIZE 0x1000
|
---|
| 128 |
|
---|
| 129 |
|
---|
| 130 | //クラス管理用のクラス
|
---|
| 131 | #include "Class.h"
|
---|
| 132 |
|
---|
| 133 | //列挙体管理用のクラス
|
---|
| 134 | #include "Enum.h"
|
---|
| 135 |
|
---|
| 136 | //定数管理用のクラス
|
---|
| 137 | #include "Const.h"
|
---|
| 138 |
|
---|
| 139 |
|
---|
| 140 | struct ERRORINFO{
|
---|
| 141 | char *FileName;
|
---|
| 142 | int line;
|
---|
| 143 | };
|
---|
| 144 | struct INCLUDEFILEINFO{
|
---|
| 145 | char **ppFileNames;
|
---|
| 146 | int FilesNum;
|
---|
| 147 | int LineOfFile[MAX_LEN];
|
---|
| 148 | };
|
---|
| 149 |
|
---|
| 150 | //変数
|
---|
| 151 | #define REF_PARAMETER 1
|
---|
| 152 | #define OBJECT_PARAMETER 2
|
---|
| 153 | struct VARIABLE{
|
---|
| 154 | char name[255];
|
---|
| 155 | int type;
|
---|
| 156 | union{
|
---|
| 157 | LONG_PTR index;
|
---|
| 158 | CClass *pobj_c;
|
---|
| 159 | }u;
|
---|
| 160 |
|
---|
| 161 | DWORD fRef;
|
---|
| 162 |
|
---|
| 163 | BOOL bArray;
|
---|
| 164 | int SubScripts[MAX_ARRAYDIM];
|
---|
| 165 |
|
---|
| 166 | //コンストラクタ用パラメータ
|
---|
| 167 | char *ConstractParameter;
|
---|
| 168 |
|
---|
| 169 | /* --- オフセット ---
|
---|
| 170 |
|
---|
| 171 | ※グローバル変数で初期バッファがない場合は最上位ビットに1がセットされ、
|
---|
| 172 | 初期バッファの有無が識別される。
|
---|
| 173 | (その後、スケジュール実行により、実際の配置に並び替えられる)*/
|
---|
| 174 | int offset;
|
---|
| 175 |
|
---|
| 176 |
|
---|
| 177 | //レキシカルスコープ用
|
---|
| 178 | int ScopeStartAddress;
|
---|
| 179 | int ScopeEndAddress;
|
---|
| 180 | int ScopeLevel;
|
---|
| 181 | BOOL bLiving;
|
---|
| 182 |
|
---|
| 183 |
|
---|
| 184 | int source_code_address;
|
---|
| 185 | };
|
---|
| 186 |
|
---|
| 187 | //変数の相対情報
|
---|
| 188 | struct RELATIVE_VAR{
|
---|
| 189 | DWORD dwKind;
|
---|
| 190 | LONG_PTR offset;
|
---|
| 191 | BOOL bOffsetOffset;
|
---|
| 192 | };
|
---|
| 193 |
|
---|
| 194 | //パラメータ
|
---|
| 195 | struct PARAMETER_INFO{
|
---|
| 196 | char *name;
|
---|
| 197 | int type;
|
---|
| 198 | union{
|
---|
| 199 | LONG_PTR index;
|
---|
| 200 | CClass *pobj_c;
|
---|
| 201 | }u;
|
---|
| 202 |
|
---|
| 203 | BOOL bByVal;
|
---|
| 204 | BOOL bArray;
|
---|
| 205 | int SubScripts[MAX_ARRAYDIM];
|
---|
| 206 | };
|
---|
| 207 |
|
---|
| 208 | #define SUBTYPE_SUB 1
|
---|
| 209 | #define SUBTYPE_FUNCTION 2
|
---|
| 210 | #define SUBTYPE_MACRO 3
|
---|
| 211 | struct SUBINFO{
|
---|
| 212 | DWORD dwType;
|
---|
| 213 |
|
---|
| 214 | //クラス情報
|
---|
| 215 | CClass *pobj_ParentClass;
|
---|
| 216 |
|
---|
| 217 | long id;
|
---|
| 218 |
|
---|
| 219 | char *name;
|
---|
| 220 | long address;
|
---|
| 221 |
|
---|
| 222 | //パラメータ
|
---|
| 223 | PARAMETER_INFO *pParmInfo;
|
---|
| 224 | int ParmNum;
|
---|
| 225 | int SecondParmNum;
|
---|
| 226 | PARAMETER_INFO *pRealParmInfo;
|
---|
| 227 | int RealParmNum;
|
---|
| 228 | int RealSecondParmNum;
|
---|
| 229 |
|
---|
| 230 | //戻り値
|
---|
| 231 | int ReturnType;
|
---|
| 232 | union{
|
---|
| 233 | LONG_PTR ReturnIndex;
|
---|
| 234 | CClass *Return_pobj_c;
|
---|
| 235 | }u;
|
---|
| 236 |
|
---|
| 237 | DWORD CompileAddress;
|
---|
| 238 | DWORD EndOpAddr;
|
---|
| 239 | VARIABLE *pVar;
|
---|
| 240 | int VarNum;
|
---|
| 241 |
|
---|
| 242 | BOOL bExport;
|
---|
| 243 | BOOL bCdecl;
|
---|
| 244 | BOOL bVirtual;
|
---|
| 245 | BOOL bUse;
|
---|
| 246 | BOOL bCompile;
|
---|
| 247 | BOOL bSystem;
|
---|
| 248 |
|
---|
| 249 | SUBINFO *pNextData;
|
---|
| 250 | };
|
---|
| 251 | #define DECLARE_DYNAMIC 1
|
---|
| 252 | #define DECLARE_STATIC 2
|
---|
| 253 | struct DECLAREINFO{
|
---|
| 254 | DWORD dwType;
|
---|
| 255 |
|
---|
| 256 | char *file;
|
---|
| 257 | char *name;
|
---|
| 258 | char *alias;
|
---|
| 259 | BOOL bCdecl;
|
---|
| 260 |
|
---|
| 261 | //パラメータ
|
---|
| 262 | PARAMETER_INFO *pParmInfo;
|
---|
| 263 | int ParmNum;
|
---|
| 264 |
|
---|
| 265 | //戻り値
|
---|
| 266 | int ReturnType;
|
---|
| 267 | union{
|
---|
| 268 | LONG_PTR ReturnIndex;
|
---|
| 269 | CClass *Return_pobj_c;
|
---|
| 270 | }u;
|
---|
| 271 |
|
---|
| 272 | union{
|
---|
| 273 | int LookupAddress;
|
---|
| 274 | int StaticProc_CodeAddress;
|
---|
| 275 | };
|
---|
| 276 |
|
---|
| 277 | BOOL bUse;
|
---|
| 278 |
|
---|
| 279 | int pos;
|
---|
| 280 |
|
---|
| 281 | DECLAREINFO *pNextData;
|
---|
| 282 | };
|
---|
| 283 | struct PROCPTRINFO{
|
---|
| 284 | PARAMETER_INFO *pParmInfo;
|
---|
| 285 | int ParmNum;
|
---|
| 286 |
|
---|
| 287 | int ReturnType;
|
---|
| 288 | union{
|
---|
| 289 | LONG_PTR ReturnIndex;
|
---|
| 290 | CClass *Return_pobj_c;
|
---|
| 291 | }u;
|
---|
| 292 | };
|
---|
| 293 | struct CONSTINFO{
|
---|
| 294 | char *name;
|
---|
| 295 | char *StrValue;
|
---|
| 296 |
|
---|
| 297 | double DblValue;
|
---|
| 298 | _int64 i64Value;
|
---|
| 299 | int type;
|
---|
| 300 | LONG_PTR lpIndex;
|
---|
| 301 |
|
---|
| 302 | int ParmNum;
|
---|
| 303 | char **ppParm;
|
---|
| 304 |
|
---|
| 305 | CONSTINFO *pNextData;
|
---|
| 306 | };
|
---|
| 307 |
|
---|
| 308 |
|
---|
| 309 | #define CODETYPE_SYSTEMPROC 0x0001
|
---|
| 310 | #define CODETYPE_DEBUGPROC 0x0002
|
---|
| 311 | struct LINEINFO{
|
---|
| 312 | int TopCp;
|
---|
| 313 | int TopObp;
|
---|
| 314 | DWORD dwCodeType;
|
---|
| 315 | };
|
---|
| 316 | struct RESOURCEDATAINFO{
|
---|
| 317 | DWORD dwId;
|
---|
| 318 | char FileName[MAX_PATH];
|
---|
| 319 | };
|
---|
| 320 |
|
---|
| 321 |
|
---|
| 322 | //////////////////////////////////////////
|
---|
| 323 | // リソース ヘッダ(アイコン、カーソル用)
|
---|
| 324 | typedef struct{
|
---|
| 325 | WORD idReserved;
|
---|
| 326 | WORD idType;
|
---|
| 327 | WORD idCount;
|
---|
| 328 | }ICONDIR,CURSORDIR;
|
---|
| 329 |
|
---|
| 330 |
|
---|
| 331 | /////////////////////////////
|
---|
| 332 | // .curファイルのヘッダ情報
|
---|
| 333 | struct CURSORDIRENTRY{
|
---|
| 334 | BYTE bWidth;
|
---|
| 335 | BYTE bHeight;
|
---|
| 336 | BYTE bColorCount;
|
---|
| 337 | BYTE bReserved;
|
---|
| 338 | WORD wXHotspot;
|
---|
| 339 | WORD wYHotspot;
|
---|
| 340 | DWORD dwBytesInRes;
|
---|
| 341 | DWORD dwImageOffset;
|
---|
| 342 | };
|
---|
| 343 | struct CURSORDIRENTRY_RES{
|
---|
| 344 | WORD wWidth;
|
---|
| 345 | WORD wHeight;
|
---|
| 346 | WORD wXHotspot;
|
---|
| 347 | WORD wYHotspot;
|
---|
| 348 | DWORD dwBytesInRes;
|
---|
| 349 | WORD wCursorNum;
|
---|
| 350 | };
|
---|
| 351 |
|
---|
| 352 |
|
---|
| 353 | ////////////////////////////
|
---|
| 354 | //.icoファイルのヘッダ情報
|
---|
| 355 | struct ICONDIRENTRY{
|
---|
| 356 | BYTE bWidth;
|
---|
| 357 | BYTE bHeight;
|
---|
| 358 | BYTE bColorCount;
|
---|
| 359 | BYTE bReserved;
|
---|
| 360 | WORD wPlanes;
|
---|
| 361 | WORD wBitCount;
|
---|
| 362 | DWORD dwBytesInRes;
|
---|
| 363 | DWORD dwImageOffset;
|
---|
| 364 | };
|
---|
| 365 | struct ICONDIRENTRY_RES{
|
---|
| 366 | BYTE bWidth;
|
---|
| 367 | BYTE bHeight;
|
---|
| 368 | BYTE bColorCount;
|
---|
| 369 | BYTE bReserved;
|
---|
| 370 | WORD wPlanes;
|
---|
| 371 | WORD wBitCount;
|
---|
| 372 | DWORD dwBytesInRes;
|
---|
| 373 | WORD wIconNum;
|
---|
| 374 | };
|
---|
| 375 |
|
---|
| 376 |
|
---|
| 377 |
|
---|
| 378 | #include "../BasicCompiler_Common/schedule.h"
|
---|
| 379 | #include "../BasicCompiler_Common/DebugSection.h"
|
---|
| 380 | #include "../BasicCompiler_Common/LexicalScoping.h"
|
---|
| 381 |
|
---|
| 382 |
|
---|
| 383 |
|
---|
| 384 | int StaticCalculation(bool enableerror, char *Command,int BaseType,_int64 *pi64data,LONG_PTR *plpIndex,BOOL bDebuggingWatchList=0);
|
---|
| 385 |
|
---|
| 386 |
|
---|
| 387 | //BasicCompiler.cpp
|
---|
| 388 | void HeapDefaultFree(LPVOID lpMem);
|
---|
| 389 | void ts(int i);
|
---|
| 390 | void ts(int i,int i2);
|
---|
| 391 | void ts(char *msg);
|
---|
| 392 | void ts(char *msg,char *title);
|
---|
| 393 | void epi_check();
|
---|
| 394 | void GetRelationalPath(char *path,char *dir);
|
---|
| 395 | void GetFullPath(char *path,char *dir);
|
---|
| 396 | void ShowErrorLine(int LineNum,char *FileName);
|
---|
| 397 | BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen);
|
---|
| 398 | void MakeMessageText(char *buffer,char *msg,int flag);
|
---|
| 399 |
|
---|
| 400 | //hash.cpp
|
---|
| 401 | int hash_default(char *name);
|
---|
| 402 | CONSTINFO *GetConstHash(char *name);
|
---|
| 403 | DECLAREINFO *GetDeclareHash(char *name);
|
---|
| 404 | SUBINFO *GetSubHash(char *name,BOOL bError=0);
|
---|
| 405 | SUBINFO **GetOverloadObjectSubHash(char *name,CClass *pobj_c, int *pNum);
|
---|
| 406 | SUBINFO **GetOverloadSubHash(char *name,int *pNum);
|
---|
| 407 |
|
---|
| 408 | //Variable.cpp
|
---|
| 409 | BOOL IsVariableTopChar(char c);
|
---|
| 410 | BOOL IsVariableChar(char c);
|
---|
| 411 | BOOL IsPtrType(int type);
|
---|
| 412 | BOOL IsSignedType(int type);
|
---|
| 413 | BOOL IsNaturalWholeNumberType(int type);
|
---|
| 414 | BOOL IsWholeNumberType(int type);
|
---|
| 415 | BOOL IsRealNumberType(int type);
|
---|
| 416 | BOOL Is64Type(int type);
|
---|
| 417 | int GetSignedType(int type);
|
---|
| 418 | int GetUnsignedType(int type);
|
---|
| 419 | int GetTypeSize(int type,LONG_PTR lpIndex);
|
---|
| 420 | int GetPtrType(int type,LONG_PTR lpIndex);
|
---|
| 421 | int GetTypeFixed(char *TypeName,LONG_PTR *lpNum);
|
---|
| 422 | void GetOriginalTypeName(char *buffer);
|
---|
| 423 | BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name);
|
---|
| 424 | BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,int *pRefType);
|
---|
| 425 | void GetArrayElement(char *buffer,char *variable,char *array_element);
|
---|
| 426 | BOOL CheckVarNameError(char *name,int NowLine);
|
---|
| 427 | int JumpSubScripts(int *ss);
|
---|
| 428 | void GetArrange(char *variable,char *variAnswer,int *SubScripts);
|
---|
| 429 | int GetTypeFromSimpleName(char *variable);
|
---|
| 430 | int GetVarType(char *NameBuffer,LONG_PTR *plpIndex,BOOL bError);
|
---|
| 431 | BOOL GetDimentionFormat(char *buffer,char *VarName,int *SubScripts,TYPEINFO *pTypeInfo,char *InitBuf,char *ConstractParameter);
|
---|
| 432 | BOOL GetNowStaticVarFullName(char *VarName,char *FullName);
|
---|
| 433 | void AddGlobalVariable(char *name,int *SubScripts,TYPEINFO *pTypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlag);
|
---|
| 434 |
|
---|
| 435 | //Object.cpp
|
---|
| 436 | int GetSizeOfClassMember(CClass *pobj_c,char *pMemberName,int *pMemberNum);
|
---|
| 437 | int GetSizeOfClass(CClass *pobj_c);
|
---|
| 438 | void AddClassName(char *Parameter,int NowLine);
|
---|
| 439 | void CallConstractor(char *VarName,int *SubScripts,TYPEINFO &TypeInfo,char *Parameter);
|
---|
| 440 | void CallDestrouctorsOfScope(void);
|
---|
| 441 |
|
---|
| 442 | //Overload.sbp
|
---|
| 443 | SUBINFO *OverloadSolutionWithStrParam(char *name,SUBINFO **ppsi,int num,char *Parameter,char *ObjectName,TYPEINFO *pReturnTypeInfo);
|
---|
| 444 | SUBINFO *OverloadSolution(char *name,SUBINFO **ppsi,int num,PARAMETER_INFO *ppi,int ParmNum,TYPEINFO *pReturnTypeInfo);
|
---|
| 445 |
|
---|
| 446 | //Debug.cpp
|
---|
| 447 | void Debugger_StepIn(void);
|
---|
| 448 | void Debugger_StepOver(void);
|
---|
| 449 | void Debugger_StepCursor(void);
|
---|
| 450 | void Debugger_Stop(void);
|
---|
| 451 | void Debugger_Pause(void);
|
---|
| 452 | ULONG_PTR rva_to_real(DWORD p);
|
---|
| 453 | SUBINFO *GetSubFromObp(ULONG_PTR pos);
|
---|
| 454 | void ReadOpBuffer();
|
---|
| 455 | void DebugProgram(void);
|
---|
| 456 |
|
---|
| 457 | //VarList.cpp
|
---|
| 458 | void InitVarList(DWORD dwThreadId);
|
---|
| 459 | BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
---|
| 460 | BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
---|
| 461 |
|
---|
| 462 | //WatchList.cpp
|
---|
| 463 | ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar);
|
---|
| 464 | ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip);
|
---|
| 465 | int Debugging_GetVarOffset(char *variable,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss);
|
---|
| 466 |
|
---|
| 467 | //MakeExe.cpp
|
---|
| 468 | void StepCompileProgress(void);
|
---|
| 469 | void DeleteConstInfo(CONSTINFO **ppConstHash);
|
---|
| 470 | void DeleteDeclareInfo(void);
|
---|
| 471 | void AddSourceCode(char *buffer);
|
---|
| 472 | void OutputExe(void);
|
---|
| 473 | int MainThread(DWORD dummy);
|
---|
| 474 |
|
---|
| 475 | //Intermediate_Step1.cpp
|
---|
| 476 | void ChangeReturnCode(char *buffer);
|
---|
| 477 | void DeleteComment(char *buffer);
|
---|
| 478 | void KillReturnCode(char *buffer);
|
---|
| 479 | void CheckParenthesis(char *buffer);
|
---|
| 480 | BOOL CheckParenthesis2(char *buffer);
|
---|
| 481 | void DirectiveCheck(void);
|
---|
| 482 | void NextCommandFormat(char *buffer);
|
---|
| 483 | void SetEscapeSequenceFormat(char *buffer);
|
---|
| 484 | void DefCommandFormat(char *buffer);
|
---|
| 485 | void IfCommandFormat(char *buffer);
|
---|
| 486 | void CheckPareCommand(void);
|
---|
| 487 |
|
---|
| 488 | //Intermediate_Step2.cpp
|
---|
| 489 | void GetConstInfo(void);
|
---|
| 490 | void ChangeCommandToCode(char *buffer);
|
---|
| 491 |
|
---|
| 492 | //preprocessor.cpp
|
---|
| 493 | char *OpenBasicFile(char *FileName);
|
---|
| 494 |
|
---|
| 495 | //Resource.cpp
|
---|
| 496 | void GetResourceData(char *FileName);
|
---|
| 497 |
|
---|
| 498 | //CommandFormat.cpp
|
---|
| 499 | void ComOpen(char *Parameter,char *buffer,int NowLine);
|
---|
| 500 | void ComClose(char *Parameter,char *buffer);
|
---|
| 501 | void ComField(char *Parameter,char *buffer);
|
---|
| 502 | void ComLine(char *Parameter,char *buffer,int NowLine);
|
---|
| 503 | void ComCircle(char *Parameter,char *buffer,int NowLine);
|
---|
| 504 | void ComPSet(char *Parameter,char *buffer,int NowLine);
|
---|
| 505 | void ComPaint(char *Parameter,char *buffer,int NowLine);
|
---|
| 506 |
|
---|
| 507 | // StrOperation.cpp
|
---|
| 508 | void KillSpaces(char *str1,char *str2);
|
---|
| 509 | void KillStringSpaces(char *str);
|
---|
| 510 | BOOL RemoveStringQuotes(char *str);
|
---|
| 511 | void RemoveStringPare(char *str);
|
---|
| 512 | void RemoveStringBracket(char *str);
|
---|
| 513 | void SetStringQuotes(char *str);
|
---|
| 514 | int FormatString_EscapeSequence(char *buffer);
|
---|
| 515 | void SlideString(char *str,int slide);
|
---|
| 516 | void SlideBuffer(char *buffer,int length,int slide);
|
---|
| 517 | _int8 IsCommandDelimitation(char c);
|
---|
| 518 | BOOL IsBlank(char c);
|
---|
| 519 | int GetOneParameter(char *Parameter,int pos,char *retAns);
|
---|
| 520 | int JumpOneParameter(char *Parameter,int i);
|
---|
| 521 | int GetStringInQuotation(char *buffer,char *ReadBuffer);
|
---|
| 522 | int GetStringInPare(char *buffer,char *ReadBuffer);
|
---|
| 523 | int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer);
|
---|
| 524 | int GetStringInBracket(char *buffer,char *ReadBuffer);
|
---|
| 525 | int JumpStringInPare(char *buffer,int pos);
|
---|
| 526 | int JumpStringInBracket(char *buffer,int pos);
|
---|
| 527 | int GetCpFromLine(int LineNum);
|
---|
| 528 | BOOL GetLineNum(int pos,int *pLine,char *FileName);
|
---|
| 529 | char GetEndXXXCommand(char es);
|
---|
| 530 | void GetDefaultNameFromES(char es,char *name);
|
---|
| 531 | void GetCalcName(int idCalc,char *name);
|
---|
| 532 | BOOL IsFile(char *path);
|
---|
| 533 | BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
|
---|
| 534 |
|
---|
| 535 | //calculation.cpp
|
---|
| 536 | BOOL IsNumCalcMark(char *Command,int p);
|
---|
| 537 | BOOL IsNumCalcMark_Back(char *Command,int p);
|
---|
| 538 | BOOL IsStrCalcMark(char c);
|
---|
| 539 | BOOL IsExponent(char *Command,int p);
|
---|
| 540 | int GetLiteralIndex(_int64 i64data);
|
---|
| 541 | int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2);
|
---|
| 542 | DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType);
|
---|
| 543 | BOOL GetConstCalcBuffer(char *name,char *Parameter,char *pCalcBuffer);
|
---|
| 544 | DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex);
|
---|
| 545 | BOOL IsStringObjectType(TYPEINFO *pTypeInfo);
|
---|
| 546 | BOOL IsStringSubsituation(CClass *pobj_c);
|
---|
| 547 | int IsStrCalculation(char *Command);
|
---|
| 548 | BYTE GetCalcId(char *Command,int *pi);
|
---|
| 549 | BOOL GetNumOpeElements(char *Command,int *pnum,
|
---|
| 550 | char *values[255],long calc[255],long stack[255]);
|
---|
| 551 |
|
---|
| 552 | //NumOpe_GetType.cpp
|
---|
| 553 | int AutoBigCast(int BaseType,int CalcType);
|
---|
| 554 | BOOL CheckCalcType(int idCalc,int *type,int sp);
|
---|
| 555 | int NumOpe_GetType(char *Command,TYPEINFO *pBaseType,LONG_PTR *plpIndex);
|
---|
| 556 |
|
---|
| 557 | //Subroutine.cpp
|
---|
| 558 | int GetCallProcName(char *buffer,char *name);
|
---|
| 559 | int GetProc(char *name,void **ppInfo);
|
---|
| 560 | void GetObjectName(char *name,char *ObjectName,int *pRefType);
|
---|
| 561 | int GetReturnTypeOfProc(int idProc,void *pInfo,char *name,char *Parameter,LONG_PTR *plpRetIndex);
|
---|
| 562 | BOOL GetReturnTypeOfPropertyMethod(char *variable,char *RightSide,TYPEINFO *pRetTypeInfo);
|
---|
| 563 | BOOL CompareParameter(PARAMETER_INFO *ppi1,int pi_num1,PARAMETER_INFO *ppi2,int pi_num2);
|
---|
| 564 | SUBINFO *AddSubData(char *buffer,int NowLine,BOOL bVirtual,CClass *pobj_c,BOOL bStatic=0);
|
---|
| 565 | void GetSubInfo(void);
|
---|
| 566 | void DeleteSubInfo(SUBINFO **ppSubHash,char **ppMacroNames,int MacroNum);
|
---|
| 567 | void DeleteDeclareInfo(void);
|
---|
| 568 | int AddProcPtrInfo(char *buffer,DWORD dwProcType);
|
---|
| 569 | void DeleteProcPtrInfo(void);
|
---|
| 570 |
|
---|
| 571 | //LoopRefCheck.cpp
|
---|
| 572 | class CLoopRefCheck{
|
---|
| 573 | char **names;
|
---|
| 574 | int num;
|
---|
| 575 | void init();
|
---|
| 576 | public:
|
---|
| 577 | CLoopRefCheck();
|
---|
| 578 | ~CLoopRefCheck();
|
---|
| 579 | void add(char *lpszInheritsClass);
|
---|
| 580 | void del(char *lpszInheritsClass);
|
---|
| 581 | BOOL check(char *lpszInheritsClass);
|
---|
| 582 | };
|
---|
| 583 | extern CLoopRefCheck *pobj_LoopRefCheck;
|
---|
| 584 |
|
---|
| 585 | //error.cpp
|
---|
| 586 | void SetError(int ErrorNum,char *KeyWord,int pos);
|
---|
| 587 | void CompileMessage(char *buffer);
|
---|
| 588 | void CheckDifferentType(int VarType,LONG_PTR lpVarIndex,int CalcType,LONG_PTR lpCalcIndex,char *pszFuncName,int ParmNum);
|
---|
| 589 |
|
---|
| 590 | //Compile.cpp
|
---|
| 591 | void DebugVariable(void);
|
---|
| 592 | void Compile(void);
|
---|
| 593 |
|
---|
| 594 | //gc.cpp
|
---|
| 595 | void InitGCVariables(void);
|
---|
| 596 | void PerformedGcVarSchedule(void);
|
---|
| 597 |
|
---|
| 598 |
|
---|
| 599 |
|
---|
| 600 | #ifdef _DEBUG
|
---|
| 601 | /*Debug*/
|
---|
| 602 | /*
|
---|
| 603 | #define HeapAlloc CheckHeapAlloc
|
---|
| 604 | #define HeapReAlloc CheckHeapReAlloc
|
---|
| 605 | LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
|
---|
| 606 | LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
|
---|
| 607 | */
|
---|
| 608 | #endif
|
---|