"L. Spiro Engine"
Public Member Functions | Protected Member Functions | Protected Attributes

lsg::CPreProcContainer Class Reference

Stores all of the data parsed during the parsing of an expression for use with the preprocessor. More...

#include <LSGPreProcContainer.h>

List of all members.

Public Member Functions

LSBOOL LSE_CALL CreateIdentifier (const LSCHAR *_pcText, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateDecimal (const LSCHAR *_pcText, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateHexadecimal (const LSCHAR *_pcText, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateFloatingPoint (const LSCHAR *_pcText, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateUnaryOp (LSUINT32 _ui32Op, const YYSTYPE::LSG_NODE_DATA &_ndBase, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateMath (const YYSTYPE::LSG_NODE_DATA &_ndLeft, const YYSTYPE::LSG_NODE_DATA &_ndRight, LSUINT32 _ui32Op, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateTertiary (const YYSTYPE::LSG_NODE_DATA &_ndCond, const YYSTYPE::LSG_NODE_DATA &_ndLeft, const YYSTYPE::LSG_NODE_DATA &_ndRight, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateDefined (const YYSTYPE::LSG_NODE_DATA &_ndIdent, YYSTYPE::LSG_NODE_DATA &_ndNode)
LSBOOL LSE_CALL CreateTranslationUnit (const YYSTYPE::LSG_NODE_DATA &_ndLeft, const YYSTYPE::LSG_NODE_DATA &_ndRight, YYSTYPE::LSG_NODE_DATA &_ndNode)
const
LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA
&LSE_CALL 
GetNode (LSUINT32 _ui32Index) const
LSUINT32 LSE_CALL TotalNodes () const
const CString &LSE_CALL GetString (LSUINT32 _ui32Index) const

Protected Member Functions

LSBOOL LSE_CALL AddNode (LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA &_ndNode)
LSUINT32 LSE_CALL AddIdentifier (const LSCHAR *_pcText)

Protected Attributes

CVector< CString, LSUINT32, 32UL > m_vStringPool
CVectorPoD
< LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA,
LSUINT32, 512UL > 
m_vNodes

Detailed Description

Stores all of the data parsed during the parsing of an expression for use with the preprocessor.

Class CPreProcContainer Description: Stores all of the data parsed during the parsing of an expression for use with the preprocessor.


Member Function Documentation

LSUINT32 LSE_CALL lsg::CPreProcContainer::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::CPreProcContainer::AddNode ( LSG_PREPROC_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.
LSBOOL LSE_CALL lsg::CPreProcContainer::CreateDecimal ( const LSCHAR *  _pcText,
YYSTYPE::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::CPreProcContainer::CreateDefined ( const YYSTYPE::LSG_NODE_DATA _ndIdent,
YYSTYPE::LSG_NODE_DATA _ndNode 
)

Creates a defined() expression.

Parameters:
_ndIdentThe identifier.
_ndNodeNode to create.
Returns:
Returns true if the node was added.
LSBOOL LSE_CALL lsg::CPreProcContainer::CreateFloatingPoint ( const LSCHAR *  _pcText,
YYSTYPE::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::CPreProcContainer::CreateHexadecimal ( const LSCHAR *  _pcText,
YYSTYPE::LSG_NODE_DATA _ndNode 
)

Accepts a string representation of a hexadecimal 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::CPreProcContainer::CreateIdentifier ( const LSCHAR *  _pcText,
YYSTYPE::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::CPreProcContainer::CreateMath ( const YYSTYPE::LSG_NODE_DATA _ndLeft,
const YYSTYPE::LSG_NODE_DATA _ndRight,
LSUINT32  _ui32Op,
YYSTYPE::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::CPreProcContainer::CreateTertiary ( const YYSTYPE::LSG_NODE_DATA _ndCond,
const YYSTYPE::LSG_NODE_DATA _ndLeft,
const YYSTYPE::LSG_NODE_DATA _ndRight,
YYSTYPE::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::CPreProcContainer::CreateTranslationUnit ( const YYSTYPE::LSG_NODE_DATA _ndLeft,
const YYSTYPE::LSG_NODE_DATA _ndRight,
YYSTYPE::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::CPreProcContainer::CreateUnaryOp ( LSUINT32  _ui32Op,
const YYSTYPE::LSG_NODE_DATA _ndBase,
YYSTYPE::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.
const LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA& LSE_CALL lsg::CPreProcContainer::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.
const CString& LSE_CALL lsg::CPreProcContainer::GetString ( LSUINT32  _ui32Index) const

Get a string from the string pool.

Parameters:
_ui32IndexIndex of the string to get.
Returns:
Returns the string at the given index.
LSUINT32 LSE_CALL lsg::CPreProcContainer::TotalNodes ( ) const

Get the total number of nodes.

Returns:
Returns the total number of nodes in the syntax tree.

Member Data Documentation

CVectorPoD<LSG_PREPROC_SYNTAX_NODES::LSG_NODE_DATA, LSUINT32, 512UL> lsg::CPreProcContainer::m_vNodes [protected]

The stack of nodes.

CVector<CString, LSUINT32, 32UL> lsg::CPreProcContainer::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