I know for a fact that unreal uses a reflection system in order to have C++ scripts. I also know that it uses macros in order to define how the variables should be reflected by the engine. Here comes what i don't know:
Are this macros defining metadata from within the code execution (filling lists, defining structs, etc...), or are they just markers for a parser that generates more C++ code, which then is used by the engine to know which variables to reflect?
It has to be one of this two, since I highly doubt that macros could help with parsing debug code, which is the only third option that I have found after investigating several C++ reflection systems.
Unreal engine generates C++ code that is used for the reflection system.
UHT parses the headers, builds up a set of reflection data, and then generates C++ code containing the reflection data (contributing to a per-module .generated.inl), as well as various helpers and thunk functions (per-header .generated.h).
From https://www.unrealengine.com/en-US/blog/unreal-property-system-reflection