c-next 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6127 -5387
- package/dist/index.js.map +3 -3
- package/grammar/C.g4 +8 -1
- package/package.json +3 -2
- package/src/transpiler/Transpiler.ts +11 -3
- package/src/transpiler/logic/parser/c/grammar/C.interp +15 -3
- package/src/transpiler/logic/parser/c/grammar/C.tokens +219 -207
- package/src/transpiler/logic/parser/c/grammar/CLexer.interp +21 -3
- package/src/transpiler/logic/parser/c/grammar/CLexer.tokens +219 -207
- package/src/transpiler/logic/parser/c/grammar/CLexer.ts +643 -606
- package/src/transpiler/logic/parser/c/grammar/CParser.ts +1076 -1038
- package/src/transpiler/logic/symbols/SymbolTable.ts +128 -66
- package/src/transpiler/logic/symbols/__tests__/SymbolTable.test.ts +79 -14
- package/src/transpiler/logic/symbols/c/__tests__/CResolver.integration.test.ts +3 -3
- package/src/transpiler/logic/symbols/c/collectors/StructCollector.ts +7 -37
- package/src/transpiler/output/codegen/CodeGenerator.ts +9 -0
- package/src/transpiler/output/codegen/helpers/FunctionContextManager.ts +15 -3
- package/src/transpiler/output/codegen/helpers/ParameterInputAdapter.ts +14 -6
- package/src/transpiler/output/codegen/helpers/__tests__/ParameterInputAdapter.test.ts +1 -0
- package/src/transpiler/output/codegen/types/IFunctionContextCallbacks.ts +2 -0
- package/src/transpiler/types/ICachedFileEntry.ts +4 -0
- package/src/utils/cache/CacheManager.ts +28 -15
- package/src/utils/cache/__tests__/CacheManager.test.ts +6 -4
|
@@ -17,213 +17,225 @@ T__15=16
|
|
|
17
17
|
T__16=17
|
|
18
18
|
T__17=18
|
|
19
19
|
T__18=19
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
20
|
+
T__19=20
|
|
21
|
+
T__20=21
|
|
22
|
+
T__21=22
|
|
23
|
+
T__22=23
|
|
24
|
+
T__23=24
|
|
25
|
+
T__24=25
|
|
26
|
+
Auto=26
|
|
27
|
+
Break=27
|
|
28
|
+
Case=28
|
|
29
|
+
Char=29
|
|
30
|
+
Const=30
|
|
31
|
+
Continue=31
|
|
32
|
+
Default=32
|
|
33
|
+
Do=33
|
|
34
|
+
Double=34
|
|
35
|
+
Else=35
|
|
36
|
+
Enum=36
|
|
37
|
+
Extern=37
|
|
38
|
+
Float=38
|
|
39
|
+
For=39
|
|
40
|
+
Goto=40
|
|
41
|
+
If=41
|
|
42
|
+
Inline=42
|
|
43
|
+
Int=43
|
|
44
|
+
Long=44
|
|
45
|
+
Register=45
|
|
46
|
+
Restrict=46
|
|
47
|
+
Return=47
|
|
48
|
+
Short=48
|
|
49
|
+
Signed=49
|
|
50
|
+
Sizeof=50
|
|
51
|
+
Static=51
|
|
52
|
+
Struct=52
|
|
53
|
+
Switch=53
|
|
54
|
+
Typedef=54
|
|
55
|
+
Union=55
|
|
56
|
+
Unsigned=56
|
|
57
|
+
Void=57
|
|
58
|
+
Volatile=58
|
|
59
|
+
While=59
|
|
60
|
+
Alignas=60
|
|
61
|
+
Alignof=61
|
|
62
|
+
Atomic=62
|
|
63
|
+
Bool=63
|
|
64
|
+
Complex=64
|
|
65
|
+
Generic=65
|
|
66
|
+
Imaginary=66
|
|
67
|
+
Noreturn=67
|
|
68
|
+
StaticAssert=68
|
|
69
|
+
ThreadLocal=69
|
|
70
|
+
LeftParen=70
|
|
71
|
+
RightParen=71
|
|
72
|
+
LeftBracket=72
|
|
73
|
+
RightBracket=73
|
|
74
|
+
LeftBrace=74
|
|
75
|
+
RightBrace=75
|
|
76
|
+
Less=76
|
|
77
|
+
LessEqual=77
|
|
78
|
+
Greater=78
|
|
79
|
+
GreaterEqual=79
|
|
80
|
+
LeftShift=80
|
|
81
|
+
RightShift=81
|
|
82
|
+
Plus=82
|
|
83
|
+
PlusPlus=83
|
|
84
|
+
Minus=84
|
|
85
|
+
MinusMinus=85
|
|
86
|
+
Star=86
|
|
87
|
+
Div=87
|
|
88
|
+
Mod=88
|
|
89
|
+
And=89
|
|
90
|
+
Or=90
|
|
91
|
+
AndAnd=91
|
|
92
|
+
OrOr=92
|
|
93
|
+
Caret=93
|
|
94
|
+
Not=94
|
|
95
|
+
Tilde=95
|
|
96
|
+
Question=96
|
|
97
|
+
Colon=97
|
|
98
|
+
Semi=98
|
|
99
|
+
Comma=99
|
|
100
|
+
Assign=100
|
|
101
|
+
StarAssign=101
|
|
102
|
+
DivAssign=102
|
|
103
|
+
ModAssign=103
|
|
104
|
+
PlusAssign=104
|
|
105
|
+
MinusAssign=105
|
|
106
|
+
LeftShiftAssign=106
|
|
107
|
+
RightShiftAssign=107
|
|
108
|
+
AndAssign=108
|
|
109
|
+
XorAssign=109
|
|
110
|
+
OrAssign=110
|
|
111
|
+
Equal=111
|
|
112
|
+
NotEqual=112
|
|
113
|
+
Arrow=113
|
|
114
|
+
Dot=114
|
|
115
|
+
Ellipsis=115
|
|
116
|
+
Identifier=116
|
|
117
|
+
Constant=117
|
|
118
|
+
DigitSequence=118
|
|
119
|
+
StringLiteral=119
|
|
120
|
+
MultiLineMacro=120
|
|
121
|
+
Directive=121
|
|
122
|
+
AsmBlock=122
|
|
123
|
+
Whitespace=123
|
|
124
|
+
Newline=124
|
|
125
|
+
BlockComment=125
|
|
126
|
+
LineComment=126
|
|
121
127
|
'__extension__'=1
|
|
122
128
|
'__builtin_va_arg'=2
|
|
123
129
|
'__builtin_offsetof'=3
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
'
|
|
138
|
-
'
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'
|
|
154
|
-
'
|
|
155
|
-
'
|
|
156
|
-
'
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
161
|
-
'
|
|
162
|
-
'
|
|
163
|
-
'
|
|
164
|
-
'
|
|
165
|
-
'
|
|
166
|
-
'
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'
|
|
176
|
-
'
|
|
177
|
-
'
|
|
178
|
-
'
|
|
179
|
-
'
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
184
|
-
'
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
'
|
|
188
|
-
'
|
|
189
|
-
'
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
201
|
-
'
|
|
202
|
-
'
|
|
203
|
-
'
|
|
204
|
-
'
|
|
205
|
-
'
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
'
|
|
210
|
-
'
|
|
211
|
-
'
|
|
212
|
-
'
|
|
213
|
-
'
|
|
214
|
-
'
|
|
215
|
-
'
|
|
216
|
-
'
|
|
217
|
-
'
|
|
218
|
-
'
|
|
219
|
-
'
|
|
220
|
-
'
|
|
221
|
-
'
|
|
222
|
-
'
|
|
223
|
-
'
|
|
224
|
-
'
|
|
225
|
-
'
|
|
226
|
-
'
|
|
227
|
-
'
|
|
228
|
-
'
|
|
229
|
-
'
|
|
130
|
+
'__signed__'=4
|
|
131
|
+
'__m128'=5
|
|
132
|
+
'__m128d'=6
|
|
133
|
+
'__m128i'=7
|
|
134
|
+
'__typeof__'=8
|
|
135
|
+
'__const'=9
|
|
136
|
+
'__const__'=10
|
|
137
|
+
'__restrict'=11
|
|
138
|
+
'__restrict__'=12
|
|
139
|
+
'__volatile'=13
|
|
140
|
+
'__volatile__'=14
|
|
141
|
+
'__inline__'=15
|
|
142
|
+
'__stdcall'=16
|
|
143
|
+
'__declspec'=17
|
|
144
|
+
'__cdecl'=18
|
|
145
|
+
'__clrcall'=19
|
|
146
|
+
'__fastcall'=20
|
|
147
|
+
'__thiscall'=21
|
|
148
|
+
'__vectorcall'=22
|
|
149
|
+
'__asm'=23
|
|
150
|
+
'__asm__'=24
|
|
151
|
+
'__attribute__'=25
|
|
152
|
+
'auto'=26
|
|
153
|
+
'break'=27
|
|
154
|
+
'case'=28
|
|
155
|
+
'char'=29
|
|
156
|
+
'const'=30
|
|
157
|
+
'continue'=31
|
|
158
|
+
'default'=32
|
|
159
|
+
'do'=33
|
|
160
|
+
'double'=34
|
|
161
|
+
'else'=35
|
|
162
|
+
'enum'=36
|
|
163
|
+
'extern'=37
|
|
164
|
+
'float'=38
|
|
165
|
+
'for'=39
|
|
166
|
+
'goto'=40
|
|
167
|
+
'if'=41
|
|
168
|
+
'inline'=42
|
|
169
|
+
'int'=43
|
|
170
|
+
'long'=44
|
|
171
|
+
'register'=45
|
|
172
|
+
'restrict'=46
|
|
173
|
+
'return'=47
|
|
174
|
+
'short'=48
|
|
175
|
+
'signed'=49
|
|
176
|
+
'sizeof'=50
|
|
177
|
+
'static'=51
|
|
178
|
+
'struct'=52
|
|
179
|
+
'switch'=53
|
|
180
|
+
'typedef'=54
|
|
181
|
+
'union'=55
|
|
182
|
+
'unsigned'=56
|
|
183
|
+
'void'=57
|
|
184
|
+
'volatile'=58
|
|
185
|
+
'while'=59
|
|
186
|
+
'_Alignas'=60
|
|
187
|
+
'_Alignof'=61
|
|
188
|
+
'_Atomic'=62
|
|
189
|
+
'_Bool'=63
|
|
190
|
+
'_Complex'=64
|
|
191
|
+
'_Generic'=65
|
|
192
|
+
'_Imaginary'=66
|
|
193
|
+
'_Noreturn'=67
|
|
194
|
+
'_Static_assert'=68
|
|
195
|
+
'_Thread_local'=69
|
|
196
|
+
'('=70
|
|
197
|
+
')'=71
|
|
198
|
+
'['=72
|
|
199
|
+
']'=73
|
|
200
|
+
'{'=74
|
|
201
|
+
'}'=75
|
|
202
|
+
'<'=76
|
|
203
|
+
'<='=77
|
|
204
|
+
'>'=78
|
|
205
|
+
'>='=79
|
|
206
|
+
'<<'=80
|
|
207
|
+
'>>'=81
|
|
208
|
+
'+'=82
|
|
209
|
+
'++'=83
|
|
210
|
+
'-'=84
|
|
211
|
+
'--'=85
|
|
212
|
+
'*'=86
|
|
213
|
+
'/'=87
|
|
214
|
+
'%'=88
|
|
215
|
+
'&'=89
|
|
216
|
+
'|'=90
|
|
217
|
+
'&&'=91
|
|
218
|
+
'||'=92
|
|
219
|
+
'^'=93
|
|
220
|
+
'!'=94
|
|
221
|
+
'~'=95
|
|
222
|
+
'?'=96
|
|
223
|
+
':'=97
|
|
224
|
+
';'=98
|
|
225
|
+
','=99
|
|
226
|
+
'='=100
|
|
227
|
+
'*='=101
|
|
228
|
+
'/='=102
|
|
229
|
+
'%='=103
|
|
230
|
+
'+='=104
|
|
231
|
+
'-='=105
|
|
232
|
+
'<<='=106
|
|
233
|
+
'>>='=107
|
|
234
|
+
'&='=108
|
|
235
|
+
'^='=109
|
|
236
|
+
'|='=110
|
|
237
|
+
'=='=111
|
|
238
|
+
'!='=112
|
|
239
|
+
'->'=113
|
|
240
|
+
'.'=114
|
|
241
|
+
'...'=115
|