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