OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ogre::ParticleScriptCompiler Class Reference

#include <OgreParticleScriptCompiler.h>

+ Inheritance diagram for Ogre::ParticleScriptCompiler:
+ Collaboration diagram for Ogre::ParticleScriptCompiler:

Public Types

enum  {
  ID_ON = 1, ID_OFF = 2, ID_TRUE = 1, ID_FALSE = 2,
  ID_YES = 1, ID_NO = 2
}
 
enum  {
  CE_STRINGEXPECTED, CE_NUMBEREXPECTED, CE_FEWERPARAMETERSEXPECTED, CE_VARIABLEEXPECTED,
  CE_UNDEFINEDVARIABLE, CE_OBJECTNAMEEXPECTED, CE_OBJECTALLOCATIONERROR, CE_INVALIDPARAMETERS,
  CE_DUPLICATEOVERRIDE, CE_UNEXPECTEDTOKEN, CE_OBJECTBASENOTFOUND, CE_UNSUPPORTEDBYRENDERSYSTEM,
  CE_REFERENCETOANONEXISTINGOBJECT
}
 
typedef list< ErrorPtr >::type ErrorList
 
typedef SharedPtr< ErrorErrorPtr
 
typedef map< String, uint32 >::type IdMap
 

Public Member Functions

 ParticleScriptCompiler ()
 
bool _compile (AbstractNodeListPtr nodes, const String &group, bool doImports=true, bool doObjects=true, bool doVariables=true)
 Compiles the given abstract syntax tree. More...
 
bool _fireEvent (ScriptCompilerEvent *evt, void *retval)
 Internal method for firing the handleEvent method. More...
 
AbstractNodeListPtr _generateAST (const String &str, const String &source, bool doImports=false, bool doObjects=false, bool doVariables=false)
 Generates the AST from the given string script. More...
 
void addError (uint32 code, const String &file, int line, const String &msg="")
 Adds the given error to the compiler's list of errors. More...
 
void addNameExclusion (const String &type)
 Adds a name exclusion to the map. More...
 
bool compile (const String &str, const String &source, const String &group)
 Takes in a string of script code and compiles it into resources. More...
 
bool compile (const ConcreteNodeListPtr &nodes, const String &group)
 Compiles resources from the given concrete node list. More...
 
ScriptCompilerListenergetListener ()
 Returns the currently set listener. More...
 
ParticleSystemgetParticleSystem () const
 Returns the particle system currently being compiled. More...
 
const StringgetResourceGroup () const
 Returns the resource group currently set for this compiler. More...
 
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)
 
void removeNameExclusion (const String &type)
 Removes a name exclusion. More...
 
void setListener (ParticleScriptCompilerListener *listener)
 Sets the listener for this compiler. More...
 
void setListener (ScriptCompilerListener *listener)
 Sets the listener used by the compiler. More...
 

Static Public Member Functions

static String formatErrorCode (uint32 code)
 

Protected Member Functions

bool compileImpl (ScriptNodeListPtr nodes)
 This begins the compilation of the particle system from the final transformed AST. More...
 
bool errorRaised (const ScriptCompilerErrorPtr &error)
 Allows a listener to override error handling in the compiler. More...
 
ScriptNodeListPtr loadImportPath (const String &name)
 This is the override for loading imports. More...
 
void preParse ()
 Allows a listener to override the word id map before parsing. More...
 
bool processNode (ScriptNodeList::iterator &i, ScriptNodeList::iterator &end)
 Delegates to the listener if it can, otherwise returns false. If it returns true, then some input was consumed. More...
 

Private Member Functions

void compileAffector (const ScriptNodePtr &node)
 
void compileEmitter (const ScriptNodePtr &node)
 
void compileParticleSystem (const ScriptNodePtr &node)
 
String getParameterValue (ScriptNodeList::iterator &i, ScriptNodeList::iterator &end)
 

Private Attributes

ParticleScriptCompilerListenermListener
 
ParticleSystemmSystem
 

Detailed Description

Definition at line 56 of file OgreParticleScriptCompiler.h.

Member Typedef Documentation

typedef list<ErrorPtr>::type Ogre::ScriptCompiler::ErrorList
inherited

Definition at line 200 of file OgreScriptCompiler.h.

Definition at line 199 of file OgreScriptCompiler.h.

typedef map<String,uint32>::type Ogre::ScriptCompiler::IdMap
inherited

Definition at line 190 of file OgreScriptCompiler.h.

Member Enumeration Documentation

anonymous enum
inherited
Enumerator
ID_ON 
ID_OFF 
ID_TRUE 
ID_FALSE 
ID_YES 
ID_NO 

Definition at line 311 of file OgreScriptCompiler.h.

anonymous enum
inherited
Enumerator
CE_STRINGEXPECTED 
CE_NUMBEREXPECTED 
CE_FEWERPARAMETERSEXPECTED 
CE_VARIABLEEXPECTED 
CE_UNDEFINEDVARIABLE 
CE_OBJECTNAMEEXPECTED 
CE_OBJECTALLOCATIONERROR 
CE_INVALIDPARAMETERS 
CE_DUPLICATEOVERRIDE 
CE_UNEXPECTEDTOKEN 
CE_OBJECTBASENOTFOUND 
CE_UNSUPPORTEDBYRENDERSYSTEM 
CE_REFERENCETOANONEXISTINGOBJECT 

Definition at line 203 of file OgreScriptCompiler.h.

Constructor & Destructor Documentation

Ogre::ParticleScriptCompiler::ParticleScriptCompiler ( )

Member Function Documentation

bool Ogre::ScriptCompiler::_compile ( AbstractNodeListPtr  nodes,
const String group,
bool  doImports = true,
bool  doObjects = true,
bool  doVariables = true 
)
inherited

Compiles the given abstract syntax tree.

bool Ogre::ScriptCompiler::_fireEvent ( ScriptCompilerEvent evt,
void *  retval 
)
inherited

Internal method for firing the handleEvent method.

AbstractNodeListPtr Ogre::ScriptCompiler::_generateAST ( const String str,
const String source,
bool  doImports = false,
bool  doObjects = false,
bool  doVariables = false 
)
inherited

Generates the AST from the given string script.

void Ogre::ScriptCompiler::addError ( uint32  code,
const String file,
int  line,
const String msg = "" 
)
inherited

Adds the given error to the compiler's list of errors.

void Ogre::ScriptCompiler::addNameExclusion ( const String type)
inherited

Adds a name exclusion to the map.

Name exclusions identify object types which cannot accept names. This means that excluded types will always have empty names. All values in the object header are stored as object values.

bool Ogre::ScriptCompiler::compile ( const String str,
const String source,
const String group 
)
inherited

Takes in a string of script code and compiles it into resources.

Parameters
strThe script code
sourceThe source of the script code (e.g. a script file)
groupThe resource group to place the compiled resources into
bool Ogre::ScriptCompiler::compile ( const ConcreteNodeListPtr nodes,
const String group 
)
inherited

Compiles resources from the given concrete node list.

void Ogre::ParticleScriptCompiler::compileAffector ( const ScriptNodePtr &  node)
private
void Ogre::ParticleScriptCompiler::compileEmitter ( const ScriptNodePtr &  node)
private
bool Ogre::ParticleScriptCompiler::compileImpl ( ScriptNodeListPtr  nodes)
protected

This begins the compilation of the particle system from the final transformed AST.

void Ogre::ParticleScriptCompiler::compileParticleSystem ( const ScriptNodePtr &  node)
private
bool Ogre::ParticleScriptCompiler::errorRaised ( const ScriptCompilerErrorPtr &  error)
protected

Allows a listener to override error handling in the compiler.

static String Ogre::ScriptCompiler::formatErrorCode ( uint32  code)
staticinherited
ScriptCompilerListener* Ogre::ScriptCompiler::getListener ( )
inherited

Returns the currently set listener.

String Ogre::ParticleScriptCompiler::getParameterValue ( ScriptNodeList::iterator &  i,
ScriptNodeList::iterator &  end 
)
private
ParticleSystem* Ogre::ParticleScriptCompiler::getParticleSystem ( ) const

Returns the particle system currently being compiled.

const String& Ogre::ScriptCompiler::getResourceGroup ( ) const
inherited

Returns the resource group currently set for this compiler.

ScriptNodeListPtr Ogre::ParticleScriptCompiler::loadImportPath ( const String name)
protected

This is the override for loading imports.

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

Definition at line 95 of file OgreMemoryAllocatedObject.h.

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

Definition at line 101 of file OgreMemoryAllocatedObject.h.

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

Definition at line 107 of file OgreMemoryAllocatedObject.h.

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

Definition at line 112 of file OgreMemoryAllocatedObject.h.

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

Definition at line 118 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 67 of file OgreMemoryAllocatedObject.h.

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

Definition at line 72 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 78 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 85 of file OgreMemoryAllocatedObject.h.

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

Definition at line 90 of file OgreMemoryAllocatedObject.h.

void Ogre::ParticleScriptCompiler::preParse ( )
protected

Allows a listener to override the word id map before parsing.

bool Ogre::ParticleScriptCompiler::processNode ( ScriptNodeList::iterator &  i,
ScriptNodeList::iterator &  end 
)
protected

Delegates to the listener if it can, otherwise returns false. If it returns true, then some input was consumed.

void Ogre::ScriptCompiler::removeNameExclusion ( const String type)
inherited

Removes a name exclusion.

void Ogre::ParticleScriptCompiler::setListener ( ParticleScriptCompilerListener listener)

Sets the listener for this compiler.

void Ogre::ScriptCompiler::setListener ( ScriptCompilerListener listener)
inherited

Sets the listener used by the compiler.

Member Data Documentation

ParticleScriptCompilerListener* Ogre::ParticleScriptCompiler::mListener
private

Definition at line 82 of file OgreParticleScriptCompiler.h.

ParticleSystem* Ogre::ParticleScriptCompiler::mSystem
private

Definition at line 85 of file OgreParticleScriptCompiler.h.


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