mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-31 01:16:58 -07:00
Library can now construct into AST and serialization itself (singleheader).
Still need to validate if they match.
This commit is contained in:
@@ -5,6 +5,7 @@ namespace ECode
|
||||
# define Define_Types \
|
||||
Entry( Invalid ) \
|
||||
Entry( Untyped ) \
|
||||
Entry( NewLine ) \
|
||||
Entry( Comment ) \
|
||||
Entry( Access_Private ) \
|
||||
Entry( Access_Protected ) \
|
||||
|
@@ -57,14 +57,14 @@ namespace EOperator
|
||||
};
|
||||
|
||||
inline
|
||||
char const* to_str( Type op )
|
||||
StrC to_str( Type op )
|
||||
{
|
||||
local_persist
|
||||
char const* lookup[ Num_Ops ] = {
|
||||
# define Entry( Type_, Token_ ) stringize(Token_),
|
||||
StrC lookup[ Num_Ops ] = {
|
||||
# define Entry( Type_, Token_ ) { sizeof(stringize(Token_)), stringize(Token_) },
|
||||
Define_Operators
|
||||
# undef Entry
|
||||
","
|
||||
txt_StrC(",")
|
||||
};
|
||||
|
||||
return lookup[ op ];
|
||||
|
@@ -50,10 +50,10 @@ namespace Parser
|
||||
Entry( Decl_Typedef, "typedef" ) \
|
||||
Entry( Decl_Using, "using" ) \
|
||||
Entry( Decl_Union, "union" ) \
|
||||
Entry( Empty_Line, "__empty_line__" ) \
|
||||
Entry( Identifier, "__identifier__" ) \
|
||||
Entry( Module_Import, "import" ) \
|
||||
Entry( Module_Export, "export" ) \
|
||||
Entry( NewLine, "__NewLine__" ) \
|
||||
Entry( Number, "__number__" ) \
|
||||
Entry( Operator, "__operator__" ) \
|
||||
Entry( Preprocess_Define, "define") \
|
||||
@@ -144,12 +144,12 @@ namespace Parser
|
||||
}
|
||||
|
||||
internal inline
|
||||
char const* to_str( Type type )
|
||||
StrC to_str( Type type )
|
||||
{
|
||||
local_persist
|
||||
char const* lookup[(u32)NumTokens] =
|
||||
StrC lookup[(u32)NumTokens] =
|
||||
{
|
||||
# define Entry( Name_, Str_ ) Str_,
|
||||
# define Entry( Name_, Str_ ) { sizeof(Str_), Str_ },
|
||||
Define_TokType
|
||||
GEN_DEFINE_ATTRIBUTE_TOKENS
|
||||
# undef Entry
|
||||
|
Reference in New Issue
Block a user