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