mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-23 08:14:45 -08:00
119 lines
2.9 KiB
C++
119 lines
2.9 KiB
C++
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
|
#pragma once
|
|
#include "components/types.hpp"
|
|
#endif
|
|
|
|
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
|
|
|
enum Operator : u32
|
|
{
|
|
Op_Invalid,
|
|
Op_Assign,
|
|
Op_Assign_Add,
|
|
Op_Assign_Subtract,
|
|
Op_Assign_Multiply,
|
|
Op_Assign_Divide,
|
|
Op_Assign_Modulo,
|
|
Op_Assign_BAnd,
|
|
Op_Assign_BOr,
|
|
Op_Assign_BXOr,
|
|
Op_Assign_LShift,
|
|
Op_Assign_RShift,
|
|
Op_Increment,
|
|
Op_Decrement,
|
|
Op_Unary_Plus,
|
|
Op_Unary_Minus,
|
|
Op_UnaryNot,
|
|
Op_Add,
|
|
Op_Subtract,
|
|
Op_Multiply,
|
|
Op_Divide,
|
|
Op_Modulo,
|
|
Op_BNot,
|
|
Op_BAnd,
|
|
Op_BOr,
|
|
Op_BXOr,
|
|
Op_LShift,
|
|
Op_RShift,
|
|
Op_LAnd,
|
|
Op_LOr,
|
|
Op_LEqual,
|
|
Op_LNot,
|
|
Op_Lesser,
|
|
Op_Greater,
|
|
Op_LesserEqual,
|
|
Op_GreaterEqual,
|
|
Op_Subscript,
|
|
Op_Indirection,
|
|
Op_AddressOf,
|
|
Op_MemberOfPointer,
|
|
Op_PtrToMemOfPtr,
|
|
Op_FunctionCall,
|
|
Op_Comma,
|
|
Op_New,
|
|
Op_NewArray,
|
|
Op_Delete,
|
|
Op_DeleteArray,
|
|
Op_NumOps,
|
|
Op_UnderlyingType = 0xffffffffu
|
|
};
|
|
|
|
inline StrC operator_to_str( Operator op )
|
|
{
|
|
local_persist StrC lookup[47] = {
|
|
{ sizeof( "INVALID" ), "INVALID" },
|
|
{ sizeof( "=" ), "=" },
|
|
{ sizeof( "+=" ), "+=" },
|
|
{ sizeof( "-=" ), "-=" },
|
|
{ sizeof( "*=" ), "*=" },
|
|
{ sizeof( "/=" ), "/=" },
|
|
{ sizeof( "%=" ), "%=" },
|
|
{ sizeof( "&=" ), "&=" },
|
|
{ sizeof( "|=" ), "|=" },
|
|
{ sizeof( "^=" ), "^=" },
|
|
{ sizeof( "<<=" ), "<<=" },
|
|
{ sizeof( ">>=" ), ">>=" },
|
|
{ sizeof( "++" ), "++" },
|
|
{ sizeof( "--" ), "--" },
|
|
{ sizeof( "+" ), "+" },
|
|
{ sizeof( "-" ), "-" },
|
|
{ sizeof( "!" ), "!" },
|
|
{ sizeof( "+" ), "+" },
|
|
{ sizeof( "-" ), "-" },
|
|
{ sizeof( "*" ), "*" },
|
|
{ sizeof( "/" ), "/" },
|
|
{ sizeof( "%" ), "%" },
|
|
{ sizeof( "~" ), "~" },
|
|
{ sizeof( "&" ), "&" },
|
|
{ sizeof( "|" ), "|" },
|
|
{ sizeof( "^" ), "^" },
|
|
{ sizeof( "<<" ), "<<" },
|
|
{ sizeof( ">>" ), ">>" },
|
|
{ sizeof( "&&" ), "&&" },
|
|
{ sizeof( "||" ), "||" },
|
|
{ sizeof( "==" ), "==" },
|
|
{ sizeof( "!=" ), "!=" },
|
|
{ sizeof( "<" ), "<" },
|
|
{ sizeof( ">" ), ">" },
|
|
{ sizeof( "<=" ), "<=" },
|
|
{ sizeof( ">=" ), ">=" },
|
|
{ sizeof( "[]" ), "[]" },
|
|
{ sizeof( "*" ), "*" },
|
|
{ sizeof( "&" ), "&" },
|
|
{ sizeof( "->" ), "->" },
|
|
{ sizeof( "->*" ), "->*" },
|
|
{ sizeof( "()" ), "()" },
|
|
{ sizeof( "," ), "," },
|
|
{ sizeof( "new" ), "new" },
|
|
{ sizeof( "new[]" ), "new[]" },
|
|
{ sizeof( "delete" ), "delete" },
|
|
{ sizeof( "delete[]" ), "delete[]" },
|
|
};
|
|
return lookup[op];
|
|
}
|
|
|
|
forceinline StrC to_str( Operator op )
|
|
{
|
|
return operator_to_str( op );
|
|
}
|