Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Ogre::ScriptTranslator Class Reference

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

#include <OgreScriptTranslator.h>

Inheritance diagram for Ogre::ScriptTranslator:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual void translate (ScriptCompiler *compiler, const AbstractNodePtr &node)=0
 This function translates the given node into Ogre resource(s).
 AllocatedObject ()
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
void * operator new (size_t sz)
void * operator new (size_t sz, void *ptr)
 placement operator new
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
void * operator new[] (size_t sz)
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 *)

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.

Static Protected Member Functions

static AbstractNodeList::const_iterator getNodeAt (const AbstractNodeList &nodes, int index)
 Retrieves the node iterator at the given index.
static bool getBoolean (const AbstractNodePtr &node, bool *result)
 Converts the node to a boolean and returns true if successful.
static bool getString (const AbstractNodePtr &node, String *result)
 Converts the node to a string and returns true if successful.
static bool getReal (const AbstractNodePtr &node, Real *result)
 Converts the node to a Real and returns true if successful.
static bool getFloat (const AbstractNodePtr &node, float *result)
 Converts the node to a float and returns true if successful.
static bool getInt (const AbstractNodePtr &node, int *result)
 Converts the node to an integer and returns true if successful.
static bool getUInt (const AbstractNodePtr &node, uint32 *result)
 Converts the node to an unsigned integer and returns true if successful.
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.
static bool getSceneBlendFactor (const AbstractNodePtr &node, SceneBlendFactor *sbf)
 Converts the node to a SceneBlendFactor enum and returns true if successful.
static bool getCompareFunction (const AbstractNodePtr &node, CompareFunction *func)
 Converts the node to a CompareFunction enum and returns true if successful.
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.
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.
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.
static bool getStencilOp (const AbstractNodePtr &node, StencilOperation *op)
 Converts the node to a StencilOperation enum and returns true if successful.

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 42 of file OgreScriptTranslator.h.


Constructor & Destructor Documentation

virtual Ogre::ScriptTranslator::~ScriptTranslator  )  [protected, virtual]
 

Definition at line 53 of file OgreScriptTranslator.h.


Member Function Documentation

Ogre::AllocatedObject< ScriptingAllocPolicy >::AllocatedObject  )  [explicit, inherited]
 

Definition at line 55 of file OgreMemoryAllocatedObject.h.

static bool Ogre::ScriptTranslator::getBoolean const AbstractNodePtr node,
bool *  result
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getColour AbstractNodeList::const_iterator  i,
AbstractNodeList::const_iterator  end,
ColourValue result,
int  maxEntries = 4
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getCompareFunction const AbstractNodePtr node,
CompareFunction func
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getFloat const AbstractNodePtr node,
float *  result
[static, protected]
 

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
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getInt const AbstractNodePtr node,
int *  result
[static, protected]
 

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
[static, protected]
 

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
[static, protected]
 

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
[static, protected]
 

Retrieves the node iterator at the given index.

static bool Ogre::ScriptTranslator::getReal const AbstractNodePtr node,
Real result
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getSceneBlendFactor const AbstractNodePtr node,
SceneBlendFactor sbf
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getStencilOp const AbstractNodePtr node,
StencilOperation op
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getString const AbstractNodePtr node,
String result
[static, protected]
 

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

static bool Ogre::ScriptTranslator::getUInt const AbstractNodePtr node,
uint32 result
[static, protected]
 

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

void Ogre::AllocatedObject< ScriptingAllocPolicy >::operator delete void *  ptr,
const char *  ,
int  ,
const char * 
[inherited]
 

Definition at line 101 of file OgreMemoryAllocatedObject.h.

void Ogre::AllocatedObject< ScriptingAllocPolicy >::operator delete void *  ptr,
void * 
[inherited]
 

Definition at line 95 of file OgreMemoryAllocatedObject.h.

void Ogre::AllocatedObject< ScriptingAllocPolicy >::operator delete void *  ptr  )  [inherited]
 

Definition at line 89 of file OgreMemoryAllocatedObject.h.

void Ogre::AllocatedObject< ScriptingAllocPolicy >::operator delete[] void *  ptr,
const char *  ,
int  ,
const char * 
[inherited]
 

Definition at line 112 of file OgreMemoryAllocatedObject.h.

void Ogre::AllocatedObject< ScriptingAllocPolicy >::operator delete[] void *  ptr  )  [inherited]
 

Definition at line 106 of file OgreMemoryAllocatedObject.h.

void* Ogre::AllocatedObject< ScriptingAllocPolicy >::operator new size_t  sz,
void *  ptr
[inherited]
 

placement operator new

Definition at line 73 of file OgreMemoryAllocatedObject.h.

void* Ogre::AllocatedObject< ScriptingAllocPolicy >::operator new size_t  sz  )  [inherited]
 

Definition at line 67 of file OgreMemoryAllocatedObject.h.

void* Ogre::AllocatedObject< ScriptingAllocPolicy >::operator new size_t  sz,
const char *  file,
int  line,
const char *  func
[inherited]
 

operator new, with debug line info

Definition at line 62 of file OgreMemoryAllocatedObject.h.

void* Ogre::AllocatedObject< ScriptingAllocPolicy >::operator new[] size_t  sz  )  [inherited]
 

Definition at line 84 of file OgreMemoryAllocatedObject.h.

void* Ogre::AllocatedObject< ScriptingAllocPolicy >::operator new[] size_t  sz,
const char *  file,
int  line,
const char *  func
[inherited]
 

array operator new, with debug line info

Definition at line 79 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.

virtual void Ogre::ScriptTranslator::translate ScriptCompiler compiler,
const AbstractNodePtr node
[pure virtual]
 

This function translates the given node into Ogre resource(s).

Parameters:
compiler The compiler invoking this translator
node The current AST node to be translated

Implemented in Ogre::MaterialTranslator, Ogre::TechniqueTranslator, Ogre::PassTranslator, Ogre::TextureUnitTranslator, Ogre::TextureSourceTranslator, Ogre::GpuProgramTranslator, Ogre::ParticleSystemTranslator, Ogre::ParticleEmitterTranslator, Ogre::ParticleAffectorTranslator, Ogre::CompositorTranslator, Ogre::CompositionTechniqueTranslator, Ogre::CompositionTargetPassTranslator, Ogre::CompositionPassTranslator, Ogre::CompositionPassClearTranslator, and Ogre::CompositionPassStencilTranslator.


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

Copyright © 2008 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:53:50 2009