2023-07-11 23:37:51 -07:00
|
|
|
#ifdef gen_time
|
|
|
|
#define GEN_FEATURE_PARSING
|
2023-07-15 23:26:55 -07:00
|
|
|
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
|
|
|
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
2023-07-10 19:56:59 -07:00
|
|
|
#include "Parsed\Array.Parsed.hpp"
|
2023-07-11 00:10:20 -07:00
|
|
|
#include "Parsed\Buffer.Parsed.hpp"
|
|
|
|
#include "Parsed\HashTable.Parsed.hpp"
|
|
|
|
#include "Parsed\Ring.Parsed.hpp"
|
2023-07-08 14:14:05 -07:00
|
|
|
#include "Parsed\Sanity.Parsed.hpp"
|
2023-07-11 15:29:45 -07:00
|
|
|
#include "SOA.hpp"
|
2023-07-08 11:11:41 -07:00
|
|
|
#include "gen.cpp"
|
|
|
|
|
|
|
|
using namespace gen;
|
|
|
|
|
2023-07-15 23:26:55 -07:00
|
|
|
// TODO : Need to make a more robust test suite
|
2023-07-08 11:11:41 -07:00
|
|
|
|
|
|
|
int gen_main()
|
|
|
|
{
|
|
|
|
gen::init();
|
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
gen_sanity();
|
2023-07-08 11:11:41 -07:00
|
|
|
|
2023-07-10 19:56:59 -07:00
|
|
|
gen_array( u8 );
|
2023-07-11 00:10:20 -07:00
|
|
|
gen_array( sw );
|
2023-07-08 11:11:41 -07:00
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
gen_buffer( u8 );
|
2023-07-08 11:11:41 -07:00
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
gen_hashtable( u32 );
|
2023-07-08 11:11:41 -07:00
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
gen_ring( s16 );
|
|
|
|
gen_ring( uw );
|
2023-07-08 11:11:41 -07:00
|
|
|
|
2023-07-10 19:56:59 -07:00
|
|
|
gen_array_file();
|
2023-07-11 00:10:20 -07:00
|
|
|
gen_buffer_file();
|
|
|
|
gen_hashtable_file();
|
|
|
|
gen_ring_file();
|
2023-07-08 11:11:41 -07:00
|
|
|
|
2023-07-11 15:29:45 -07:00
|
|
|
Builder soa_test; soa_test.open( "SOA.gen.hpp" );
|
|
|
|
|
|
|
|
soa_test.print( parse_using( code(
|
|
|
|
using u16 = unsigned short;
|
|
|
|
)));
|
|
|
|
|
2023-07-15 20:07:30 -07:00
|
|
|
soa_test.print( def_include( txt_StrC("gen.hpp")));
|
2023-07-11 15:29:45 -07:00
|
|
|
|
|
|
|
soa_test.print( def_using_namespace( name(gen) ) );
|
|
|
|
|
|
|
|
soa_test.print( gen_SOA(
|
|
|
|
parse_struct( code(
|
|
|
|
struct TestStruct
|
|
|
|
{
|
|
|
|
u8 A;
|
|
|
|
u16 B;
|
|
|
|
u32 C;
|
|
|
|
u64 D;
|
|
|
|
};
|
2023-07-15 20:07:30 -07:00
|
|
|
))
|
2023-07-11 15:29:45 -07:00
|
|
|
));
|
|
|
|
|
|
|
|
soa_test.write();
|
|
|
|
|
2023-07-08 11:11:41 -07:00
|
|
|
gen::deinit();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef runtime
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|