mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-15 03:01:47 -07:00
Massive total progress on c_library generation: (Summary of last 3 WIP commits)
- No longer using GEN_API_C_* macros as C-library wont need them and if you need C linkage there is no need to use the c++ library. - GEN_C_LIKE_CPP replaces GEN_SUPPORT_CPP_MEMBER_FEATURES && GEN_SUPPORT_CPP_REFERENCES a. If users don't want to use member functions, function overloading, or referencese they can just this one macro to before including the library. - Enums aren't accomodated in C++ sources, they entirely converted in c_libray.cpp - ast.hpp now properly generates with C variant - Fully prepared code_types.hpp for C library gen (not tested yet) - Generated enums managed by helper.hpp now properly generate for C library.
This commit is contained in:
@ -142,67 +142,67 @@ inline StrC codetype_to_str( CodeType type )
|
||||
inline StrC codetype_to_keyword_str( CodeType type )
|
||||
{
|
||||
local_persist StrC lookup[61] = {
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "//" ), "//" },
|
||||
{ sizeof( "private" ), "private" },
|
||||
{ sizeof( "protected" ), "protected" },
|
||||
{ sizeof( "public" ), "public" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "class" ), "class" },
|
||||
{ sizeof( "clsss" ), "clsss" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "enum" ), "enum" },
|
||||
{ sizeof( "enum" ), "enum" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "enum class" ), "enum class" },
|
||||
{ sizeof( "enum class" ), "enum class" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "extern" ), "extern" },
|
||||
{ sizeof( "extern" ), "extern" },
|
||||
{ sizeof( "friend" ), "friend" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "module" ), "module" },
|
||||
{ sizeof( "namespace" ), "namespace" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "operator" ), "operator" },
|
||||
{ sizeof( "operator" ), "operator" },
|
||||
{ sizeof( "operator" ), "operator" },
|
||||
{ sizeof( "operator" ), "operator" },
|
||||
{ sizeof( "operator" ), "operator" },
|
||||
{ sizeof( "operator" ), "operator" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "define" ), "define" },
|
||||
{ sizeof( "include" ), "include" },
|
||||
{ sizeof( "if" ), "if" },
|
||||
{ sizeof( "ifdef" ), "ifdef" },
|
||||
{ sizeof( "ifndef" ), "ifndef" },
|
||||
{ sizeof( "elif" ), "elif" },
|
||||
{ sizeof( "else" ), "else" },
|
||||
{ sizeof( "endif" ), "endif" },
|
||||
{ sizeof( "pragma" ), "pragma" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "struct" ), "struct" },
|
||||
{ sizeof( "struct" ), "struct" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "template" ), "template" },
|
||||
{ sizeof( "typedef" ), "typedef" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "union" ), "union" },
|
||||
{ sizeof( "union" ), "union" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "using" ), "using" },
|
||||
{ sizeof( "using namespace" ), "using namespace" },
|
||||
{ sizeof( "__NA__" ), "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "//" ) - 1, "//" },
|
||||
{ sizeof( "private" ) - 1, "private" },
|
||||
{ sizeof( "protected" ) - 1, "protected" },
|
||||
{ sizeof( "public" ) - 1, "public" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "class" ) - 1, "class" },
|
||||
{ sizeof( "clsss" ) - 1, "clsss" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "enum" ) - 1, "enum" },
|
||||
{ sizeof( "enum" ) - 1, "enum" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "enum class" ) - 1, "enum class" },
|
||||
{ sizeof( "enum class" ) - 1, "enum class" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "extern" ) - 1, "extern" },
|
||||
{ sizeof( "extern" ) - 1, "extern" },
|
||||
{ sizeof( "friend" ) - 1, "friend" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "module" ) - 1, "module" },
|
||||
{ sizeof( "namespace" ) - 1, "namespace" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "operator" ) - 1, "operator" },
|
||||
{ sizeof( "operator" ) - 1, "operator" },
|
||||
{ sizeof( "operator" ) - 1, "operator" },
|
||||
{ sizeof( "operator" ) - 1, "operator" },
|
||||
{ sizeof( "operator" ) - 1, "operator" },
|
||||
{ sizeof( "operator" ) - 1, "operator" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "define" ) - 1, "define" },
|
||||
{ sizeof( "include" ) - 1, "include" },
|
||||
{ sizeof( "if" ) - 1, "if" },
|
||||
{ sizeof( "ifdef" ) - 1, "ifdef" },
|
||||
{ sizeof( "ifndef" ) - 1, "ifndef" },
|
||||
{ sizeof( "elif" ) - 1, "elif" },
|
||||
{ sizeof( "else" ) - 1, "else" },
|
||||
{ sizeof( "endif" ) - 1, "endif" },
|
||||
{ sizeof( "pragma" ) - 1, "pragma" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "struct" ) - 1, "struct" },
|
||||
{ sizeof( "struct" ) - 1, "struct" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "template" ) - 1, "template" },
|
||||
{ sizeof( "typedef" ) - 1, "typedef" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "union" ) - 1, "union" },
|
||||
{ sizeof( "union" ) - 1, "union" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
{ sizeof( "using" ) - 1, "using" },
|
||||
{ sizeof( "using namespace" ) - 1, "using namespace" },
|
||||
{ sizeof( "__NA__" ) - 1, "__NA__" },
|
||||
};
|
||||
return lookup[type];
|
||||
}
|
||||
|
Reference in New Issue
Block a user