mirror of
https://github.com/Ed94/gencpp.git
synced 2025-01-09 08:23:32 -08:00
Ed_
a42e241afb
This isn't the last step though everything in the main project directory that isn't md files needs to be generated only. Can't do that till testing is robust enough...
108 lines
2.4 KiB
C++
108 lines
2.4 KiB
C++
// This file was generated automatially by gen.bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
|
|
|
#pragma once
|
|
|
|
namespace EOperator
|
|
{
|
|
enum Type : u32
|
|
{
|
|
Invalid,
|
|
Assign,
|
|
Assign_Add,
|
|
Assign_Subtract,
|
|
Assign_Multiply,
|
|
Assign_Divide,
|
|
Assign_Modulo,
|
|
Assign_BAnd,
|
|
Assign_BOr,
|
|
Assign_BXOr,
|
|
Assign_LShift,
|
|
Assign_RShift,
|
|
Increment,
|
|
Decrement,
|
|
Unary_Plus,
|
|
Unary_Minus,
|
|
UnaryNot,
|
|
Add,
|
|
Subtract,
|
|
Multiply,
|
|
Divide,
|
|
Modulo,
|
|
BNot,
|
|
BAnd,
|
|
BOr,
|
|
BXOr,
|
|
LShift,
|
|
RShift,
|
|
LAnd,
|
|
LOr,
|
|
LEqual,
|
|
LNot,
|
|
Lesser,
|
|
Greater,
|
|
LesserEqual,
|
|
GreaterEqual,
|
|
Subscript,
|
|
Indirection,
|
|
AddressOf,
|
|
MemberOfPointer,
|
|
PtrToMemOfPtr,
|
|
FunctionCall,
|
|
Comma,
|
|
NumOps
|
|
};
|
|
|
|
StrC to_str( Type op )
|
|
{
|
|
local_persist StrC lookup[] {
|
|
{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( "," ), "," },
|
|
};
|
|
return lookup[ op ];
|
|
}
|
|
|
|
} // namespace EOperator
|
|
|
|
using OperatorT = EOperator::Type;
|