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
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
*/
tAST_BlockState *Parent;
tSpiderScript *Script; //!< Script
tAST_Variable *FirstVar; //!< First variable in the list
+ tSpiderValue *RetVal;
};
struct sAST_Variable
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);
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