X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibspiderscript.so_src%2Fast.h;h=8b9c25b05ddf781805b389723a2293c5d244dce0;hb=7eab89f95c3ea818686482a69a2d37ce0cb68c62;hp=4fa98ca0859fabfe21b7e2806ed48ad17b4f6e90;hpb=6a945643557084578509e149c84cf5dde3c59c3c;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libspiderscript.so_src/ast.h b/Usermode/Libraries/libspiderscript.so_src/ast.h index 4fa98ca0..8b9c25b0 100644 --- a/Usermode/Libraries/libspiderscript.so_src/ast.h +++ b/Usermode/Libraries/libspiderscript.so_src/ast.h @@ -34,6 +34,9 @@ enum eAST_NodeTypes NODETYPE_ASSIGN, //!< Variable assignment operator NODETYPE_FUNCTIONCALL, //!< Call a function + NODETYPE_IF, //!< Conditional + NODETYPE_LOOP, //!< Looping Construct + NODETYPE_INDEX, //!< Index into an array NODETYPE_LOGICALAND, //!< Logical AND operator @@ -119,6 +122,20 @@ struct sAST_Node char Name[]; } FunctionCall; + struct { + tAST_Node *Condition; + tAST_Node *True; + tAST_Node *False; + } If; + + struct { + tAST_Node *Init; + int bCheckAfter; + tAST_Node *Condition; + tAST_Node *Increment; + tAST_Node *Code; + } For; + /** * \note Used for \a NODETYPE_VARIABLE and \a NODETYPE_CONSTANT */ @@ -153,6 +170,7 @@ struct sAST_BlockState tAST_BlockState *Parent; tSpiderScript *Script; //!< Script tAST_Variable *FirstVar; //!< First variable in the list + tSpiderValue *RetVal; }; struct sAST_Variable @@ -180,6 +198,9 @@ extern void AST_AppendFunctionCallArg(tAST_Node *Node, tAST_Node *Arg); extern tAST_Node *AST_NewCodeBlock(void); extern void AST_AppendNode(tAST_Node *Parent, tAST_Node *Child); + +extern tAST_Node *AST_NewIf(tAST_Node *Condition, tAST_Node *True, tAST_Node *False); + extern tAST_Node *AST_NewAssign(int Operation, tAST_Node *Dest, tAST_Node *Value); extern tAST_Node *AST_NewBinOp(int Operation, tAST_Node *Left, tAST_Node *Right); extern tAST_Node *AST_NewUniOp(int Operation, tAST_Node *Value); @@ -187,6 +208,8 @@ extern tAST_Node *AST_NewUniOp(int Operation, tAST_Node *Value); extern void AST_FreeNode(tAST_Node *Node); // exec_ast.h +extern void Object_Dereference(tSpiderValue *Object); +extern void Object_Reference(tSpiderValue *Object); extern tSpiderValue *AST_ExecuteNode(tAST_BlockState *Block, tAST_Node *Node); #endif