"L. Spiro Engine"
|
Manages all information related to a parsed shader file. More...
#include <LSGShaderLanguageParser.h>
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.
typedef struct lsg::CShaderLanguageParser::LSG_ENGINE_MACRO * lsg::CShaderLanguageParser::LPLSG_ENGINE_MACRO |
An engine-defined macro.
typedef struct lsg::CShaderLanguageParser::LSG_IDENTIFIER * lsg::CShaderLanguageParser::LPLSG_IDENTIFIER |
Identifier data.
A scalar type.
A structure.
typedef struct lsg::CShaderLanguageParser::LSG_STRUCT_DECLARATOR * lsg::CShaderLanguageParser::LPLSG_STRUCT_DECLARATOR |
Structure declarator.
typedef struct lsg::CShaderLanguageParser::LSG_STRUCT_MEMBER * lsg::CShaderLanguageParser::LPLSG_STRUCT_MEMBER |
A structure member.
typedef CMap<CString, LSG_STRUCT> lsg::CShaderLanguageParser::LSG_STRUCT_ARRAY |
An array of structures.
Shader types.
Structure base ID.
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.
_pcText | The string name of the 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.
_ndNode | The node to add to the stack. |
static CString LSE_CALL lsg::CShaderLanguageParser::BasicTypeToString | ( | LSUINT64 | _ui64Type | ) | [static] |
Get the name of a basic type.
_ui64Type | The type whose name is to be obtained. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreMatrices | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Are both types matrices?
_ui64Left | Left type. |
_ui64Right | Right type. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreScalars | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Are both types scalars?
_ui64Left | Left type. |
_ui64Right | Right type. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreStructs | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Are both types structures?
_ui64Left | Left type. |
_ui64Right | Right type. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::BothAreVectors | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Are both types vectors?
_ui64Left | Left type. |
_ui64Right | Right type. |
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.
_sScalar | The value to cast. |
_ui64OriginalType | The type of value in _sScalar. |
_ui64NewType | The type to which to cast the given scalar value. |
_bRes | If set to true, the function succeeded in converting the values. |
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.
_ui64Type | Type specifier. |
_ui32Array0 | Array value 1. |
_ui32Array1 | Array value 2. Must be ~0UL if not used. |
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.
_ncType | The type to convert. |
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.
_ui32ArgListIndex | Index of the argument list whose nodes are to be counted. |
_ui32MaxArgs | Maximum number of arguments that can be stored in _pui32Nodes. |
_pui32Nodes | Filled with the arguments in reverse order upon return. |
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.
_ui32ArgListIndex | Index of the argument list whose nodes are to be counted. |
_pvRet | If not NULL, filled with the arguments in reverse order upon return. |
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.
_ui32MemberListIndex | Index of the structure declaration list whose nodes are to be counted. |
_pvRet | If not NULL, filled with the arguments in reverse order upon return. |
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.
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ndNode | Node to create. |
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.
_ndBase | Base part of the expression. |
_ndIndex | Array index part of the expression. |
_ndNode | Node to create. |
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.
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ui32Op | The operator. |
_ndNode | Node to create. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateBlankStatement | ( | LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA & | _ndNode | ) |
Creates an empty statement.
_ndNode | Node to create. |
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.
_bValue | The boolean value of the node. |
_ndNode | Node to create based off the string constant. |
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.
_ui64Type | The type to which to cast the expression. |
_ndBase | The base expression. |
_ndNode | Node to create. |
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.
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ndNode | Node to create. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateConstructor | ( | LSUINT64 | _ui64Type, |
LSUINT32 | _ui32Args, | ||
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA & | _ndNode | ||
) |
Create a constructor node.
_ui64Type | The type ID, including implicit arrays. |
_ui32Args | Index of the argument-list node if any. |
_ndNode | Node to create. |
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.
_pcText | String constant containing the numeric. |
_ndNode | Node to create based off the string constant. |
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.
_ndDecl | The declaration node. |
_ndNode | Node to create. |
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.
_ndExp | The conditional expression. |
_ndBody | The body of the iterator. |
_ndNode | Node to create. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateExpressionStatement | ( | LSUINT32 | _ui32Index, |
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA & | _ndNode | ||
) |
Creates an expression statement.
_ui32Index | Index of the expression or ~0UL |
_ndNode | Node to create. |
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.
param | _ndLeft Left operand. |
_ndRight | Right operand. |
_ndNode | Node to create. |
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.
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ndNode | Node to create. |
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.
_pcText | String constant containing the numeric. |
_ndNode | Node to create based off the string constant. |
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.
_ndExp | The initializer node. |
_ndNode | Node to create. |
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.
_ndInitExp | The initializer expression. |
_ndExp | The conditional expression. |
_ui32ItIndex | The iteartion expression index, of any. |
_ndBody | The body of the iterator. |
_ndNode | Node to create. |
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".
_ui64Qualifiers | The type qualifiers. |
_ndSpec | Type specifier. |
_ndNode | Node to create. |
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.
_ndFunction | The left operand. |
_ui32ArgList | The index of the optional argument list. |
_ndNode | Node to create. |
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.
_ndType | Type information. |
_ndName | Function name. |
_ui32Parms | Optional parameters. |
_ndNode | Node to create. |
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.
_ndHeader | Function header and parameters. |
_ndBody | Function body. |
_ndNode | Node to create. |
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).
_pcText | The string name of the identifier. |
_ndNode | Node to create based off the string constant. |
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.
_ndLeft | Left operand. |
_ndRight | Right operand. |
_ndNode | Node to create. |
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 {}.
_ndList | The initialier list. |
_ndNode | Node to create. |
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.
_ui32Intrinsic | The intrinsic to create. |
_ndExp | The parameters for the intrinsic function. |
_ndNode | Node to create. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateJump | ( | LSG_NODE | _nType, |
LSUINT32 | _ui32NodeIndex, | ||
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA & | _ndNode | ||
) |
Creates a jump node.
_nType | The jump node type. |
_ui32NodeIndex | Index of the associated node, if there is one. |
_ndNode | Node to create. |
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.
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ui32Op | The operand. |
_ndNode | Node to create. |
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.
_ndStatement | The statement with the increased scope. |
_ndNode | Node to create. |
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.
_ui64TypeInfo | Full type-qualifier information. |
_ndDecl | Declaration node. |
_ndNode | Node to create. |
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.
_ndLeft | Left operand. |
_ndRight | Right operand. |
_ndNode | Node to create. |
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.
_ndType | The type information. |
_ndName | Parameter name. |
_ui32ArrayNodeIndex | Index of the node associated with the array part of the declarator if any. |
_ui32SemanticNodeIndex | Index of the node associated with the semantic part of the declarator if any. |
_ndNode | Node to create. |
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.
_ndOp | The left operand. |
_nType | Type of operation. |
_ndNode | Node to create. |
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.
_ndExp | The expression to evaluate. |
_ndBody | The statement body. |
_ui32ElseBody | The index of the else body statement if any. |
_ndNode | Node to create. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::CreateSemantic | ( | const LSCHAR * | _pcText, |
LSUINT32 | _ui32Type, | ||
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA & | _ndNode | ||
) |
Creates a semantic.
_pcText | The semantic text. |
_ui32Type | The semantic type. |
_ndNode | Node to create. |
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 }".
_ui32Name | Name of the variable to create. |
_ndTypeNode | Fully specified type data. |
_ui32ConstNodeIndex | Index of the constant-expression node or ~0UL if there is none. |
_ui32SemanticNodeIndex | Index of the semantic node or ~0UL if there is none. |
_ui32InitializerNodeIndex | Index of the initializer node or ~0UL if there is none. |
_ndNode | Node to create. |
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.
_ndLeft | Left operand. |
_ndRight | Right operand. |
_ndNode | Node to create. |
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.
_pcText | The string from the code to convert and store. |
_bHasQuotes | If true, the first and last characters are assumed to be quotation marks and not part of the string itself. |
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.
_ui32IdentifierIndex | Index of the node representing the name of the structure, if any. ~0UL if the structure is nameless. |
_ndDecl | The structure members. |
_ndNode | Node to create. |
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.
_ui64Qualifiers | The qualifiers. |
_ndType | The type data. |
_ndDecl | The declarator node, always of type LSG_N_STRUCTDECLARATORLIST. |
_ndNode | Node to create. |
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.
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ndNode | Node to create. |
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.
_ndName | Identifier node representing the name of the member. |
_ui32ArrayNodeIndex | Index of the node representing the array constant or ~0UL. |
_ndNode | Node to create. |
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.
_ndLeft | Left operand. |
_ndRight | Right operand. |
_ndNode | Node to create. |
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.
_ndCond | The conditional operand. |
_ndLeft | The left operand. |
_ndRight | The right operand. |
_ndNode | Node to create. |
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.
_ui64Qualifiers | The type qualifiers. |
_ndNode | Node to create. |
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.
_ui32Op | The operator. |
_ndBase | The base expression modified by the operator. |
_ndNode | Node to create. |
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.
_ndExp | The conditional expression. |
_ndBody | The body of the iterator. |
_ndNode | Node to create. |
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::FindIdentifier | ( | const LSCHAR * | _pcName | ) | const |
Find an identifier by name.
_pcName | Name of the identifier to find. |
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.
_pcName | Name of the token to find. |
_ui32Index | Holds the returned index. |
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.
_ndNode | Node to search. |
static LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetArrayUnit | ( | LSUINT64 | _ui64Type, |
LSUINT32 | _ui32Unit | ||
) | [static] |
Gets the length of an array unit of a type.
_ui64Type | The type whose array unit is to be obtained. |
_ui32Unit | The array unit to be obtained. |
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.
_ncLeft | The left type. |
_ncRight | The right type. |
const LSG_IDENTIFIER& LSE_CALL lsg::CShaderLanguageParser::GetIdentifier | ( | LSUINT32 | _ui32Index | ) | const |
Get an identifier by index.
_ui32Index | Index of the identifier to get. |
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.
_ui64Left | Left type. |
_ui64Right | Right type. |
_ui32Columns | Number of columns. |
_ui32Rows | Number 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.
_ndNode | The node from which to extract the name. |
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.
_ndNode | The node from which to extract the name index. |
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.
_ndNode | Node to search. |
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.
_ndNode | Node to search. |
const LSG_SHADER_SYNTAX_NODES::LSG_NODE_DATA& LSE_CALL lsg::CShaderLanguageParser::GetNode | ( | LSUINT32 | _ui32Index | ) | const |
Get a node for read-only.
_ui32Index | Index of the node to get. |
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.
_ndNode | The node to test. |
_sValue | The value of the node, which should be reinterpreted based on 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.
_ndNode | Node to search. |
LSG_SHADER_TYPES LSE_CALL lsg::CShaderLanguageParser::GetShaderType | ( | ) | const |
Get 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.
_ui64Type | The type whose size is to be obtained. |
const CString& LSE_CALL lsg::CShaderLanguageParser::GetString | ( | LSUINT32 | _ui32Index | ) | const |
Get a string by index.
_ui32Index | Index of the string to get. |
CString LSE_CALL lsg::CShaderLanguageParser::GetStructById | ( | LSUINT32 | _ui32Id | ) | const |
Get a structure name by its type ID.
_ui32Id | ID of the user-defined structure to get. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::GetStructDeclarators | ( | LSUINT32 | _ui32Index, |
CVectorPoD< LSG_STRUCT_DECLARATOR > & | _vRet | ||
) | const |
Get the declarators on a structure declaration.
_ui32Index | Index of the structure declaration. |
_vRet | Returned array of structure declarators. |
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.
_pcText | The type name. |
static LSUINT32 LSE_CALL lsg::CShaderLanguageParser::GetType | ( | LSUINT64 | _ui64Type | ) | [static] |
Get the type part of a type + array-unit combination.
_ui64Type | The type whose type data is to be obtained. |
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.
_ndNode | The node from which to extract the type. |
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.
_ndNode | Node to search. |
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.
_ndNode | The node from which to extract the type qualifiers. |
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.
_ndNode | Node to search. |
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.
_ui64Left | Left type. |
_ui64Right | Right type. |
_ui32Ret | Number 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?
_ui64Left | Left type. |
_ui64Right | Right type. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherScalar | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Is one type or the other a scalar?
_ui64Left | Left type. |
_ui64Right | Right type. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherStruct | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Is one type or the other a structure?
_ui64Left | Left type. |
_ui64Right | Right type. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsEitherVector | ( | LSUINT64 | _ui64Left, |
LSUINT64 | _ui64Right | ||
) | [static] |
Is one type or the other a vector?
_ui64Left | Left type. |
_ui64Right | Right 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.
_ndNode | The node to check. |
static LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsInteger | ( | LSUINT64 | _ui64Type | ) | [static] |
Is the given type an integral type?
_ui64Type | The type to check for being an integer. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::IsToken | ( | const LSCHAR * | _pcText | ) | const |
Is the given string a registered token?
_pcText | Name to check for being a token as apposed to an identifier. |
LSBOOL LSE_CALL lsg::CShaderLanguageParser::RegisterStructType | ( | const LSCHAR * | _pcText | ) |
Register a user type. This is always a structure.
_pcText | The type name. |
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::TotalIdentifiers | ( | ) | const |
Get the total identifiers.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::TotalNodes | ( | ) | const |
Get the total number of nodes.
LSUINT32 LSE_CALL lsg::CShaderLanguageParser::TotalStrings | ( | ) | const |
Get the total 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).
_ui64Type | The type to convert. |
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.
CShaderLexer* lsg::CShaderLanguageParser::m_plLexer [protected] |
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.
LSUINT32 lsg::CShaderLanguageParser::m_ui32TypeId [protected] |
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.