WIP: It can parse to around ~2k lines. Need to improve its ability to detect when a forward declare of a class/enum/struct/union..

This language truly is a mess.
This commit is contained in:
2023-08-01 00:42:08 -04:00
parent 2b63fc27cd
commit 21a8f3bb39
5 changed files with 500 additions and 122 deletions

View File

@ -15,8 +15,8 @@ BraceSquare_Open, "["
BraceSquare_Close, "]"
Capture_Start, "("
Capture_End, ")"
Comment, "comemnt"
Char, "character"
Comment, "__comemnt__"
Char, "__character__"
Comma, ","
Decl_Class, "class"
Decl_GNU_Attribute, "__attribute__"
@ -26,18 +26,18 @@ Decl_Extern_Linkage, "extern"
Decl_Friend, "friend"
Decl_Module, "module"
Decl_Namespace, "namespace"
Decl_Operator, "operator"
Decl_Operator, "__operator__"
Decl_Struct, "struct"
Decl_Template, "template"
Decl_Typedef, "typedef"
Decl_Using, "using"
Decl_Union, "union"
Identifier, "identifier"
Identifier, "__identifier__"
Module_Import, "import"
Module_Export, "export"
Number, "number"
Operator, "operator"
Preprocess_Define, "#define"
Number, "__number__"
Operator, "__operator__"
Preprocess_Define, "define"
Preprocess_If, "if"
Preprocess_IfDef, "ifdef"
Preprocess_IfNotDef, "ifndef"
@ -46,7 +46,8 @@ Preprocess_Else, "else"
Preprocess_EndIf, "endif"
Preprocess_Include, "include"
Preprocess_Pragma, "pragma"
Preprocess_Macro, "macro"
Preprocess_Macro, "__macro__"
Preprocess_Unsupported, "__unsupported__"
Spec_Alignas, "alignas"
Spec_Const, "const"
Spec_Consteval, "consteval"
@ -66,7 +67,8 @@ Spec_ThreadLocal, "thread_local"
Spec_Volatile, "volatile"
Star, "*"
Statement_End, ";"
String, "string"
StaticAssert, "static_assert"
String, "__string__"
Type_Unsigned, "unsigned"
Type_Signed, "signed"
Type_Short, "short"
@ -74,5 +76,10 @@ Type_Long, "long"
Type_char, "char"
Type_int, "int"
Type_double, "double"
Type_MS_int8, "__int8"
Type_MS_int16, "__int16"
Type_MS_int32, "__int32"
Type_MS_int64, "__int64"
Type_MS_W64, "_W64"
Varadic_Argument, "..."
Attributes_Start, "__attrib_start__"
__Attributes_Start, "__attrib_start__"

1 Invalid __invalid__
15 BraceSquare_Close ]
16 Capture_Start (
17 Capture_End )
18 Comment comemnt __comemnt__
19 Char character __character__
20 Comma ,
21 Decl_Class class
22 Decl_GNU_Attribute __attribute__
26 Decl_Friend friend
27 Decl_Module module
28 Decl_Namespace namespace
29 Decl_Operator operator __operator__
30 Decl_Struct struct
31 Decl_Template template
32 Decl_Typedef typedef
33 Decl_Using using
34 Decl_Union union
35 Identifier identifier __identifier__
36 Module_Import import
37 Module_Export export
38 Number number __number__
39 Operator operator __operator__
40 Preprocess_Define #define define
41 Preprocess_If if
42 Preprocess_IfDef ifdef
43 Preprocess_IfNotDef ifndef
46 Preprocess_EndIf endif
47 Preprocess_Include include
48 Preprocess_Pragma pragma
49 Preprocess_Macro macro __macro__
50 Preprocess_Unsupported __unsupported__
51 Spec_Alignas alignas
52 Spec_Const const
53 Spec_Consteval consteval
67 Spec_Volatile volatile
68 Star *
69 Statement_End ;
70 String StaticAssert string static_assert
71 String __string__
72 Type_Unsigned unsigned
73 Type_Signed signed
74 Type_Short short
76 Type_char char
77 Type_int int
78 Type_double double
79 Type_MS_int8 __int8
80 Type_MS_int16 __int16
81 Type_MS_int32 __int32
82 Type_MS_int64 __int64
83 Type_MS_W64 _W64
84 Varadic_Argument ...
85 Attributes_Start __Attributes_Start __attrib_start__