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