#include "linden_common.h"
#include "lscript_tree.h"
#include "lscript_typecheck.h"
#include "lscript_resource.h"
#include "lscript_bytecode.h"
#include "lscript_heap.h"
#include "lscript_library.h"
#include "lscript_alloc.h"
Include dependency graph for lscript_tree.cpp:
Go to the source code of this file.
Copyright (c) 2002-2007, Linden Research, Inc.
Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2
There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception
By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$
Definition in file lscript_tree.cpp.
void add_exit_pops | ( | LLScriptByteCodeChunk * | chunk, | |
LLScriptScopeEntry * | entry | |||
) |
Definition at line 7458 of file lscript_tree.cpp.
References LLScriptByteCodeChunk::addByte(), LLScriptArgString::getType(), i, LOPC_POP, LOPC_POPL, LOPC_POPQ, LOPC_POPS, LOPC_POPV, LSCRIPTOpCodes, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, LLScriptScopeEntry::mFunctionArgs, LLScriptScopeEntry::mLocals, LLScriptArgString::mString, and S32.
Referenced by add_return(), and LLScriptStateChange::recurse().
void add_return | ( | LLScriptByteCodeChunk * | chunk, | |
LLScriptScopeEntry * | entry | |||
) |
Definition at line 7744 of file lscript_tree.cpp.
References add_exit_pops(), LLScriptByteCodeChunk::addByte(), LOPC_RETURN, and LSCRIPTOpCodes.
Referenced by LLScriptGlobalFunctions::recurse(), LLScriptEventHandler::recurse(), and LLScriptReturn::recurse().
void cast2stack | ( | LLScriptByteCodeChunk * | chunk, | |
LSCRIPTType | ret_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4226 of file lscript_tree.cpp.
References LLScriptByteCodeChunk::addByte(), LOPC_CAST, LSCRIPTOpCodes, LSCRIPTTypeByte, and LSCRIPTTypeHi4Bits.
Referenced by LLScriptDeclaration::recurse(), and store2stack().
bool is_parameter | ( | LLScriptIdentifier * | identifier, | |
LLScriptScopeEntry * | function_scope | |||
) |
Definition at line 3794 of file lscript_tree.cpp.
References LLScriptScopeEntry::mOffset, and LLScriptIdentifier::mScopeEntry.
Referenced by print_cil_asignment(), print_cil_load_address(), LLScriptDeclaration::recurse(), and LLScriptLValue::recurse().
bool is_SA_constant_integer | ( | LLScriptSimpleAssignable * | sa | ) |
Definition at line 677 of file lscript_tree.cpp.
References LSSAT_CONSTANT, LST_INTEGER, and LLScriptSimpleAssignable::mType.
Referenced by LLScriptSAQuaternion::recurse(), and LLScriptSAVector::recurse().
void operation2stack | ( | LLScriptByteCodeChunk * | chunk, | |
LSCRIPTType | ret_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4236 of file lscript_tree.cpp.
References LLScriptByteCodeChunk::addByte(), LSCRIPTTypeByte, and LSCRIPTTypeHi4Bits.
Referenced by LLScriptModAssignment::recurse(), LLScriptDivAssignment::recurse(), LLScriptMulAssignment::recurse(), LLScriptSubAssignment::recurse(), and LLScriptAddAssignment::recurse().
void print_asignment | ( | FILE * | fp, | |
LLScriptExpression * | exp | |||
) |
Definition at line 4139 of file lscript_tree.cpp.
References LIT_GLOBAL, LIT_VARIABLE, LSCRIPTTypeGlobalStore, LSCRIPTTypeLocalStore, LLScriptLValue::mAccessor, LLScriptLValue::mIdentifier, LLScriptScopeEntry::mIDType, LLScriptIdentifier::mName, LLScriptLValue::mOffset, LLScriptScopeEntry::mOffset, LLScriptIdentifier::mScopeEntry, and LLScriptScopeEntry::mType.
Referenced by LLScriptPostDecrement::recurse(), LLScriptPostIncrement::recurse(), LLScriptPreDecrement::recurse(), LLScriptPreIncrement::recurse(), LLScriptModAssignment::recurse(), LLScriptDivAssignment::recurse(), LLScriptMulAssignment::recurse(), LLScriptSubAssignment::recurse(), LLScriptAddAssignment::recurse(), and LLScriptAssignment::recurse().
void print_cast | ( | FILE * | fp, | |
LSCRIPTType | ret_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4218 of file lscript_tree.cpp.
References LSCRIPTTypeNames.
Referenced by LLScriptLSOParse::initOpCodePrinting(), and LLScriptAssignment::recurse().
void print_cil_accessor | ( | FILE * | fp, | |
LLScriptLValue * | lvalue | |||
) |
Definition at line 3839 of file lscript_tree.cpp.
References LLScriptLValue::mAccessor, LLScriptLValue::mIdentifier, LLScriptIdentifier::mName, LLScriptExpression::mReturnType, LLScriptIdentifier::mScopeEntry, LLScriptScopeEntry::mType, and print_cil_type().
Referenced by print_cil_asignment(), and LLScriptLValue::recurse().
void print_cil_add | ( | FILE * | fp, | |
LSCRIPTType | left_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4390 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, and print_cil_box().
Referenced by LLScriptPlus::recurse(), and LLScriptAddAssignment::recurse().
void print_cil_arg_list | ( | FILE * | fp, | |
LLScriptFuncExpressionList * | exp_list | |||
) |
Definition at line 7061 of file lscript_tree.cpp.
References LLScriptFuncExpressionList::mFirstp, LLScriptExpression::mReturnType, LLScriptFuncExpressionList::mSecondp, NULL, and print_cil_type().
Referenced by LLScriptFunctionCall::recurse().
void print_cil_asignment | ( | FILE * | fp, | |
LLScriptExpression * | exp, | |||
LLScriptScopeEntry * | function_scope | |||
) |
Definition at line 4167 of file lscript_tree.cpp.
References is_parameter(), LIT_GLOBAL, LIT_VARIABLE, LLScriptLValue::mAccessor, LLScriptScopeEntry::mCount, LLScriptScopeEntry::mIdentifier, LLScriptLValue::mIdentifier, LLScriptScopeEntry::mIDType, LLScriptIdentifier::mScopeEntry, print_cil_accessor(), print_cil_load_address(), and print_cil_member().
Referenced by LLScriptPostDecrement::recurse(), LLScriptPostIncrement::recurse(), LLScriptPreDecrement::recurse(), LLScriptPreIncrement::recurse(), LLScriptModAssignment::recurse(), LLScriptDivAssignment::recurse(), LLScriptMulAssignment::recurse(), LLScriptSubAssignment::recurse(), LLScriptAddAssignment::recurse(), and LLScriptAssignment::recurse().
void print_cil_box | ( | FILE * | fp, | |
LSCRIPTType | type | |||
) |
Definition at line 46 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_QUATERNION, LST_STRING, and LST_VECTOR.
Referenced by print_cil_add(), and LLScriptListExpressionList::recurse().
void print_cil_cast | ( | FILE * | fp, | |
LSCRIPTType | srcType, | |||
LSCRIPTType | targetType | |||
) |
Definition at line 556 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, and LST_VECTOR.
Referenced by print_cil_div(), print_cil_mul(), print_cil_numeric_cast(), LLScriptQuaternionInitializer::recurse(), LLScriptVectorInitializer::recurse(), LLScriptTypeCast::recurse(), LLScriptSAQuaternion::recurse(), and LLScriptSAVector::recurse().
void print_cil_div | ( | FILE * | fp, | |
LSCRIPTType | left_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4720 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_QUATERNION, LST_VECTOR, and print_cil_cast().
Referenced by LLScriptDivide::recurse(), and LLScriptDivAssignment::recurse().
void print_cil_eq | ( | FILE * | fp, | |
LSCRIPTType | left_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4923 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, and LST_VECTOR.
Referenced by LLScriptEquality::recurse().
void print_cil_globals | ( | FILE * | fp, | |
LLScriptGlobalVariable * | global | |||
) |
Definition at line 9758 of file lscript_tree.cpp.
References LLScriptGlobalVariable::mIdentifier, LLScriptIdentifier::mName, LLScriptGlobalVariable::mNextp, LLScriptType::mType, LLScriptGlobalVariable::mType, NULL, and print_cil_type().
Referenced by LLScriptScript::recurse().
void print_cil_load_address | ( | FILE * | fp, | |
LLScriptExpression * | exp, | |||
LLScriptScopeEntry * | function_scope | |||
) |
Definition at line 3803 of file lscript_tree.cpp.
References is_parameter(), LIT_GLOBAL, LIT_VARIABLE, LLScriptLValue::mAccessor, LLScriptScopeEntry::mIdentifier, LLScriptLValue::mIdentifier, LLScriptScopeEntry::mIDType, LLScriptIdentifier::mScopeEntry, LLScriptScopeEntry::mType, and print_cil_type().
Referenced by print_cil_asignment(), LLScriptPostDecrement::recurse(), LLScriptPostIncrement::recurse(), LLScriptPreDecrement::recurse(), LLScriptPreIncrement::recurse(), LLScriptModAssignment::recurse(), LLScriptDivAssignment::recurse(), LLScriptMulAssignment::recurse(), LLScriptSubAssignment::recurse(), LLScriptAddAssignment::recurse(), LLScriptAssignment::recurse(), and LLScriptLValue::recurse().
void print_cil_local_init | ( | FILE * | fp, | |
LLScriptScopeEntry * | scopeEntry | |||
) |
Definition at line 8754 of file lscript_tree.cpp.
References LLScriptArgString::getNumber(), LLScriptArgString::getType(), LLScriptScopeEntry::mLocals, and print_cil_type().
Referenced by LLScriptGlobalFunctions::recurse(), and LLScriptEventHandler::recurse().
void print_cil_member | ( | FILE * | fp, | |
LLScriptIdentifier * | ident | |||
) |
Definition at line 3848 of file lscript_tree.cpp.
References LLScriptScopeEntry::mIdentifier, LLScriptIdentifier::mScopeEntry, LLScriptScopeEntry::mType, and print_cil_type().
Referenced by print_cil_asignment(), and LLScriptLValue::recurse().
void print_cil_mod | ( | FILE * | fp, | |
LSCRIPTType | left_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4835 of file lscript_tree.cpp.
References LST_INTEGER, and LST_VECTOR.
Referenced by LLScriptMod::recurse(), and LLScriptModAssignment::recurse().
void print_cil_mul | ( | FILE * | fp, | |
LSCRIPTType | left_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4598 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_QUATERNION, LST_VECTOR, and print_cil_cast().
Referenced by LLScriptTimes::recurse(), and LLScriptMulAssignment::recurse().
void print_cil_numeric_cast | ( | FILE * | fp, | |
LSCRIPTType | currentArg, | |||
LSCRIPTType | otherArg | |||
) |
Definition at line 4322 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, and print_cil_cast().
Referenced by LLScriptDivide::recurse(), LLScriptTimes::recurse(), LLScriptMinus::recurse(), LLScriptPlus::recurse(), LLScriptEquality::recurse(), LLScriptDivAssignment::recurse(), LLScriptMulAssignment::recurse(), LLScriptSubAssignment::recurse(), LLScriptAddAssignment::recurse(), and LLScriptAssignment::recurse().
void print_cil_sub | ( | FILE * | fp, | |
LSCRIPTType | left_type, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4499 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_QUATERNION, and LST_VECTOR.
Referenced by LLScriptMinus::recurse(), and LLScriptSubAssignment::recurse().
void print_cil_type | ( | FILE * | fp, | |
LSCRIPTType | type | |||
) |
Definition at line 71 of file lscript_tree.cpp.
References LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_NULL, LST_QUATERNION, LST_STRING, and LST_VECTOR.
Referenced by print_cil_accessor(), print_cil_arg_list(), print_cil_globals(), print_cil_load_address(), print_cil_local_init(), print_cil_member(), LLScriptGlobalFunctions::recurse(), LLScriptFunctionCall::recurse(), and LLScriptType::recurse().
void print_escape_quotes | ( | FILE * | fp, | |
const char * | str | |||
) |
Definition at line 250 of file lscript_tree.cpp.
References c.
Referenced by LLScriptConstantString::recurse().
void print_exit_pops | ( | FILE * | fp, | |
LLScriptScopeEntry * | entry | |||
) |
Definition at line 7530 of file lscript_tree.cpp.
References LLScriptArgString::getType(), i, LSCRIPTTypePop, LLScriptScopeEntry::mFunctionArgs, LLScriptScopeEntry::mLocals, LLScriptArgString::mString, and S32.
Referenced by print_return(), and LLScriptStateChange::recurse().
void print_return | ( | FILE * | fp, | |
LLScriptScopeEntry * | entry | |||
) |
Definition at line 7750 of file lscript_tree.cpp.
References print_exit_pops().
Referenced by LLScriptLSOParse::initOpCodePrinting(), LLScriptGlobalFunctions::recurse(), LLScriptEventHandler::recurse(), and LLScriptReturn::recurse().
void store2stack | ( | LLScriptExpression * | exp, | |
LLScriptExpression * | lv, | |||
LLScriptByteCodeChunk * | chunk, | |||
LSCRIPTType | right_type | |||
) |
Definition at line 4242 of file lscript_tree.cpp.
References LLScriptByteCodeChunk::addByte(), LLScriptByteCodeChunk::addInteger(), cast2stack(), legal_binary_expression(), LIT_VARIABLE, LOPC_STORE, LOPC_STOREG, LOPC_STOREGL, LOPC_STOREGQ, LOPC_STOREGS, LOPC_STOREGV, LOPC_STOREL, LOPC_STOREQ, LOPC_STORES, LOPC_STOREV, LSCRIPTOpCodes, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_NULL, LST_QUATERNION, LST_STRING, LST_VECTOR, LLScriptLValue::mIdentifier, LLScriptScopeEntry::mIDType, LLScriptExpression::mLeftType, LLScriptLValue::mOffset, LLScriptScopeEntry::mOffset, LLScriptExpression::mReturnType, LLScriptExpression::mRightType, LLScriptIdentifier::mScopeEntry, LLScriptExpression::mType, and S32.
Referenced by LLScriptPostDecrement::recurse(), LLScriptPostIncrement::recurse(), LLScriptPreDecrement::recurse(), LLScriptPreIncrement::recurse(), LLScriptModAssignment::recurse(), LLScriptDivAssignment::recurse(), LLScriptMulAssignment::recurse(), LLScriptSubAssignment::recurse(), LLScriptAddAssignment::recurse(), and LLScriptAssignment::recurse().
U64 gCurrentHandler = 0 |
Definition at line 8752 of file lscript_tree.cpp.
Referenced by LLScriptState::recurse(), and LLScriptEventHandler::recurse().