29 #ifndef __SCRIPTCOMPILER_H_
30 #define __SCRIPTCOMPILER_H_
105 virtual String getValue()
const = 0;
119 void parseNumber()
const;
140 void addVariable(
const String &name);
141 void setVariable(
const String &name,
const String &value);
142 std::pair<bool,String> getVariable(
const String &name)
const;
192 typedef HashMap<String,uint32>
IdMap;
218 CE_REFERENCETOANONEXISTINGOBJECT
233 bool compile(
const ConcreteNodeListPtr &nodes,
const String &group);
235 AbstractNodeListPtr _generateAST(
const String &str,
const String &source,
bool doImports =
false,
bool doObjects =
false,
bool doVariables =
false);
237 bool _compile(AbstractNodeListPtr nodes,
const String &group,
bool doImports =
true,
bool doObjects =
true,
bool doVariables =
true);
245 const String &getResourceGroup()
const;
252 void addNameExclusion(
const String &type);
254 void removeNameExclusion(
const String &type);
258 AbstractNodeListPtr convertToAST(
const ConcreteNodeListPtr &nodes);
260 void processImports(AbstractNodeListPtr &nodes);
262 AbstractNodeListPtr loadImportPath(
const String &name);
264 AbstractNodeListPtr locateTarget(AbstractNodeList *nodes,
const String &target);
266 void processObjects(AbstractNodeList *nodes,
const AbstractNodeListPtr &top);
268 void processVariables(AbstractNodeList *nodes);
306 const AbstractNodeListPtr &getResult()
const;
354 virtual void preConversion(
ScriptCompiler *compiler, ConcreteNodeListPtr nodes);
362 virtual bool postConversion(
ScriptCompiler *compiler,
const AbstractNodeListPtr&);
378 class ScriptTranslator;
379 class ScriptTranslatorManager;
417 void clearTranslatorManagers();
422 void addScriptPattern(
const String &pattern);
428 Real getLoadingOrder(
void)
const;
524 :
ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup), mSource(source),
525 mSyntax(syntax), mProgramType(programType)
538 :
ScriptCompilerEvent(eventType), mFile(file), mName(name), mResourceGroup(resourceGroup), mSource(source),
539 mLanguage(language), mProgramType(programType)
848 #ifdef RTSHADER_SYSTEM_BUILD_CORE_SHADERS
virtual ~ScriptCompilerListener()
vector< ScriptTranslatorManager * >::type mManagers
AbstractNodeList mImportTable
AbstractNodeList children
The ScriptTranslatorManager manages the lifetime and access to script translators.
Abstract class defining the interface used by classes which wish to perform script loading to define ...
GpuProgramType mProgramType
SharedPtr< AbstractNode > AbstractNodePtr
CreateMaterialScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
PreApplyTextureAliasesScriptCompilerEvent(Material *material, AliasTextureNamePairList *aliases)
AliasTextureNamePairList * mAliases
#define OGRE_THREAD_POINTER(T, var)
virtual ~ScriptCompiler()
Reference-counted shared pointer, used for objects where implicit destruction is required.
CreateCompositorScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
float Real
Software floating point type.
vector< String >::type StringVector
This is a listener for the compiler.
This class translates script AST (abstract syntax tree) into Ogre resources.
multimap< String, String >::type ImportRequestMap
Suport for shader model 5.0.
SharedPtr< Error > ErrorPtr
ProcessResourceNameScriptCompilerEvent(ResourceType resourceType, const String &name)
AbstractNodeList overrides
Variant type that can hold Any other type.
AbstractNodeListPtr mNodes
CreateParticleSystemScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup)
ConcreteNodeType
These enums hold the types of the concrete parsed nodes.
This struct is a base class for events which can be thrown by the compilers and caught by subscribers...
ScriptTranslatorManager * mBuiltinTranslatorManager
SharedPtr< ConcreteNode > ConcreteNodePtr
map< String, String >::type AliasTextureNamePairList
Alias / Texture name pair (first = alias, second = texture name)
map< String, String >::type mEnv
This abstract node represents a script property.
StringVector mScriptPatterns
This abstract node represents a variable assignment.
list< AbstractNodePtr >::type AbstractNodeList
ScriptCompiler * mCompiler
This abstract node represents an import statement.
This is an abstract node which cannot be broken down further.
list< ErrorPtr >::type ErrorList
GpuProgramType
Enumerates the types of programs which can run on the GPU.
ScriptCompilerListener * mListener
map< String, AbstractNodeListPtr >::type ImportCacheMap
list< ConcreteNodePtr >::type ConcreteNodeList
Manages threaded compilation of scripts.
virtual ~ScriptCompilerEvent()
HashMap< String, uint32 > IdMap
ProcessNameExclusionScriptCompilerEvent(const String &cls, AbstractNode *parent)
SharedPtr< AbstractNodeList > AbstractNodeListPtr
ScriptCompilerEvent(const String &type)
Class encapsulates rendering properties of an object.
map< String, String >::type Environment
ImportRequestMap mImportRequests
GpuProgramType mProgramType
ScriptCompilerEvent & operator=(const ScriptCompilerEvent &)
Template class for creating single-instance global classes.
This specific abstract node represents a script object.
CreateGpuProgramScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup, const String &source, const String &syntax, GpuProgramType programType)
ScriptCompilerListener * mListener
CreateHighLevelGpuProgramScriptCompilerEvent(const String &file, const String &name, const String &resourceGroup, const String &source, const String &language, GpuProgramType programType)
vector< String >::type bases
ResourceType mResourceType
AbstractNodeType
This enum holds the types of the possible abstract nodes.
SharedPtr< ConcreteNodeList > ConcreteNodeListPtr
This is the main class for the compiler.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
ConcreteNodeList children