NODETYPE_RETURN, //!< Return from a function (reserved word)
NODETYPE_ASSIGN, //!< Variable assignment operator
+ NODETYPE_POSTINC, //!< Post-increment (i++) - Uniop
+ NODETYPE_POSTDEC, //!< Post-decrement (i--) - Uniop
NODETYPE_FUNCTIONCALL, //!< Call a function
NODETYPE_METHODCALL, //!< Call a class method
NODETYPE_CREATEOBJECT, //!< Create an object
NODETYPE_INDEX, //!< Index into an array
+ NODETYPE_LOGICALNOT, //!< Logical NOT operator
NODETYPE_LOGICALAND, //!< Logical AND operator
NODETYPE_LOGICALOR, //!< Logical OR operator
NODETYPE_LOGICALXOR, //!< Logical XOR operator
NODETYPE_EQUALS, //!< Comparison Equals
NODETYPE_LESSTHAN, //!< Comparison Less Than
+ NODETYPE_LESSTHANEQUAL, //!< Comparison Less Than or Equal
NODETYPE_GREATERTHAN, //!< Comparison Greater Than
+ NODETYPE_GREATERTHANEQUAL, //!< Comparison Greater Than or Equal
+ NODETYPE_BWNOT, //!< Bitwise NOT
NODETYPE_BWAND, //!< Bitwise AND
NODETYPE_BWOR, //!< Bitwise OR
NODETYPE_BWXOR, //!< Bitwise XOR
NODETYPE_BITSHIFTRIGHT, //!< Bitwise Shift Right (Shrink)
NODETYPE_BITROTATELEFT, //!< Bitwise Rotate Left (Grow)
+ NODETYPE_NEGATE, //!< Negagte
NODETYPE_ADD, //!< Add
NODETYPE_SUBTRACT, //!< Subtract
NODETYPE_MULTIPLY, //!< Multiply
const char *File;
int Line;
+ void *BlockState; //!< BlockState pointer (for cache integrity)
+ int BlockIdent; //!< Ident (same as above)
+ void *ValueCache; //!< Cached value / pointer
+
union
{
struct {
tAST_Node *Object;
tAST_Node *FirstArg;
tAST_Node *LastArg;
+ int NumArgs;
char Name[];
} FunctionCall;
int DataType;
tAST_Node *LevelSizes;
tAST_Node *LevelSizes_Last;
+ tAST_Node *InitialValue;
char Name[];
} DefVar;
tAST_Node *Value;
} Cast;
- struct {
- int Length;
- char Data[];
- } String;
-
- uint64_t Integer;
- double Real;
+ // Used for NODETYPE_REAL, NODETYPE_INTEGER and NODETYPE_STRING
+ tSpiderValue Constant;
};
};
tSpiderValue *RetVal;
tSpiderNamespace *BaseNamespace; //!< Base namespace (for entire block)
tSpiderNamespace *CurNamespace; //!< Currently selected namespace
+ int Ident;
};
struct sAST_Variable
extern void AST_AppendFunctionArg(tAST_Function *Function, tAST_Node *Arg);
extern void AST_SetFunctionCode(tAST_Function *Function, tAST_Node *Root);
+extern tAST_Node *AST_NewNop(tParser *Parser);
+
extern tAST_Node *AST_NewString(tParser *Parser, const char *String, int Length);
-extern tAST_Node *AST_NewInteger(tParser *Parser, uint64_t Value);
+extern tAST_Node *AST_NewInteger(tParser *Parser, int64_t Value);
+extern tAST_Node *AST_NewReal(tParser *Parser, double Value);
extern tAST_Node *AST_NewVariable(tParser *Parser, const char *Name);
extern tAST_Node *AST_NewDefineVar(tParser *Parser, int Type, const char *Name);
extern tAST_Node *AST_NewConstant(tParser *Parser, const char *Name);