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