2020-01-19 08:14:14 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2019-12-31 21:15:28 +00:00
|
|
|
|
2020-01-20 01:48:57 +00:00
|
|
|
#include "gs_meta.cpp"
|
|
|
|
#include "gs_meta_typeinfo_generator.h"
|
2020-01-20 01:34:49 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2020-01-20 01:34:49 +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
|
|
|
|
2020-01-19 12:03:07 +00:00
|
|
|
FinishGeneratingTypes(&TypeGenerator);
|
2020-01-20 01:34:49 +00:00
|
|
|
|
2020-01-19 12:03:07 +00:00
|
|
|
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);
|
2020-01-19 12:03:07 +00:00
|
|
|
}
|
|
|
|
|
2020-01-20 01:34:49 +00:00
|
|
|
FinishMetaprogram(&Meta);
|
2020-01-19 12:03:07 +00:00
|
|
|
//__debugbreak();
|
2019-10-30 14:28:02 +00:00
|
|
|
return 0;
|
|
|
|
}
|