| 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.246"
|
|---|
| 50 | #else
|
|---|
| 51 | #define VER_INFO "β rev.246"
|
|---|
| 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 "Class.h"
|
|---|
| 158 |
|
|---|
| 159 | // 列挙体管理用のクラス
|
|---|
| 160 | #include "Enum.h"
|
|---|
| 161 |
|
|---|
| 162 | // 定数管理用のクラス
|
|---|
| 163 | #include "Const.h"
|
|---|
| 164 |
|
|---|
| 165 | // 変数管理用のクラス
|
|---|
| 166 | #include "Variable.h"
|
|---|
| 167 |
|
|---|
| 168 | // パラメータ管理用のクラス
|
|---|
| 169 | #include "Parameter.h"
|
|---|
| 170 |
|
|---|
| 171 | // プロシージャ管理用のクラス
|
|---|
| 172 | #include "Procedure.h"
|
|---|
| 173 |
|
|---|
| 174 | // コンパイラが必要とするデータハウス
|
|---|
| 175 | #include <Smoothie.h>
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 | struct ERRORINFO{
|
|---|
| 180 | char *FileName;
|
|---|
| 181 | int line;
|
|---|
| 182 | };
|
|---|
| 183 | struct INCLUDEFILEINFO{
|
|---|
| 184 | char **ppFileNames;
|
|---|
| 185 | int FilesNum;
|
|---|
| 186 | int LineOfFile[MAX_LEN];
|
|---|
| 187 | };
|
|---|
| 188 |
|
|---|
| 189 | //変数の相対情報
|
|---|
| 190 | struct RELATIVE_VAR{
|
|---|
| 191 | DWORD dwKind;
|
|---|
| 192 | LONG_PTR offset;
|
|---|
| 193 | BOOL bOffsetOffset;
|
|---|
| 194 | };
|
|---|
| 195 |
|
|---|
| 196 | struct CONSTINFO{
|
|---|
| 197 | char *name;
|
|---|
| 198 | char *StrValue;
|
|---|
| 199 |
|
|---|
| 200 | double DblValue;
|
|---|
| 201 | _int64 i64Value;
|
|---|
| 202 | int type;
|
|---|
| 203 | LONG_PTR lpIndex;
|
|---|
| 204 |
|
|---|
| 205 | int ParmNum;
|
|---|
| 206 | char **ppParm;
|
|---|
| 207 |
|
|---|
| 208 | CONSTINFO *pNextData;
|
|---|
| 209 | };
|
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 | #define CODETYPE_SYSTEMPROC 0x0001
|
|---|
| 213 | #define CODETYPE_DEBUGPROC 0x0002
|
|---|
| 214 | struct LINEINFO{
|
|---|
| 215 | int TopCp;
|
|---|
| 216 | int TopObp;
|
|---|
| 217 | DWORD dwCodeType;
|
|---|
| 218 | };
|
|---|
| 219 | struct RESOURCEDATAINFO{
|
|---|
| 220 | DWORD dwId;
|
|---|
| 221 | char FileName[MAX_PATH];
|
|---|
| 222 | };
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 | //////////////////////////////////////////
|
|---|
| 226 | // リソース ヘッダ(アイコン、カーソル用)
|
|---|
| 227 | typedef struct{
|
|---|
| 228 | WORD idReserved;
|
|---|
| 229 | WORD idType;
|
|---|
| 230 | WORD idCount;
|
|---|
| 231 | }ICONDIR,CURSORDIR;
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 | /////////////////////////////
|
|---|
| 235 | // .curファイルのヘッダ情報
|
|---|
| 236 | struct CURSORDIRENTRY{
|
|---|
| 237 | BYTE bWidth;
|
|---|
| 238 | BYTE bHeight;
|
|---|
| 239 | BYTE bColorCount;
|
|---|
| 240 | BYTE bReserved;
|
|---|
| 241 | WORD wXHotspot;
|
|---|
| 242 | WORD wYHotspot;
|
|---|
| 243 | DWORD dwBytesInRes;
|
|---|
| 244 | DWORD dwImageOffset;
|
|---|
| 245 | };
|
|---|
| 246 | struct CURSORDIRENTRY_RES{
|
|---|
| 247 | WORD wWidth;
|
|---|
| 248 | WORD wHeight;
|
|---|
| 249 | WORD wXHotspot;
|
|---|
| 250 | WORD wYHotspot;
|
|---|
| 251 | DWORD dwBytesInRes;
|
|---|
| 252 | WORD wCursorNum;
|
|---|
| 253 | };
|
|---|
| 254 |
|
|---|
| 255 |
|
|---|
| 256 | ////////////////////////////
|
|---|
| 257 | //.icoファイルのヘッダ情報
|
|---|
| 258 | struct ICONDIRENTRY{
|
|---|
| 259 | BYTE bWidth;
|
|---|
| 260 | BYTE bHeight;
|
|---|
| 261 | BYTE bColorCount;
|
|---|
| 262 | BYTE bReserved;
|
|---|
| 263 | WORD wPlanes;
|
|---|
| 264 | WORD wBitCount;
|
|---|
| 265 | DWORD dwBytesInRes;
|
|---|
| 266 | DWORD dwImageOffset;
|
|---|
| 267 | };
|
|---|
| 268 | struct ICONDIRENTRY_RES{
|
|---|
| 269 | BYTE bWidth;
|
|---|
| 270 | BYTE bHeight;
|
|---|
| 271 | BYTE bColorCount;
|
|---|
| 272 | BYTE bReserved;
|
|---|
| 273 | WORD wPlanes;
|
|---|
| 274 | WORD wBitCount;
|
|---|
| 275 | DWORD dwBytesInRes;
|
|---|
| 276 | WORD wIconNum;
|
|---|
| 277 | };
|
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
|
|---|
| 281 | #include "../BasicCompiler_Common/PESchedule.h"
|
|---|
| 282 | #include "../BasicCompiler_Common/DebugSection.h"
|
|---|
| 283 | #include "../BasicCompiler_Common/VariableOpe.h"
|
|---|
| 284 | #include "../BasicCompiler_Common/Exception.h"
|
|---|
| 285 |
|
|---|
| 286 |
|
|---|
| 287 |
|
|---|
| 288 | bool StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,Type &resultType,BOOL bDebuggingWatchList=0, bool *pIsMemoryAccessError=NULL);
|
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 | //BasicCompiler.cpp
|
|---|
| 292 | void HeapDefaultFree(LPVOID lpMem);
|
|---|
| 293 | void ts(int i);
|
|---|
| 294 | void ts(int i,int i2);
|
|---|
| 295 | void ts(char *msg);
|
|---|
| 296 | void ts(char *msg,char *title);
|
|---|
| 297 | void epi_check();
|
|---|
| 298 | void GetRelationalPath(char *path,char *dir);
|
|---|
| 299 | void GetFullPath(char *path,char *dir);
|
|---|
| 300 | void ShowErrorLine(int LineNum,char *FileName);
|
|---|
| 301 | BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen);
|
|---|
| 302 | void MakeMessageText(char *buffer,char *msg,int flag);
|
|---|
| 303 |
|
|---|
| 304 | //hash.cpp
|
|---|
| 305 | int hash_default(const char *name);
|
|---|
| 306 | CONSTINFO *GetConstHash(const char *name);
|
|---|
| 307 | DllProc *GetDeclareHash(char *name);
|
|---|
| 308 | void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs );
|
|---|
| 309 | UserProc *GetSubHash(const char *name,BOOL bError=0);
|
|---|
| 310 | UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError=0);
|
|---|
| 311 | UserProc *GetClassMethod( const char *className, const char *methodName );
|
|---|
| 312 |
|
|---|
| 313 | //Object.cpp
|
|---|
| 314 | void CallConstructor( const char *ObjectName,const int *SubScripts, const Type &type,const char *Parameter);
|
|---|
| 315 | bool Operator_New( const char *expression, const Type &baseType, Type &resultType );
|
|---|
| 316 |
|
|---|
| 317 | //Overload.sbp
|
|---|
| 318 | UserProc *OverloadSolutionWithStrParam(
|
|---|
| 319 | const char *name,
|
|---|
| 320 | std::vector<UserProc *> &subs,
|
|---|
| 321 | const char *Parameter,
|
|---|
| 322 | const char *ObjectName);
|
|---|
| 323 | UserProc *OverloadSolution(
|
|---|
| 324 | const char *name,
|
|---|
| 325 | std::vector<UserProc *> &subs,
|
|---|
| 326 | const Parameters ¶ms,
|
|---|
| 327 | const Type &returnType );
|
|---|
| 328 |
|
|---|
| 329 | //Debug.cpp
|
|---|
| 330 | void Debugger_StepIn(void);
|
|---|
| 331 | void Debugger_StepOver(void);
|
|---|
| 332 | void Debugger_StepCursor(void);
|
|---|
| 333 | void Debugger_Stop(void);
|
|---|
| 334 | void Debugger_Pause(void);
|
|---|
| 335 | ULONG_PTR rva_to_real(DWORD p);
|
|---|
| 336 | GlobalProc *GetSubFromObp(ULONG_PTR pos);
|
|---|
| 337 | void ReadOpBuffer();
|
|---|
| 338 | void DebugProgram(void);
|
|---|
| 339 |
|
|---|
| 340 | //VarList.cpp
|
|---|
| 341 | void InitVarList(DWORD dwThreadId);
|
|---|
| 342 | BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
|---|
| 343 | BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
|---|
| 344 |
|
|---|
| 345 | //WatchList.cpp
|
|---|
| 346 | ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar);
|
|---|
| 347 | ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip);
|
|---|
| 348 | int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss);
|
|---|
| 349 |
|
|---|
| 350 | //MakeExe.cpp
|
|---|
| 351 | void StepCompileProgress(void);
|
|---|
| 352 | void DeleteConstInfo(CONSTINFO **ppConstHash);
|
|---|
| 353 | void DeleteDeclareInfo(void);
|
|---|
| 354 | void AddSourceCode(char *buffer);
|
|---|
| 355 | void OutputExe(void);
|
|---|
| 356 | int MainThread(DWORD dummy);
|
|---|
| 357 |
|
|---|
| 358 | //Intermediate_Step1.cpp
|
|---|
| 359 | void ChangeReturnCode(char *buffer);
|
|---|
| 360 | void DeleteComment(char *buffer);
|
|---|
| 361 | void KillReturnCode(char *buffer);
|
|---|
| 362 | void CheckParenthesis(char *buffer);
|
|---|
| 363 | BOOL CheckParenthesis2(char *buffer);
|
|---|
| 364 | void DirectiveCheck(void);
|
|---|
| 365 | void NextCommandFormat(char *buffer);
|
|---|
| 366 | void SetEscapeSequenceFormat(char *buffer);
|
|---|
| 367 | void DefCommandFormat(char *buffer);
|
|---|
| 368 | void IfCommandFormat(char *buffer);
|
|---|
| 369 | void CheckPareCommand(void);
|
|---|
| 370 |
|
|---|
| 371 | //Intermediate_Step2.cpp
|
|---|
| 372 | bool GetConstInfo(void);
|
|---|
| 373 | void ChangeCommandToCode(char *buffer);
|
|---|
| 374 |
|
|---|
| 375 | //preprocessor.cpp
|
|---|
| 376 | char *OpenBasicFile(char *FileName);
|
|---|
| 377 |
|
|---|
| 378 | //Resource.cpp
|
|---|
| 379 | void GetResourceData(char *FileName);
|
|---|
| 380 |
|
|---|
| 381 | //CommandFormat.cpp
|
|---|
| 382 | void ComOpen(char *Parameter,char *buffer,int nowLine);
|
|---|
| 383 | void ComClose(char *Parameter,char *buffer);
|
|---|
| 384 | void ComField(char *Parameter,char *buffer);
|
|---|
| 385 | void ComLine(char *Parameter,char *buffer,int nowLine);
|
|---|
| 386 | void ComCircle(char *Parameter,char *buffer,int nowLine);
|
|---|
| 387 | void ComPSet(char *Parameter,char *buffer,int nowLine);
|
|---|
| 388 | void ComPaint(char *Parameter,char *buffer,int nowLine);
|
|---|
| 389 |
|
|---|
| 390 | // StrOperation.cpp
|
|---|
| 391 | void KillSpaces(char *str1,char *str2);
|
|---|
| 392 | void KillStringSpaces(char *str);
|
|---|
| 393 | BOOL RemoveStringQuotes(char *str);
|
|---|
| 394 | void RemoveStringPare(char *str);
|
|---|
| 395 | void RemoveStringBracket(char *str);
|
|---|
| 396 | void SetStringQuotes(char *str);
|
|---|
| 397 | int FormatString_EscapeSequence(char *buffer);
|
|---|
| 398 | void SlideString(char *str,int slide);
|
|---|
| 399 | void SlideBuffer(char *buffer,int length,int slide);
|
|---|
| 400 | _int8 IsCommandDelimitation(char c);
|
|---|
| 401 | BOOL IsBlank(char c);
|
|---|
| 402 | int GetOneParameter(const char *Parameter,int pos,char *retAns);
|
|---|
| 403 | int JumpOneParameter(char *Parameter,int i);
|
|---|
| 404 | int GetStringInQuotation(char *buffer,char *ReadBuffer);
|
|---|
| 405 | int GetStringInPare(char *buffer,const char *ReadBuffer);
|
|---|
| 406 | int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer);
|
|---|
| 407 | int GetStringInBracket(char *buffer,const char *ReadBuffer);
|
|---|
| 408 | int JumpStringInPare(const char *buffer,int pos);
|
|---|
| 409 | int JumpStringInBracket(const char *buffer,int pos);
|
|---|
| 410 | int GetCpFromLine(int LineNum);
|
|---|
| 411 | BOOL GetLineNum(int pos,int *pLine,char *FileName);
|
|---|
| 412 | char GetEndXXXCommand(char es);
|
|---|
| 413 | void GetDefaultNameFromES(char es,char *name);
|
|---|
| 414 | void GetCalcName(int idCalc,char *name);
|
|---|
| 415 | BOOL IsFile(char *path);
|
|---|
| 416 | BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
|
|---|
| 417 | BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
|
|---|
| 418 | void ShortPathToLongPath(const char *ShortPath,char *LongPath);
|
|---|
| 419 |
|
|---|
| 420 | //calculation.cpp
|
|---|
| 421 | bool IsNumberTopChar(const char *buffer);
|
|---|
| 422 | bool IsNumberChar(const char c);
|
|---|
| 423 | BOOL IsNumCalcMark(const char *Command,int p);
|
|---|
| 424 | BOOL IsNumCalcMark_Back(const char *Command,int p);
|
|---|
| 425 | BOOL IsStrCalcMark(const char c);
|
|---|
| 426 | BOOL IsExponent(const char *Command,int p);
|
|---|
| 427 | int GetLiteralIndex(_int64 i64data);
|
|---|
| 428 | int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2);
|
|---|
| 429 | DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType);
|
|---|
| 430 | BOOL GetConstCalcBuffer(const char *name,const char *Parameter,char *pCalcBuffer);
|
|---|
| 431 | DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex);
|
|---|
| 432 | bool IsStringObjectType(const Type &TypeInfo);
|
|---|
| 433 | int IsStrCalculation(char *Command);
|
|---|
| 434 | BYTE GetCalcId(const char *Command,int *pi);
|
|---|
| 435 | BOOL GetNumOpeElements(const char *Command,int *pnum,
|
|---|
| 436 | char *values[255],long calc[255],long stack[255]);
|
|---|
| 437 |
|
|---|
| 438 | //NumOpe_GetType.cpp
|
|---|
| 439 | int AutoBigCast(int BaseType,int CalcType);
|
|---|
| 440 | BOOL CheckCalcType(int idCalc,int *type,int sp);
|
|---|
| 441 | bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType );
|
|---|
| 442 |
|
|---|
| 443 | //Subroutine.cpp
|
|---|
| 444 | int GetCallProcName(char *buffer,char *name);
|
|---|
| 445 | int GetProc(char *name,void **ppInfo);
|
|---|
| 446 | void SplitObjectName(const char *name,char *ObjectName,int *pRefType);
|
|---|
| 447 | bool SplitMemberName( const char *desc, char *object, char *member, CClass::RefType &refType );
|
|---|
| 448 | bool SplitMemberName( const char *desc, char *object, char *member );
|
|---|
| 449 | bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn = true );
|
|---|
| 450 | bool CallPropertyMethod( const char *variable, const char *rightSide, Type &resultType);
|
|---|
| 451 | bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType );
|
|---|
| 452 | bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType );
|
|---|
| 453 | GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic = false );
|
|---|
| 454 | void GetSubInfo(void);
|
|---|
| 455 | void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum);
|
|---|
| 456 | void DeleteDeclareInfo(void);
|
|---|
| 457 | int AddProcPtrInfo( const string &typeExpression, int nowLine );
|
|---|
| 458 | void DeleteProcPtrInfo(void);
|
|---|
| 459 | bool IsNeedProcCompile();
|
|---|
| 460 |
|
|---|
| 461 | //OldStatement.cpp
|
|---|
| 462 | void Opcode_Input(const char *Parameter);
|
|---|
| 463 | void Opcode_Print(const char *Parameter,BOOL bWrite);
|
|---|
| 464 |
|
|---|
| 465 | //LoopRefCheck.cpp
|
|---|
| 466 | class CLoopRefCheck{
|
|---|
| 467 | char **names;
|
|---|
| 468 | int num;
|
|---|
| 469 | void init();
|
|---|
| 470 | public:
|
|---|
| 471 | CLoopRefCheck();
|
|---|
| 472 | ~CLoopRefCheck();
|
|---|
| 473 | void add(char *lpszInheritsClass);
|
|---|
| 474 | void del(char *lpszInheritsClass);
|
|---|
| 475 | BOOL check(const CClass &inheritsClass) const;
|
|---|
| 476 | };
|
|---|
| 477 | extern CLoopRefCheck *pobj_LoopRefCheck;
|
|---|
| 478 |
|
|---|
| 479 | //DataTable.cpp
|
|---|
| 480 | class DataTable{
|
|---|
| 481 | void *pdata;
|
|---|
| 482 | int size;
|
|---|
| 483 |
|
|---|
| 484 | public:
|
|---|
| 485 | DataTable();
|
|---|
| 486 | ~DataTable();
|
|---|
| 487 | void Init();
|
|---|
| 488 |
|
|---|
| 489 | int AddBinary( const void *pdata, int size );
|
|---|
| 490 | int Add( _int64 i64data );
|
|---|
| 491 | int Add( int i32data );
|
|---|
| 492 | int Add( double dbl );
|
|---|
| 493 | int Add( float flt );
|
|---|
| 494 | int AddString( const char *str, int length );
|
|---|
| 495 | int AddString( const char *str );
|
|---|
| 496 |
|
|---|
| 497 | const void *GetPtr() const;
|
|---|
| 498 | int GetSize() const;
|
|---|
| 499 | };
|
|---|
| 500 | extern DataTable dataTable;
|
|---|
| 501 |
|
|---|
| 502 | //error.cpp
|
|---|
| 503 | void SetError(int ErrorNum,const char *KeyWord,int pos);
|
|---|
| 504 | void SetError(int ErrorNum,const string &keyWord,int pos);
|
|---|
| 505 | void SetError();
|
|---|
| 506 | void CompileMessage(char *buffer);
|
|---|
| 507 | bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum);
|
|---|
| 508 | bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
|
|---|
| 509 |
|
|---|
| 510 | //Compile.cpp
|
|---|
| 511 | void ReallocNativeCodeBuffer();
|
|---|
| 512 | void GetIdentifierToken( char *token, const char *source, int &pos );
|
|---|
| 513 | int JumpStatement(const char *source, int &pos);
|
|---|
| 514 | void DebugVariable(void);
|
|---|
| 515 | void Compile(void);
|
|---|
| 516 |
|
|---|
| 517 | //Diagnose.cpp
|
|---|
| 518 | void Diagnose();
|
|---|
| 519 |
|
|---|
| 520 | //gc.cpp
|
|---|
| 521 | void InitGCVariables(void);
|
|---|
| 522 | void PerformedGcVarSchedule(void);
|
|---|
| 523 |
|
|---|
| 524 |
|
|---|
| 525 |
|
|---|
| 526 | #ifdef _DEBUG
|
|---|
| 527 | /*Debug*/
|
|---|
| 528 | /*
|
|---|
| 529 | #define HeapAlloc CheckHeapAlloc
|
|---|
| 530 | #define HeapReAlloc CheckHeapReAlloc
|
|---|
| 531 | LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
|
|---|
| 532 | LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
|
|---|
| 533 | */
|
|---|
| 534 | #endif
|
|---|