"L. Spiro Engine"
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

lsg::CShaderLanguageParser Class Reference

Manages all information related to a parsed shader file. More...

#include <LSGShaderLanguageParser.h>

List of all members.

Classes

struct  LSG_ENGINE_MACRO
struct  LSG_IDENTIFIER
union  LSG_SCALAR
struct  LSG_STRUCT
struct  LSG_STRUCT_DECLARATOR
struct  LSG_STRUCT_MEMBER

Public Types

enum  LSG_SHADER_TYPES { LSG_ST_INVALID = -1, LSG_ST_VERTEX, LSG_ST_PIXEL, LSG_ST_TOTAL }
enum  LSG_STRUCT_BASE { LSG_SB_START = 10000 }
typedef struct
lsg::CShaderLanguageParser::LSG_IDENTIFIER
LPLSG_IDENTIFIER
typedef struct
lsg::CShaderLanguageParser::LSG_IDENTIFIER 
LPCLSG_IDENTIFIER
typedef union
lsg::CShaderLanguageParser::LSG_SCALAR
LPLSG_SCALAR
typedef union
lsg::CShaderLanguageParser::LSG_SCALAR 
LPCLSG_SCALAR
typedef struct
lsg::CShaderLanguageParser::LSG_STRUCT_MEMBER
LPLSG_STRUCT_MEMBER
typedef struct
lsg::CShaderLanguageParser::LSG_STRUCT_MEMBER 
LPCLSG_STRUCT_MEMBER
typedef struct
lsg::CShaderLanguageParser::LSG_STRUCT
LPLSG_STRUCT
typedef struct
lsg::CShaderLanguageParser::LSG_STRUCT 
LPCLSG_STRUCT
typedef CMap< CString, LSG_STRUCTLSG_STRUCT_ARRAY
typedef CMap< CString,
LSG_STRUCT > * 
LPLSG_STRUCT_ARRAY
typedef CMap< CString,
LSG_STRUCT > *const 
LPCLSG_STRUCT_ARRAY
typedef struct
lsg::CShaderLanguageParser::LSG_STRUCT_DECLARATOR
LPLSG_STRUCT_DECLARATOR
typedef struct
lsg::CShaderLanguageParser::LSG_STRUCT_DECLARATOR 
LPCLSG_STRUCT_DECLARATOR
typedef struct
lsg::CShaderLanguageParser::LSG_ENGINE_MACRO
LPLSG_ENGINE_MACRO
typedef struct
lsg::CShaderLanguageParser::LSG_ENGINE_MACRO 
LPCLSG_ENGINE_MACRO

Public Member Functions

LSE_CALLCTOR CShaderLanguageParser (LSG_SHADER_TYPES _stType, CShaderLexer *_plLexer)
LSG_SHADER_TYPES LSE_CALL GetShaderType () const
LSUINT32 LSE_CALL CreateString (const LSCHAR *_pcText, LSBOOL _bHasQuotes=true)
LSBOOL LSE_CALL CreateDecimal (const LSCHAR *_pcText, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFloatingPoint (const LSCHAR *_pcText, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateBool (LSBOOL _bValue, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateIdentifier (const LSCHAR *_pcText, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateArrayAccess (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBase, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndIndex, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreatePostfixOrPrefixIncOrDec (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndOp, LSG_NODE _nType, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateUnaryOp (LSUINT32 _ui32Op, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBase, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateCast (LSUINT64 _ui64Type, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBase, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateMath (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSUINT32 _ui32Op, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateTertiary (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndCond, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateAssignment (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSUINT32 _ui32Op, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateComma (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateIntrinsic (LSUINT32 _ui32Intrinsic, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndExp, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateArgExpList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFunctionCall (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndFunction, LSUINT32 _ui32ArgList, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFieldSelect (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateConstructor (LSUINT64 _ui64Type, LSUINT32 _ui32Args, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateExpressionStatement (LSUINT32 _ui32Index, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateDeclarationStatement (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndDecl, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateSemantic (const LSCHAR *_pcText, LSUINT32 _ui32Type, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateTypeSpecifier (LSUINT64 _ui64Qualifiers, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFullySpecifiedType (LSUINT64 _ui64Qualifiers, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndSpec, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateSingleDeclaration (LSUINT32 _ui32Name, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndTypeNode, LSUINT32 _ui32ConstNodeIndex, LSUINT32 _ui32SemanticNodeIndex, LSUINT32 _ui32InitializerNodeIndex, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateInitializerList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateInitializerListWrap (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndList, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateStatementList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateNewScopedStatement (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndStatement, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateBlankStatement (LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateStructDeclarator (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndName, LSUINT32 _ui32ArrayNodeIndex, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateStructDeclaratorList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateStructDeclaration (LSUINT64 _ui64Qualifiers, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndType, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndDecl, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateStructDeclarationList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateStruct (LSUINT32 _ui32IdentifierIndex, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndDecl, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateParameterDeclarator (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndType, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndName, LSUINT32 _ui32ArrayNodeIndex, LSUINT32 _ui32SemanticNodeIndex, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateParameterDeclaration (LSUINT64 _ui64TypeInfo, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndDecl, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateParameterDeclarationList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFunctionDeclaration (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndType, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndName, LSUINT32 _ui32Parms, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFunctionDefinition (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndHeader, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBody, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateSelectionStatement (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndExp, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBody, LSUINT32 _ui32ElseBody, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateForInitDeclStatement (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndExp, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateWhileLoop (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndExp, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBody, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateDoWhileLoop (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndExp, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBody, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateForLoop (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndInitExp, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndExp, LSUINT32 _ui32ItIndex, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndBody, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateJump (LSG_NODE _nType, LSUINT32 _ui32NodeIndex, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateExternalDeclarationList (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndLeft, const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndRight, LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSUINT32 LSE_CALL FindIdentifier (const LSCHAR *_pcName) const
LSBOOL LSE_CALL IsToken (const LSCHAR *_pcText) const
const
LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA
&LSE_CALL 
GetNode (LSUINT32 _ui32Index) const
LSUINT32 LSE_CALL TotalNodes () const
LSUINT32 LSE_CALL TotalIdentifiers () const
const LSG_IDENTIFIER &LSE_CALL GetIdentifier (LSUINT32 _ui32Index) const
LSUINT32 LSE_CALL TotalStrings () const
const CString &LSE_CALL GetString (LSUINT32 _ui32Index) const
LSG_NUM_CONSTANTS LSE_CALL GetNodeValue (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode, LSG_SCALAR &_sValue) const
LSBOOL LSE_CALL IsInteger (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT32 LSE_CALL CountArgs (LSUINT32 _ui32ArgListIndex, LSUINT32 _ui32MaxArgs, LSUINT32 *_pui32Nodes) const
LSUINT32 LSE_CALL CountParms (LSUINT32 _ui32ArgListIndex, CVectorPoD< LSUINT32, LSUINT32 > *_pvRet=NULL)
LSUINT32 LSE_CALL CountStructMembers (LSUINT32 _ui32MemberListIndex, CVectorPoD< LSUINT32, LSUINT32 > *_pvRet=NULL)
LSBOOL LSE_CALL GetStructDeclarators (LSUINT32 _ui32Index, CVectorPoD< LSG_STRUCT_DECLARATOR > &_vRet) const
LSUINT64 LSE_CALL GetTypeQualifier (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT64 LSE_CALL GetType (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
const CString &LSE_CALL GetName (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT32 LSE_CALL GetNameIndex (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT64 LSE_CALL GetSemantic (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT64 LSE_CALL GetTypeQualifiersOnParm (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT64 LSE_CALL GetTypeOnParm (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
const CString &LSE_CALL GetNameOfParm (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT32 LSE_CALL GetNameIndexOfParm (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSUINT32 LSE_CALL GetArrayIndexOfParm (const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode) const
LSBOOL LSE_CALL RegisterStructType (const LSCHAR *_pcText)
LSUINT32 LSE_CALL GetStructTypeId (const LSCHAR *_pcText) const
CString LSE_CALL GetStructById (LSUINT32 _ui32Id) const
LSUINT32 LSE_CALL GetSize (LSUINT64 _ui64Type) const

Static Public Member Functions

static LSBOOL LSE_CALL IsInteger (LSUINT64 _ui64Type)
static LSUINT32 LSE_CALL GetArrayUnit (LSUINT64 _ui64Type, LSUINT32 _ui32Unit)
static LSUINT32 LSE_CALL GetType (LSUINT64 _ui64Type)
static LSUINT64 LSE_CALL CombineTypesAndArrays (LSUINT64 _ui64Type, LSUINT32 _ui32Array0, LSUINT32 _ui32Array1)
static LSG_NUM_CONSTANTS LSE_CALL TypeToConstantType (LSUINT64 _ui64Type)
static LSUINT64 LSE_CALL ConstantTypeToType (LSG_NUM_CONSTANTS _ncType)
static CString LSE_CALL BasicTypeToString (LSUINT64 _ui64Type)
static LSG_SCALAR LSE_CALL CastScalar (const LSG_SCALAR &_sScalar, LSUINT64 _ui64OriginalType, LSUINT64 _ui64NewType, LSBOOL &_bRes)
static LSG_NUM_CONSTANTS LSE_CALL GetHighType (LSG_NUM_CONSTANTS _ncLeft, LSG_NUM_CONSTANTS _ncRight)
static LSBOOL LSE_CALL IsEitherMatrix (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL BothAreMatrices (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL IsEitherVector (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL BothAreVectors (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL IsEitherScalar (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL BothAreScalars (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL IsEitherStruct (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSBOOL LSE_CALL BothAreStructs (LSUINT64 _ui64Left, LSUINT64 _ui64Right)
static LSVOID LSE_CALL GetMatrixSize (LSUINT64 _ui64Left, LSUINT64 _ui64Right, LSUINT32 &_ui32Columns, LSUINT32 &_ui32Rows)
static LSVOID LSE_CALL GetVectorSize (LSUINT64 _ui64Left, LSUINT64 _ui64Right, LSUINT32 &_ui32Ret)

Protected Member Functions

LSBOOL LSE_CALL AddNode (LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSUINT32 LSE_CALL AddIdentifier (const LSCHAR *_pcText)
LSBOOL LSE_CALL FindToken (const LSCHAR *_pcName, LSUINT32 &_ui32Index) const

Protected Attributes

CVector< CString, LSUINT32, 512UL > m_vStringPool
CVectorPoD
< LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA,
LSUINT32, 512UL *10UL > 
m_vNodes
CVectorPoD< LSG_IDENTIFIER,
LSUINT32, 512UL > 
m_vIdentifiers
CVectorPoD< LSUINT32, LSUINT32, 512UL > m_vSortedTokens
CShaderScopeStack m_sssScopes
LSG_SHADER_TYPES m_stShaderType
CMap< CString, LSUINT32 > m_mUserTypes
LSUINT32 m_ui32TypeId
LSG_STRUCT_ARRAY m_saStructures
CShaderLexerm_plLexer

Detailed Description

Manages all information related to a parsed shader file.

Class CShaderLanguageParser Description: Handles the meat of parsing a shader file. Bison performs the actual parsing, but all nodes are sent to this class to be managed. This is the go-to class for any information needed on a parsed shader.


Member Typedef Documentation

An engine-defined macro.

Identifier data.

A scalar type.

A structure.

Structure declarator.

A structure member.

An array of structures.


Member Enumeration Documentation

Shader types.

Structure base ID.


Member Function Documentation

LSUINT32 LSE_CALL lsg::CShaderLanguageParser::AddIdentifier ( const LSCHAR *  _pcText) [protected]

Add an identifier by name. Returns the index of the created identifier in the identifier stack. The type of the created identifier is undefined.

Parameters:
_pcTextThe string name of the identifier.
Returns:
Returns the index of the created identifier.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::AddNode ( LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA &  _ndNode) [protected]

Add a node to the stack. Set the node index too.

Parameters:
_ndNodeThe node to add to the stack.
Returns:
Returns true if the node was added.
static CString LSE_CALL lsg::CShaderLanguageParser::BasicTypeToString ( LSUINT64  _ui64Type) [static]

Get the name of a basic type.

Parameters:
_ui64TypeThe type whose name is to be obtained.
Returns:
Returns the type in string form.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreMatrices ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Are both types matrices?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if both types are matrices.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreScalars ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Are both types scalars?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if both types are scalars.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreStructs ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Are both types structures?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if both types are structures.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreVectors ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Are both types vectors?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if both types are vectors.
static LSG_SCALAR LSE_CALL lsg::CShaderLanguageParser::CastScalar ( const LSG_SCALAR _sScalar,
LSUINT64  _ui64OriginalType,
LSUINT64  _ui64NewType,
LSBOOL &  _bRes 
) [static]

Convert from one scalar type to another.

Parameters:
_sScalarThe value to cast.
_ui64OriginalTypeThe type of value in _sScalar.
_ui64NewTypeThe type to which to cast the given scalar value.
_bResIf set to true, the function succeeded in converting the values.
Returns:
Returns the scalar cast to the given type.
static LSUINT64 LSE_CALL lsg::CShaderLanguageParser::CombineTypesAndArrays ( LSUINT64  _ui64Type,
LSUINT32  _ui32Array0,
LSUINT32  _ui32Array1 
) [static]

Combine a type specifier with array specifiers to create a value that contains both.

Parameters:
_ui64TypeType specifier.
_ui32Array0Array value 1.
_ui32Array1Array value 2. Must be ~0UL if not used.
Returns:
Returns the value created by combining the input values into a single LSUINT64.
static LSUINT64 LSE_CALL lsg::CShaderLanguageParser::ConstantTypeToType ( LSG_NUM_CONSTANTS  _ncType) [static]

Convert a numeric-constant type to a full type that most closely matches the numeric-constant type.

Parameters:
_ncTypeThe type to convert.
Returns:
Returns the full type form that matches most closely the given numeric-constant type.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::CountArgs ( LSUINT32  _ui32ArgListIndex,
LSUINT32  _ui32MaxArgs,
LSUINT32 *  _pui32Nodes 
) const

Count the number of arguments in the given argument list up to the maximum specified. Also stores the argument node indices in the given array in reverse order. If the number of arguments is less than or equal to the given max, the node count is returned and the nodes are stored in _pui32Nodes. Otherwise ~0UL is returned and the contents of _pui32Nodes are undefined. This is used by the engine for intrinsic functions only.

Parameters:
_ui32ArgListIndexIndex of the argument list whose nodes are to be counted.
_ui32MaxArgsMaximum number of arguments that can be stored in _pui32Nodes.
_pui32NodesFilled with the arguments in reverse order upon return.
Returns:
Returns the number of arguments found or ~0UL if there are more than _ui32MaxArgs.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::CountParms ( LSUINT32  _ui32ArgListIndex,
CVectorPoD< LSUINT32, LSUINT32 > *  _pvRet = NULL 
)

Count the number of parameters in the given argument list. Optionally returns the argument node indices in the optionally supplied vector in reverse order.

Parameters:
_ui32ArgListIndexIndex of the argument list whose nodes are to be counted.
_pvRetIf not NULL, filled with the arguments in reverse order upon return.
Returns:
return Returns the number of arguments found or ~0UL if there is not enough memory to add the indices to the given vector.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::CountStructMembers ( LSUINT32  _ui32MemberListIndex,
CVectorPoD< LSUINT32, LSUINT32 > *  _pvRet = NULL 
)

Count the number of members on a structure. Optionally returns the member declarations in reverse order.

Parameters:
_ui32MemberListIndexIndex of the structure declaration list whose nodes are to be counted.
_pvRetIf not NULL, filled with the arguments in reverse order upon return.
Returns:
return Returns the number of members found or ~0UL if there is not enough memory to add the indices to the given vector.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateArgExpList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Make an argument expression list.

Parameters:
_ndLeftThe left operand.
_ndRightThe right operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateArrayAccess ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBase,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndIndex,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an array-access node.

Parameters:
_ndBaseBase part of the expression.
_ndIndexArray index part of the expression.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateAssignment ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSUINT32  _ui32Op,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an assignment node.

Parameters:
_ndLeftThe left operand.
_ndRightThe right operand.
_ui32OpThe operator.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateBlankStatement ( LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode)

Creates an empty statement.

Parameters:
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateBool ( LSBOOL  _bValue,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a node that represents either boolean true or boolean false.

Parameters:
_bValueThe boolean value of the node.
_ndNodeNode to create based off the string constant.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateCast ( LSUINT64  _ui64Type,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBase,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a cast expression.

Parameters:
_ui64TypeThe type to which to cast the expression.
_ndBaseThe base expression.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateComma ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a comma sequence.

Parameters:
_ndLeftThe left operand.
_ndRightThe right operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateConstructor ( LSUINT64  _ui64Type,
LSUINT32  _ui32Args,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Create a constructor node.

Parameters:
_ui64TypeThe type ID, including implicit arrays.
_ui32ArgsIndex of the argument-list node if any.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateDecimal ( const LSCHAR *  _pcText,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Accepts a string representation of a decimal constant and stores the result in the given node.

Parameters:
_pcTextString constant containing the numeric.
_ndNodeNode to create based off the string constant.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateDeclarationStatement ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndDecl,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an declaration statement.

Parameters:
_ndDeclThe declaration node.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateDoWhileLoop ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndExp,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBody,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a do () while node.

Parameters:
_ndExpThe conditional expression.
_ndBodyThe body of the iterator.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateExpressionStatement ( LSUINT32  _ui32Index,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an expression statement.

Parameters:
_ui32IndexIndex of the expression or ~0UL
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateExternalDeclarationList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a list of external declarations.

Parameters:
param_ndLeft Left operand.
_ndRightRight operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateFieldSelect ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Create a field-select node.

Parameters:
_ndLeftThe left operand.
_ndRightThe right operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateFloatingPoint ( const LSCHAR *  _pcText,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Accepts a representation of a floating-point constant and stores the result in the given node.

Parameters:
_pcTextString constant containing the numeric.
_ndNodeNode to create based off the string constant.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateForInitDeclStatement ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndExp,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a for-initilializer node.

Parameters:
_ndExpThe initializer node.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateForLoop ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndInitExp,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndExp,
LSUINT32  _ui32ItIndex,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBody,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a for () node.

Parameters:
_ndInitExpThe initializer expression.
_ndExpThe conditional expression.
_ui32ItIndexThe iteartion expression index, of any.
_ndBodyThe body of the iterator.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateFullySpecifiedType ( LSUINT64  _ui64Qualifiers,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndSpec,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a fully specified type. Such as "IN void" or "float".

Parameters:
_ui64QualifiersThe type qualifiers.
_ndSpecType specifier.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateFunctionCall ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndFunction,
LSUINT32  _ui32ArgList,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Create a function-call node.

Parameters:
_ndFunctionThe left operand.
_ui32ArgListThe index of the optional argument list.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateFunctionDeclaration ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndType,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndName,
LSUINT32  _ui32Parms,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a function-declaration node.

Parameters:
_ndTypeType information.
_ndNameFunction name.
_ui32ParmsOptional parameters.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateFunctionDefinition ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndHeader,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBody,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a function definition node.

Parameters:
_ndHeaderFunction header and parameters.
_ndBodyFunction body.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateIdentifier ( const LSCHAR *  _pcText,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a node pointing to an identifier (by index into the identifier stack).

Parameters:
_pcTextThe string name of the identifier.
_ndNodeNode to create based off the string constant.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateInitializerList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an initializer list.

Parameters:
_ndLeftLeft operand.
_ndRightRight operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateInitializerListWrap ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndList,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an initializer list, wrapped inside {}.

Parameters:
_ndListThe initialier list.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateIntrinsic ( LSUINT32  _ui32Intrinsic,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndExp,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates an intrinsic function.

Parameters:
_ui32IntrinsicThe intrinsic to create.
_ndExpThe parameters for the intrinsic function.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateJump ( LSG_NODE  _nType,
LSUINT32  _ui32NodeIndex,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a jump node.

Parameters:
_nTypeThe jump node type.
_ui32NodeIndexIndex of the associated node, if there is one.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateMath ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSUINT32  _ui32Op,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a node referencing two other nodes with an operator between them. From X * Y to X && Y.

Parameters:
_ndLeftThe left operand.
_ndRightThe right operand.
_ui32OpThe operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateNewScopedStatement ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndStatement,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a statement with a raised scope.

Parameters:
_ndStatementThe statement with the increased scope.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateParameterDeclaration ( LSUINT64  _ui64TypeInfo,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndDecl,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a parameter declaration node.

Parameters:
_ui64TypeInfoFull type-qualifier information.
_ndDeclDeclaration node.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateParameterDeclarationList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a parameter declaration list.

Parameters:
_ndLeftLeft operand.
_ndRightRight operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateParameterDeclarator ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndType,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndName,
LSUINT32  _ui32ArrayNodeIndex,
LSUINT32  _ui32SemanticNodeIndex,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a parameter declarator node.

Parameters:
_ndTypeThe type information.
_ndNameParameter name.
_ui32ArrayNodeIndexIndex of the node associated with the array part of the declarator if any.
_ui32SemanticNodeIndexIndex of the node associated with the semantic part of the declarator if any.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreatePostfixOrPrefixIncOrDec ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndOp,
LSG_NODE  _nType,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a postfix or prefix ++ or -- node.

Parameters:
_ndOpThe left operand.
_nTypeType of operation.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateSelectionStatement ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndExp,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBody,
LSUINT32  _ui32ElseBody,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a selection (if/else) statement node.

Parameters:
_ndExpThe expression to evaluate.
_ndBodyThe statement body.
_ui32ElseBodyThe index of the else body statement if any.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateSemantic ( const LSCHAR *  _pcText,
LSUINT32  _ui32Type,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a semantic.

Parameters:
_pcTextThe semantic text.
_ui32TypeThe semantic type.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateSingleDeclaration ( LSUINT32  _ui32Name,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndTypeNode,
LSUINT32  _ui32ConstNodeIndex,
LSUINT32  _ui32SemanticNodeIndex,
LSUINT32  _ui32InitializerNodeIndex,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a single declaration. Such as "flat vector g_vUp = { 0.0f, 1.0f, 0.0 }".

Parameters:
_ui32NameName of the variable to create.
_ndTypeNodeFully specified type data.
_ui32ConstNodeIndexIndex of the constant-expression node or ~0UL if there is none.
_ui32SemanticNodeIndexIndex of the semantic node or ~0UL if there is none.
_ui32InitializerNodeIndexIndex of the initializer node or ~0UL if there is none.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateStatementList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a statement list.

Parameters:
_ndLeftLeft operand.
_ndRightRight operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::CreateString ( const LSCHAR *  _pcText,
LSBOOL  _bHasQuotes = true 
)

Accepts a string from code in a shader, converts it to binary (for example, is converted to character 0x0D), and returns the index of the string where it was stored in the pool of strings.

Parameters:
_pcTextThe string from the code to convert and store.
_bHasQuotesIf true, the first and last characters are assumed to be quotation marks and not part of the string itself.
Returns:
Returns the index of the stored string or ~0UL on error.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateStruct ( LSUINT32  _ui32IdentifierIndex,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndDecl,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a structure node.

Parameters:
_ui32IdentifierIndexIndex of the node representing the name of the structure, if any. ~0UL if the structure is nameless.
_ndDeclThe structure members.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateStructDeclaration ( LSUINT64  _ui64Qualifiers,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndType,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndDecl,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a structure declarator. A full member or list of members with the same type specifiers and qualifiers.

Parameters:
_ui64QualifiersThe qualifiers.
_ndTypeThe type data.
_ndDeclThe declarator node, always of type LSG_N_STRUCTDECLARATORLIST.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateStructDeclarationList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a structure declaration list node.

Parameters:
_ndLeftThe left operand.
_ndRightThe right operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateStructDeclarator ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndName,
LSUINT32  _ui32ArrayNodeIndex,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a structure-declarator node. This is the declaration of a single member of a structure excluding type qualifiers.

Parameters:
_ndNameIdentifier node representing the name of the member.
_ui32ArrayNodeIndexIndex of the node representing the array constant or ~0UL.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateStructDeclaratorList ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a structure-declarator list node.

Parameters:
_ndLeftLeft operand.
_ndRightRight operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateTertiary ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndCond,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndLeft,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndRight,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a tertiary ?: expression.

Parameters:
_ndCondThe conditional operand.
_ndLeftThe left operand.
_ndRightThe right operand.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateTypeSpecifier ( LSUINT64  _ui64Qualifiers,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a type-specifier node without a precision qualifier. Precision qualifiers do not currently exist but may in the future.

Parameters:
_ui64QualifiersThe type qualifiers.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateUnaryOp ( LSUINT32  _ui32Op,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBase,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a unary !, ~, -, or + node.

Parameters:
_ui32OpThe operator.
_ndBaseThe base expression modified by the operator.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateWhileLoop ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndExp,
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndBody,
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode 
)

Creates a while () node.

Parameters:
_ndExpThe conditional expression.
_ndBodyThe body of the iterator.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::FindIdentifier ( const LSCHAR *  _pcName) const

Find an identifier by name.

Parameters:
_pcNameName of the identifier to find.
Returns:
Returns the index of the identifier with the given name in the stack of identifiers or ~0UL on error.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::FindToken ( const LSCHAR *  _pcName,
LSUINT32 &  _ui32Index 
) const [protected]

Get the index of a token or the index where the token should be added if it is not in the list of tokens.

Parameters:
_pcNameName of the token to find.
_ui32IndexHolds the returned index.
Returns:
Returns true if the token is in the list, false otherwise.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetArrayIndexOfParm ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the array index of a parameter declaration (LSG_N_PARMDECLARATION) node.

Parameters:
_ndNodeNode to search.
Returns:
Returns the array index of the given node.
static LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetArrayUnit ( LSUINT64  _ui64Type,
LSUINT32  _ui32Unit 
) [static]

Gets the length of an array unit of a type.

Parameters:
_ui64TypeThe type whose array unit is to be obtained.
_ui32UnitThe array unit to be obtained.
Returns:
Returns the array unit of a given type.
static LSG_NUM_CONSTANTS LSE_CALL lsg::CShaderLanguageParser::GetHighType ( LSG_NUM_CONSTANTS  _ncLeft,
LSG_NUM_CONSTANTS  _ncRight 
) [static]

Get the best type between the two given types. In order: bool, int, uint, float.

Parameters:
_ncLeftThe left type.
_ncRightThe right type.
Returns:
Returns the highest precision type between the two given types.
const LSG_IDENTIFIER& LSE_CALL lsg::CShaderLanguageParser::GetIdentifier ( LSUINT32  _ui32Index) const

Get an identifier by index.

Parameters:
_ui32IndexIndex of the identifier to get.
Returns:
Returns a constant reference to the requested identifier.
static LSVOID LSE_CALL lsg::CShaderLanguageParser::GetMatrixSize ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right,
LSUINT32 &  _ui32Columns,
LSUINT32 &  _ui32Rows 
) [static]

Get the matrix dimensions from the type that is a matrix. Exactly one of the types must be a matrix.

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
_ui32ColumnsNumber of columns.
_ui32RowsNumber of rows.
const CString& LSE_CALL lsg::CShaderLanguageParser::GetName ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get a name from an identifier node.

Parameters:
_ndNodeThe node from which to extract the name.
Returns:
Returns the name of the given node.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetNameIndex ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the index of a name from an identifier node.

Parameters:
_ndNodeThe node from which to extract the name index.
Returns:
Returns the index of the name of the given node.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetNameIndexOfParm ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the name index of a parameter declaration (LSG_N_PARMDECLARATION) node.

Parameters:
_ndNodeNode to search.
Returns:
Returns the name index of the given node.
const CString& LSE_CALL lsg::CShaderLanguageParser::GetNameOfParm ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the name of a parameter declaration (LSG_N_PARMDECLARATION) node.

Parameters:
_ndNodeNode to search.
Returns:
Returns the name of the given node.
const LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA& LSE_CALL lsg::CShaderLanguageParser::GetNode ( LSUINT32  _ui32Index) const

Get a node for read-only.

Parameters:
_ui32IndexIndex of the node to get.
Returns:
Returns a constant reference to the requested node.
LSG_NUM_CONSTANTS LSE_CALL lsg::CShaderLanguageParser::GetNodeValue ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode,
LSG_SCALAR _sValue 
) const

Get the type and value of a node. The node must represent a constant numeric type.

Parameters:
_ndNodeThe node to test.
_sValueThe value of the node, which should be reinterpreted based on the type of the node.
Returns:
Returns the type of the node.
LSUINT64 LSE_CALL lsg::CShaderLanguageParser::GetSemantic ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the semantics node from a parameter declaration (LSG_N_PARMDECLARATION) node.

Parameters:
_ndNodeNode to search.
Returns:
Returns the semantic type and the semantic numeric, with the numeric being stored in the upper 32 bits of the return value. If there is no semantic, ~0ULL is returned.
LSG_SHADER_TYPES LSE_CALL lsg::CShaderLanguageParser::GetShaderType ( ) const

Get the shader type.

Returns:
Returns the shader type.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetSize ( LSUINT64  _ui64Type) const

Get the size of a type. For structures, elements are always packed on 16-byte boundaries, and the size returned will be rounded up to the next 16-byte boundary.

Parameters:
_ui64TypeThe type whose size is to be obtained.
Returns:
Returns the size of the given type or ~0UL if the type is not defined.
const CString& LSE_CALL lsg::CShaderLanguageParser::GetString ( LSUINT32  _ui32Index) const

Get a string by index.

Parameters:
_ui32IndexIndex of the string to get.
Returns:
Returns a constant reference to the requested string.
CString LSE_CALL lsg::CShaderLanguageParser::GetStructById ( LSUINT32  _ui32Id) const

Get a structure name by its type ID.

Parameters:
_ui32IdID of the user-defined structure to get.
Returns:
Returns the name of the structure if found, or an empty string if not.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::GetStructDeclarators ( LSUINT32  _ui32Index,
CVectorPoD< LSG_STRUCT_DECLARATOR > &  _vRet 
) const

Get the declarators on a structure declaration.

Parameters:
_ui32IndexIndex of the structure declaration.
_vRetReturned array of structure declarators.
Returns:
Returns true if there was enough memory to perform the operation.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetStructTypeId ( const LSCHAR *  _pcText) const

Get the type ID for a given user-defined type. Returns 0 if no such type exists.

Parameters:
_pcTextThe type name.
Returns:
Returns the type ID if the given type name exists or 0 if it does not.
static LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetType ( LSUINT64  _ui64Type) [static]

Get the type part of a type + array-unit combination.

Parameters:
_ui64TypeThe type whose type data is to be obtained.
Returns:
Returns the type part of the combination.
LSUINT64 LSE_CALL lsg::CShaderLanguageParser::GetType ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the type from a fully specified type node.

Parameters:
_ndNodeThe node from which to extract the type.
Returns:
Returns the type from the given node.
LSUINT64 LSE_CALL lsg::CShaderLanguageParser::GetTypeOnParm ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the type from a parameter declaration (LSG_N_PARMDECLARATION) node.

Parameters:
_ndNodeNode to search.
Returns:
Returns the type on the given node.
LSUINT64 LSE_CALL lsg::CShaderLanguageParser::GetTypeQualifier ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the type qualifiers from a fully specified type node.

Parameters:
_ndNodeThe node from which to extract the type qualifiers.
Returns:
Returns the type qualifiers from the given node.
LSUINT64 LSE_CALL lsg::CShaderLanguageParser::GetTypeQualifiersOnParm ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Get the type qualifiers from a parameter declaration (LSG_N_PARMDECLARATION) node.

Parameters:
_ndNodeNode to search.
Returns:
Returns the type qualifiers on the given node.
static LSVOID LSE_CALL lsg::CShaderLanguageParser::GetVectorSize ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right,
LSUINT32 &  _ui32Ret 
) [static]

Get the vector dimension from the type that is a vector. Exactly one of the types must be a vector.

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
_ui32RetNumber of scalars in the vector type.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherMatrix ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Is one type or the other a matrix?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if either type is a matrix type.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherScalar ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Is one type or the other a scalar?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if either type is a scalar type.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherStruct ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Is one type or the other a structure?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if either type is a structure type.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherVector ( LSUINT64  _ui64Left,
LSUINT64  _ui64Right 
) [static]

Is one type or the other a vector?

Parameters:
_ui64LeftLeft type.
_ui64RightRight type.
Returns:
Returns true if either type is a vector type.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsInteger ( const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA _ndNode) const

Determine if a given expression resolves to an integer value.

Parameters:
_ndNodeThe node to check.
Returns:
Returns true if the expression resolves to an integer value.
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsInteger ( LSUINT64  _ui64Type) [static]

Is the given type an integral type?

Parameters:
_ui64TypeThe type to check for being an integer.
Returns:
Returns true if the given type is an integral type that is not an array.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsToken ( const LSCHAR *  _pcText) const

Is the given string a registered token?

Parameters:
_pcTextName to check for being a token as apposed to an identifier.
Returns:
Returns true if the given string is a token name.
LSBOOL LSE_CALL lsg::CShaderLanguageParser::RegisterStructType ( const LSCHAR *  _pcText)

Register a user type. This is always a structure.

Parameters:
_pcTextThe type name.
Returns:
Returns true if there is enough memory to perform the operation.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::TotalIdentifiers ( ) const

Get the total identifiers.

Returns:
Returns the total number of identifiers.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::TotalNodes ( ) const

Get the total number of nodes.

Returns:
Returns the total number of nodes in the syntax tree.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::TotalStrings ( ) const

Get the total strings.

Returns:
Returns the total number of strings.
static LSG_NUM_CONSTANTS LSE_CALL lsg::CShaderLanguageParser::TypeToConstantType ( LSUINT64  _ui64Type) [static]

Convert a type to a numeric-constant type. Returns LSG_NC_INVALID if the type is not a basic type (arrays).

Parameters:
_ui64TypeThe type to convert.
Returns:
Returns the LSG_NUM_CONSTANTS type of the given type.

Member Data Documentation

CMap<CString, LSUINT32> lsg::CShaderLanguageParser::m_mUserTypes [protected]

Mapping between user types and their ID's. Because a user type may only be declared once, there is no need to support multiple ID's for a type name.

The lexer, needed for the line number.

Map of structures sorted by name.

Stack of scopes. We maintain at least one scope always (the global scope) during parsing of the data. After the data has been parsed, the scope stack is cleared.

The type of shader being compiled.

Unique-type counter.

CVectorPoD<LSG_IDENTIFIER, LSUINT32, 512UL> lsg::CShaderLanguageParser::m_vIdentifiers [protected]

Stack of identifiers.

CVectorPoD<LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA, LSUINT32, 512UL * 10UL> lsg::CShaderLanguageParser::m_vNodes [protected]

The stack of nodes.

CVectorPoD<LSUINT32, LSUINT32, 512UL> lsg::CShaderLanguageParser::m_vSortedTokens [protected]

Sorted list of tokens. Sorted for fast searching.

CVector<CString, LSUINT32, 512UL> lsg::CShaderLanguageParser::m_vStringPool [protected]

A pool of strings. Strings are binary and not necessarily terminated with a NULL.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator