Lumenarium/meta/foldhaus_meta.cpp

47 lines
1.4 KiB
C++
Raw Normal View History

//
// Usage
//
// GSMetaTag(<tag name>) to give commands to the meta layer
//
// Tag Values
//
// breakpoint
// will cause the meta layer to break in the debugger when it reaches
// that point in processing the file
// TODO: specify which stage you want it to break at
#include "gs_meta.cpp"
#include "gs_meta_typeinfo_generator.h"
int main(int ArgCount, char* Args[])
{
if (ArgCount <= 1)
{
printf("Please supply at least one source directory to analyze.\n");
return 0;
}
gs_meta_preprocessor Meta = PreprocessProgram(Args[1]);
s64 Cycles_Preprocess = GetWallClock();
typeinfo_generator TypeGenerator = InitTypeInfoGenerator(Meta.TypeTable);
2020-01-20 01:03:19 +00:00
GenerateFilteredTypeInfo(MakeStringLiteral("node_struct"), Meta.TypeTable, &TypeGenerator);
GenerateFilteredTypeInfo(MakeStringLiteral("gen_type_info"), Meta.TypeTable, &TypeGenerator);
2020-01-20 01:03:19 +00:00
FinishGeneratingTypes(&TypeGenerator);
FILE* TypeInfoH = fopen("C:\\projects\\foldhaus\\src\\generated\\gs_meta_generated_typeinfo.h", "w");
if (TypeInfoH)
{
WriteStringBuilderToFile(TypeGenerator.TypeList, TypeInfoH);
WriteStringBuilderToFile(TypeGenerator.StructMembers, TypeInfoH);
WriteStringBuilderToFile(TypeGenerator.TypeDefinitions, TypeInfoH);
2020-01-20 01:03:19 +00:00
fclose(TypeInfoH);
}
FinishMetaprogram(&Meta);
//__debugbreak();
2019-10-30 14:28:02 +00:00
return 0;
}