mirror of
https://github.com/Ed94/gencpp.git
synced 2024-11-13 20:24:52 -08:00
Ed_
1f77e39694
- Added support for anonymous structs. - Gave Token_Fmt::token_map its own static memory. - Minor natvis fix for CodeBody - Renamed ESpecifier::Static_Member to just Static (acts as a general use case) specifier option - Setup the lex token array with a configurable arena allocator. Two major things left before V0.3-4: - Attribute and Module parisng support with base case test - AST serializtaion strings get a dedicated slag allocator.
74 lines
1.1 KiB
C++
74 lines
1.1 KiB
C++
#ifdef gen_time
|
|
#define GEN_FEATURE_PARSING
|
|
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
|
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
|
#include "Parsed\Array.Parsed.hpp"
|
|
#include "Parsed\Buffer.Parsed.hpp"
|
|
#include "Parsed\HashTable.Parsed.hpp"
|
|
#include "Parsed\Ring.Parsed.hpp"
|
|
#include "Parsed\Sanity.Parsed.hpp"
|
|
#include "SOA.hpp"
|
|
#include "gen.cpp"
|
|
|
|
using namespace gen;
|
|
|
|
// TODO : Need to make a more robust test suite
|
|
|
|
int gen_main()
|
|
{
|
|
gen::init();
|
|
|
|
gen_sanity();
|
|
|
|
gen_array( u8 );
|
|
gen_array( sw );
|
|
|
|
gen_buffer( u8 );
|
|
|
|
gen_hashtable( u32 );
|
|
|
|
gen_ring( s16 );
|
|
gen_ring( uw );
|
|
|
|
gen_array_file();
|
|
gen_buffer_file();
|
|
gen_hashtable_file();
|
|
gen_ring_file();
|
|
|
|
Builder soa_test; soa_test.open( "SOA.gen.hpp" );
|
|
|
|
soa_test.print( parse_using( code(
|
|
using u16 = unsigned short;
|
|
)));
|
|
|
|
soa_test.print( def_include( txt_StrC("gen.hpp")));
|
|
|
|
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;
|
|
};
|
|
))
|
|
));
|
|
|
|
soa_test.write();
|
|
|
|
gen::deinit();
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifdef runtime
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|