34 using QueryLookupFunc = ::std::function<
37 ::MolangQueryFunctionReturnType&,
46 ::ll::TypedStorage<2, 2, ::ExpressionOp> mOp;
47 ::ll::TypedStorage<2, 2, ::MolangVersion> mMolangVersion;
48 ::ll::TypedStorage<4, 4, float> mMul;
49 ::ll::TypedStorage<4, 4, float> mAdd;
50 ::ll::TypedStorage<1, 1, bool> mStoreStackState;
51 ::ll::TypedStorage<1, 1, bool> mNeedsToCompile;
52 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mIsBeingCompiled;
53 ::ll::TypedStorage<8, 88, ::MolangScriptArg> mValue;
54 ::ll::TypedStorage<8, 24, ::std::vector<::ExpressionNode>> mChildren;
55 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::IMolangInstruction>>> mInstructions;
56 ::ll::TypedStorage<8, 32, ::std::string> _mExpressionString;
57 ::ll::TypedStorage<8, 32, ::std::string> _mContentScopeString;
62 std::string
const& value,
63 ::MolangVersion molangVersion,
64 ::gsl::span<::HashedString const> querySetID
67 parse(value, molangVersion, querySetID);
83 ::MolangVersion molangVersion,
84 ::gsl::span<::HashedString const> querySetID
89 MCFOLD
bool _checkAllOperationsAreValid()
const;
91 MCAPI
bool _hasDisallowedQueryPtrs(
92 ::std::vector<::std::function<
97 MCAPI
bool _optimize(::MolangVersion version,
::RenderParams& outRenderParams,
int recursionDepth);
99 MCAPI
bool _processBinaryExpressions(::std::function<
bool(::ExpressionOp)> predicate);
101 MCAPI
bool _processTernaryAndConditionalExpressions();
103 MCAPI
bool _readNextToken(
104 char const*& expression,
105 ::gsl::span<::HashedString const>
const& idSet,
106 ::MolangVersion molangVersion
109 MCAPI
void _setExpressionStringWithoutRelink(::std::string
const& expressionString);
111 MCAPI
bool _tokenize(
112 char const* expression,
114 ::gsl::span<::HashedString const>
const& idSet,
115 ::MolangVersion molangVersion
118 MCAPI
bool _validate(::MolangVersion version,
bool inLoop,
int inAssignmentLHSDepth)
const;
120 MCAPI
bool _validateChildrenAreNumerical(::MolangVersion version)
const;
126 MCAPI ::MolangScriptArg
const& evalGeneric(
::RenderParams& renderParams)
const;
128 MCAPI
bool findClosingOp(uint64& i, ::ExpressionOp endOp)
const;
130 MCAPI ::std::string
const getExpressionString()
const;
132 MCAPI ::std::string
const& getExpressionString();
134 MCAPI uint64 getTreeHash(
bool sideEffectsReturnZero)
const;
136 MCAPI
bool getTreeString(::std::string& dest,
bool sideEffectsReturnZero)
const;
138 MCAPI
bool hasDisallowedQueries(::std::vector<::std::string>
const& allowedQueries)
const;
140 MCAPI
bool hasMadd()
const;
142 MCAPI
bool hasSideEffects(
bool countRandomAsSideEffect)
const;
144 MCFOLD
bool isValid()
const;
146 MCAPI ::MolangCompileResult link()
const;
148 MCAPI ::MolangCompileResult link(::MolangVersion molangVersion)
const;
150 MCAPI
void moveConstantChildToValueIfFloatOrHashType(
int firstConstChildIndex);
156 MCAPI ::ExpressionNode& operator=(
float value);
160 MCAPI
bool optimizeFunctionCallParams();
163 parse(::std::string
const& inputExpression, ::MolangVersion molangVersion, ::gsl::span<::HashedString const> idSet);
165 MCAPI
bool processArrays();
167 MCAPI
bool processBinaryExpression(::ExpressionOp op);
169 MCAPI
bool processMathFuncs();
171 MCAPI
bool processMemberAccessors();
173 MCAPI
bool processNegativesAndLogicalNots();
175 MCAPI
bool processQueriesAndFunctions();
177 MCAPI
bool processSections();
179 MCAPI
bool processSemicolons();
181 MCAPI
bool processUnaryExpression(::ExpressionOp op);
189 MCAPI static ::MolangCompileResult
192 MCAPI static ::MolangScriptArg* _getOrCreateReferencedMemberVariableScriptArg(
197 MCAPI
static bool _getQueryFunctionAccessor(
199 ::std::string
const& functionName,
200 ::MolangVersion molangVersion,
201 ::MolangQueryFunctionReturnType functionReturnType,
205 MCAPI static ::MolangScriptArg
const*
208 MCAPI
static bool _initializeMolangQueries();
210 MCAPI
static void _writeScriptArgToMemberAccessedVariable(
216 MCAPI
static void _writeScriptArgToMolangVariable(
218 ::MolangVariableIndex variableIndex,
222 MCAPI
static void buildExpressionOpTable();
224 MCAPI
static float fast_atof_positiveOnly(
char const*& ptr);
226 MCAPI
static char const* getOpFriendlyName(::ExpressionOp op);
228 MCAPI static ::std::function<
230 queryFunctionAccessorFromString(
231 ::std::string
const& functionName,
232 ::MolangVersion molangVersion,
233 ::MolangQueryFunctionReturnType& functionReturnType,
234 bool missingIsOkay_returnNullIfSo
237 MCAPI static ::MolangQueryFunction& registerQueryFunction(
238 ::std::string
const& queryFunctionName,
240 ::std::string
const& documentation,
241 ::MolangQueryFunctionReturnType returnType,
243 uint64 minArgumentCount,
244 uint64 maxArgumentCount,
245 ::std::initializer_list<int>
const& experiments
249 unregisterQueryFunction(::std::string
const& queryFunctionName,
::HashedString querySetIdentifier);
256 _defaultUnknownQueryFunction();
258 MCAPI static ::std::vector<::std::pair<::std::string, ::ExpressionOp>>& mAliasOpTokens();
260 MCAPI static ::ExperimentStorage& mExperiments();
262 MCAPI static ::std::vector<::std::string>& mExpressionOpTokens();
265 mGetParticleTintFunc();
267 MCAPI
static bool& mMolangInitialized();
269 MCAPI static ::std::unordered_multimap<::HashedString, ::MolangQueryFunction>& mQueryFunctionAccessors();
271 MCAPI static ::std::unordered_map<::HashedString, ::std::unordered_set<::HashedString>>& mQuerySets();
286 $ctor(
::Json::Value const& value, ::MolangVersion molangVersion, ::gsl::span<::HashedString const> querySetID);