OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::ScriptTranslator Class Referenceabstract

This class translates script AST (abstract syntax tree) into Ogre resources. More...

#include <OgreScriptTranslator.h>

+ Inheritance diagram for Ogre::ScriptTranslator:
+ Collaboration diagram for Ogre::ScriptTranslator:

Public Member Functions

void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
virtual void translate (ScriptCompiler *compiler, const AbstractNodePtr &node)=0
 This function translates the given node into Ogre resource(s). More...
 

Protected Member Functions

virtual ~ScriptTranslator ()
 
void processNode (ScriptCompiler *compiler, const AbstractNodePtr &node)
 Retrieves a new translator from the factories and uses it to process the give node. More...
 

Static Protected Member Functions

static bool getBoolean (const AbstractNodePtr &node, bool *result)
 Converts the node to a boolean and returns true if successful. More...
 
static bool getBooleans (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, uint *vals, int count)
 Converts the range of nodes to an array of uint-stored boolean values and returns true if successful. More...
 
static bool getColour (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, ColourValue *result, int maxEntries=4)
 Converts the range of nodes to a ColourValue and returns true if successful. More...
 
static bool getCompareFunction (const AbstractNodePtr &node, CompareFunction *func)
 Converts the node to a CompareFunction enum and returns true if successful. More...
 
static bool getConstantType (AbstractNodeList::const_iterator i, GpuConstantType *op)
 Converts the node to a GpuConstantType enum and returns true if successful. More...
 
static bool getDouble (const AbstractNodePtr &node, double *result)
 Converts the node to a float and returns true if successful. More...
 
static bool getDoubles (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, double *vals, int count)
 Converts the range of nodes to an array of floats and returns true if successful. More...
 
static bool getFloat (const AbstractNodePtr &node, float *result)
 Converts the node to a float and returns true if successful. More...
 
static bool getFloats (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, float *vals, int count)
 Converts the range of nodes to an array of floats and returns true if successful. More...
 
static bool getHex (const AbstractNodePtr &node, uint32 *result)
 Converts the node to a an integer (from hexadecimal) and returns true if successful. More...
 
static bool getIdString (const AbstractNodePtr &node, IdString *result)
 Converts the node to an IdString and returns true if successful. More...
 
static bool getInt (const AbstractNodePtr &node, int *result)
 Converts the node to an integer and returns true if successful. More...
 
static bool getInts (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, int *vals, int count)
 Converts the range of nodes to an array of ints and returns true if successful. More...
 
static bool getMatrix4 (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, Matrix4 *m)
 Converts the range of nodes to a Matrix4 and returns true if successful. More...
 
static
AbstractNodeList::const_iterator 
getNodeAt (const AbstractNodeList &nodes, int index)
 Retrieves the node iterator at the given index. More...
 
static bool getReal (const AbstractNodePtr &node, Real *result)
 Converts the node to a Real and returns true if successful. More...
 
static bool getSceneBlendFactor (const AbstractNodePtr &node, SceneBlendFactor *sbf)
 Converts the node to a SceneBlendFactor enum and returns true if successful. More...
 
static bool getStencilOp (const AbstractNodePtr &node, StencilOperation *op)
 Converts the node to a StencilOperation enum and returns true if successful. More...
 
static bool getString (const AbstractNodePtr &node, String *result)
 Converts the node to a string and returns true if successful. More...
 
static bool getUInt (const AbstractNodePtr &node, uint32 *result)
 Converts the node to an unsigned integer and returns true if successful. More...
 
static bool getUInts (AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, uint *vals, int count)
 Converts the range of nodes to an array of floats and returns true if successful. More...
 

Detailed Description

This class translates script AST (abstract syntax tree) into Ogre resources.

It defines a common interface for subclasses which perform the actual translation.

Definition at line 53 of file OgreScriptTranslator.h.

Constructor & Destructor Documentation

virtual Ogre::ScriptTranslator::~ScriptTranslator ( )
inlineprotectedvirtual

Definition at line 64 of file OgreScriptTranslator.h.

Member Function Documentation

static bool Ogre::ScriptTranslator::getBoolean ( const AbstractNodePtr node,
bool *  result 
)
staticprotected

Converts the node to a boolean and returns true if successful.

static bool Ogre::ScriptTranslator::getBooleans ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
uint vals,
int  count 
)
staticprotected

Converts the range of nodes to an array of uint-stored boolean values and returns true if successful.

static bool Ogre::ScriptTranslator::getColour ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
ColourValue result,
int  maxEntries = 4 
)
staticprotected

Converts the range of nodes to a ColourValue and returns true if successful.

static bool Ogre::ScriptTranslator::getCompareFunction ( const AbstractNodePtr node,
CompareFunction func 
)
staticprotected

Converts the node to a CompareFunction enum and returns true if successful.

static bool Ogre::ScriptTranslator::getConstantType ( AbstractNodeList::const_iterator  i,
GpuConstantType op 
)
staticprotected

Converts the node to a GpuConstantType enum and returns true if successful.

static bool Ogre::ScriptTranslator::getDouble ( const AbstractNodePtr node,
double *  result 
)
staticprotected

Converts the node to a float and returns true if successful.

static bool Ogre::ScriptTranslator::getDoubles ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
double *  vals,
int  count 
)
staticprotected

Converts the range of nodes to an array of floats and returns true if successful.

static bool Ogre::ScriptTranslator::getFloat ( const AbstractNodePtr node,
float *  result 
)
staticprotected

Converts the node to a float and returns true if successful.

static bool Ogre::ScriptTranslator::getFloats ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
float *  vals,
int  count 
)
staticprotected

Converts the range of nodes to an array of floats and returns true if successful.

static bool Ogre::ScriptTranslator::getHex ( const AbstractNodePtr node,
uint32 result 
)
staticprotected

Converts the node to a an integer (from hexadecimal) and returns true if successful.

static bool Ogre::ScriptTranslator::getIdString ( const AbstractNodePtr node,
IdString result 
)
staticprotected

Converts the node to an IdString and returns true if successful.

static bool Ogre::ScriptTranslator::getInt ( const AbstractNodePtr node,
int *  result 
)
staticprotected

Converts the node to an integer and returns true if successful.

static bool Ogre::ScriptTranslator::getInts ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
int *  vals,
int  count 
)
staticprotected

Converts the range of nodes to an array of ints and returns true if successful.

static bool Ogre::ScriptTranslator::getMatrix4 ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
Matrix4 m 
)
staticprotected

Converts the range of nodes to a Matrix4 and returns true if successful.

static AbstractNodeList::const_iterator Ogre::ScriptTranslator::getNodeAt ( const AbstractNodeList nodes,
int  index 
)
staticprotected

Retrieves the node iterator at the given index.

static bool Ogre::ScriptTranslator::getReal ( const AbstractNodePtr node,
Real result 
)
staticprotected

Converts the node to a Real and returns true if successful.

static bool Ogre::ScriptTranslator::getSceneBlendFactor ( const AbstractNodePtr node,
SceneBlendFactor sbf 
)
staticprotected

Converts the node to a SceneBlendFactor enum and returns true if successful.

static bool Ogre::ScriptTranslator::getStencilOp ( const AbstractNodePtr node,
StencilOperation op 
)
staticprotected

Converts the node to a StencilOperation enum and returns true if successful.

static bool Ogre::ScriptTranslator::getString ( const AbstractNodePtr node,
String result 
)
staticprotected

Converts the node to a string and returns true if successful.

static bool Ogre::ScriptTranslator::getUInt ( const AbstractNodePtr node,
uint32 result 
)
staticprotected

Converts the node to an unsigned integer and returns true if successful.

static bool Ogre::ScriptTranslator::getUInts ( AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
uint vals,
int  count 
)
staticprotected

Converts the range of nodes to an array of floats and returns true if successful.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

void Ogre::ScriptTranslator::processNode ( ScriptCompiler compiler,
const AbstractNodePtr node 
)
protected

Retrieves a new translator from the factories and uses it to process the give node.


The documentation for this class was generated from the following file: