Sheep
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Public Member Functions | List of all members
Sheep::ICompiler Class Referenceabstract

Interface to a Compiler object that compiles sheep scripts. More...

#include <sheepcpp.h>

Public Member Functions

virtual void Release ()=0
 
virtual SheepLanguageVersion GetLanguageVersion ()=0
 Gets the language version with which this compiler was created.
 
virtual int DefineImportFunction (const char *name, SymbolType returnType, SymbolType parameters[], int numParameters)=0
 
virtual IScriptCompileScript (const char *script)=0
 

Detailed Description

Interface to a Compiler object that compiles sheep scripts.

Member Function Documentation

virtual IScript* Sheep::ICompiler::CompileScript ( const char *  script)
pure virtual

Compiles the given sheep script.

This function always returns an instance if IScript, even if the script wasn't successfully compiled. You must examine the IScript result to find out the results of the compilation. Be sure to call IScript::Release() when done with the IScript result.

Parameters
script0-terminated string containing sheep script
Returns
A new instance of IScript.
virtual int Sheep::ICompiler::DefineImportFunction ( const char *  name,
SymbolType  returnType,
SymbolType  parameters[],
int  numParameters 
)
pure virtual

Defines an import function.

Parameters
nameThe name of the import function to define
returnTypeThe return type of the import function
parametersAn array with a list of parameter types, or null if there are no parameters
numParametersThe number of parameters. This should match the array length of "parameters"
Returns
SHEEP_SUCCESS if successful, SHEEP_ERR_INVALID_ARGUMENT if "name" is null or the import function has already been defined.
virtual void Sheep::ICompiler::Release ( )
pure virtual

Releases the Compiler, decreasing its reference count by 1.

When all references to the compiler have been released the compiler is deleted. Any active instances of IScript that have been created by this compiler are still alive.


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