Update to GasaGen based on changes to UE 5.5 source

Will eventually need update the gencpp repo...
This commit is contained in:
Edward R. Gonzalez 2024-10-19 19:29:53 -04:00
parent f6cd4717ea
commit aaf2a082f0
4 changed files with 43 additions and 8 deletions

View File

@ -54,6 +54,9 @@ int gen_main()
PreprocessorDefines.append( get_cached_string(str_DECLARE_MULTICAST_DELEGATE_OneParam));
PreprocessorDefines.append( get_cached_string(str_DECLARE_MULTICAST_DELEGATE_ThreeParams));
PreprocessorDefines.append( get_cached_string(str_DECLARE_MULTICAST_DELEGATE_TwoParams));
PreprocessorDefines.append( get_cached_string(str_DECLARE_TS_MULTICAST_DELEGATE_OneParam));
PreprocessorDefines.append( get_cached_string(str_DECLARE_TS_MULTICAST_DELEGATE_TwoParams));
PreprocessorDefines.append( get_cached_string(str_DECLARE_TS_MULTICAST_DELEGATE_ThreeParams));
PreprocessorDefines.append( get_cached_string(str_DEFINE_ACTORDESC_TYPE));
PreprocessorDefines.append( get_cached_string(str_DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL));
PreprocessorDefines.append( get_cached_string(str_ENUM_CLASS_FLAGS));
@ -76,6 +79,7 @@ int gen_main()
PreprocessorDefines.append( get_cached_string(str_UPARAM));
PreprocessorDefines.append( get_cached_string(str_UPROPERTY));
PreprocessorDefines.append( get_cached_string(str_USTRUCT));
PreprocessorDefines.append( get_cached_string(str_UE_REQUIRES));
}
gen_UGasaAttributeSet();
@ -84,9 +88,9 @@ int gen_main()
// gen_netslime_interfaces();
// One offs
if (0)
if (1)
{
ue_parse_testing();
// ue_parse_testing();
swap_SBlueprintActionMenu_Construct();
}
return 0;

View File

@ -36,6 +36,9 @@ constexpr StrC str_DECLARE_LOG_CATEGORY_EXTERN = txt("
constexpr StrC str_DECLARE_MULTICAST_DELEGATE_OneParam = txt("DECLARE_MULTICAST_DELEGATE_OneParam(");
constexpr StrC str_DECLARE_MULTICAST_DELEGATE_ThreeParams = txt("DECLARE_MULTICAST_DELEGATE_ThreeParams(");
constexpr StrC str_DECLARE_MULTICAST_DELEGATE_TwoParams = txt("DECLARE_MULTICAST_DELEGATE_TwoParams(");
constexpr StrC str_DECLARE_TS_MULTICAST_DELEGATE_OneParam = txt("DECLARE_TS_MULTICAST_DELEGATE_OneParam(");
constexpr StrC str_DECLARE_TS_MULTICAST_DELEGATE_TwoParams = txt("DECLARE_TS_MULTICAST_DELEGATE_TwoParams(");
constexpr StrC str_DECLARE_TS_MULTICAST_DELEGATE_ThreeParams = txt("DECLARE_TS_MULTICAST_DELEGATE_ThreeParams(");
constexpr StrC str_DEFINE_ACTORDESC_TYPE = txt("DEFINE_ACTORDESC_TYPE(");
constexpr StrC str_DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL = txt("DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(");
constexpr StrC str_ENUM_CLASS_FLAGS = txt("ENUM_CLASS_FLAGS(");
@ -58,6 +61,7 @@ constexpr StrC str_UMETA = txt("
constexpr StrC str_UPARAM = txt("UPARAM(");
constexpr StrC str_UPROPERTY = txt("UPROPERTY(");
constexpr StrC str_USTRUCT = txt("USTRUCT(");
constexpr StrC str_UE_REQUIRES = txt("UE_REQUIRES(");
constexpr StrC str_GASA_API = txt("GASA_API");

View File

@ -2314,6 +2314,11 @@ void CodeParam::to_string( String& result )
else if ( ast->ValueType )
result.append_fmt( " %S", ast->ValueType.to_string() );
if ( ast->PostNameMacro )
{
result.append_fmt(" %S", ast->PostNameMacro.to_string() );
}
if ( ast->Value )
result.append_fmt( " = %S", ast->Value.to_string() );
@ -9708,10 +9713,11 @@ namespace parser
return { nullptr };
}
Code macro = { nullptr };
CodeType type = { nullptr };
Code value = { nullptr };
Token name = NullToken;
Code macro = { nullptr };
CodeType type = { nullptr };
Code value = { nullptr };
Token name = NullToken;
Code post_name_macro = { nullptr };
if ( check( TokType::Varadic_Argument ) )
{
@ -9752,6 +9758,15 @@ namespace parser
// ( <Macro> <ValueType> <Name>
}
// Unreal has yet another type of macro:
// template<class T UE_REQUIRES(TPointerIsConvertibleFromTo<T, UInterface>::Value)>
// class T ... and then ^this^ UE_REQUIRES shows up
// So we need to consume that.
if ( check( TokType::Preprocess_Macro ))
{
post_name_macro = parse_simple_preprocess( ETokType::Preprocess_Macro );
}
// In template captures you can have a typename have direct assignment without a name
// typename = typename ...
// Which would result in a static value type from a struct expansion (traditionally)
@ -9855,6 +9870,15 @@ namespace parser
// ( <Macro> <ValueType> <Name> = <Expression>, <Macro> <ValueType> <Name>
}
// Unreal has yet another type of macro:
// template<class T UE_REQUIRES(TPointerIsConvertibleFromTo<T, UInterface>::Value)>
// class T ... and then ^this^ UE_REQUIRES shows up
// So we need to consume that.
if ( check( TokType::Preprocess_Macro ))
{
post_name_macro = parse_simple_preprocess( ETokType::Preprocess_Macro );
}
// In template captures you can have a typename have direct assignment without a name
// typename = typename ...
// Which would result in a static value type from a struct expansion (traditionally)

View File

@ -830,7 +830,7 @@ struct AST
union
{
AST* ArrExpr; // Typename
AST* Body; // Class, Constructr, Destructor, Enum, Friend, Function, Namespace, Struct, Union
AST* Body; // Class, Constructor, Destructor, Enum, Friend, Function, Namespace, Struct, Union
AST* Declaration; // Friend, Template
AST* Value; // Parameter, Variable
};
@ -840,6 +840,7 @@ struct AST
AST* NextVar; // Variable; Possible way to handle comma separated variables declarations. ( , NextVar->Specs NextVar->Name NextVar->ArrExpr =
// NextVar->Value )
AST* SuffixSpecs; // Only used with typenames, to store the function suffix if typename is function signature. ( May not be needed )
AST* PostNameMacro; // Only used with parameters for specifically UE_REQUIRES (Thanks Unreal)
};
};
@ -921,6 +922,7 @@ struct AST_POD
AST* NextVar; // Variable; Possible way to handle comma separated variables declarations. ( , NextVar->Specs NextVar->Name NextVar->ArrExpr =
// NextVar->Value )
AST* SuffixSpecs; // Only used with typenames, to store the function suffix if typename is function signature. ( May not be needed )
AST* PostNameMacro; // Only used with parameters for specifically UE_REQUIRES (Thanks Unreal)
};
};
@ -2630,7 +2632,8 @@ struct AST_Param
CodeType ValueType;
Code Macro;
Code Value;
char _PAD_PROPERTIES_3_[sizeof( AST* )];
Code PostNameMacro; // Thanks Unreal
// char _PAD_PROPERTIES_3_[sizeof( AST* )];
};
};