| 1 | //#define _CRT_SECURE_NO_DEPRECATE | 
|---|
| 2 | #pragma warning(disable : 4996) | 
|---|
| 3 |  | 
|---|
| 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 | #include <string> | 
|---|
| 14 | #include <fstream> | 
|---|
| 15 |  | 
|---|
| 16 | //boost libraries | 
|---|
| 17 | #include <boost/foreach.hpp> | 
|---|
| 18 |  | 
|---|
| 19 | #define foreach BOOST_FOREACH | 
|---|
| 20 |  | 
|---|
| 21 | using namespace std; | 
|---|
| 22 |  | 
|---|
| 23 | #ifdef _AMD64_ | 
|---|
| 24 | #include "../BasicCompiler64/resource.h" | 
|---|
| 25 | #include "../BasicCompiler64/CommandValue.h" | 
|---|
| 26 | #include "../BasicCompiler64/FunctionValue.h" | 
|---|
| 27 | #define OPCODE_H_PATH "../BasicCompiler64/opcode.h" | 
|---|
| 28 | #else | 
|---|
| 29 | #include "../BasicCompiler32/resource.h" | 
|---|
| 30 | #include "../BasicCompiler32/CommandValue.h" | 
|---|
| 31 | #include "../BasicCompiler32/FunctionValue.h" | 
|---|
| 32 | #define OPCODE_H_PATH "../BasicCompiler32/opcode.h" | 
|---|
| 33 | #endif | 
|---|
| 34 |  | 
|---|
| 35 | #include "../BasicCompiler_Common/BasicFixed.h" | 
|---|
| 36 | #include "../BasicCompiler_Common/NonVolatile.h" | 
|---|
| 37 | #include "../BasicCompiler_Common/psapi.h" | 
|---|
| 38 | #include "../BasicCompiler_Common/BreakPoint.h" | 
|---|
| 39 | #include "../BasicCompiler_Common/LexicalScoping.h" | 
|---|
| 40 |  | 
|---|
| 41 |  | 
|---|
| 42 |  | 
|---|
| 43 | //バージョン | 
|---|
| 44 | #define MAJOR_VER       5 | 
|---|
| 45 | #define MINOR_VER       00 | 
|---|
| 46 | #define REVISION_VER    00 | 
|---|
| 47 |  | 
|---|
| 48 | #ifdef _AMD64_ | 
|---|
| 49 | #define VER_INFO        "(x64) (rev.280)" | 
|---|
| 50 | #else | 
|---|
| 51 | #define VER_INFO        "(rev.280)" | 
|---|
| 52 | #endif | 
|---|
| 53 |  | 
|---|
| 54 | #if defined(JPN) | 
|---|
| 55 | //日本語 | 
|---|
| 56 | #include "common_msg_jpn.h" | 
|---|
| 57 | #else | 
|---|
| 58 | //英語 | 
|---|
| 59 | #include "common_msg_eng.h" | 
|---|
| 60 | #endif | 
|---|
| 61 |  | 
|---|
| 62 |  | 
|---|
| 63 | #define PTR_SIZE        sizeof(LONG_PTR) | 
|---|
| 64 | #define OBJECT_HEAD_SIZE PTR_SIZE*4 | 
|---|
| 65 |  | 
|---|
| 66 | #define MAX_LEN         65535 | 
|---|
| 67 | #define VN_SIZE         512 | 
|---|
| 68 | #define DIGIT_SIZE      128 | 
|---|
| 69 | #define MAX_PARMS       64 | 
|---|
| 70 | #define MAX_ARRAYDIM    16 | 
|---|
| 71 | #define MAX_HASH        32761 | 
|---|
| 72 |  | 
|---|
| 73 |  | 
|---|
| 74 | #ifdef _AMD64_ | 
|---|
| 75 | #define PLATFORM    64 | 
|---|
| 76 | #else | 
|---|
| 77 | #define PLATFORM    32 | 
|---|
| 78 | typedef long LONG_PTR; | 
|---|
| 79 | typedef DWORD ULONG_PTR; | 
|---|
| 80 | #endif | 
|---|
| 81 |  | 
|---|
| 82 |  | 
|---|
| 83 | //未定義の定数情報 | 
|---|
| 84 | #ifndef IMAGE_FILE_MACHINE_AMD64 | 
|---|
| 85 | #define IMAGE_FILE_MACHINE_AMD64 0x8664 | 
|---|
| 86 | #endif | 
|---|
| 87 |  | 
|---|
| 88 | #ifdef _AMD64_ | 
|---|
| 89 | #ifndef IMAGE_SIZEOF_NT_OPTIONAL64_HEADER | 
|---|
| 90 | #define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER    240 | 
|---|
| 91 | #endif | 
|---|
| 92 | #else | 
|---|
| 93 | #ifndef IMAGE_SIZEOF_NT_OPTIONAL32_HEADER | 
|---|
| 94 | #define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER    224 | 
|---|
| 95 | #endif | 
|---|
| 96 | #endif | 
|---|
| 97 |  | 
|---|
| 98 |  | 
|---|
| 99 | extern HWND hOwnerEditor; | 
|---|
| 100 | extern HANDLE hHeap; | 
|---|
| 101 | extern char BasicSystemDir[MAX_PATH]; | 
|---|
| 102 | extern int cp; | 
|---|
| 103 | extern bool isUnicode; | 
|---|
| 104 | extern int typeOfPtrChar; | 
|---|
| 105 | extern int typeOfPtrUChar; | 
|---|
| 106 |  | 
|---|
| 107 |  | 
|---|
| 108 |  | 
|---|
| 109 | ////////////////////////////////////////// | 
|---|
| 110 | // BasicCompiler、ProjectEditor共通の定数 | 
|---|
| 111 | ////////////////////////////////////////// | 
|---|
| 112 |  | 
|---|
| 113 | //サイズ変更枠の太さ | 
|---|
| 114 | #define LEVER_THICK 5 | 
|---|
| 115 |  | 
|---|
| 116 | #define WM_SHOWERROR            WM_USER+70  //エラー表示メッセージ | 
|---|
| 117 |  | 
|---|
| 118 | #define WM_SETCOMPILEVIEW       WM_USER+71  //コンパイラウィンドウが表示されたとき | 
|---|
| 119 | #define WM_DESTROYCOMPILEVIEW   WM_USER+72  //コンパイラウィンドウが破棄されたとき | 
|---|
| 120 |  | 
|---|
| 121 | #define WM_SETDEBUGGERBASE      WM_USER+73  //デバッガベースウィンドウが表示されたとき | 
|---|
| 122 | #define WM_DESTROYDEBUGGERBASE  WM_USER+74  //デバッガベースウィンドウが破棄されたとき | 
|---|
| 123 |  | 
|---|
| 124 | #define WM_SETDEBUGGERVIEW      WM_USER+75  //デバッガウィンドウが表示されたとき | 
|---|
| 125 | #define WM_DESTROYDEBUGGERVIEW  WM_USER+76  //デバッガウィンドウが表示されたとき | 
|---|
| 126 |  | 
|---|
| 127 | /////////////////////////////////////////// | 
|---|
| 128 |  | 
|---|
| 129 |  | 
|---|
| 130 | #define WM_SHOWVARLIST          WM_USER+80 | 
|---|
| 131 | #define WM_VARLIST_CLOSE        WM_USER+81  //変数リストの終了メッセージ(破棄のみ、解放なし) | 
|---|
| 132 |  | 
|---|
| 133 |  | 
|---|
| 134 |  | 
|---|
| 135 | /////////////////////////////////////////// | 
|---|
| 136 | // デバッグ コマンド | 
|---|
| 137 |  | 
|---|
| 138 | #define WM_DEBUG_CONTINUE   WM_USER+200 | 
|---|
| 139 | #define WM_STEP_IN          WM_USER+201 | 
|---|
| 140 | #define WM_STEP_OVER        WM_USER+202 | 
|---|
| 141 | #define WM_STEP_CURSOR      WM_USER+203 | 
|---|
| 142 | #define WM_DEBUG_STOP       WM_USER+204 | 
|---|
| 143 | #define WM_DEBUG_PAUSE      WM_USER+205 | 
|---|
| 144 | #define WM_CLOSE_DEBUGGER   WM_USER+206 | 
|---|
| 145 |  | 
|---|
| 146 | /////////////////////////////////////////// | 
|---|
| 147 |  | 
|---|
| 148 |  | 
|---|
| 149 |  | 
|---|
| 150 |  | 
|---|
| 151 | #define FILE_ALIGNMENT  0x1000 | 
|---|
| 152 | #define MEM_ALIGNMENT   0x1000 | 
|---|
| 153 | #define EXE_HEADER_SIZE 0x1000 | 
|---|
| 154 |  | 
|---|
| 155 |  | 
|---|
| 156 | // ログ生成を行うためのクラス | 
|---|
| 157 | #include <logger.h> | 
|---|
| 158 |  | 
|---|
| 159 | // クラス管理用のクラス | 
|---|
| 160 | #include "Class.h" | 
|---|
| 161 |  | 
|---|
| 162 | // 列挙体管理用のクラス | 
|---|
| 163 | #include "Enum.h" | 
|---|
| 164 |  | 
|---|
| 165 | // 定数管理用のクラス | 
|---|
| 166 | #include "Const.h" | 
|---|
| 167 |  | 
|---|
| 168 | // 変数管理用のクラス | 
|---|
| 169 | #include "Variable.h" | 
|---|
| 170 |  | 
|---|
| 171 | // パラメータ管理用のクラス | 
|---|
| 172 | #include "Parameter.h" | 
|---|
| 173 |  | 
|---|
| 174 | // プロシージャ管理用のクラス | 
|---|
| 175 | #include "Procedure.h" | 
|---|
| 176 |  | 
|---|
| 177 | // コンパイラが必要とするデータハウス | 
|---|
| 178 | #include <Smoothie.h> | 
|---|
| 179 |  | 
|---|
| 180 |  | 
|---|
| 181 |  | 
|---|
| 182 | struct ERRORINFO{ | 
|---|
| 183 | char *FileName; | 
|---|
| 184 | int line; | 
|---|
| 185 | }; | 
|---|
| 186 | struct INCLUDEFILEINFO{ | 
|---|
| 187 | char **ppFileNames; | 
|---|
| 188 | int FilesNum; | 
|---|
| 189 | int LineOfFile[MAX_LEN]; | 
|---|
| 190 | }; | 
|---|
| 191 |  | 
|---|
| 192 | //変数の相対情報 | 
|---|
| 193 | struct RELATIVE_VAR{ | 
|---|
| 194 | DWORD dwKind; | 
|---|
| 195 | LONG_PTR offset; | 
|---|
| 196 | BOOL bOffsetOffset; | 
|---|
| 197 | }; | 
|---|
| 198 |  | 
|---|
| 199 | struct CONSTINFO{ | 
|---|
| 200 | char *name; | 
|---|
| 201 | char *StrValue; | 
|---|
| 202 |  | 
|---|
| 203 | double DblValue; | 
|---|
| 204 | _int64 i64Value; | 
|---|
| 205 | int type; | 
|---|
| 206 | LONG_PTR lpIndex; | 
|---|
| 207 |  | 
|---|
| 208 | int ParmNum; | 
|---|
| 209 | char **ppParm; | 
|---|
| 210 |  | 
|---|
| 211 | CONSTINFO *pNextData; | 
|---|
| 212 | }; | 
|---|
| 213 |  | 
|---|
| 214 |  | 
|---|
| 215 | #define CODETYPE_SYSTEMPROC     0x0001 | 
|---|
| 216 | #define CODETYPE_DEBUGPROC      0x0002 | 
|---|
| 217 | struct LINEINFO{ | 
|---|
| 218 | int TopCp; | 
|---|
| 219 | int TopObp; | 
|---|
| 220 | DWORD dwCodeType; | 
|---|
| 221 | }; | 
|---|
| 222 | struct RESOURCEDATAINFO{ | 
|---|
| 223 | DWORD dwId; | 
|---|
| 224 | char FileName[MAX_PATH]; | 
|---|
| 225 | }; | 
|---|
| 226 |  | 
|---|
| 227 |  | 
|---|
| 228 | ////////////////////////////////////////// | 
|---|
| 229 | // リソース ヘッダ(アイコン、カーソル用) | 
|---|
| 230 | typedef struct{ | 
|---|
| 231 | WORD idReserved; | 
|---|
| 232 | WORD idType; | 
|---|
| 233 | WORD idCount; | 
|---|
| 234 | }ICONDIR,CURSORDIR; | 
|---|
| 235 |  | 
|---|
| 236 |  | 
|---|
| 237 | ///////////////////////////// | 
|---|
| 238 | // .curファイルのヘッダ情報 | 
|---|
| 239 | struct CURSORDIRENTRY{ | 
|---|
| 240 | BYTE bWidth; | 
|---|
| 241 | BYTE bHeight; | 
|---|
| 242 | BYTE bColorCount; | 
|---|
| 243 | BYTE bReserved; | 
|---|
| 244 | WORD wXHotspot; | 
|---|
| 245 | WORD wYHotspot; | 
|---|
| 246 | DWORD dwBytesInRes; | 
|---|
| 247 | DWORD dwImageOffset; | 
|---|
| 248 | }; | 
|---|
| 249 | struct CURSORDIRENTRY_RES{ | 
|---|
| 250 | WORD wWidth; | 
|---|
| 251 | WORD wHeight; | 
|---|
| 252 | WORD wXHotspot; | 
|---|
| 253 | WORD wYHotspot; | 
|---|
| 254 | DWORD dwBytesInRes; | 
|---|
| 255 | WORD wCursorNum; | 
|---|
| 256 | }; | 
|---|
| 257 |  | 
|---|
| 258 |  | 
|---|
| 259 | //////////////////////////// | 
|---|
| 260 | //.icoファイルのヘッダ情報 | 
|---|
| 261 | struct ICONDIRENTRY{ | 
|---|
| 262 | BYTE bWidth; | 
|---|
| 263 | BYTE bHeight; | 
|---|
| 264 | BYTE bColorCount; | 
|---|
| 265 | BYTE bReserved; | 
|---|
| 266 | WORD wPlanes; | 
|---|
| 267 | WORD wBitCount; | 
|---|
| 268 | DWORD dwBytesInRes; | 
|---|
| 269 | DWORD dwImageOffset; | 
|---|
| 270 | }; | 
|---|
| 271 | struct ICONDIRENTRY_RES{ | 
|---|
| 272 | BYTE bWidth; | 
|---|
| 273 | BYTE bHeight; | 
|---|
| 274 | BYTE bColorCount; | 
|---|
| 275 | BYTE bReserved; | 
|---|
| 276 | WORD wPlanes; | 
|---|
| 277 | WORD wBitCount; | 
|---|
| 278 | DWORD dwBytesInRes; | 
|---|
| 279 | WORD wIconNum; | 
|---|
| 280 | }; | 
|---|
| 281 |  | 
|---|
| 282 |  | 
|---|
| 283 |  | 
|---|
| 284 | #include "../BasicCompiler_Common/PESchedule.h" | 
|---|
| 285 | #include "../BasicCompiler_Common/DebugSection.h" | 
|---|
| 286 | #include "../BasicCompiler_Common/VariableOpe.h" | 
|---|
| 287 | #include <Exception.h> | 
|---|
| 288 |  | 
|---|
| 289 |  | 
|---|
| 290 |  | 
|---|
| 291 | bool StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,Type &resultType,BOOL bDebuggingWatchList=0, bool *pIsMemoryAccessError=NULL); | 
|---|
| 292 |  | 
|---|
| 293 |  | 
|---|
| 294 | //BasicCompiler.cpp | 
|---|
| 295 | void HeapDefaultFree(LPVOID lpMem); | 
|---|
| 296 | void ts(int i); | 
|---|
| 297 | void ts(int i,int i2); | 
|---|
| 298 | void ts(char *msg); | 
|---|
| 299 | void ts(char *msg,char *title); | 
|---|
| 300 | void epi_check(); | 
|---|
| 301 | void GetRelationalPath(char *path,char *dir); | 
|---|
| 302 | void GetFullPath(char *path,char *dir); | 
|---|
| 303 | void ShowErrorLine(int LineNum,char *FileName); | 
|---|
| 304 | BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen); | 
|---|
| 305 | void MakeMessageText(char *buffer,char *msg,int flag); | 
|---|
| 306 |  | 
|---|
| 307 | //hash.cpp | 
|---|
| 308 | int hash_default(const char *name); | 
|---|
| 309 | CONSTINFO *GetConstHash(const char *name); | 
|---|
| 310 | DllProc *GetDeclareHash(char *name); | 
|---|
| 311 | void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs ); | 
|---|
| 312 | UserProc *GetSubHash(const char *name,BOOL bError=0); | 
|---|
| 313 | UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError=0); | 
|---|
| 314 | UserProc *GetClassMethod( const char *className, const char *methodName ); | 
|---|
| 315 |  | 
|---|
| 316 | //Object.cpp | 
|---|
| 317 | void CallConstructor( const char *ObjectName,const int *SubScripts, const Type &type,const char *Parameter); | 
|---|
| 318 | bool Operator_New( const char *expression, const Type &baseType, Type &resultType ); | 
|---|
| 319 |  | 
|---|
| 320 | //Overload.sbp | 
|---|
| 321 | UserProc *OverloadSolutionWithStrParam( | 
|---|
| 322 | const char *name, | 
|---|
| 323 | std::vector<UserProc *> &subs, | 
|---|
| 324 | const char *Parameter, | 
|---|
| 325 | const char *ObjectName); | 
|---|
| 326 | UserProc *OverloadSolution( | 
|---|
| 327 | const char *name, | 
|---|
| 328 | std::vector<UserProc *> &subs, | 
|---|
| 329 | const Parameters ¶ms, | 
|---|
| 330 | const Type &returnType ); | 
|---|
| 331 |  | 
|---|
| 332 | //Debug.cpp | 
|---|
| 333 | void Debugger_StepIn(void); | 
|---|
| 334 | void Debugger_StepOver(void); | 
|---|
| 335 | void Debugger_StepCursor(void); | 
|---|
| 336 | void Debugger_Stop(void); | 
|---|
| 337 | void Debugger_Pause(void); | 
|---|
| 338 | ULONG_PTR rva_to_real(DWORD p); | 
|---|
| 339 | GlobalProc *GetSubFromObp(ULONG_PTR pos); | 
|---|
| 340 | void ReadOpBuffer(); | 
|---|
| 341 | void DebugProgram(void); | 
|---|
| 342 |  | 
|---|
| 343 | //VarList.cpp | 
|---|
| 344 | void InitVarList(DWORD dwThreadId); | 
|---|
| 345 | BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); | 
|---|
| 346 | BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); | 
|---|
| 347 |  | 
|---|
| 348 | //WatchList.cpp | 
|---|
| 349 | ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar); | 
|---|
| 350 | ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip); | 
|---|
| 351 | int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss); | 
|---|
| 352 |  | 
|---|
| 353 | //MakeExe.cpp | 
|---|
| 354 | void StepCompileProgress(void); | 
|---|
| 355 | void DeleteConstInfo(CONSTINFO **ppConstHash); | 
|---|
| 356 | void DeleteDeclareInfo(void); | 
|---|
| 357 | void AddSourceCode(char *buffer); | 
|---|
| 358 | void OutputExe(void); | 
|---|
| 359 | int MainThread(DWORD dummy); | 
|---|
| 360 |  | 
|---|
| 361 | //Intermediate_Step1.cpp | 
|---|
| 362 | void ChangeReturnCode(char *buffer); | 
|---|
| 363 | void DeleteComment(char *buffer); | 
|---|
| 364 | void KillReturnCode(char *buffer); | 
|---|
| 365 | void CheckParenthesis(char *buffer); | 
|---|
| 366 | BOOL CheckParenthesis2(char *buffer); | 
|---|
| 367 | void DirectiveCheck(void); | 
|---|
| 368 | void NextCommandFormat(char *buffer); | 
|---|
| 369 | void SetEscapeSequenceFormat(char *buffer); | 
|---|
| 370 | void DefCommandFormat(char *buffer); | 
|---|
| 371 | void IfCommandFormat(char *buffer); | 
|---|
| 372 | void CheckPareCommand(void); | 
|---|
| 373 |  | 
|---|
| 374 | //Intermediate_Step2.cpp | 
|---|
| 375 | bool GetConstInfo(void); | 
|---|
| 376 | void ChangeCommandToCode(char *buffer); | 
|---|
| 377 |  | 
|---|
| 378 | //preprocessor.cpp | 
|---|
| 379 | char *OpenBasicFile(char *FileName); | 
|---|
| 380 |  | 
|---|
| 381 | //Resource.cpp | 
|---|
| 382 | void GetResourceData(char *FileName); | 
|---|
| 383 |  | 
|---|
| 384 | //CommandFormat.cpp | 
|---|
| 385 | void ComOpen(char *Parameter,char *buffer,int nowLine); | 
|---|
| 386 | void ComClose(char *Parameter,char *buffer); | 
|---|
| 387 | void ComField(char *Parameter,char *buffer); | 
|---|
| 388 | void ComLine(char *Parameter,char *buffer,int nowLine); | 
|---|
| 389 | void ComCircle(char *Parameter,char *buffer,int nowLine); | 
|---|
| 390 | void ComPSet(char *Parameter,char *buffer,int nowLine); | 
|---|
| 391 | void ComPaint(char *Parameter,char *buffer,int nowLine); | 
|---|
| 392 |  | 
|---|
| 393 | // StrOperation.cpp | 
|---|
| 394 | void KillSpaces(char *str1,char *str2); | 
|---|
| 395 | void KillStringSpaces(char *str); | 
|---|
| 396 | BOOL RemoveStringQuotes(char *str); | 
|---|
| 397 | void RemoveStringPare(char *str); | 
|---|
| 398 | void RemoveStringBracket(char *str); | 
|---|
| 399 | void SetStringQuotes(char *str); | 
|---|
| 400 | int FormatString_EscapeSequence(char *buffer); | 
|---|
| 401 | void SlideString(char *str,int slide); | 
|---|
| 402 | void SlideBuffer(char *buffer,int length,int slide); | 
|---|
| 403 | _int8 IsCommandDelimitation(char c); | 
|---|
| 404 | BOOL IsBlank(char c); | 
|---|
| 405 | int GetOneParameter(const char *Parameter,int pos,char *retAns); | 
|---|
| 406 | int JumpOneParameter(char *Parameter,int i); | 
|---|
| 407 | int GetStringInQuotation(char *buffer,char *ReadBuffer); | 
|---|
| 408 | int GetStringInPare(char *buffer,const char *ReadBuffer); | 
|---|
| 409 | int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer); | 
|---|
| 410 | int GetStringInBracket(char *buffer,const char *ReadBuffer); | 
|---|
| 411 | int JumpStringInPare(const char *buffer,int pos); | 
|---|
| 412 | int JumpStringInBracket(const char *buffer,int pos); | 
|---|
| 413 | int GetCpFromLine(int LineNum); | 
|---|
| 414 | BOOL GetLineNum(int pos,int *pLine,char *FileName); | 
|---|
| 415 | char GetEndXXXCommand(char es); | 
|---|
| 416 | void GetDefaultNameFromES(char es,char *name); | 
|---|
| 417 | void GetCalcName(int idCalc,char *name); | 
|---|
| 418 | BOOL IsFile(char *path); | 
|---|
| 419 | BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath); | 
|---|
| 420 | BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle); | 
|---|
| 421 | void ShortPathToLongPath(const char *ShortPath,char *LongPath); | 
|---|
| 422 |  | 
|---|
| 423 | //calculation.cpp | 
|---|
| 424 | bool IsNumberTopChar(const char *buffer); | 
|---|
| 425 | bool IsNumberChar(const char c); | 
|---|
| 426 | BOOL IsNumCalcMark(const char *Command,int p); | 
|---|
| 427 | BOOL IsNumCalcMark_Back(const char *Command,int p); | 
|---|
| 428 | BOOL IsStrCalcMark(const char c); | 
|---|
| 429 | BOOL IsExponent(const char *Command,int p); | 
|---|
| 430 | int GetLiteralIndex(_int64 i64data); | 
|---|
| 431 | int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2); | 
|---|
| 432 | DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType); | 
|---|
| 433 | BOOL GetConstCalcBuffer(const char *name,const char *Parameter,char *pCalcBuffer); | 
|---|
| 434 | DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex); | 
|---|
| 435 | int IsStrCalculation(char *Command); | 
|---|
| 436 | BYTE GetCalcId(const char *Command,int *pi); | 
|---|
| 437 | BOOL GetNumOpeElements(const char *Command,int *pnum, | 
|---|
| 438 | char *values[255],long calc[255],long stack[255]); | 
|---|
| 439 |  | 
|---|
| 440 | //NumOpe_GetType.cpp | 
|---|
| 441 | int AutoBigCast(int BaseType,int CalcType); | 
|---|
| 442 | BOOL CheckCalcType(int idCalc,int *type,int sp); | 
|---|
| 443 | bool GetTermType( const char *term, Type &resultType, bool &isLiteral, bool *pIsClassName = NULL ); | 
|---|
| 444 | bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType ); | 
|---|
| 445 |  | 
|---|
| 446 | //Subroutine.cpp | 
|---|
| 447 | int GetCallProcName(char *buffer,char *name); | 
|---|
| 448 | int GetProc(char *name,void **ppInfo); | 
|---|
| 449 | void SplitObjectName(const char *name,char *ObjectName,int *pRefType); | 
|---|
| 450 | bool SplitMemberName( const char *desc, char *object, char *member, CClass::RefType &refType ); | 
|---|
| 451 | bool SplitMemberName( const char *desc, char *object, char *member ); | 
|---|
| 452 | bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn = true ); | 
|---|
| 453 | bool CallPropertyMethod( const char *variable, const char *rightSide, Type &resultType); | 
|---|
| 454 | bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType ); | 
|---|
| 455 | bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType ); | 
|---|
| 456 | GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic = false ); | 
|---|
| 457 | void GetSubInfo(void); | 
|---|
| 458 | void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum); | 
|---|
| 459 | void DeleteDeclareInfo(void); | 
|---|
| 460 | int AddProcPtrInfo( const string &typeExpression, int nowLine ); | 
|---|
| 461 | void DeleteProcPtrInfo(void); | 
|---|
| 462 | bool IsNeedProcCompile(); | 
|---|
| 463 |  | 
|---|
| 464 | //OldStatement.cpp | 
|---|
| 465 | void Opcode_Input(const char *Parameter); | 
|---|
| 466 | void Opcode_Print(const char *Parameter,BOOL bWrite); | 
|---|
| 467 |  | 
|---|
| 468 | //LoopRefCheck.cpp | 
|---|
| 469 | class CLoopRefCheck{ | 
|---|
| 470 | char **names; | 
|---|
| 471 | int num; | 
|---|
| 472 | void init(); | 
|---|
| 473 | public: | 
|---|
| 474 | CLoopRefCheck(); | 
|---|
| 475 | ~CLoopRefCheck(); | 
|---|
| 476 | void add(const char *lpszInheritsClass); | 
|---|
| 477 | void del(const char *lpszInheritsClass); | 
|---|
| 478 | BOOL check(const CClass &inheritsClass) const; | 
|---|
| 479 | }; | 
|---|
| 480 | extern CLoopRefCheck *pobj_LoopRefCheck; | 
|---|
| 481 |  | 
|---|
| 482 | //DataTable.cpp | 
|---|
| 483 | class DataTable{ | 
|---|
| 484 | void *pdata; | 
|---|
| 485 | int size; | 
|---|
| 486 |  | 
|---|
| 487 | public: | 
|---|
| 488 | DataTable(); | 
|---|
| 489 | ~DataTable(); | 
|---|
| 490 | void Init(); | 
|---|
| 491 |  | 
|---|
| 492 | int AddBinary( const void *pdata, int size ); | 
|---|
| 493 | int Add( _int64 i64data ); | 
|---|
| 494 | int Add( int i32data ); | 
|---|
| 495 | int Add( double dbl ); | 
|---|
| 496 | int Add( float flt ); | 
|---|
| 497 | int AddString( const char *str, int length ); | 
|---|
| 498 | int AddString( const char *str ); | 
|---|
| 499 |  | 
|---|
| 500 | const void *GetPtr() const; | 
|---|
| 501 | int GetSize() const; | 
|---|
| 502 | }; | 
|---|
| 503 | extern DataTable dataTable; | 
|---|
| 504 |  | 
|---|
| 505 | //error.cpp | 
|---|
| 506 | void SetError(int ErrorNum,const char *KeyWord,int pos); | 
|---|
| 507 | void SetError(int ErrorNum,const string &keyWord,int pos); | 
|---|
| 508 | void SetError(); | 
|---|
| 509 | void CompileMessage(char *buffer); | 
|---|
| 510 | bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum); | 
|---|
| 511 | bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum); | 
|---|
| 512 |  | 
|---|
| 513 | //Compile.cpp | 
|---|
| 514 | void ReallocNativeCodeBuffer(); | 
|---|
| 515 | void GetIdentifierToken( char *token, const char *source, int &pos ); | 
|---|
| 516 | int JumpStatement(const char *source, int &pos); | 
|---|
| 517 | void DebugVariable(void); | 
|---|
| 518 | void Compile(void); | 
|---|
| 519 |  | 
|---|
| 520 | //Diagnose.cpp | 
|---|
| 521 | void Diagnose(); | 
|---|
| 522 |  | 
|---|
| 523 | //gc.cpp | 
|---|
| 524 | void InitGCVariables(void); | 
|---|
| 525 | void PerformedGcVarSchedule(void); | 
|---|
| 526 |  | 
|---|
| 527 |  | 
|---|
| 528 |  | 
|---|
| 529 | #ifdef _DEBUG | 
|---|
| 530 | /*Debug*/ | 
|---|
| 531 | /* | 
|---|
| 532 | #define HeapAlloc CheckHeapAlloc | 
|---|
| 533 | #define HeapReAlloc CheckHeapReAlloc | 
|---|
| 534 | LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes); | 
|---|
| 535 | LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes); | 
|---|
| 536 | */ | 
|---|
| 537 | #endif | 
|---|