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