mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-27 16:19:34 +00:00
Merge branch 'master' into console-func-refactor
Conflicts: Engine/source/app/net/net.cpp Engine/source/console/astNodes.cpp Engine/source/console/compiledEval.cpp Engine/source/console/console.h Engine/source/console/consoleInternal.h Engine/source/console/engineAPI.h
This commit is contained in:
commit
b507dc9555
6487 changed files with 315149 additions and 609761 deletions
|
|
@ -27,6 +27,7 @@ class ExprEvalState;
|
|||
class Namespace;
|
||||
class SimObject;
|
||||
class SimGroup;
|
||||
class CodeStream;
|
||||
|
||||
/// Enable this #define if you are seeing the message "precompile size mismatch" in the console.
|
||||
/// This will help track down which node type is causing the error. It could be
|
||||
|
|
@ -78,15 +79,13 @@ struct StmtNode
|
|||
/// @name Breaking
|
||||
/// @{
|
||||
|
||||
void addBreakCount();
|
||||
void addBreakLine(U32 ip);
|
||||
void addBreakLine(CodeStream &codeStream);
|
||||
/// @}
|
||||
|
||||
/// @name Compilation
|
||||
/// @{
|
||||
|
||||
virtual U32 precompileStmt(U32 loopCount) = 0;
|
||||
virtual U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint) = 0;
|
||||
virtual U32 compileStmt(CodeStream &codeStream, U32 ip) = 0;
|
||||
virtual void setPackage(StringTableEntry packageName);
|
||||
/// @}
|
||||
};
|
||||
|
|
@ -102,27 +101,26 @@ struct BreakStmtNode : StmtNode
|
|||
{
|
||||
static BreakStmtNode *alloc( S32 lineNumber );
|
||||
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
DBG_STMT_TYPE(BreakStmtNode);
|
||||
};
|
||||
|
||||
struct ContinueStmtNode : StmtNode
|
||||
{
|
||||
static ContinueStmtNode *alloc( S32 lineNumber );
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
DBG_STMT_TYPE(ContinueStmtNode);
|
||||
};
|
||||
|
||||
/// A mathematical expression.
|
||||
struct ExprNode : StmtNode
|
||||
{
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
|
||||
virtual U32 precompile(TypeReq type) = 0;
|
||||
virtual U32 compile(U32 *codeStream, U32 ip, TypeReq type) = 0;
|
||||
virtual U32 compile(CodeStream &codeStream, U32 ip, TypeReq type) = 0;
|
||||
virtual TypeReq getPreferredType() = 0;
|
||||
};
|
||||
|
||||
|
|
@ -131,8 +129,8 @@ struct ReturnStmtNode : StmtNode
|
|||
ExprNode *expr;
|
||||
|
||||
static ReturnStmtNode *alloc( S32 lineNumber, ExprNode *expr );
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
DBG_STMT_TYPE(ReturnStmtNode);
|
||||
};
|
||||
|
||||
|
|
@ -148,8 +146,8 @@ struct IfStmtNode : StmtNode
|
|||
static IfStmtNode *alloc( S32 lineNumber, ExprNode *testExpr, StmtNode *ifBlock, StmtNode *elseBlock, bool propagateThrough );
|
||||
void propagateSwitchExpr(ExprNode *left, bool string);
|
||||
ExprNode *getSwitchOR(ExprNode *left, ExprNode *list, bool string);
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
DBG_STMT_TYPE(IfStmtNode);
|
||||
};
|
||||
|
||||
|
|
@ -166,8 +164,8 @@ struct LoopStmtNode : StmtNode
|
|||
bool integer;
|
||||
|
||||
static LoopStmtNode *alloc( S32 lineNumber, ExprNode *testExpr, ExprNode *initExpr, ExprNode *endLoopExpr, StmtNode *loopBlock, bool isDoLoop );
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
DBG_STMT_TYPE(LoopStmtNode);
|
||||
};
|
||||
|
||||
|
|
@ -191,8 +189,7 @@ struct IterStmtNode : StmtNode
|
|||
|
||||
static IterStmtNode* alloc( S32 lineNumber, StringTableEntry varName, ExprNode* containerExpr, StmtNode* body, bool isStringIter );
|
||||
|
||||
U32 precompileStmt( U32 loopCount );
|
||||
U32 compileStmt( U32* codeStream, U32 ip, U32 continuePoint, U32 breakPoint );
|
||||
U32 compileStmt( CodeStream &codeStream, U32 ip );
|
||||
};
|
||||
|
||||
/// A binary mathematical expression (ie, left op right).
|
||||
|
|
@ -206,8 +203,8 @@ struct BinaryExprNode : ExprNode
|
|||
struct FloatBinaryExprNode : BinaryExprNode
|
||||
{
|
||||
static FloatBinaryExprNode *alloc( S32 lineNumber, S32 op, ExprNode *left, ExprNode *right );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(FloatBinaryExprNode);
|
||||
};
|
||||
|
|
@ -219,8 +216,8 @@ struct ConditionalExprNode : ExprNode
|
|||
ExprNode *falseExpr;
|
||||
bool integer;
|
||||
static ConditionalExprNode *alloc( S32 lineNumber, ExprNode *testExpr, ExprNode *trueExpr, ExprNode *falseExpr );
|
||||
virtual U32 precompile(TypeReq type);
|
||||
virtual U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
virtual U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
virtual TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(ConditionalExprNode);
|
||||
};
|
||||
|
|
@ -233,8 +230,8 @@ struct IntBinaryExprNode : BinaryExprNode
|
|||
static IntBinaryExprNode *alloc( S32 lineNumber, S32 op, ExprNode *left, ExprNode *right );
|
||||
|
||||
void getSubTypeOperand();
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(IntBinaryExprNode);
|
||||
};
|
||||
|
|
@ -243,18 +240,18 @@ struct StreqExprNode : BinaryExprNode
|
|||
{
|
||||
bool eq;
|
||||
static StreqExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, bool eq );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(StreqExprNode);
|
||||
};
|
||||
|
||||
struct StrcatExprNode : BinaryExprNode
|
||||
{
|
||||
int appendChar;
|
||||
static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, int appendChar );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
S32 appendChar;
|
||||
static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar );
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(StrcatExprNode);
|
||||
};
|
||||
|
|
@ -263,8 +260,8 @@ struct CommaCatExprNode : BinaryExprNode
|
|||
{
|
||||
static CommaCatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right );
|
||||
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(CommaCatExprNode);
|
||||
};
|
||||
|
|
@ -276,8 +273,8 @@ struct IntUnaryExprNode : ExprNode
|
|||
bool integer;
|
||||
|
||||
static IntUnaryExprNode *alloc( S32 lineNumber, S32 op, ExprNode *expr );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(IntUnaryExprNode);
|
||||
};
|
||||
|
|
@ -288,8 +285,8 @@ struct FloatUnaryExprNode : ExprNode
|
|||
ExprNode *expr;
|
||||
|
||||
static FloatUnaryExprNode *alloc( S32 lineNumber, S32 op, ExprNode *expr );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(FloatUnaryExprNode);
|
||||
};
|
||||
|
|
@ -300,8 +297,8 @@ struct VarNode : ExprNode
|
|||
ExprNode *arrayIndex;
|
||||
|
||||
static VarNode *alloc( S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(VarNode);
|
||||
};
|
||||
|
|
@ -312,8 +309,8 @@ struct IntNode : ExprNode
|
|||
U32 index; // if it's converted to float/string
|
||||
|
||||
static IntNode *alloc( S32 lineNumber, S32 value );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(IntNode);
|
||||
};
|
||||
|
|
@ -324,8 +321,8 @@ struct FloatNode : ExprNode
|
|||
U32 index;
|
||||
|
||||
static FloatNode *alloc( S32 lineNumber, F64 value );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(FloatNode);
|
||||
};
|
||||
|
|
@ -339,8 +336,8 @@ struct StrConstNode : ExprNode
|
|||
bool doc; // Specifies that this string is a documentation block.
|
||||
|
||||
static StrConstNode *alloc( S32 lineNumber, char *str, bool tag, bool doc = false );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(StrConstNode);
|
||||
};
|
||||
|
|
@ -352,8 +349,8 @@ struct ConstantNode : ExprNode
|
|||
U32 index;
|
||||
|
||||
static ConstantNode *alloc( S32 lineNumber, StringTableEntry value );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(ConstantNode);
|
||||
};
|
||||
|
|
@ -366,8 +363,8 @@ struct AssignExprNode : ExprNode
|
|||
TypeReq subType;
|
||||
|
||||
static AssignExprNode *alloc( S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex, ExprNode *expr );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(AssignExprNode);
|
||||
};
|
||||
|
|
@ -390,8 +387,8 @@ struct AssignOpExprNode : ExprNode
|
|||
TypeReq subType;
|
||||
|
||||
static AssignOpExprNode *alloc( S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex, ExprNode *expr, S32 op );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(AssignOpExprNode);
|
||||
};
|
||||
|
|
@ -403,8 +400,8 @@ struct TTagSetStmtNode : StmtNode
|
|||
ExprNode *stringExpr;
|
||||
|
||||
static TTagSetStmtNode *alloc( S32 lineNumber, StringTableEntry tag, ExprNode *valueExpr, ExprNode *stringExpr );
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
DBG_STMT_TYPE(TTagSetStmtNode);
|
||||
};
|
||||
|
||||
|
|
@ -413,8 +410,8 @@ struct TTagDerefNode : ExprNode
|
|||
ExprNode *expr;
|
||||
|
||||
static TTagDerefNode *alloc( S32 lineNumber, ExprNode *expr );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(TTagDerefNode);
|
||||
};
|
||||
|
|
@ -424,8 +421,8 @@ struct TTagExprNode : ExprNode
|
|||
StringTableEntry tag;
|
||||
|
||||
static TTagExprNode *alloc( S32 lineNumber, StringTableEntry tag );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(TTagExprNode);
|
||||
};
|
||||
|
|
@ -443,8 +440,8 @@ struct FuncCallExprNode : ExprNode
|
|||
};
|
||||
|
||||
static FuncCallExprNode *alloc( S32 lineNumber, StringTableEntry funcName, StringTableEntry nameSpace, ExprNode *args, bool dot );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(FuncCallExprNode);
|
||||
};
|
||||
|
|
@ -456,8 +453,8 @@ struct AssertCallExprNode : ExprNode
|
|||
U32 messageIndex;
|
||||
|
||||
static AssertCallExprNode *alloc( S32 lineNumber, ExprNode *testExpr, const char *message );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(AssertCallExprNode);
|
||||
};
|
||||
|
|
@ -476,8 +473,8 @@ struct SlotAccessNode : ExprNode
|
|||
StringTableEntry slotName;
|
||||
|
||||
static SlotAccessNode *alloc( S32 lineNumber, ExprNode *objectExpr, ExprNode *arrayExpr, StringTableEntry slotName );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(SlotAccessNode);
|
||||
};
|
||||
|
|
@ -496,8 +493,8 @@ struct InternalSlotAccessNode : ExprNode
|
|||
bool recurse;
|
||||
|
||||
static InternalSlotAccessNode *alloc( S32 lineNumber, ExprNode *objectExpr, ExprNode *slotExpr, bool recurse );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(InternalSlotAccessNode);
|
||||
};
|
||||
|
|
@ -510,8 +507,8 @@ struct SlotAssignNode : ExprNode
|
|||
U32 typeID;
|
||||
|
||||
static SlotAssignNode *alloc( S32 lineNumber, ExprNode *objectExpr, ExprNode *arrayExpr, StringTableEntry slotName, ExprNode *valueExpr, U32 typeID = -1 );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(SlotAssignNode);
|
||||
};
|
||||
|
|
@ -526,8 +523,8 @@ struct SlotAssignOpNode : ExprNode
|
|||
TypeReq subType;
|
||||
|
||||
static SlotAssignOpNode *alloc( S32 lineNumber, ExprNode *objectExpr, StringTableEntry slotName, ExprNode *arrayExpr, S32 op, ExprNode *valueExpr );
|
||||
U32 precompile(TypeReq type);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(SlotAssignOpNode);
|
||||
};
|
||||
|
|
@ -546,10 +543,10 @@ struct ObjectDeclNode : ExprNode
|
|||
bool isSingleton;
|
||||
|
||||
static ObjectDeclNode *alloc( S32 lineNumber, ExprNode *classNameExpr, ExprNode *objectNameExpr, ExprNode *argList, StringTableEntry parentObject, SlotAssignNode *slotDecls, ObjectDeclNode *subObjects, bool isDatablock, bool classNameInternal, bool isSingleton );
|
||||
U32 precompile(TypeReq type);
|
||||
|
||||
U32 precompileSubObject(bool);
|
||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||
U32 compileSubObject(U32 *codeStream, U32 ip, bool);
|
||||
U32 compile(CodeStream &codeStream, U32 ip, TypeReq type);
|
||||
U32 compileSubObject(CodeStream &codeStream, U32 ip, bool);
|
||||
TypeReq getPreferredType();
|
||||
DBG_STMT_TYPE(ObjectDeclNode);
|
||||
};
|
||||
|
|
@ -571,18 +568,13 @@ struct FunctionDeclStmtNode : StmtNode
|
|||
U32 argc;
|
||||
|
||||
static FunctionDeclStmtNode *alloc( S32 lineNumber, StringTableEntry fnName, StringTableEntry nameSpace, VarNode *args, StmtNode *stmts );
|
||||
U32 precompileStmt(U32 loopCount);
|
||||
U32 compileStmt(U32 *codeStream, U32 ip, U32 continuePoint, U32 breakPoint);
|
||||
|
||||
U32 compileStmt(CodeStream &codeStream, U32 ip);
|
||||
void setPackage(StringTableEntry packageName);
|
||||
DBG_STMT_TYPE(FunctionDeclStmtNode);
|
||||
};
|
||||
|
||||
extern StmtNode *gStatementList;
|
||||
extern void createFunction(const char *fnName, VarNode *args, StmtNode *statements);
|
||||
extern ExprEvalState gEvalState;
|
||||
extern bool lookupFunction(const char *fnName, VarNode **args, StmtNode **statements);
|
||||
typedef const char *(*cfunc)(S32 argc, char **argv);
|
||||
extern bool lookupCFunction(const char *fnName, cfunc *f);
|
||||
|
||||
extern ExprEvalState gEvalState;;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue