gencpp/project/components/gen/ecode.hpp

142 lines
4.8 KiB
C++
Raw Normal View History

#pragma once
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
2023-08-21 22:51:59 -07:00
namespace ECode
{
enum Type : u32
{
Invalid,
Untyped,
NewLine,
Comment,
Access_Private,
Access_Protected,
Access_Public,
PlatformAttributes,
Class,
Class_Fwd,
Class_Body,
Constructor,
Constructor_Fwd,
Destructor,
Destructor_Fwd,
Enum,
Enum_Fwd,
Enum_Body,
Enum_Class,
Enum_Class_Fwd,
Execution,
Export_Body,
Extern_Linkage,
Extern_Linkage_Body,
Friend,
Function,
Function_Fwd,
Function_Body,
Global_Body,
Module,
Namespace,
Namespace_Body,
Operator,
Operator_Fwd,
Operator_Member,
Operator_Member_Fwd,
Operator_Cast,
Operator_Cast_Fwd,
Parameters,
Preprocess_Define,
Preprocess_Include,
Preprocess_If,
Preprocess_IfDef,
Preprocess_IfNotDef,
Preprocess_ElIf,
Preprocess_Else,
Preprocess_EndIf,
Preprocess_Pragma,
Specifiers,
Struct,
Struct_Fwd,
Struct_Body,
Template,
Typedef,
Typename,
Union,
Union_Body,
Using,
Using_Namespace,
Variable,
NumTypes
};
StrC to_str( Type type )
{
local_persist StrC lookup[] {
{sizeof( "Invalid" ), "Invalid" },
{ sizeof( "Untyped" ), "Untyped" },
{ sizeof( "NewLine" ), "NewLine" },
{ sizeof( "Comment" ), "Comment" },
{ sizeof( "Access_Private" ), "Access_Private" },
{ sizeof( "Access_Protected" ), "Access_Protected" },
{ sizeof( "Access_Public" ), "Access_Public" },
{ sizeof( "PlatformAttributes" ), "PlatformAttributes" },
{ sizeof( "Class" ), "Class" },
{ sizeof( "Class_Fwd" ), "Class_Fwd" },
{ sizeof( "Class_Body" ), "Class_Body" },
{ sizeof( "Constructor" ), "Constructor" },
{ sizeof( "Constructor_Fwd" ), "Constructor_Fwd" },
{ sizeof( "Destructor" ), "Destructor" },
{ sizeof( "Destructor_Fwd" ), "Destructor_Fwd" },
{ sizeof( "Enum" ), "Enum" },
{ sizeof( "Enum_Fwd" ), "Enum_Fwd" },
{ sizeof( "Enum_Body" ), "Enum_Body" },
{ sizeof( "Enum_Class" ), "Enum_Class" },
{ sizeof( "Enum_Class_Fwd" ), "Enum_Class_Fwd" },
{ sizeof( "Execution" ), "Execution" },
{ sizeof( "Export_Body" ), "Export_Body" },
{ sizeof( "Extern_Linkage" ), "Extern_Linkage" },
{ sizeof( "Extern_Linkage_Body" ), "Extern_Linkage_Body"},
{ sizeof( "Friend" ), "Friend" },
{ sizeof( "Function" ), "Function" },
{ sizeof( "Function_Fwd" ), "Function_Fwd" },
{ sizeof( "Function_Body" ), "Function_Body" },
{ sizeof( "Global_Body" ), "Global_Body" },
{ sizeof( "Module" ), "Module" },
{ sizeof( "Namespace" ), "Namespace" },
{ sizeof( "Namespace_Body" ), "Namespace_Body" },
{ sizeof( "Operator" ), "Operator" },
{ sizeof( "Operator_Fwd" ), "Operator_Fwd" },
{ sizeof( "Operator_Member" ), "Operator_Member" },
{ sizeof( "Operator_Member_Fwd" ), "Operator_Member_Fwd"},
{ sizeof( "Operator_Cast" ), "Operator_Cast" },
{ sizeof( "Operator_Cast_Fwd" ), "Operator_Cast_Fwd" },
{ sizeof( "Parameters" ), "Parameters" },
{ sizeof( "Preprocess_Define" ), "Preprocess_Define" },
{ sizeof( "Preprocess_Include" ), "Preprocess_Include" },
{ sizeof( "Preprocess_If" ), "Preprocess_If" },
{ sizeof( "Preprocess_IfDef" ), "Preprocess_IfDef" },
{ sizeof( "Preprocess_IfNotDef" ), "Preprocess_IfNotDef"},
{ sizeof( "Preprocess_ElIf" ), "Preprocess_ElIf" },
{ sizeof( "Preprocess_Else" ), "Preprocess_Else" },
{ sizeof( "Preprocess_EndIf" ), "Preprocess_EndIf" },
{ sizeof( "Preprocess_Pragma" ), "Preprocess_Pragma" },
{ sizeof( "Specifiers" ), "Specifiers" },
{ sizeof( "Struct" ), "Struct" },
{ sizeof( "Struct_Fwd" ), "Struct_Fwd" },
{ sizeof( "Struct_Body" ), "Struct_Body" },
{ sizeof( "Template" ), "Template" },
{ sizeof( "Typedef" ), "Typedef" },
{ sizeof( "Typename" ), "Typename" },
{ sizeof( "Union" ), "Union" },
{ sizeof( "Union_Body" ), "Union_Body" },
{ sizeof( "Using" ), "Using" },
{ sizeof( "Using_Namespace" ), "Using_Namespace" },
{ sizeof( "Variable" ), "Variable" },
};
return lookup[ type ];
}
} // namespace ECode
using CodeT = ECode::Type;