Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
121
GameTools/ScriptEngine/SymbolTable.h
Normal file
121
GameTools/ScriptEngine/SymbolTable.h
Normal file
@@ -0,0 +1,121 @@
|
||||
|
||||
#ifndef _SymbolTable_H_
|
||||
#define _SymbolTable_H_
|
||||
|
||||
#include "STL.h"
|
||||
#include "BaseDef.h"
|
||||
#include "Message.h"
|
||||
|
||||
#define SYSVAR_SWITCHTEMP "<SwitchTempVar>"
|
||||
#define SYSVAR_FLOATUNIT "<FloatUnit>"
|
||||
#define SYSVAR_FLOATTEMP "<FloatTemp>"
|
||||
#define SYSVAR_TRUE "<True>"
|
||||
#define SYSVAR_FALSE "<False>"
|
||||
#define SYSVAR_CONVBUFFER "<ConvBuffer>"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// <09>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD>ڴ<EFBFBD> 7<><37><EFBFBD><EFBFBD> <20>Ѿ <20>ȵȴ<C8B5>.
|
||||
|
||||
struct SFuncType
|
||||
{
|
||||
public:
|
||||
unsigned long m_data;
|
||||
|
||||
public:
|
||||
SFuncType();
|
||||
SFuncType( unsigned long );
|
||||
|
||||
void SetArgType( int nth, eDataType arg ) { m_data |= ( 0x0000000f & arg ) << (nth*4); }
|
||||
void SetReturnType( eDataType retType ) { m_data |= ( 0x0000000f & retType ) << 28; }
|
||||
eDataType GetArgType( int nth ) { return (eDataType)(m_data >> (nth*4) & 0x0000000f); }
|
||||
eDataType GetReturnType() { return (eDataType)(m_data >> 28 & 0x0000000f); }
|
||||
int GetArgCount();
|
||||
const char* ToString( const char * szFuncName );
|
||||
|
||||
bool operator==( const SFuncType & rhs ) { return (m_data & 0x0fffffff) == (rhs.m_data & 0x0fffffff); }
|
||||
bool operator!=( const SFuncType & rhs ) { return (m_data & 0x0fffffff) != (rhs.m_data & 0x0fffffff); }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
class CSymbolTable
|
||||
{
|
||||
public:
|
||||
typedef map< int, int > OFFSETMAP;
|
||||
typedef unsigned char byte;
|
||||
typedef struct ConstInfo CONSTINFO;
|
||||
typedef map<string,CONSTINFO> CONST_CONTAINER;
|
||||
typedef struct VarInfo VARINFO;
|
||||
typedef map<string,VARINFO> VAR_CONTAINER;
|
||||
typedef struct SLocalVarInfo LOCALVARINFO;
|
||||
typedef list<LOCALVARINFO> LOCALVAR_CONTAINER;
|
||||
typedef pair<SFuncType, bool> FUNCINFO;
|
||||
typedef multimap<string,FUNCINFO> FUNC_CONTAINER;
|
||||
|
||||
|
||||
protected:
|
||||
CONST_CONTAINER * m_pConstants;
|
||||
VAR_CONTAINER * m_pGlobalVar;
|
||||
LOCALVAR_CONTAINER* m_pLocalVars;
|
||||
VAR_CONTAINER * m_pCurNameSpace;
|
||||
VAR_CONTAINER * m_pNameSpace2; //CurNameSpace<63><65> <20><><EFBFBD><EFBFBD> <20>̷<EFBFBD>( CurNameSpace<63><65> ArgContainer<65><72> <20><> <20>̰<EFBFBD><CCB0><EFBFBD> VarContainer, VarContainer<65><72> <20><> ArgContainer )
|
||||
FUNC_CONTAINER * m_pFunctions;
|
||||
|
||||
LOCALVARINFO * m_pCurrentLocalVar;
|
||||
|
||||
eDataType m_eCurrentType;
|
||||
|
||||
int m_iVarOffset, m_iVarOffsetGlobal;
|
||||
int m_iOffsetFactor;
|
||||
int m_iStringOffset;
|
||||
|
||||
public:
|
||||
CSymbolTable();
|
||||
~CSymbolTable();
|
||||
|
||||
void Create();
|
||||
void Destroy();
|
||||
|
||||
int AddConst( const char * szName, eDataType type );
|
||||
int AddArrVar( const char * szName, eDataType, int nArray );
|
||||
int AddArrVar( const char * szName, int nArray ) { return AddArrVar( szName, m_eCurrentType, nArray ); }
|
||||
int AddVar( const char * szName, eDataType type ) { return AddArrVar( szName, type, 1 ); }
|
||||
int AddVar( const char * szName ) { return AddVar( szName, m_eCurrentType ); }
|
||||
int AddFunc( bool hasDef, const char * szName, SFuncType );
|
||||
void SetCurrentType( eDataType type ) { m_eCurrentType = type; }
|
||||
eDataType GetCurrentType() { return m_eCurrentType; }
|
||||
int FindConst( const char * szName );
|
||||
int FindVar( const char * szName );
|
||||
int FindFunc( const char * szname, SFuncType );
|
||||
|
||||
void BeginLocalNameSpace();
|
||||
void EndLocalNameSpace( int ); //<2F><><EFBFBD>ڷδ<DAB7> <20>Լ<EFBFBD><D4BC><EFBFBD> ID<49><44> <20>Ѱ<EFBFBD><D1B0>ش<EFBFBD>.
|
||||
void EndArgument();
|
||||
|
||||
const char* GetNameOfConst( int );
|
||||
eDataType GetTypeOfConst( int );
|
||||
int GetOffsetOfConst( int );
|
||||
|
||||
const char* GetNameOfVar( int );
|
||||
eDataType GetTypeOfVar( int );
|
||||
int GetCountOfVar( int );
|
||||
int GetOffsetOfVar( int ); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> EBP<42><50> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ּҿ<D6BC> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
const char* GetNameOfFunc( int );
|
||||
const char* GetTypeStringOfFunc( int );
|
||||
SFuncType GetTypeOfFunc( int );
|
||||
bool IsFuncDefined( int );
|
||||
|
||||
int GetLocalVarSize( int );
|
||||
int GetGlobalVarSize();
|
||||
int GetStringBufferSize();
|
||||
|
||||
void StringBuffer( void * );
|
||||
|
||||
void Show( MESSAGE_FUNCTION2 Print );
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user