[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 |
|
---|
[73] | 157 | // プロシージャ管理用のクラス
|
---|
| 158 | #include "Procedure.h"
|
---|
[71] | 159 |
|
---|
| 160 |
|
---|
[73] | 161 |
|
---|
[4] | 162 | struct ERRORINFO{
|
---|
| 163 | char *FileName;
|
---|
| 164 | int line;
|
---|
| 165 | };
|
---|
| 166 | struct INCLUDEFILEINFO{
|
---|
| 167 | char **ppFileNames;
|
---|
| 168 | int FilesNum;
|
---|
| 169 | int LineOfFile[MAX_LEN];
|
---|
| 170 | };
|
---|
| 171 |
|
---|
[14] | 172 |
|
---|
[4] | 173 | //変数
|
---|
| 174 | #define REF_PARAMETER 1
|
---|
| 175 | #define OBJECT_PARAMETER 2
|
---|
[40] | 176 | #define REF_VARIABLE 4
|
---|
[4] | 177 | struct VARIABLE{
|
---|
| 178 | char name[255];
|
---|
| 179 | int type;
|
---|
| 180 | union{
|
---|
| 181 | LONG_PTR index;
|
---|
| 182 | CClass *pobj_c;
|
---|
| 183 | }u;
|
---|
| 184 |
|
---|
| 185 | DWORD fRef;
|
---|
| 186 |
|
---|
[7] | 187 | //定数変数かどうか
|
---|
[11] | 188 | bool bConst;
|
---|
[7] | 189 |
|
---|
[4] | 190 | BOOL bArray;
|
---|
| 191 | int SubScripts[MAX_ARRAYDIM];
|
---|
| 192 |
|
---|
| 193 | //コンストラクタ用パラメータ
|
---|
| 194 | char *ConstractParameter;
|
---|
| 195 |
|
---|
| 196 | /* --- オフセット ---
|
---|
| 197 |
|
---|
| 198 | ※グローバル変数で初期バッファがない場合は最上位ビットに1がセットされ、
|
---|
| 199 | 初期バッファの有無が識別される。
|
---|
| 200 | (その後、スケジュール実行により、実際の配置に並び替えられる)*/
|
---|
| 201 | int offset;
|
---|
| 202 |
|
---|
| 203 |
|
---|
| 204 | //レキシカルスコープ用
|
---|
| 205 | int ScopeStartAddress;
|
---|
| 206 | int ScopeEndAddress;
|
---|
| 207 | int ScopeLevel;
|
---|
| 208 | BOOL bLiving;
|
---|
| 209 |
|
---|
| 210 |
|
---|
| 211 | int source_code_address;
|
---|
| 212 | };
|
---|
| 213 |
|
---|
| 214 | //変数の相対情報
|
---|
| 215 | struct RELATIVE_VAR{
|
---|
| 216 | DWORD dwKind;
|
---|
| 217 | LONG_PTR offset;
|
---|
| 218 | BOOL bOffsetOffset;
|
---|
| 219 | };
|
---|
| 220 |
|
---|
| 221 | struct PARAMETER_INFO{
|
---|
| 222 | char *name;
|
---|
| 223 | int type;
|
---|
| 224 | union{
|
---|
| 225 | LONG_PTR index;
|
---|
| 226 | CClass *pobj_c;
|
---|
| 227 | }u;
|
---|
| 228 |
|
---|
| 229 | BOOL bByVal;
|
---|
| 230 | BOOL bArray;
|
---|
| 231 | int SubScripts[MAX_ARRAYDIM];
|
---|
| 232 | };
|
---|
| 233 |
|
---|
| 234 | #define DECLARE_DYNAMIC 1
|
---|
| 235 | #define DECLARE_STATIC 2
|
---|
| 236 | struct DECLAREINFO{
|
---|
| 237 | DWORD dwType;
|
---|
| 238 |
|
---|
| 239 | char *file;
|
---|
| 240 | char *name;
|
---|
| 241 | char *alias;
|
---|
| 242 | BOOL bCdecl;
|
---|
| 243 |
|
---|
| 244 | //パラメータ
|
---|
| 245 | PARAMETER_INFO *pParmInfo;
|
---|
| 246 | int ParmNum;
|
---|
| 247 |
|
---|
| 248 | //戻り値
|
---|
| 249 | int ReturnType;
|
---|
| 250 | union{
|
---|
| 251 | LONG_PTR ReturnIndex;
|
---|
| 252 | CClass *Return_pobj_c;
|
---|
| 253 | }u;
|
---|
| 254 |
|
---|
| 255 | union{
|
---|
| 256 | int LookupAddress;
|
---|
| 257 | int StaticProc_CodeAddress;
|
---|
| 258 | };
|
---|
| 259 |
|
---|
| 260 | BOOL bUse;
|
---|
| 261 |
|
---|
| 262 | int pos;
|
---|
| 263 |
|
---|
| 264 | DECLAREINFO *pNextData;
|
---|
| 265 | };
|
---|
| 266 | struct PROCPTRINFO{
|
---|
| 267 | PARAMETER_INFO *pParmInfo;
|
---|
| 268 | int ParmNum;
|
---|
| 269 |
|
---|
| 270 | int ReturnType;
|
---|
| 271 | union{
|
---|
| 272 | LONG_PTR ReturnIndex;
|
---|
| 273 | CClass *Return_pobj_c;
|
---|
| 274 | }u;
|
---|
| 275 | };
|
---|
| 276 | struct CONSTINFO{
|
---|
| 277 | char *name;
|
---|
| 278 | char *StrValue;
|
---|
| 279 |
|
---|
| 280 | double DblValue;
|
---|
| 281 | _int64 i64Value;
|
---|
| 282 | int type;
|
---|
| 283 | LONG_PTR lpIndex;
|
---|
| 284 |
|
---|
| 285 | int ParmNum;
|
---|
| 286 | char **ppParm;
|
---|
| 287 |
|
---|
| 288 | CONSTINFO *pNextData;
|
---|
| 289 | };
|
---|
| 290 |
|
---|
| 291 |
|
---|
| 292 | #define CODETYPE_SYSTEMPROC 0x0001
|
---|
| 293 | #define CODETYPE_DEBUGPROC 0x0002
|
---|
| 294 | struct LINEINFO{
|
---|
| 295 | int TopCp;
|
---|
| 296 | int TopObp;
|
---|
| 297 | DWORD dwCodeType;
|
---|
| 298 | };
|
---|
| 299 | struct RESOURCEDATAINFO{
|
---|
| 300 | DWORD dwId;
|
---|
| 301 | char FileName[MAX_PATH];
|
---|
| 302 | };
|
---|
| 303 |
|
---|
| 304 |
|
---|
| 305 | //////////////////////////////////////////
|
---|
| 306 | // リソース ヘッダ(アイコン、カーソル用)
|
---|
| 307 | typedef struct{
|
---|
| 308 | WORD idReserved;
|
---|
| 309 | WORD idType;
|
---|
| 310 | WORD idCount;
|
---|
| 311 | }ICONDIR,CURSORDIR;
|
---|
| 312 |
|
---|
| 313 |
|
---|
| 314 | /////////////////////////////
|
---|
| 315 | // .curファイルのヘッダ情報
|
---|
| 316 | struct CURSORDIRENTRY{
|
---|
| 317 | BYTE bWidth;
|
---|
| 318 | BYTE bHeight;
|
---|
| 319 | BYTE bColorCount;
|
---|
| 320 | BYTE bReserved;
|
---|
| 321 | WORD wXHotspot;
|
---|
| 322 | WORD wYHotspot;
|
---|
| 323 | DWORD dwBytesInRes;
|
---|
| 324 | DWORD dwImageOffset;
|
---|
| 325 | };
|
---|
| 326 | struct CURSORDIRENTRY_RES{
|
---|
| 327 | WORD wWidth;
|
---|
| 328 | WORD wHeight;
|
---|
| 329 | WORD wXHotspot;
|
---|
| 330 | WORD wYHotspot;
|
---|
| 331 | DWORD dwBytesInRes;
|
---|
| 332 | WORD wCursorNum;
|
---|
| 333 | };
|
---|
| 334 |
|
---|
| 335 |
|
---|
| 336 | ////////////////////////////
|
---|
| 337 | //.icoファイルのヘッダ情報
|
---|
| 338 | struct ICONDIRENTRY{
|
---|
| 339 | BYTE bWidth;
|
---|
| 340 | BYTE bHeight;
|
---|
| 341 | BYTE bColorCount;
|
---|
| 342 | BYTE bReserved;
|
---|
| 343 | WORD wPlanes;
|
---|
| 344 | WORD wBitCount;
|
---|
| 345 | DWORD dwBytesInRes;
|
---|
| 346 | DWORD dwImageOffset;
|
---|
| 347 | };
|
---|
| 348 | struct ICONDIRENTRY_RES{
|
---|
| 349 | BYTE bWidth;
|
---|
| 350 | BYTE bHeight;
|
---|
| 351 | BYTE bColorCount;
|
---|
| 352 | BYTE bReserved;
|
---|
| 353 | WORD wPlanes;
|
---|
| 354 | WORD wBitCount;
|
---|
| 355 | DWORD dwBytesInRes;
|
---|
| 356 | WORD wIconNum;
|
---|
| 357 | };
|
---|
| 358 |
|
---|
| 359 |
|
---|
| 360 |
|
---|
[34] | 361 | #include "../BasicCompiler_Common/PESchedule.h"
|
---|
[4] | 362 | #include "../BasicCompiler_Common/DebugSection.h"
|
---|
| 363 | #include "../BasicCompiler_Common/LexicalScoping.h"
|
---|
[11] | 364 | #include "../BasicCompiler_Common/Variable.h"
|
---|
[26] | 365 | #include "../BasicCompiler_Common/Exception.h"
|
---|
[4] | 366 |
|
---|
| 367 |
|
---|
| 368 |
|
---|
[15] | 369 | int StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,LONG_PTR *plpIndex,BOOL bDebuggingWatchList=0);
|
---|
[4] | 370 |
|
---|
| 371 |
|
---|
| 372 | //BasicCompiler.cpp
|
---|
| 373 | void HeapDefaultFree(LPVOID lpMem);
|
---|
| 374 | void ts(int i);
|
---|
| 375 | void ts(int i,int i2);
|
---|
| 376 | void ts(char *msg);
|
---|
| 377 | void ts(char *msg,char *title);
|
---|
| 378 | void epi_check();
|
---|
| 379 | void GetRelationalPath(char *path,char *dir);
|
---|
| 380 | void GetFullPath(char *path,char *dir);
|
---|
| 381 | void ShowErrorLine(int LineNum,char *FileName);
|
---|
| 382 | BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen);
|
---|
| 383 | void MakeMessageText(char *buffer,char *msg,int flag);
|
---|
| 384 |
|
---|
| 385 | //hash.cpp
|
---|
| 386 | int hash_default(char *name);
|
---|
| 387 | CONSTINFO *GetConstHash(char *name);
|
---|
| 388 | DECLAREINFO *GetDeclareHash(char *name);
|
---|
[73] | 389 | SubInfo *GetSubHash(const char *name,BOOL bError=0);
|
---|
| 390 | SubInfo *GetMethodHash(char *ObjectName,char *MethodName,char *Parameter,BOOL bError=0);
|
---|
| 391 | void GetOverloadSubHash( const char *lpszName, std::vector<SubInfo *> &subs );
|
---|
[4] | 392 |
|
---|
| 393 | //Object.cpp
|
---|
| 394 | void AddClassName(char *Parameter,int NowLine);
|
---|
[50] | 395 | void CallConstructor(char *VarName,int *SubScripts,TYPEINFO &TypeInfo,char *Parameter);
|
---|
[4] | 396 |
|
---|
| 397 | //Overload.sbp
|
---|
[73] | 398 | SubInfo *OverloadSolutionWithStrParam(
|
---|
[50] | 399 | const char *name,
|
---|
[73] | 400 | std::vector<SubInfo *> &subs,
|
---|
[50] | 401 | const char *Parameter,
|
---|
| 402 | const char *ObjectName,
|
---|
| 403 | TYPEINFO *pReturnTypeInfo);
|
---|
[73] | 404 | SubInfo *OverloadSolution(
|
---|
[50] | 405 | const char *name,
|
---|
[73] | 406 | std::vector<SubInfo *> &subs,
|
---|
[50] | 407 | const PARAMETER_INFO *ppi,
|
---|
| 408 | const int ParmNum,
|
---|
| 409 | TYPEINFO *pReturnTypeInfo);
|
---|
[4] | 410 |
|
---|
| 411 | //Debug.cpp
|
---|
| 412 | void Debugger_StepIn(void);
|
---|
| 413 | void Debugger_StepOver(void);
|
---|
| 414 | void Debugger_StepCursor(void);
|
---|
| 415 | void Debugger_Stop(void);
|
---|
| 416 | void Debugger_Pause(void);
|
---|
| 417 | ULONG_PTR rva_to_real(DWORD p);
|
---|
[73] | 418 | SubInfo *GetSubFromObp(ULONG_PTR pos);
|
---|
[4] | 419 | void ReadOpBuffer();
|
---|
| 420 | void DebugProgram(void);
|
---|
| 421 |
|
---|
| 422 | //VarList.cpp
|
---|
| 423 | void InitVarList(DWORD dwThreadId);
|
---|
| 424 | BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
---|
| 425 | BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
---|
| 426 |
|
---|
| 427 | //WatchList.cpp
|
---|
| 428 | ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar);
|
---|
| 429 | ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip);
|
---|
| 430 | int Debugging_GetVarOffset(char *variable,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss);
|
---|
| 431 |
|
---|
| 432 | //MakeExe.cpp
|
---|
| 433 | void StepCompileProgress(void);
|
---|
| 434 | void DeleteConstInfo(CONSTINFO **ppConstHash);
|
---|
| 435 | void DeleteDeclareInfo(void);
|
---|
[15] | 436 | void AddSourceCode(char *buffer);
|
---|
[4] | 437 | void OutputExe(void);
|
---|
| 438 | int MainThread(DWORD dummy);
|
---|
| 439 |
|
---|
| 440 | //Intermediate_Step1.cpp
|
---|
| 441 | void ChangeReturnCode(char *buffer);
|
---|
| 442 | void DeleteComment(char *buffer);
|
---|
| 443 | void KillReturnCode(char *buffer);
|
---|
| 444 | void CheckParenthesis(char *buffer);
|
---|
| 445 | BOOL CheckParenthesis2(char *buffer);
|
---|
| 446 | void DirectiveCheck(void);
|
---|
| 447 | void NextCommandFormat(char *buffer);
|
---|
| 448 | void SetEscapeSequenceFormat(char *buffer);
|
---|
| 449 | void DefCommandFormat(char *buffer);
|
---|
| 450 | void IfCommandFormat(char *buffer);
|
---|
| 451 | void CheckPareCommand(void);
|
---|
| 452 |
|
---|
| 453 | //Intermediate_Step2.cpp
|
---|
[16] | 454 | bool GetConstInfo(void);
|
---|
[4] | 455 | void ChangeCommandToCode(char *buffer);
|
---|
| 456 |
|
---|
| 457 | //preprocessor.cpp
|
---|
[15] | 458 | char *OpenBasicFile(char *FileName);
|
---|
[4] | 459 |
|
---|
| 460 | //Resource.cpp
|
---|
| 461 | void GetResourceData(char *FileName);
|
---|
| 462 |
|
---|
| 463 | //CommandFormat.cpp
|
---|
| 464 | void ComOpen(char *Parameter,char *buffer,int NowLine);
|
---|
| 465 | void ComClose(char *Parameter,char *buffer);
|
---|
| 466 | void ComField(char *Parameter,char *buffer);
|
---|
| 467 | void ComLine(char *Parameter,char *buffer,int NowLine);
|
---|
| 468 | void ComCircle(char *Parameter,char *buffer,int NowLine);
|
---|
| 469 | void ComPSet(char *Parameter,char *buffer,int NowLine);
|
---|
| 470 | void ComPaint(char *Parameter,char *buffer,int NowLine);
|
---|
| 471 |
|
---|
| 472 | // StrOperation.cpp
|
---|
| 473 | void KillSpaces(char *str1,char *str2);
|
---|
| 474 | void KillStringSpaces(char *str);
|
---|
| 475 | BOOL RemoveStringQuotes(char *str);
|
---|
| 476 | void RemoveStringPare(char *str);
|
---|
| 477 | void RemoveStringBracket(char *str);
|
---|
| 478 | void SetStringQuotes(char *str);
|
---|
| 479 | int FormatString_EscapeSequence(char *buffer);
|
---|
| 480 | void SlideString(char *str,int slide);
|
---|
| 481 | void SlideBuffer(char *buffer,int length,int slide);
|
---|
| 482 | _int8 IsCommandDelimitation(char c);
|
---|
| 483 | BOOL IsBlank(char c);
|
---|
| 484 | int GetOneParameter(char *Parameter,int pos,char *retAns);
|
---|
| 485 | int JumpOneParameter(char *Parameter,int i);
|
---|
| 486 | int GetStringInQuotation(char *buffer,char *ReadBuffer);
|
---|
[15] | 487 | int GetStringInPare(char *buffer,const char *ReadBuffer);
|
---|
[4] | 488 | int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer);
|
---|
[15] | 489 | int GetStringInBracket(char *buffer,const char *ReadBuffer);
|
---|
[49] | 490 | int JumpStringInPare(const char *buffer,int pos);
|
---|
| 491 | int JumpStringInBracket(const char *buffer,int pos);
|
---|
[4] | 492 | int GetCpFromLine(int LineNum);
|
---|
| 493 | BOOL GetLineNum(int pos,int *pLine,char *FileName);
|
---|
| 494 | char GetEndXXXCommand(char es);
|
---|
| 495 | void GetDefaultNameFromES(char es,char *name);
|
---|
| 496 | void GetCalcName(int idCalc,char *name);
|
---|
| 497 | BOOL IsFile(char *path);
|
---|
[31] | 498 | BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
|
---|
[4] | 499 | BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
|
---|
[31] | 500 | void ShortPathToLongPath(const char *ShortPath,char *LongPath);
|
---|
[4] | 501 |
|
---|
| 502 | //calculation.cpp
|
---|
[15] | 503 | bool IsNumberTopChar(const char *buffer);
|
---|
| 504 | bool IsNumberChar(const char c);
|
---|
| 505 | BOOL IsNumCalcMark(const char *Command,int p);
|
---|
| 506 | BOOL IsNumCalcMark_Back(const char *Command,int p);
|
---|
| 507 | BOOL IsStrCalcMark(const char c);
|
---|
| 508 | BOOL IsExponent(const char *Command,int p);
|
---|
[4] | 509 | int GetLiteralIndex(_int64 i64data);
|
---|
| 510 | int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2);
|
---|
| 511 | DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType);
|
---|
| 512 | BOOL GetConstCalcBuffer(char *name,char *Parameter,char *pCalcBuffer);
|
---|
| 513 | DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex);
|
---|
[64] | 514 | bool IsStringObjectType(const TYPEINFO &TypeInfo);
|
---|
[4] | 515 | int IsStrCalculation(char *Command);
|
---|
[15] | 516 | BYTE GetCalcId(const char *Command,int *pi);
|
---|
| 517 | BOOL GetNumOpeElements(const char *Command,int *pnum,
|
---|
[4] | 518 | char *values[255],long calc[255],long stack[255]);
|
---|
| 519 |
|
---|
[73] | 520 | //NumOpe_GetType_Old.cpp
|
---|
[4] | 521 | int AutoBigCast(int BaseType,int CalcType);
|
---|
| 522 | BOOL CheckCalcType(int idCalc,int *type,int sp);
|
---|
[73] | 523 | int NumOpe_GetType_Old( const char *Command, TYPEINFO *pBaseTypeInfo, LONG_PTR *plpIndex );
|
---|
| 524 | bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType );
|
---|
[4] | 525 |
|
---|
| 526 | //Subroutine.cpp
|
---|
| 527 | int GetCallProcName(char *buffer,char *name);
|
---|
| 528 | int GetProc(char *name,void **ppInfo);
|
---|
[46] | 529 | void SplitObjectName(const char *name,char *ObjectName,int *pRefType);
|
---|
[28] | 530 | bool SplitMemberName( const char *desc, char *object, char *member );
|
---|
[50] | 531 | int CallProc(int idProc,void *pInfo,char *name,char *Parameter,LONG_PTR *plpRetIndex);
|
---|
| 532 | BOOL CallPropertyMethod(char *variable,char *RightSide,TYPEINFO *pRetTypeInfo);
|
---|
[4] | 533 | int GetReturnTypeOfProc(int idProc,void *pInfo,char *name,char *Parameter,LONG_PTR *plpRetIndex);
|
---|
| 534 | BOOL GetReturnTypeOfPropertyMethod(char *variable,char *RightSide,TYPEINFO *pRetTypeInfo);
|
---|
[38] | 535 | bool GetReturnTypeOfIndexerGetterProc(CClass *pobj_Class,TYPEINFO &RetTypeInfo);
|
---|
[4] | 536 | BOOL CompareParameter(PARAMETER_INFO *ppi1,int pi_num1,PARAMETER_INFO *ppi2,int pi_num2);
|
---|
[73] | 537 | SubInfo *AddSubData(char *buffer,int NowLine,BOOL bVirtual,CClass *pobj_c,BOOL bStatic=0);
|
---|
[4] | 538 | void GetSubInfo(void);
|
---|
[73] | 539 | void DeleteSubInfo(SubInfo **ppSubHash,char **ppMacroNames,int MacroNum);
|
---|
[4] | 540 | void DeleteDeclareInfo(void);
|
---|
| 541 | int AddProcPtrInfo(char *buffer,DWORD dwProcType);
|
---|
| 542 | void DeleteProcPtrInfo(void);
|
---|
| 543 |
|
---|
| 544 | //LoopRefCheck.cpp
|
---|
| 545 | class CLoopRefCheck{
|
---|
| 546 | char **names;
|
---|
| 547 | int num;
|
---|
| 548 | void init();
|
---|
| 549 | public:
|
---|
| 550 | CLoopRefCheck();
|
---|
| 551 | ~CLoopRefCheck();
|
---|
| 552 | void add(char *lpszInheritsClass);
|
---|
| 553 | void del(char *lpszInheritsClass);
|
---|
| 554 | BOOL check(char *lpszInheritsClass);
|
---|
| 555 | };
|
---|
| 556 | extern CLoopRefCheck *pobj_LoopRefCheck;
|
---|
| 557 |
|
---|
[56] | 558 | //DataTable.cpp
|
---|
| 559 | class DataTable{
|
---|
| 560 | void *pdata;
|
---|
| 561 | int size;
|
---|
| 562 |
|
---|
| 563 | public:
|
---|
| 564 | DataTable();
|
---|
| 565 | ~DataTable();
|
---|
| 566 | void Init();
|
---|
| 567 |
|
---|
| 568 | int AddBinary( const void *pdata, int size );
|
---|
| 569 | int Add( _int64 i64data );
|
---|
| 570 | int Add( int i32data );
|
---|
| 571 | int Add( double dbl );
|
---|
| 572 | int Add( float flt );
|
---|
| 573 | int AddString( const char *str, int length );
|
---|
| 574 | int AddString( const char *str );
|
---|
| 575 |
|
---|
| 576 | const void *GetPtr() const;
|
---|
| 577 | int GetSize() const;
|
---|
| 578 | };
|
---|
| 579 | extern DataTable dataTable;
|
---|
| 580 |
|
---|
[4] | 581 | //error.cpp
|
---|
[40] | 582 | void SetError(int ErrorNum,const char *KeyWord,int pos);
|
---|
[64] | 583 | void SetError();
|
---|
[4] | 584 | void CompileMessage(char *buffer);
|
---|
[46] | 585 | bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum);
|
---|
[4] | 586 |
|
---|
| 587 | //Compile.cpp
|
---|
[17] | 588 | void GetIdentifierToken( char *token, const char *source, int &pos );
|
---|
[16] | 589 | int JumpStatement(const char *source, int &pos);
|
---|
[4] | 590 | void DebugVariable(void);
|
---|
| 591 | void Compile(void);
|
---|
| 592 |
|
---|
| 593 | //gc.cpp
|
---|
| 594 | void InitGCVariables(void);
|
---|
| 595 | void PerformedGcVarSchedule(void);
|
---|
| 596 |
|
---|
| 597 |
|
---|
| 598 |
|
---|
| 599 | #ifdef _DEBUG
|
---|
| 600 | /*Debug*/
|
---|
| 601 | /*
|
---|
| 602 | #define HeapAlloc CheckHeapAlloc
|
---|
| 603 | #define HeapReAlloc CheckHeapReAlloc
|
---|
| 604 | LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
|
---|
| 605 | LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
|
---|
| 606 | */
|
---|
| 607 | #endif
|
---|