[14] | 1 | //#define _CRT_SECURE_NO_DEPRECATE
|
---|
| 2 | #pragma warning(disable : 4996)
|
---|
[5] | 3 |
|
---|
[4] | 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>
|
---|
[71] | 13 | #include <string>
|
---|
[76] | 14 | #include <fstream>
|
---|
[4] | 15 |
|
---|
[50] | 16 | //boost libraries
|
---|
| 17 | #include <boost/foreach.hpp>
|
---|
| 18 |
|
---|
| 19 | #define foreach BOOST_FOREACH
|
---|
| 20 |
|
---|
[71] | 21 | using namespace std;
|
---|
| 22 |
|
---|
[4] | 23 | #ifdef _AMD64_
|
---|
| 24 | #include "../BasicCompiler64/resource.h"
|
---|
| 25 | #include "../BasicCompiler64/CommandValue.h"
|
---|
| 26 | #include "../BasicCompiler64/FunctionValue.h"
|
---|
[7] | 27 | #define OPCODE_H_PATH "../BasicCompiler64/opcode.h"
|
---|
[4] | 28 | #else
|
---|
[5] | 29 | #include "../BasicCompiler32/resource.h"
|
---|
| 30 | #include "../BasicCompiler32/CommandValue.h"
|
---|
| 31 | #include "../BasicCompiler32/FunctionValue.h"
|
---|
[7] | 32 | #define OPCODE_H_PATH "../BasicCompiler32/opcode.h"
|
---|
[4] | 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"
|
---|
[75] | 39 | #include "../BasicCompiler_Common/LexicalScoping.h"
|
---|
[4] | 40 |
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 | //バージョン
|
---|
| 44 | #define MAJOR_VER 5
|
---|
| 45 | #define MINOR_VER 00
|
---|
| 46 | #define REVISION_VER 00
|
---|
| 47 |
|
---|
| 48 | #ifdef _AMD64_
|
---|
[79] | 49 | #define VER_INFO "β17 (x64)"
|
---|
[4] | 50 | #else
|
---|
[79] | 51 | #define VER_INFO "β17"
|
---|
[4] | 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;
|
---|
[55] | 94 | extern bool isUnicode;
|
---|
[69] | 95 | extern int typeOfPtrChar;
|
---|
[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 | // コンパイラが必要とするデータハウス
|
---|
| 165 | #include <House.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"
|
---|
[26] | 274 | #include "../BasicCompiler_Common/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);
|
---|
| 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
|
---|
[75] | 295 | int hash_default(const char *name);
|
---|
[4] | 296 | CONSTINFO *GetConstHash(char *name);
|
---|
[75] | 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 );
|
---|
[4] | 301 |
|
---|
| 302 | //Object.cpp
|
---|
[75] | 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 );
|
---|
[4] | 305 |
|
---|
| 306 | //Overload.sbp
|
---|
[75] | 307 | UserProc *OverloadSolutionWithStrParam(
|
---|
[50] | 308 | const char *name,
|
---|
[75] | 309 | std::vector<UserProc *> &subs,
|
---|
[50] | 310 | const char *Parameter,
|
---|
[75] | 311 | const char *ObjectName);
|
---|
| 312 | UserProc *OverloadSolution(
|
---|
[50] | 313 | const char *name,
|
---|
[75] | 314 | std::vector<UserProc *> &subs,
|
---|
| 315 | const Parameters ¶ms,
|
---|
| 316 | const Type &returnType );
|
---|
[4] | 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);
|
---|
[75] | 325 | UserProc *GetSubFromObp(ULONG_PTR pos);
|
---|
[4] | 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);
|
---|
[75] | 337 | int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss);
|
---|
[4] | 338 |
|
---|
| 339 | //MakeExe.cpp
|
---|
| 340 | void StepCompileProgress(void);
|
---|
| 341 | void DeleteConstInfo(CONSTINFO **ppConstHash);
|
---|
| 342 | void DeleteDeclareInfo(void);
|
---|
[15] | 343 | void AddSourceCode(char *buffer);
|
---|
[4] | 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
|
---|
[16] | 361 | bool GetConstInfo(void);
|
---|
[4] | 362 | void ChangeCommandToCode(char *buffer);
|
---|
| 363 |
|
---|
| 364 | //preprocessor.cpp
|
---|
[15] | 365 | char *OpenBasicFile(char *FileName);
|
---|
[4] | 366 |
|
---|
| 367 | //Resource.cpp
|
---|
| 368 | void GetResourceData(char *FileName);
|
---|
| 369 |
|
---|
| 370 | //CommandFormat.cpp
|
---|
[75] | 371 | void ComOpen(char *Parameter,char *buffer,int nowLine);
|
---|
[4] | 372 | void ComClose(char *Parameter,char *buffer);
|
---|
| 373 | void ComField(char *Parameter,char *buffer);
|
---|
[75] | 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);
|
---|
[4] | 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);
|
---|
[77] | 391 | int GetOneParameter(const char *Parameter,int pos,char *retAns);
|
---|
[4] | 392 | int JumpOneParameter(char *Parameter,int i);
|
---|
| 393 | int GetStringInQuotation(char *buffer,char *ReadBuffer);
|
---|
[15] | 394 | int GetStringInPare(char *buffer,const char *ReadBuffer);
|
---|
[4] | 395 | int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer);
|
---|
[15] | 396 | int GetStringInBracket(char *buffer,const char *ReadBuffer);
|
---|
[49] | 397 | int JumpStringInPare(const char *buffer,int pos);
|
---|
| 398 | int JumpStringInBracket(const char *buffer,int pos);
|
---|
[4] | 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);
|
---|
[31] | 405 | BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
|
---|
[4] | 406 | BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
|
---|
[31] | 407 | void ShortPathToLongPath(const char *ShortPath,char *LongPath);
|
---|
[4] | 408 |
|
---|
| 409 | //calculation.cpp
|
---|
[15] | 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);
|
---|
[4] | 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);
|
---|
[75] | 421 | bool IsStringObjectType(const Type &TypeInfo);
|
---|
[4] | 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);
|
---|
[73] | 430 | bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType );
|
---|
[4] | 431 |
|
---|
| 432 | //Subroutine.cpp
|
---|
| 433 | int GetCallProcName(char *buffer,char *name);
|
---|
| 434 | int GetProc(char *name,void **ppInfo);
|
---|
[46] | 435 | void SplitObjectName(const char *name,char *ObjectName,int *pRefType);
|
---|
[28] | 436 | bool SplitMemberName( const char *desc, char *object, char *member );
|
---|
[75] | 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 );
|
---|
[4] | 442 | void GetSubInfo(void);
|
---|
[75] | 443 | void DeleteSubInfo(UserProc **ppSubHash,char **ppMacroNames,int MacroNum);
|
---|
[4] | 444 | void DeleteDeclareInfo(void);
|
---|
[78] | 445 | int AddProcPtrInfo( const string &typeExpression, int nowLine );
|
---|
[4] | 446 | void DeleteProcPtrInfo(void);
|
---|
| 447 |
|
---|
[76] | 448 | //OldStatement.cpp
|
---|
| 449 | void Opcode_Input(const char *Parameter);
|
---|
| 450 | void Opcode_Print(const char *Parameter,BOOL bWrite);
|
---|
| 451 |
|
---|
[4] | 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 |
|
---|
[56] | 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 |
|
---|
[4] | 489 | //error.cpp
|
---|
[40] | 490 | void SetError(int ErrorNum,const char *KeyWord,int pos);
|
---|
[75] | 491 | void SetError(int ErrorNum,const string &keyWord,int pos);
|
---|
[64] | 492 | void SetError();
|
---|
[4] | 493 | void CompileMessage(char *buffer);
|
---|
[46] | 494 | bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum);
|
---|
[75] | 495 | bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
|
---|
[4] | 496 |
|
---|
| 497 | //Compile.cpp
|
---|
[17] | 498 | void GetIdentifierToken( char *token, const char *source, int &pos );
|
---|
[16] | 499 | int JumpStatement(const char *source, int &pos);
|
---|
[4] | 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
|
---|