eliminate old eval/type-graph layers

This commit is contained in:
Ryan Fleury
2024-08-06 10:20:37 -07:00
parent e951d788ed
commit c1cea82ae7
26 changed files with 444 additions and 7229 deletions
+121 -47
View File
@@ -4,51 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
U8 eval_expr_kind_child_counts[40] =
{
0,
2,
2,
1,
1,
2,
1,
1,
1,
1,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
3,
0,
0,
0,
0,
0,
0,
1,
2,
1,
2,
0,
};
String8 eval_expr_kind_strings[40] =
String8 e_expr_kind_strings[41] =
{
str8_lit_comp("Nil"),
str8_lit_comp("ArrayIndex"),
@@ -81,6 +37,7 @@ str8_lit_comp("LogOr"),
str8_lit_comp("Ternary"),
str8_lit_comp("LeafBytecode"),
str8_lit_comp("LeafMember"),
str8_lit_comp("LeafStringLiteral"),
str8_lit_comp("LeafU64"),
str8_lit_comp("LeafF64"),
str8_lit_comp("LeafF32"),
@@ -92,7 +49,7 @@ str8_lit_comp("Define"),
str8_lit_comp("LeafIdent"),
};
String8 eval_result_code_display_strings[11] =
String8 e_interpretation_code_display_strings[11] =
{
str8_lit_comp(""),
str8_lit_comp("Cannot divide by zero."),
@@ -107,7 +64,7 @@ str8_lit_comp("Insufficient evaluation machine stack space."),
str8_lit_comp("Malformed bytecode."),
};
String8 eval_expr_op_strings[40] =
String8 e_expr_op_strings[41] =
{
str8_lit_comp(""),
str8_lit_comp("[]"),
@@ -140,6 +97,7 @@ str8_lit_comp("||"),
str8_lit_comp("? "),
str8_lit_comp("bytecode"),
str8_lit_comp("member"),
str8_lit_comp("string_literal"),
str8_lit_comp("U64"),
str8_lit_comp("F64"),
str8_lit_comp("F32"),
@@ -151,5 +109,121 @@ str8_lit_comp("="),
str8_lit_comp("leaf_ident"),
};
U8 e_kind_basic_byte_size_table[54] =
{
0,
0,
0xFF,
1,
2,
4,
1,
2,
4,
1,
2,
4,
8,
16,
32,
64,
1,
2,
4,
8,
16,
32,
64,
1,
2,
4,
4,
6,
8,
10,
16,
8,
16,
20,
32,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
String8 e_kind_basic_string_table[54] =
{
str8_lit_comp(""),
str8_lit_comp("void"),
str8_lit_comp("HANDLE"),
str8_lit_comp("char8"),
str8_lit_comp("char16"),
str8_lit_comp("char32"),
str8_lit_comp("uchar8"),
str8_lit_comp("uchar16"),
str8_lit_comp("uchar32"),
str8_lit_comp("U8"),
str8_lit_comp("U16"),
str8_lit_comp("U32"),
str8_lit_comp("U64"),
str8_lit_comp("U128"),
str8_lit_comp("U256"),
str8_lit_comp("U512"),
str8_lit_comp("S8"),
str8_lit_comp("S16"),
str8_lit_comp("S32"),
str8_lit_comp("S64"),
str8_lit_comp("S128"),
str8_lit_comp("S256"),
str8_lit_comp("S512"),
str8_lit_comp("bool"),
str8_lit_comp("F16"),
str8_lit_comp("F32"),
str8_lit_comp("F32PP"),
str8_lit_comp("F48"),
str8_lit_comp("F64"),
str8_lit_comp("F80"),
str8_lit_comp("F128"),
str8_lit_comp("ComplexF32"),
str8_lit_comp("ComplexF64"),
str8_lit_comp("ComplexF80"),
str8_lit_comp("ComplexF128"),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp("struct"),
str8_lit_comp("class"),
str8_lit_comp("union"),
str8_lit_comp("enum"),
str8_lit_comp("typedef"),
str8_lit_comp("struct"),
str8_lit_comp("union"),
str8_lit_comp("class"),
str8_lit_comp("enum"),
str8_lit_comp(""),
str8_lit_comp(""),
};
C_LINKAGE_END
+133 -62
View File
@@ -6,73 +6,144 @@
#ifndef EVAL_META_H
#define EVAL_META_H
typedef U32 EVAL_ExprKind;
typedef enum EVAL_ExprKindEnum
typedef enum E_TypeKind
{
EVAL_ExprKind_Nil,
EVAL_ExprKind_ArrayIndex,
EVAL_ExprKind_MemberAccess,
EVAL_ExprKind_Deref,
EVAL_ExprKind_Address,
EVAL_ExprKind_Cast,
EVAL_ExprKind_Sizeof,
EVAL_ExprKind_Neg,
EVAL_ExprKind_LogNot,
EVAL_ExprKind_BitNot,
EVAL_ExprKind_Mul,
EVAL_ExprKind_Div,
EVAL_ExprKind_Mod,
EVAL_ExprKind_Add,
EVAL_ExprKind_Sub,
EVAL_ExprKind_LShift,
EVAL_ExprKind_RShift,
EVAL_ExprKind_Less,
EVAL_ExprKind_LsEq,
EVAL_ExprKind_Grtr,
EVAL_ExprKind_GrEq,
EVAL_ExprKind_EqEq,
EVAL_ExprKind_NtEq,
EVAL_ExprKind_BitAnd,
EVAL_ExprKind_BitXor,
EVAL_ExprKind_BitOr,
EVAL_ExprKind_LogAnd,
EVAL_ExprKind_LogOr,
EVAL_ExprKind_Ternary,
EVAL_ExprKind_LeafBytecode,
EVAL_ExprKind_LeafMember,
EVAL_ExprKind_LeafU64,
EVAL_ExprKind_LeafF64,
EVAL_ExprKind_LeafF32,
EVAL_ExprKind_TypeIdent,
EVAL_ExprKind_Ptr,
EVAL_ExprKind_Array,
EVAL_ExprKind_Func,
EVAL_ExprKind_Define,
EVAL_ExprKind_LeafIdent,
EVAL_ExprKind_COUNT,
} EVAL_ExprKindEnum;
E_TypeKind_Null,
E_TypeKind_Void,
E_TypeKind_Handle,
E_TypeKind_Char8,
E_TypeKind_Char16,
E_TypeKind_Char32,
E_TypeKind_UChar8,
E_TypeKind_UChar16,
E_TypeKind_UChar32,
E_TypeKind_U8,
E_TypeKind_U16,
E_TypeKind_U32,
E_TypeKind_U64,
E_TypeKind_U128,
E_TypeKind_U256,
E_TypeKind_U512,
E_TypeKind_S8,
E_TypeKind_S16,
E_TypeKind_S32,
E_TypeKind_S64,
E_TypeKind_S128,
E_TypeKind_S256,
E_TypeKind_S512,
E_TypeKind_Bool,
E_TypeKind_F16,
E_TypeKind_F32,
E_TypeKind_F32PP,
E_TypeKind_F48,
E_TypeKind_F64,
E_TypeKind_F80,
E_TypeKind_F128,
E_TypeKind_ComplexF32,
E_TypeKind_ComplexF64,
E_TypeKind_ComplexF80,
E_TypeKind_ComplexF128,
E_TypeKind_Modifier,
E_TypeKind_Ptr,
E_TypeKind_LRef,
E_TypeKind_RRef,
E_TypeKind_Array,
E_TypeKind_Function,
E_TypeKind_Method,
E_TypeKind_MemberPtr,
E_TypeKind_Struct,
E_TypeKind_Class,
E_TypeKind_Union,
E_TypeKind_Enum,
E_TypeKind_Alias,
E_TypeKind_IncompleteStruct,
E_TypeKind_IncompleteUnion,
E_TypeKind_IncompleteClass,
E_TypeKind_IncompleteEnum,
E_TypeKind_Bitfield,
E_TypeKind_Variadic,
E_TypeKind_COUNT,
E_TypeKind_FirstBasic = E_TypeKind_Void,
E_TypeKind_LastBasic = E_TypeKind_ComplexF128,
E_TypeKind_FirstInteger = E_TypeKind_Char8,
E_TypeKind_LastInteger = E_TypeKind_S512,
E_TypeKind_FirstSigned1 = E_TypeKind_Char8,
E_TypeKind_LastSigned1 = E_TypeKind_Char32,
E_TypeKind_FirstSigned2 = E_TypeKind_S8,
E_TypeKind_LastSigned2 = E_TypeKind_S512,
E_TypeKind_FirstIncomplete = E_TypeKind_IncompleteStruct,
E_TypeKind_LastIncomplete = E_TypeKind_IncompleteEnum,
} E_TypeKind;
typedef enum EVAL_ResultCode
typedef U32 E_ExprKind;
typedef enum E_ExprKindEnum
{
EVAL_ResultCode_Good,
EVAL_ResultCode_DivideByZero,
EVAL_ResultCode_BadOp,
EVAL_ResultCode_BadOpTypes,
EVAL_ResultCode_BadMemRead,
EVAL_ResultCode_BadRegRead,
EVAL_ResultCode_BadFrameBase,
EVAL_ResultCode_BadModuleBase,
EVAL_ResultCode_BadTLSBase,
EVAL_ResultCode_InsufficientStackSpace,
EVAL_ResultCode_MalformedBytecode,
EVAL_ResultCode_COUNT,
} EVAL_ResultCode;
E_ExprKind_Nil,
E_ExprKind_ArrayIndex,
E_ExprKind_MemberAccess,
E_ExprKind_Deref,
E_ExprKind_Address,
E_ExprKind_Cast,
E_ExprKind_Sizeof,
E_ExprKind_Neg,
E_ExprKind_LogNot,
E_ExprKind_BitNot,
E_ExprKind_Mul,
E_ExprKind_Div,
E_ExprKind_Mod,
E_ExprKind_Add,
E_ExprKind_Sub,
E_ExprKind_LShift,
E_ExprKind_RShift,
E_ExprKind_Less,
E_ExprKind_LsEq,
E_ExprKind_Grtr,
E_ExprKind_GrEq,
E_ExprKind_EqEq,
E_ExprKind_NtEq,
E_ExprKind_BitAnd,
E_ExprKind_BitXor,
E_ExprKind_BitOr,
E_ExprKind_LogAnd,
E_ExprKind_LogOr,
E_ExprKind_Ternary,
E_ExprKind_LeafBytecode,
E_ExprKind_LeafMember,
E_ExprKind_LeafStringLiteral,
E_ExprKind_LeafU64,
E_ExprKind_LeafF64,
E_ExprKind_LeafF32,
E_ExprKind_TypeIdent,
E_ExprKind_Ptr,
E_ExprKind_Array,
E_ExprKind_Func,
E_ExprKind_Define,
E_ExprKind_LeafIdent,
E_ExprKind_COUNT,
} E_ExprKindEnum;
typedef enum E_InterpretationCode
{
E_InterpretationCode_Good,
E_InterpretationCode_DivideByZero,
E_InterpretationCode_BadOp,
E_InterpretationCode_BadOpTypes,
E_InterpretationCode_BadMemRead,
E_InterpretationCode_BadRegRead,
E_InterpretationCode_BadFrameBase,
E_InterpretationCode_BadModuleBase,
E_InterpretationCode_BadTLSBase,
E_InterpretationCode_InsufficientStackSpace,
E_InterpretationCode_MalformedBytecode,
E_InterpretationCode_COUNT,
} E_InterpretationCode;
C_LINKAGE_BEGIN
extern U8 eval_expr_kind_child_counts[40];
extern String8 eval_expr_kind_strings[40];
extern String8 eval_result_code_display_strings[11];
extern String8 eval_expr_op_strings[40];
extern String8 e_expr_kind_strings[41];
extern String8 e_interpretation_code_display_strings[11];
extern String8 e_expr_op_strings[41];
extern U8 e_kind_basic_byte_size_table[54];
extern String8 e_kind_basic_string_table[54];
C_LINKAGE_END