mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-14 18:51:47 -07:00
Library can now construct into AST and serialization itself (singleheader).
Still need to validate if they match.
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
#if GEN_TIME
|
||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||
#define GEN_EXPOSE_BACKEND
|
||||
#define GEN_BENCHMARK
|
||||
#include "gen.hpp"
|
||||
#include "gen/gen.hpp"
|
||||
#include "gen/gen.builder.hpp"
|
||||
using namespace gen;
|
||||
|
||||
Code gen_SOA( CodeStruct struct_def, s32 num_entries = 0 )
|
||||
@ -118,7 +118,7 @@ void check_SOA()
|
||||
{
|
||||
log_fmt("\ncheck_SOA:");
|
||||
gen::init();
|
||||
Builder soa_test; soa_test.open( "SOA.gen.hpp" );
|
||||
Builder soa_test = Builder::open( "SOA.gen.hpp" );
|
||||
|
||||
soa_test.print( parse_using( code(
|
||||
using u16 = unsigned short;
|
||||
@ -142,4 +142,3 @@ void check_SOA()
|
||||
gen::deinit();
|
||||
log_fmt(" passed!\n");
|
||||
}
|
||||
#endif
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Testing to make sure backend of library is operating properly.
|
||||
|
||||
#ifdef GEN_TIME
|
||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||
#define GEN_EXPOSE_BACKEND
|
||||
#define GEN_BENCHMARK
|
||||
#include "gen.hpp"
|
||||
#include "gen/gen.hpp"
|
||||
#include "gen/gen.builder.hpp"
|
||||
|
||||
void check_sanity()
|
||||
{
|
||||
@ -89,4 +89,3 @@ void check_sanity()
|
||||
gen::deinit();
|
||||
log_fmt("\nSanity passed!\n");
|
||||
}
|
||||
#endif
|
||||
|
@ -2,7 +2,8 @@
|
||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||
#define GEN_EXPOSE_BACKEND
|
||||
#define GEN_BENCHMARK
|
||||
#include "gen.cpp"
|
||||
#include "gen/gen.cpp"
|
||||
#include "gen/gen.builder.cpp"
|
||||
#include "sanity.cpp"
|
||||
#include "SOA.cpp"
|
||||
#include "test.singleheader_ast.cpp"
|
||||
@ -15,7 +16,7 @@ int gen_main()
|
||||
|
||||
// check_sanity();
|
||||
|
||||
check_SOA();
|
||||
// check_SOA();
|
||||
|
||||
check_singleheader_ast();
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||
#define GEN_EXPOSE_BACKEND
|
||||
#define GEN_BENCHMARK
|
||||
#include "gen.hpp"
|
||||
#include "file_processors/scanner.hpp"
|
||||
#include "gen/gen.hpp"
|
||||
#include "gen/gen.builder.hpp"
|
||||
#include "gen/gen.scanner.hpp"
|
||||
using namespace gen;
|
||||
|
||||
void check_singleheader_ast()
|
||||
@ -20,6 +19,7 @@ void check_singleheader_ast()
|
||||
|
||||
log_fmt("generated AST!!!\n");
|
||||
|
||||
#if 0
|
||||
s32 idx = 0;
|
||||
for ( Code entry : ast )
|
||||
{
|
||||
@ -30,9 +30,9 @@ void check_singleheader_ast()
|
||||
log_fmt("Entry %d: %s\n", idx, entry.to_string() );
|
||||
idx++;
|
||||
}
|
||||
#endif
|
||||
|
||||
Builder builder;
|
||||
builder.open( "singleheader_copy.gen.hpp" );
|
||||
Builder builder = Builder::open( "singleheader_copy.gen.hpp" );
|
||||
log_fmt("\n\nserializng ast\n");
|
||||
builder.print( ast );
|
||||
builder.write();
|
||||
|
Reference in New Issue
Block a user