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

lsg::CShaderTranslationProcessorBase Class Reference

Provides a set of base callbacks that other platform-specific classes can use to process the syntax tree differently. More...

#include <LSGShaderTranslationProcessorBase.h>

Inheritance diagram for lsg::CShaderTranslationProcessorBase:
lsg::CDirectX11ShaderTranslator

List of all members.

Classes

struct  LSG_ATTRIBUTE
struct  LSG_NODE_CALLBACK
struct  LSG_NODE_TYPE
struct  LSG_STACK_OBJ
struct  LSG_UNIFORM
struct  LSG_UNIFORM_SEMANTIC

Public Types

enum  LSG_ERROR_CODES {
  LSG_EC_SUCCESS, LSG_EC_INVALIDTREE, LSG_EC_OUTOFMEMORY, LSG_EC_PROCESSINGERROR,
  LSG_EC_NOMAIN, LSG_EC_MAINOVERLOADED
}
enum  LSG_PROCESSING_DIRECTIVE { LSG_PD_CONTINUE, LSG_PD_SKIP_SUB_NODES, LSG_PD_ERROR }
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_STACK_OBJ
LPLSG_STACK_OBJ
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_STACK_OBJ 
LPCLSG_STACK_OBJ
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_UNIFORM_SEMANTIC
LPLSG_UNIFORM_SEMANTIC
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_UNIFORM_SEMANTIC 
LPCLSG_UNIFORM_SEMANTIC
typedef CVector
< LSG_UNIFORM_SEMANTIC
LSG_UNIFORM_SEMANTIC_LIST
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_UNIFORM
LPLSG_UNIFORM
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_UNIFORM 
LPCLSG_UNIFORM
typedef CVector< LSG_UNIFORMLSG_UNIFORM_LIST
typedef CVector< LSG_UNIFORM > * LPLSG_UNIFORM_LIST
typedef CVector< LSG_UNIFORM >
*const 
LPCLSG_UNIFORM_LIST
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_ATTRIBUTE
LPLSG_ATTRIBUTE
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_ATTRIBUTE 
LPCLSG_ATTRIBUTE
typedef CVector< LSG_ATTRIBUTELSG_ATTRIBUTE_LIST
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_NODE_TYPE
LPLSG_NODE_TYPE
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_NODE_TYPE 
LPCLSG_NODE_TYPE
typedef CVectorPoD< LSG_NODE_TYPELSG_NODE_TYPE_LIST
typedef CVectorPoD
< LSG_NODE_TYPE > * 
LPLSG_NODE_TYPE_LIST
typedef CVectorPoD
< LSG_NODE_TYPE > *const 
LPCLSG_NODE_TYPE_LIST

Public Member Functions

LSG_ERROR_CODES LSE_CALL ProcessSyntaxTree (CShaderLanguageParser &_slpContainer, CString &_sResult, CString &_sError)
LSBOOL LSE_CALL CopyGlobalSemantics (LSG_UNIFORM_SEMANTIC_LIST &_uslOut) const
LSBOOL LSE_CALL CopyGlobalUniforms (LSG_UNIFORM_LIST &_ulOut) const
LSBOOL LSE_CALL CopyAttributes (LSG_ATTRIBUTE_LIST &_aOut) const
LSBOOL LSE_CALL GetNodeType (LSUINT32 _ui32NodeIndex, LSG_NODE_TYPE_LIST &_ntlRet) const

Protected Types

typedef CVector< LSG_STACK_OBJ,
LSUINT32 > 
LSG_NODE_STACK
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_NODE_CALLBACK
LPLSG_NODE_CALLBACK
typedef struct
lsg::CShaderTranslationProcessorBase::LSG_NODE_CALLBACK 
LPCLSG_NODE_CALLBACK

Protected Member Functions

virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
DefaultNodeHandler (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
DefaultNodePostHandler (LSG_NODE_CALLBACK &_ncData)
virtual LSBOOL LSE_CALL PostShaderString (CString &_sShader, CString &_sError)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleExternalDeclarationList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleDiscard (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleReturn (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleBreak (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleContinue (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleFor (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleDoWhile (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleWhile (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleForInit (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleIfElse (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleFunctionDefinition (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleFunctionDeclaration (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleParamaterDeclarationList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleParamaterDeclaration (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleParamaterDeclarator (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleStruct (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleStructDeclarationList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleStructDeclaration (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleStructDeclaratorList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleStructDeclarator (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleBlankStatement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleNewScopeStatement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleStatementList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleInitList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleInitListWrap (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleSingleDeclaration (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleSemantic (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleFullySpecifiedType (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleTypeSpecifierNoPrecision (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleDeclarationStatement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleExpressionStatement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleConstructor (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleFieldSelect (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleFunctionCall (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleArgList (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleIntrinsic (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleComma (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleAssignment (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleTertiary (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleMath (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleCast (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleUnary (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandlePrefixDecrement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandlePrefixIncrement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandlePostfixDecrement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandlePostfixIncrement (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleArrayAccess (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleIdentifier (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleBoolean (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleNumeric (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
HandleString (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
RegisterVariableWithCurrentScope (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
RegisterFunctionWithCurrentScope (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
RegisterStructWithCurrentScope (LSG_NODE_CALLBACK &_ncData)
virtual
LSG_PROCESSING_DIRECTIVE
LSE_CALL 
RegisterParmsWithNewScope (LSG_NODE_CALLBACK &_ncData)
virtual LSBOOL LSE_CALL DecodeTypeQualifier (LSUINT64 _ui64Qualifier, CString &_sString)
virtual LSBOOL LSE_CALL DecodeType (LSUINT64 _ui64Type, CString &_sString)
LSVOID LSE_CALL PrintError (CString &_sError, const LSCHAR *_pcError, const LSG_NODE_CALLBACK &_ncData) const
LSBOOL LSE_CALL HasParentOfType (const LSG_NODE_CALLBACK &_ncData, LSG_NODE _nType) const
const LSG_STACK_OBJ *LSE_CALL GetParentOfType (const LSG_NODE_CALLBACK &_ncData, LSG_NODE _nType) const

Static Protected Member Functions

static LSBOOL LSE_CALL PushNode (LSG_NODE_STACK &_nsStack, LSUINT32 _ui32Index, LSUINT32 _ui32ParentIndex, LSUINT32 _ui32Data=0UL, const LSCHAR *_pcPostFix=NULL, const LSCHAR *_pcPreFix=NULL)

Protected Attributes

CShaderScopeStack m_sssScopes
LSBOOL m_bHaveMain
LSBOOL m_bDefiningMain
CVectorPoD< LSUINT32, LSUINT32 > m_vMainParms
CVectorPoD< LSUINT32, LSUINT32 > m_vLastParms
LSBOOL m_bMultiPixelOutputs
CShaderLanguageParserm_pslpContainer
LSG_UNIFORM_SEMANTIC_LIST m_uslGlobalSemantics
LSG_UNIFORM_LIST m_ulGlobalUniforms
LSG_ATTRIBUTE_LIST m_alAttributes

Detailed Description

Provides a set of base callbacks that other platform-specific classes can use to process the syntax tree differently.

Class CShaderTranslationProcessorBase Description: After a shader is syntactically parsed and a syntax tree generated, this class runs over the tree and allows custom actions to be taken at each node type. For translation to HLSL and GLSL, primarily major nodes are visited and refactored. For example, function declarations and member declarations.


Member Typedef Documentation

An attribute.

Node data for callback routines.

Type information on a node. Includes one possible type for a node and whether that type is explicitly declared or just implied.

For use with the explicit stack during parsing.

A global uniform variable.

A sematic global uniform found while processing the file. We keep a list of these and update them automatically so that the user does not have to.

An array of attributes.

The explicit stack.

An array of node types.

An array of uniforms.

An array of global semantics.


Member Enumeration Documentation

Error codes.

Enumerator:
LSG_EC_SUCCESS 

No problem.

LSG_EC_INVALIDTREE 

The syntax tree is invalid.

LSG_EC_OUTOFMEMORY 

Out of memory.

LSG_EC_PROCESSINGERROR 

General error.

LSG_EC_NOMAIN 

No Main() function found in shader.

LSG_EC_MAINOVERLOADED 

The Main() function has been overloaded.

Processing directives.

Enumerator:
LSG_PD_CONTINUE 

Continue processing the sub-nodes of the current node.

LSG_PD_SKIP_SUB_NODES 

Skip over the sub-nodes of the current node.

LSG_PD_ERROR 

Error out.


Member Function Documentation

LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::CopyAttributes ( LSG_ATTRIBUTE_LIST _aOut) const

Copy the attributes to the given output.

Parameters:
_aOutThe destination to which to copy the attributes.
Returns:
Returns true if all attributes were copied successfully.
LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::CopyGlobalSemantics ( LSG_UNIFORM_SEMANTIC_LIST _uslOut) const

Copies the referenced global semantics to the given output.

Parameters:
_uslOutThe destination to which to copy the global semantics.
Returns:
Returns true if all semantics were copied successfully.
LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::CopyGlobalUniforms ( LSG_UNIFORM_LIST _ulOut) const

Copies the global uniforms to the given output.

Parameters:
_ulOutThe destination to which to copy the global semantics.
Returns:
Returns true if all uniforms were copied successfully.
virtual LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::DecodeType ( LSUINT64  _ui64Type,
CString &  _sString 
) [protected, virtual]

Decode a type.

Parameters:
_ui64TypeThe type information.
_sStringThe string to which to print the data.
Returns:
Returns true if there was enough memory to perform the operation.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::DecodeTypeQualifier ( LSUINT64  _ui64Qualifier,
CString &  _sString 
) [protected, virtual]

Decode a type qualifier to a given string.

Parameters:
_ui64QualifierThe type qualifier.
_sStringThe string to which to print the data.
Returns:
Returns true if there was enough memory to perform the operation.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::DefaultNodeHandler ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Default node handler. Simply tells the processor to go into each node.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns LSG_PD_CONTINUE.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::DefaultNodePostHandler ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Default post-processing node handler. Called after processing a node and its children.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns LSG_PD_CONTINUE.
LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::GetNodeType ( LSUINT32  _ui32NodeIndex,
LSG_NODE_TYPE_LIST _ntlRet 
) const

Get all possible types of any node. Returns more than one type when the given node can be implicitly cast to multiple types, or when an identifier is declared within the current scope in multiple forms.

Parameters:
_ui32NodeIndexNode index whose type information is to be obtained.
_ntlRetTermination node, if the node type
Returns:
Returns true if type information could be obtained from the node.
const LSG_STACK_OBJ* LSE_CALL lsg::CShaderTranslationProcessorBase::GetParentOfType ( const LSG_NODE_CALLBACK _ncData,
LSG_NODE  _nType 
) const [protected]

Gets a parent node of a given type. Returns the first node found matching the given type.

Parameters:
_ncDataThe node whose parent of the given type is to be found.
_nTypeThe type to check against all parents of the given node for a match.
Returns:
Returns a pointer to the parent node of the given type, if found, or NULL otherwise.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleArgList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_ARGLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleArrayAccess ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_ARRAYACCESS.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleAssignment ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_ASSIGNMENT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleBlankStatement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_BLANKSTATEMENT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleBoolean ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_BOOLEAN.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleBreak ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_BREAK.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleCast ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_CAST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleComma ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_COMMA.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleConstructor ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_CONSTRUCTOR.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleContinue ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_CONTINUE.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleDeclarationStatement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_DECLARATIONSTATEMENT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleDiscard ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_DISCARD.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleDoWhile ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_DOWHILE.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleExpressionStatement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_EXPRESSIONSTATEMENT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleExternalDeclarationList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_EXTERNALDECLARATIONLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleFieldSelect ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FIELDSELECT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleFor ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FOR.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleForInit ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FORINIT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleFullySpecifiedType ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FULLYSPECIFIEDTYPE.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleFunctionCall ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FUNCTIONCALL.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleFunctionDeclaration ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FUNCDECL.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleFunctionDefinition ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_FUNCDEFINITION.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleIdentifier ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_IDENTIFIER.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleIfElse ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_SELECTION.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleInitList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_INITLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleInitListWrap ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_INITLISTWRAP.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleIntrinsic ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_INTRINSIC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleMath ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_MATH.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleNewScopeStatement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_NEWSCOPESTATEMENT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleNumeric ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_NUMERICCONSTANT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleParamaterDeclaration ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_PARMDECLARATION.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleParamaterDeclarationList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_PARMDECLARATIONLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleParamaterDeclarator ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_PARMDECLARATOR.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandlePostfixDecrement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_POSTFIXDEC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandlePostfixIncrement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_POSTFIXINC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandlePrefixDecrement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_PREFIXDEC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandlePrefixIncrement ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_PREFIXINC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleReturn ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_RETURN.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleSemantic ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_SEMANTIC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleSingleDeclaration ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_SINGLEDECL.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.

Reimplemented in lsg::CDirectX11ShaderTranslator.

virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleStatementList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STATEMENTLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleString ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STRINGCONSTANT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleStruct ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STRUCT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleStructDeclaration ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STRUCTDECLARATION.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleStructDeclarationList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STRUCTDECLARATIONLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleStructDeclarator ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STRUCTDECLARATOR.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleStructDeclaratorList ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_STRUCTDECLARATORLIST.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleTertiary ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_TERTIARY.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleTypeSpecifierNoPrecision ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_TYPESPECIFIERNOPREC.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleUnary ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_UNARY.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::HandleWhile ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Handle nodes of type LSG_N_WHILE.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should go into the sub-nodes of the node or not.
LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::HasParentOfType ( const LSG_NODE_CALLBACK _ncData,
LSG_NODE  _nType 
) const [protected]

Determines if the given noce is a child node of a given type. That is, if any parent nodes to the given node have the given type.

Parameters:
_ncDataThe node.
_nTypeThe type to check against all parents of the given node for a match.
Returns:
If no parents of the given node have the given type, false is returned, otherwise true is returned.
virtual LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::PostShaderString ( CString &  _sShader,
CString &  _sError 
) [protected, virtual]

Modify the final shader string after it has been completed. Override to modify it.

Parameters:
_sShaderThe final string, modifiable in-place.
_sErrorThe error string to be filled if there is an error modifying the shader text.
Returns:
Returns false if an error occurred.

Reimplemented in lsg::CDirectX11ShaderTranslator.

LSVOID LSE_CALL lsg::CShaderTranslationProcessorBase::PrintError ( CString &  _sError,
const LSCHAR *  _pcError,
const LSG_NODE_CALLBACK _ncData 
) const [protected]

Print an error which includes line information.

Parameters:
_sErrorThe error string to which to print the error.
_pcErrorThe error to print.
_ncDataData required for adding line and file to the error report.
LSG_ERROR_CODES LSE_CALL lsg::CShaderTranslationProcessorBase::ProcessSyntaxTree ( CShaderLanguageParser _slpContainer,
CString &  _sResult,
CString &  _sError 
)

Process a syntax tree. Calls virtual functions at key nodes which are overridden differently depending on the target platform.

Parameters:
_slpContainerContainer of the syntax tree to process.
_sResultHolds the result of processing the syntax tree. This should be the shader translated into HLSH or GLSL etc.
_sErrorReturned error string.
Returns:
Returns An error code.
static LSBOOL LSE_CALL lsg::CShaderTranslationProcessorBase::PushNode ( LSG_NODE_STACK _nsStack,
LSUINT32  _ui32Index,
LSUINT32  _ui32ParentIndex,
LSUINT32  _ui32Data = 0UL,
const LSCHAR *  _pcPostFix = NULL,
const LSCHAR *  _pcPreFix = NULL 
) [static, protected]

Push a node onto the explicit stack.

Parameters:
_nsStackStack onto which to push the node.
_ui32IndexIndex of the node to push.
_ui32ParentIndexIndex of the parent node.
_ui32DataOptional data to associated with the node.
_pcPostFixA postfix string to add to the result when this node text is added.
_pcPreFixA prefix string to add to the result when this node text is added.
Returns:
Returns true if there was enough memory to push the node, which is always the case.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::RegisterFunctionWithCurrentScope ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Register a function with the current scope. Node must be of type LSG_N_FUNCDECL.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should halt or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::RegisterParmsWithNewScope ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Register the last parameters with a new scope. Pushes a new scope and registers the parameters in m_vLastParms.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should halt or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::RegisterStructWithCurrentScope ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Register a structure with the current scope. Node must be of type LSG_N_STRUCT.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should halt or not.
virtual LSG_PROCESSING_DIRECTIVE LSE_CALL lsg::CShaderTranslationProcessorBase::RegisterVariableWithCurrentScope ( LSG_NODE_CALLBACK _ncData) [protected, virtual]

Register a variable with the current scope. Node must be of type LSG_N_SINGLEDECL.

Parameters:
_ncDataAll data needed for the parsing.
Returns:
Returns a LSG_PROCESSING_DIRECTIVE enumerated value indicating whether the processor should halt or not.

Member Data Documentation

Main-function attributes.

Are we declaring Main() now?

Do we have a Main()?

Do we output multiple colors? Related to multiple render targets.

The container we are using while parsing.

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.

Global uniforms found while parsing the file.

Global semantic uniforms found while parsing the file.

CVectorPoD<LSUINT32, LSUINT32> lsg::CShaderTranslationProcessorBase::m_vLastParms [protected]

The last function's parameters.

CVectorPoD<LSUINT32, LSUINT32> lsg::CShaderTranslationProcessorBase::m_vMainParms [protected]

The Main() parameters.


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