8#define LOCTEXT_NAMESPACE "ExpressionParser"
95 template<
typename T, u
int32 MaxStackAllocationSize>
106 template <
typename Ret_,
typename T,
typename Arg1_>
114 template <
typename Ret_,
typename T,
typename Arg1_>
122 template <
typename Ret_,
typename T,
typename Arg1_,
typename Arg2_>
131 template <
typename Ret_,
typename T,
typename Arg1_,
typename Arg2_>
140 template <
typename Ret_,
typename T,
typename Arg1_,
typename Arg2_,
typename Arg3_>
150 template <
typename Ret_,
typename T,
typename Arg1_,
typename Arg2_,
typename Arg3_>
160 template <
typename T>
177 template<
typename OperandType,
typename ContextType,
typename FuncType>
182 if constexpr (NumArgs == 1)
190 else if constexpr (NumArgs == 2)
200 static_assert(
sizeof(
OperandType) == 0,
"FuncType has an unexpected number of parameters");
206 template<
typename LeftOperandType,
typename RightOperandType,
typename ContextType,
typename FuncType>
211 if constexpr (NumArgs == 2)
219 else if constexpr (NumArgs == 3)
229 static_assert(
sizeof(LeftOperandType) == 0,
"FuncType has an unexpected number of parameters");
235 template<
typename OperandType,
typename ContextType,
typename FuncType>
240 if constexpr (NumArgs == 1)
248 else if constexpr (NumArgs == 2)
258 static_assert(
sizeof(
OperandType) == 0,
"FuncType has an unexpected number of parameters");
287template<
typename ContextType,
typename CharType>
291 if (
const auto* Func = BinaryOps.Find(ID))
303template<
typename ContextType,
typename CharType>
307 if (
const auto* Func = BinaryShortCircuits.Find(ID))
315template<
typename ContextType,
typename CharType>
319 if (
const auto* Func = PreUnaryOps.Find(ID))
330template<
typename ContextType,
typename CharType>
334 if (
const auto* Func = PostUnaryOps.Find(ID))
345template<
typename ContextType,
typename CharType>
346template<
typename OperatorType,
typename FuncType>
349 using OperandType = std::decay_t<typename Impl::TCallableInfo<FuncType>::Arg1>;
357 PreUnaryOps.Add(ID, Impl::WrapUnaryFunction<OperandType, ContextType>(
InFunc));
360template<
typename ContextType,
typename CharType>
361template<
typename OperatorType,
typename FuncType>
364 using OperandType = std::decay_t<typename Impl::TCallableInfo<FuncType>::Arg1>;
372 PostUnaryOps.Add(ID, Impl::WrapUnaryFunction<OperandType, ContextType>(
InFunc));
375template<
typename ContextType,
typename CharType>
376template<
typename OperatorType,
typename FuncType>
379 using LeftOperandType = std::decay_t<typename Impl::TCallableInfo<FuncType>::Arg1>;
380 using RightOperandType = std::decay_t<typename Impl::TCallableInfo<FuncType>::Arg2>;
388 BinaryOps.Add(ID, Impl::WrapBinaryFunction<LeftOperandType, RightOperandType, ContextType>(
InFunc));
391template<
typename ContextType,
typename CharType>
392template<
typename OperatorType,
typename FuncType>
395 using OperandType = std::decay_t<typename Impl::TCallableInfo<FuncType>::Arg1>;
403 BinaryShortCircuits.Add(ID, Impl::WrapShortCircuitFunction<OperandType, ContextType>(
InFunc));
409#undef LOCTEXT_NAMESPACE
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define LOCTEXT(InKey, InTextLiteral)
Definition Internationalization.h:295
#define UE_REQUIRES_DEFINITION(...)
Definition Requires.h:88
UE_FORCEINLINE_HINT TUniquePtr< T > MakeUnique(TArgs &&... Args)
Definition UniquePtr.h:918
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
UE_REWRITE TValueOrError_ErrorProxy< ArgTypes... > MakeError(ArgTypes &&... Args UE_LIFETIMEBOUND)
Definition ValueOrError.h:41
UE_REWRITE TValueOrError_ValueProxy< ArgTypes... > MakeValue(ArgTypes &&... Args UE_LIFETIMEBOUND)
Definition ValueOrError.h:35
Definition ExpressionParserTypes.h:217
FExpressionNode()=default
CORE_API const FGuid & GetTypeId() const
Definition ExpressionParser.cpp:430
const T * Cast() const
Definition ExpressionParserTypes.inl:276
static CORE_API FText FromString(const ANSICHAR *String)
Definition Text.cpp:1081
static CORE_API FText Format(FTextFormat Fmt, const FFormatNamedArguments &InArguments)
Definition Text.cpp:469
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition ExpressionParserTypes.h:263
TStringToken< CharType > Context
Definition ExpressionParserTypes.h:272
FExpressionNode Node
Definition ExpressionParserTypes.h:271
Definition AndroidPlatformMisc.h:14
Definition UniquePtr.h:107
Definition ValueOrError.h:58
Definition ExpressionParserTypes.h:21
TOperatorJumpTable< ContextType >::FUnaryFunction WrapUnaryFunction(FuncType In)
Definition ExpressionParserTypes.inl:178
TOperatorJumpTable< ContextType >::FShortCircuit WrapShortCircuitFunction(FuncType In)
Definition ExpressionParserTypes.inl:236
TOperatorJumpTable< ContextType >::FBinaryFunction WrapBinaryFunction(FuncType In)
Definition ExpressionParserTypes.inl:207
FExpressionResult ForwardReturnType(T &&Result)
Definition ExpressionParserTypes.inl:167
Definition ExpressionParserTypes.h:295
Definition ExpressionParserTypes.inl:65
virtual void MoveAssign(uint8 *Dst) override
Definition ExpressionParserTypes.inl:85
const T * Access() const
Definition ExpressionParserTypes.inl:75
virtual FExpressionNode Copy() const override
Definition ExpressionParserTypes.inl:89
virtual void Reseat(uint8 *Dst) override
Definition ExpressionParserTypes.inl:80
FHeapDataStorage(T InValue)
Definition ExpressionParserTypes.inl:70
TUniquePtr< T > Value
Definition ExpressionParserTypes.inl:67
Definition ExpressionParserTypes.inl:32
virtual void Reseat(uint8 *Dst) override
Definition ExpressionParserTypes.inl:46
virtual FExpressionNode Copy() const override
Definition ExpressionParserTypes.inl:56
T Value
Definition ExpressionParserTypes.inl:34
FInlineDataStorage(T InValue)
Definition ExpressionParserTypes.inl:36
virtual void MoveAssign(uint8 *Dst) override
Definition ExpressionParserTypes.inl:51
const T * Access() const
Definition ExpressionParserTypes.inl:41
Definition ExpressionParserTypes.inl:18
virtual void Reseat(uint8 *Dst)=0
virtual void MoveAssign(uint8 *Dst)=0
virtual FExpressionNode Copy() const =0
virtual ~IExpressionNodeStorage()=default
Arg2_ Arg2
Definition ExpressionParserTypes.inl:155
Ret_ Ret
Definition ExpressionParserTypes.inl:153
Arg1_ Arg1
Definition ExpressionParserTypes.inl:154
Arg3_ Arg3
Definition ExpressionParserTypes.inl:156
Arg1_ Arg1
Definition ExpressionParserTypes.inl:144
Arg2_ Arg2
Definition ExpressionParserTypes.inl:145
Ret_ Ret
Definition ExpressionParserTypes.inl:143
Arg3_ Arg3
Definition ExpressionParserTypes.inl:146
Arg2_ Arg2
Definition ExpressionParserTypes.inl:136
Arg1_ Arg1
Definition ExpressionParserTypes.inl:135
Ret_ Ret
Definition ExpressionParserTypes.inl:134
Arg2_ Arg2
Definition ExpressionParserTypes.inl:127
Arg1_ Arg1
Definition ExpressionParserTypes.inl:126
Ret_ Ret
Definition ExpressionParserTypes.inl:125
Arg1_ Arg1
Definition ExpressionParserTypes.inl:118
Ret_ Ret
Definition ExpressionParserTypes.inl:117
Ret_ Ret
Definition ExpressionParserTypes.inl:109
Arg1_ Arg1
Definition ExpressionParserTypes.inl:110
Definition ExpressionParserTypes.inl:104
Definition ExpressionParserTypes.inl:162
Definition ExpressionParserTypes.inl:97
std::conditional_t< sizeof(FInlineDataStorage< T >)<=MaxStackAllocationSize, FInlineDataStorage< T >, FHeapDataStorage< T > > Type
Definition ExpressionParserTypes.inl:98
Definition ExpressionParserTypes.h:205
Definition ExpressionParserTypes.h:424
FExpressionResult ExecPreUnary(const TExpressionToken< CharType > &Operator, const TExpressionToken< CharType > &R, const ContextType *Context) const
Definition ExpressionParserTypes.inl:316
void MapPostUnary(FuncType InFunc)
Definition ExpressionParserTypes.inl:362
FExpressionResult ExecPostUnary(const TExpressionToken< CharType > &Operator, const TExpressionToken< CharType > &L, const ContextType *Context) const
Definition ExpressionParserTypes.inl:331
bool ShouldShortCircuit(const TExpressionToken< CharType > &Operator, const TExpressionToken< CharType > &L, const ContextType *Context) const
Definition ExpressionParserTypes.inl:304
FExpressionResult ExecBinary(const TExpressionToken< CharType > &Operator, const TExpressionToken< CharType > &L, const TExpressionToken< CharType > &R, const ContextType *Context) const
Definition ExpressionParserTypes.inl:288
void MapPreUnary(FuncType InFunc)
Definition ExpressionParserTypes.inl:347
void MapBinary(FuncType InFunc)
Definition ExpressionParserTypes.inl:377
void MapShortCircuit(FuncType InFunc)
Definition ExpressionParserTypes.inl:393