X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibspiderscript.so_src%2Fast.h;h=1118130e057ff9b5d620c54c69a63ce3bb61dad9;hb=ec4d050568da0f3f18a20969bd118b5c67f03ee2;hp=7c0d3037186a186f27535eac71abbd27bcbe7823;hpb=17c447e4977d83c1b6aadcb80f4542b4802e9b21;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libspiderscript.so_src/ast.h b/Usermode/Libraries/libspiderscript.so_src/ast.h index 7c0d3037..1118130e 100644 --- a/Usermode/Libraries/libspiderscript.so_src/ast.h +++ b/Usermode/Libraries/libspiderscript.so_src/ast.h @@ -115,11 +115,6 @@ struct sAST_Node tAST_Node *Right; } BinOp; - struct { - int Length; - char Data[]; - } String; - struct { tAST_Node *FirstArg; tAST_Node *LastArg; @@ -161,6 +156,11 @@ struct sAST_Node tAST_Node *Value; } Cast; + struct { + int Length; + char Data[]; + } String; + uint64_t Integer; double Real; }; @@ -187,6 +187,8 @@ struct sAST_Variable // === FUNCTIONS === extern tAST_Script *AST_NewScript(void); +extern size_t AST_WriteScript(void *Buffer, tAST_Script *Script); +extern size_t AST_WriteNode(void *Buffer, size_t Offset, tAST_Node *Node); extern tAST_Function *AST_AppendFunction(tAST_Script *Script, const char *Name); extern void AST_AppendFunctionArg(tAST_Function *Function, tAST_Node *Arg); @@ -203,6 +205,7 @@ extern tAST_Node *AST_NewCodeBlock(void); extern void AST_AppendNode(tAST_Node *Parent, tAST_Node *Child); extern tAST_Node *AST_NewIf(tParser *Parser, tAST_Node *Condition, tAST_Node *True, tAST_Node *False); +extern tAST_Node *AST_NewLoop(tParser *Parser, tAST_Node *Init, int bPostCheck, tAST_Node *Condition, tAST_Node *Increment, tAST_Node *Code); extern tAST_Node *AST_NewAssign(tParser *Parser, int Operation, tAST_Node *Dest, tAST_Node *Value); extern tAST_Node *AST_NewCast(tParser *Parser, int Target, tAST_Node *Value);