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