"L. Spiro Engine"
|
A single scope within a stack of scopes. More...
#include <LSGShaderScope.h>
Classes | |
struct | LSG_FUNCTION |
struct | LSG_STRUCT |
struct | LSG_TYPE_AND_INDEX |
struct | LSG_VARIABLE |
Public Types | |
enum | LSG_TYPE { LSG_T_VARIABLE, LSG_T_FUNCTION, LSG_T_STRUCT, LSG_T_UNDEFINED } |
typedef struct lsg::CShaderScope::LSG_VARIABLE * | LPLSG_VARIABLE |
typedef struct lsg::CShaderScope::LSG_VARIABLE | LPCLSG_VARIABLE |
typedef struct lsg::CShaderScope::LSG_FUNCTION * | LPLSG_FUNCTION |
typedef struct lsg::CShaderScope::LSG_FUNCTION | LPCLSG_FUNCTION |
typedef struct lsg::CShaderScope::LSG_STRUCT * | LPLSG_STRUCT |
typedef struct lsg::CShaderScope::LSG_STRUCT | LPCLSG_STRUCT |
typedef struct lsg::CShaderScope::LSG_TYPE_AND_INDEX * | LPLSG_TYPE_AND_INDEX |
typedef struct lsg::CShaderScope::LSG_TYPE_AND_INDEX | LPCLSG_TYPE_AND_INDEX |
Public Member Functions | |
CShaderScope &LSE_CALL | operator= (const CShaderScope &_ssOther) |
LSBOOL LSE_CALL | AddVariable (const CString &_sName, const LSG_VARIABLE &_vVar) |
LSBOOL LSE_CALL | AddFunction (const CString &_sName, const LSG_FUNCTION &_fFunc) |
LSBOOL LSE_CALL | AddStruct (const CString &_sName, const LSG_STRUCT &_sStruct) |
const LSG_VARIABLE &LSE_CALL | GetVariable (LSUINT32 _ui32Index) const |
const LSG_FUNCTION &LSE_CALL | GetFunction (LSUINT32 _ui32Index) const |
const LSG_STRUCT &LSE_CALL | GetStruct (LSUINT32 _ui32Index) const |
LSBOOL LSE_CALL | IdentifierExistsAs (LSG_TYPE _tType, const CString &_sName) const |
LSBOOL LSE_CALL | GetIdentifiersAs (LSG_TYPE _tType, const CString &_sName, CVectorPoD< LSG_TYPE_AND_INDEX > &_vRet) const |
LSBOOL LSE_CALL | CreateNameAssociation (const CString &_sOldName, const LSCHAR *_pcNewName) |
LSBOOL LSE_CALL | GetNameAssociation (const CString &_sName, const LSCHAR *&_pcNew) const |
Protected Attributes | |
CVectorPoD< LSG_VARIABLE > | m_vVariables |
CVectorPoD< LSG_FUNCTION > | m_vFuncs |
CVectorPoD< LSG_STRUCT > | m_vStructs |
CMultiMap< CString, LSG_TYPE_AND_INDEX > | m_mmTypeMap |
CMap< CString, CString > | m_mNameAssociations |
A single scope within a stack of scopes.
Class CShaderScope Description: A single scope within a stack of scopes. When a new scope is created, it is pushed to the top of a stack of scopes. The top of the stack is always the current scope.
typedef struct lsg::CShaderScope::LSG_FUNCTION * lsg::CShaderScope::LPLSG_FUNCTION |
A function. Includes its return type and number of parameters.
typedef struct lsg::CShaderScope::LSG_STRUCT * lsg::CShaderScope::LPLSG_STRUCT |
A structure. Inclues its name and its declaration node index.
A structure for use with maps that associates a name with a type and index combination. This is the type/index combination.
typedef struct lsg::CShaderScope::LSG_VARIABLE * lsg::CShaderScope::LPLSG_VARIABLE |
A variable. Includes type information and name.
Types of things.
LSBOOL LSE_CALL lsg::CShaderScope::AddFunction | ( | const CString & | _sName, |
const LSG_FUNCTION & | _fFunc | ||
) |
Add a function to this scope.
_sName | The name of the function. |
_fFunc | The function data to add. |
LSBOOL LSE_CALL lsg::CShaderScope::AddStruct | ( | const CString & | _sName, |
const LSG_STRUCT & | _sStruct | ||
) |
Add a structure to this scope.
_sName | The name of the structure. |
_sStruct | The structure data to add. |
LSBOOL LSE_CALL lsg::CShaderScope::AddVariable | ( | const CString & | _sName, |
const LSG_VARIABLE & | _vVar | ||
) |
Add a variable to this scope.
_sName | The name of the variable. |
_vVar | The variable data to add. |
LSBOOL LSE_CALL lsg::CShaderScope::CreateNameAssociation | ( | const CString & | _sOldName, |
const LSCHAR * | _pcNewName | ||
) |
Add a name association.
_sOldName | The name of the original identifier. |
_pcNewName | The new name of the identifier. |
const LSG_FUNCTION& LSE_CALL lsg::CShaderScope::GetFunction | ( | LSUINT32 | _ui32Index | ) | const |
Get a function by index.
_ui32Index | Index of the function to get. |
LSBOOL LSE_CALL lsg::CShaderScope::GetIdentifiersAs | ( | LSG_TYPE | _tType, |
const CString & | _sName, | ||
CVectorPoD< LSG_TYPE_AND_INDEX > & | _vRet | ||
) | const |
Get all forms of the given identifier as the given type. For example, if an identifier exists as both a structure name and a function, this allows to get only the function or only the structure form.
_tType | Type of the identifier. |
_sName | The identifier to locate. |
_vRet | Holds the returned list of variables, structures, or functions, all of which will match the type given in _tType. |
LSBOOL LSE_CALL lsg::CShaderScope::GetNameAssociation | ( | const CString & | _sName, |
const LSCHAR *& | _pcNew | ||
) | const |
Get a name association.
_sName | The name for which to find an association. |
_pcNew | The replacement name, if any. Filled on successful return. |
const LSG_STRUCT& LSE_CALL lsg::CShaderScope::GetStruct | ( | LSUINT32 | _ui32Index | ) | const |
Get a structure by index.
_ui32Index | Index of the structure to get. |
const LSG_VARIABLE& LSE_CALL lsg::CShaderScope::GetVariable | ( | LSUINT32 | _ui32Index | ) | const |
Get a variable by index.
_ui32Index | Index of the variable to get. |
LSBOOL LSE_CALL lsg::CShaderScope::IdentifierExistsAs | ( | LSG_TYPE | _tType, |
const CString & | _sName | ||
) | const |
Does the given type-identifier name exist within this scope?
_tType | Type of the identifier. |
_sName | The identifier to locate. |
CShaderScope& LSE_CALL lsg::CShaderScope::operator= | ( | const CShaderScope & | _ssOther | ) |
Copy operator.
_ssOther | The object to copy. |
CMultiMap<CString, LSG_TYPE_AND_INDEX> lsg::CShaderScope::m_mmTypeMap [protected] |
Mapping between names and types. Since functions can be overloaded, a CMultiMap has to be used instead of a CMap.
CMap<CString, CString> lsg::CShaderScope::m_mNameAssociations [protected] |
Name associations.
CVectorPoD<LSG_FUNCTION> lsg::CShaderScope::m_vFuncs [protected] |
Functions in this scope.
CVectorPoD<LSG_STRUCT> lsg::CShaderScope::m_vStructs [protected] |
Structures in this scope.
CVectorPoD<LSG_VARIABLE> lsg::CShaderScope::m_vVariables [protected] |
Variables in this scope.