| 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 "β17 (x64)"
|
|---|
| 50 | #else
|
|---|
| 51 | #define VER_INFO "β17"
|
|---|
| 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;
|
|---|
| 94 | extern bool isUnicode;
|
|---|
| 95 | extern int typeOfPtrChar;
|
|---|
| 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 |
|
|---|
| 146 | // クラス管理用のクラス
|
|---|
| 147 | #include "Class.h"
|
|---|
| 148 |
|
|---|
| 149 | // 列挙体管理用のクラス
|
|---|
| 150 | #include "Enum.h"
|
|---|
| 151 |
|
|---|
| 152 | // 定数管理用のクラス
|
|---|
| 153 | #include "Const.h"
|
|---|
| 154 |
|
|---|
| 155 | // 変数管理用のクラス
|
|---|
| 156 | #include "Variable.h"
|
|---|
| 157 |
|
|---|
| 158 | // パラメータ管理用のクラス
|
|---|
| 159 | #include "Parameter.h"
|
|---|
| 160 |
|
|---|
| 161 | // プロシージャ管理用のクラス
|
|---|
| 162 | #include "Procedure.h"
|
|---|
| 163 |
|
|---|
| 164 | // コンパイラが必要とするデータハウス
|
|---|
| 165 | #include <House.h>
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 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 |
|
|---|
| 271 | #include "../BasicCompiler_Common/PESchedule.h"
|
|---|
| 272 | #include "../BasicCompiler_Common/DebugSection.h"
|
|---|
| 273 | #include "../BasicCompiler_Common/VariableOpe.h"
|
|---|
| 274 | #include "../BasicCompiler_Common/Exception.h"
|
|---|
| 275 |
|
|---|
| 276 |
|
|---|
| 277 |
|
|---|
| 278 | bool StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,Type &resultType,BOOL bDebuggingWatchList=0, bool *pIsMemoryAccessError=NULL);
|
|---|
| 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);
|
|---|
| 289 | void GetFullPath(char *path,char *dir);
|
|---|
| 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
|
|---|
| 295 | int hash_default(const char *name);
|
|---|
| 296 | CONSTINFO *GetConstHash(char *name);
|
|---|
| 297 | DllProc *GetDeclareHash(char *name);
|
|---|
| 298 | UserProc *GetSubHash(const char *name,BOOL bError=0);
|
|---|
| 299 | UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError=0);
|
|---|
| 300 | void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs );
|
|---|
| 301 |
|
|---|
| 302 | //Object.cpp
|
|---|
| 303 | void CallConstructor( const char *ObjectName,const int *SubScripts, const Type &type,const char *Parameter);
|
|---|
| 304 | bool Operator_New( const char *expression, const Type &baseType, Type &resultType );
|
|---|
| 305 |
|
|---|
| 306 | //Overload.sbp
|
|---|
| 307 | UserProc *OverloadSolutionWithStrParam(
|
|---|
| 308 | const char *name,
|
|---|
| 309 | std::vector<UserProc *> &subs,
|
|---|
| 310 | const char *Parameter,
|
|---|
| 311 | const char *ObjectName);
|
|---|
| 312 | UserProc *OverloadSolution(
|
|---|
| 313 | const char *name,
|
|---|
| 314 | std::vector<UserProc *> &subs,
|
|---|
| 315 | const Parameters ¶ms,
|
|---|
| 316 | const Type &returnType );
|
|---|
| 317 |
|
|---|
| 318 | //Debug.cpp
|
|---|
| 319 | void Debugger_StepIn(void);
|
|---|
| 320 | void Debugger_StepOver(void);
|
|---|
| 321 | void Debugger_StepCursor(void);
|
|---|
| 322 | void Debugger_Stop(void);
|
|---|
| 323 | void Debugger_Pause(void);
|
|---|
| 324 | ULONG_PTR rva_to_real(DWORD p);
|
|---|
| 325 | UserProc *GetSubFromObp(ULONG_PTR pos);
|
|---|
| 326 | void ReadOpBuffer();
|
|---|
| 327 | void DebugProgram(void);
|
|---|
| 328 |
|
|---|
| 329 | //VarList.cpp
|
|---|
| 330 | void InitVarList(DWORD dwThreadId);
|
|---|
| 331 | BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
|---|
| 332 | BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
|
|---|
| 333 |
|
|---|
| 334 | //WatchList.cpp
|
|---|
| 335 | ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar);
|
|---|
| 336 | ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip);
|
|---|
| 337 | int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss);
|
|---|
| 338 |
|
|---|
| 339 | //MakeExe.cpp
|
|---|
| 340 | void StepCompileProgress(void);
|
|---|
| 341 | void DeleteConstInfo(CONSTINFO **ppConstHash);
|
|---|
| 342 | void DeleteDeclareInfo(void);
|
|---|
| 343 | void AddSourceCode(char *buffer);
|
|---|
| 344 | void OutputExe(void);
|
|---|
| 345 | int MainThread(DWORD dummy);
|
|---|
| 346 |
|
|---|
| 347 | //Intermediate_Step1.cpp
|
|---|
| 348 | void ChangeReturnCode(char *buffer);
|
|---|
| 349 | void DeleteComment(char *buffer);
|
|---|
| 350 | void KillReturnCode(char *buffer);
|
|---|
| 351 | void CheckParenthesis(char *buffer);
|
|---|
| 352 | BOOL CheckParenthesis2(char *buffer);
|
|---|
| 353 | void DirectiveCheck(void);
|
|---|
| 354 | void NextCommandFormat(char *buffer);
|
|---|
| 355 | void SetEscapeSequenceFormat(char *buffer);
|
|---|
| 356 | void DefCommandFormat(char *buffer);
|
|---|
| 357 | void IfCommandFormat(char *buffer);
|
|---|
| 358 | void CheckPareCommand(void);
|
|---|
| 359 |
|
|---|
| 360 | //Intermediate_Step2.cpp
|
|---|
| 361 | bool GetConstInfo(void);
|
|---|
| 362 | void ChangeCommandToCode(char *buffer);
|
|---|
| 363 |
|
|---|
| 364 | //preprocessor.cpp
|
|---|
| 365 | char *OpenBasicFile(char *FileName);
|
|---|
| 366 |
|
|---|
| 367 | //Resource.cpp
|
|---|
| 368 | void GetResourceData(char *FileName);
|
|---|
| 369 |
|
|---|
| 370 | //CommandFormat.cpp
|
|---|
| 371 | void ComOpen(char *Parameter,char *buffer,int nowLine);
|
|---|
| 372 | void ComClose(char *Parameter,char *buffer);
|
|---|
| 373 | void ComField(char *Parameter,char *buffer);
|
|---|
| 374 | void ComLine(char *Parameter,char *buffer,int nowLine);
|
|---|
| 375 | void ComCircle(char *Parameter,char *buffer,int nowLine);
|
|---|
| 376 | void ComPSet(char *Parameter,char *buffer,int nowLine);
|
|---|
| 377 | void ComPaint(char *Parameter,char *buffer,int nowLine);
|
|---|
| 378 |
|
|---|
| 379 | // StrOperation.cpp
|
|---|
| 380 | void KillSpaces(char *str1,char *str2);
|
|---|
| 381 | void KillStringSpaces(char *str);
|
|---|
| 382 | BOOL RemoveStringQuotes(char *str);
|
|---|
| 383 | void RemoveStringPare(char *str);
|
|---|
| 384 | void RemoveStringBracket(char *str);
|
|---|
| 385 | void SetStringQuotes(char *str);
|
|---|
| 386 | int FormatString_EscapeSequence(char *buffer);
|
|---|
| 387 | void SlideString(char *str,int slide);
|
|---|
| 388 | void SlideBuffer(char *buffer,int length,int slide);
|
|---|
| 389 | _int8 IsCommandDelimitation(char c);
|
|---|
| 390 | BOOL IsBlank(char c);
|
|---|
| 391 | int GetOneParameter(const char *Parameter,int pos,char *retAns);
|
|---|
| 392 | int JumpOneParameter(char *Parameter,int i);
|
|---|
| 393 | int GetStringInQuotation(char *buffer,char *ReadBuffer);
|
|---|
| 394 | int GetStringInPare(char *buffer,const char *ReadBuffer);
|
|---|
| 395 | int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer);
|
|---|
| 396 | int GetStringInBracket(char *buffer,const char *ReadBuffer);
|
|---|
| 397 | int JumpStringInPare(const char *buffer,int pos);
|
|---|
| 398 | int JumpStringInBracket(const char *buffer,int pos);
|
|---|
| 399 | int GetCpFromLine(int LineNum);
|
|---|
| 400 | BOOL GetLineNum(int pos,int *pLine,char *FileName);
|
|---|
| 401 | char GetEndXXXCommand(char es);
|
|---|
| 402 | void GetDefaultNameFromES(char es,char *name);
|
|---|
| 403 | void GetCalcName(int idCalc,char *name);
|
|---|
| 404 | BOOL IsFile(char *path);
|
|---|
| 405 | BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
|
|---|
| 406 | BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
|
|---|
| 407 | void ShortPathToLongPath(const char *ShortPath,char *LongPath);
|
|---|
| 408 |
|
|---|
| 409 | //calculation.cpp
|
|---|
| 410 | bool IsNumberTopChar(const char *buffer);
|
|---|
| 411 | bool IsNumberChar(const char c);
|
|---|
| 412 | BOOL IsNumCalcMark(const char *Command,int p);
|
|---|
| 413 | BOOL IsNumCalcMark_Back(const char *Command,int p);
|
|---|
| 414 | BOOL IsStrCalcMark(const char c);
|
|---|
| 415 | BOOL IsExponent(const char *Command,int p);
|
|---|
| 416 | int GetLiteralIndex(_int64 i64data);
|
|---|
| 417 | int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2);
|
|---|
| 418 | DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType);
|
|---|
| 419 | BOOL GetConstCalcBuffer(char *name,char *Parameter,char *pCalcBuffer);
|
|---|
| 420 | DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex);
|
|---|
| 421 | bool IsStringObjectType(const Type &TypeInfo);
|
|---|
| 422 | int IsStrCalculation(char *Command);
|
|---|
| 423 | BYTE GetCalcId(const char *Command,int *pi);
|
|---|
| 424 | BOOL GetNumOpeElements(const char *Command,int *pnum,
|
|---|
| 425 | char *values[255],long calc[255],long stack[255]);
|
|---|
| 426 |
|
|---|
| 427 | //NumOpe_GetType.cpp
|
|---|
| 428 | int AutoBigCast(int BaseType,int CalcType);
|
|---|
| 429 | BOOL CheckCalcType(int idCalc,int *type,int sp);
|
|---|
| 430 | bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType );
|
|---|
| 431 |
|
|---|
| 432 | //Subroutine.cpp
|
|---|
| 433 | int GetCallProcName(char *buffer,char *name);
|
|---|
| 434 | int GetProc(char *name,void **ppInfo);
|
|---|
| 435 | void SplitObjectName(const char *name,char *ObjectName,int *pRefType);
|
|---|
| 436 | bool SplitMemberName( const char *desc, char *object, char *member );
|
|---|
| 437 | bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn = true );
|
|---|
| 438 | bool CallPropertyMethod( const char *variable, const char *rightSide, Type &resultType);
|
|---|
| 439 | bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType );
|
|---|
| 440 | bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType );
|
|---|
| 441 | UserProc *AddSubData(char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic = false );
|
|---|
| 442 | void GetSubInfo(void);
|
|---|
| 443 | void DeleteSubInfo(UserProc **ppSubHash,char **ppMacroNames,int MacroNum);
|
|---|
| 444 | void DeleteDeclareInfo(void);
|
|---|
| 445 | int AddProcPtrInfo( const string &typeExpression, int nowLine );
|
|---|
| 446 | void DeleteProcPtrInfo(void);
|
|---|
| 447 |
|
|---|
| 448 | //OldStatement.cpp
|
|---|
| 449 | void Opcode_Input(const char *Parameter);
|
|---|
| 450 | void Opcode_Print(const char *Parameter,BOOL bWrite);
|
|---|
| 451 |
|
|---|
| 452 | //LoopRefCheck.cpp
|
|---|
| 453 | class CLoopRefCheck{
|
|---|
| 454 | char **names;
|
|---|
| 455 | int num;
|
|---|
| 456 | void init();
|
|---|
| 457 | public:
|
|---|
| 458 | CLoopRefCheck();
|
|---|
| 459 | ~CLoopRefCheck();
|
|---|
| 460 | void add(char *lpszInheritsClass);
|
|---|
| 461 | void del(char *lpszInheritsClass);
|
|---|
| 462 | BOOL check(char *lpszInheritsClass);
|
|---|
| 463 | };
|
|---|
| 464 | extern CLoopRefCheck *pobj_LoopRefCheck;
|
|---|
| 465 |
|
|---|
| 466 | //DataTable.cpp
|
|---|
| 467 | class DataTable{
|
|---|
| 468 | void *pdata;
|
|---|
| 469 | int size;
|
|---|
| 470 |
|
|---|
| 471 | public:
|
|---|
| 472 | DataTable();
|
|---|
| 473 | ~DataTable();
|
|---|
| 474 | void Init();
|
|---|
| 475 |
|
|---|
| 476 | int AddBinary( const void *pdata, int size );
|
|---|
| 477 | int Add( _int64 i64data );
|
|---|
| 478 | int Add( int i32data );
|
|---|
| 479 | int Add( double dbl );
|
|---|
| 480 | int Add( float flt );
|
|---|
| 481 | int AddString( const char *str, int length );
|
|---|
| 482 | int AddString( const char *str );
|
|---|
| 483 |
|
|---|
| 484 | const void *GetPtr() const;
|
|---|
| 485 | int GetSize() const;
|
|---|
| 486 | };
|
|---|
| 487 | extern DataTable dataTable;
|
|---|
| 488 |
|
|---|
| 489 | //error.cpp
|
|---|
| 490 | void SetError(int ErrorNum,const char *KeyWord,int pos);
|
|---|
| 491 | void SetError(int ErrorNum,const string &keyWord,int pos);
|
|---|
| 492 | void SetError();
|
|---|
| 493 | void CompileMessage(char *buffer);
|
|---|
| 494 | bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum);
|
|---|
| 495 | bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
|
|---|
| 496 |
|
|---|
| 497 | //Compile.cpp
|
|---|
| 498 | void GetIdentifierToken( char *token, const char *source, int &pos );
|
|---|
| 499 | int JumpStatement(const char *source, int &pos);
|
|---|
| 500 | void DebugVariable(void);
|
|---|
| 501 | void Compile(void);
|
|---|
| 502 |
|
|---|
| 503 | //gc.cpp
|
|---|
| 504 | void InitGCVariables(void);
|
|---|
| 505 | void PerformedGcVarSchedule(void);
|
|---|
| 506 |
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 | #ifdef _DEBUG
|
|---|
| 510 | /*Debug*/
|
|---|
| 511 | /*
|
|---|
| 512 | #define HeapAlloc CheckHeapAlloc
|
|---|
| 513 | #define HeapReAlloc CheckHeapReAlloc
|
|---|
| 514 | LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
|
|---|
| 515 | LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
|
|---|
| 516 | */
|
|---|
| 517 | #endif
|
|---|