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