X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2Finclude%2Fspiderscript.h;h=e1dc5078e27d9349da99a3ca7dcbf7589e15392d;hb=bfacdd3b71576cf6ceaa83352d3a7d162adb75e1;hp=c87a0e50a6fa3492006a0c5dc1445bf1d374c61e;hpb=1e45480331132c75898cbdd761ddd1fa48739e54;p=tpg%2Facess2.git diff --git a/Usermode/include/spiderscript.h b/Usermode/include/spiderscript.h index c87a0e50..e1dc5078 100644 --- a/Usermode/include/spiderscript.h +++ b/Usermode/include/spiderscript.h @@ -65,6 +65,27 @@ enum eSpiderScript_DataTypes NUM_SS_DATATYPES }; +enum eSpiderValueOps +{ + SS_VALUEOP_NOP, + + SS_VALUEOP_ADD, + SS_VALUEOP_SUBTRACT, + SS_VALUEOP_NEGATE, + SS_VALUEOP_MULIPLY, + SS_VALUEOP_DIVIDE, + SS_VALUEOP_MODULO, + + SS_VALUEOP_BITNOT, + SS_VALUEOP_BITAND, + SS_VALUEOP_BITOR, + SS_VALUEOP_BITXOR, + + SS_VALUEOP_SHIFTLEFT, + SS_VALUEOP_SHIFTRIGHT, + SS_VALUEOP_ROTATELEFT +}; + /** * \brief Namespace definition */ @@ -245,11 +266,29 @@ extern tSpiderValue *SpiderScript_ExecuteFunction(tSpiderScript *Script, tSpiderNamespace *Namespace, const char *Function, int NArguments, tSpiderValue **Arguments ); +/** + * \brief Execute an object method + */ +extern tSpiderValue *SpiderScript_ExecuteMethod(tSpiderScript *Script, + tSpiderObject *Object, const char *MethodName, + int NArguments, tSpiderValue **Arguments + ); +/** + * \brief Creates an object instance + */ +extern tSpiderValue *SpiderScript_CreateObject(tSpiderScript *Script, + tSpiderNamespace *Namespace, const char *ClassName, + int NArguments, tSpiderValue **Arguments + ); /** * \brief Convert a script to bytecode and save to a file */ extern int SpiderScript_SaveBytecode(tSpiderScript *Script, const char *DestFile); +/** + * \brief Save the AST of a script to a file + */ +extern int SpiderScript_SaveAST(tSpiderScript *Script, const char *Filename); /** * \brief Free a script @@ -273,6 +312,8 @@ extern tSpiderValue *SpiderScript_CastValueTo(int Type, tSpiderValue *Source); extern int SpiderScript_IsValueTrue(tSpiderValue *Value); extern void SpiderScript_FreeValue(tSpiderValue *Value); extern char *SpiderScript_DumpValue(tSpiderValue *Value); + +extern tSpiderValue *SpiderScript_DoOp(tSpiderValue *Left, enum eSpiderValueOps Op, int bCanCast, tSpiderValue *Right); /** * \} */