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