brett-compiler 1.0.2 → 1.0.19
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/SymbolTable.js +5 -1
- package/dist/generated/Brett.interp +152 -0
- package/dist/generated/Brett.tokens +108 -0
- package/dist/generated/BrettLexer.interp +188 -0
- package/dist/generated/BrettLexer.js +232 -0
- package/dist/generated/BrettLexer.tokens +108 -0
- package/dist/generated/BrettListener.js +369 -0
- package/dist/generated/BrettParser.js +3990 -0
- package/dist/generated/BrettVisitor.js +250 -0
- package/dist/index.js +3 -1
- package/package.json +4 -7
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
// Generated from /builds/kdg-ti/programmeren-3/projecten-25-26/brett.deswert/Compiler/src/g4/Brett.g4 by ANTLR 4.13.2
|
|
2
|
+
// jshint ignore: start
|
|
3
|
+
import antlr4 from 'antlr4';
|
|
4
|
+
|
|
5
|
+
// This class defines a complete generic visitor for a parse tree produced by BrettParser.
|
|
6
|
+
|
|
7
|
+
export default class BrettVisitor extends antlr4.tree.ParseTreeVisitor {
|
|
8
|
+
|
|
9
|
+
// Visit a parse tree produced by BrettParser#program.
|
|
10
|
+
visitProgram(ctx) {
|
|
11
|
+
return this.visitChildren(ctx);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// Visit a parse tree produced by BrettParser#statement.
|
|
16
|
+
visitStatement(ctx) {
|
|
17
|
+
return this.visitChildren(ctx);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
// Visit a parse tree produced by BrettParser#block.
|
|
22
|
+
visitBlock(ctx) {
|
|
23
|
+
return this.visitChildren(ctx);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// Visit a parse tree produced by BrettParser#variableDeclaration.
|
|
28
|
+
visitVariableDeclaration(ctx) {
|
|
29
|
+
return this.visitChildren(ctx);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// Visit a parse tree produced by BrettParser#ifStatement.
|
|
34
|
+
visitIfStatement(ctx) {
|
|
35
|
+
return this.visitChildren(ctx);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// Visit a parse tree produced by BrettParser#whileStatement.
|
|
40
|
+
visitWhileStatement(ctx) {
|
|
41
|
+
return this.visitChildren(ctx);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// Visit a parse tree produced by BrettParser#doWhileStatement.
|
|
46
|
+
visitDoWhileStatement(ctx) {
|
|
47
|
+
return this.visitChildren(ctx);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
// Visit a parse tree produced by BrettParser#forStatement.
|
|
52
|
+
visitForStatement(ctx) {
|
|
53
|
+
return this.visitChildren(ctx);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// Visit a parse tree produced by BrettParser#switchStatement.
|
|
58
|
+
visitSwitchStatement(ctx) {
|
|
59
|
+
return this.visitChildren(ctx);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
// Visit a parse tree produced by BrettParser#switchCase.
|
|
64
|
+
visitSwitchCase(ctx) {
|
|
65
|
+
return this.visitChildren(ctx);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
// Visit a parse tree produced by BrettParser#defaultCase.
|
|
70
|
+
visitDefaultCase(ctx) {
|
|
71
|
+
return this.visitChildren(ctx);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
// Visit a parse tree produced by BrettParser#returnStatement.
|
|
76
|
+
visitReturnStatement(ctx) {
|
|
77
|
+
return this.visitChildren(ctx);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
// Visit a parse tree produced by BrettParser#breakStatement.
|
|
82
|
+
visitBreakStatement(ctx) {
|
|
83
|
+
return this.visitChildren(ctx);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
// Visit a parse tree produced by BrettParser#continueStatement.
|
|
88
|
+
visitContinueStatement(ctx) {
|
|
89
|
+
return this.visitChildren(ctx);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
// Visit a parse tree produced by BrettParser#expressionStatement.
|
|
94
|
+
visitExpressionStatement(ctx) {
|
|
95
|
+
return this.visitChildren(ctx);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
// Visit a parse tree produced by BrettParser#functionDeclaration.
|
|
100
|
+
visitFunctionDeclaration(ctx) {
|
|
101
|
+
return this.visitChildren(ctx);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
// Visit a parse tree produced by BrettParser#parameterList.
|
|
106
|
+
visitParameterList(ctx) {
|
|
107
|
+
return this.visitChildren(ctx);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
// Visit a parse tree produced by BrettParser#parameter.
|
|
112
|
+
visitParameter(ctx) {
|
|
113
|
+
return this.visitChildren(ctx);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
// Visit a parse tree produced by BrettParser#ArrayType.
|
|
118
|
+
visitArrayType(ctx) {
|
|
119
|
+
return this.visitChildren(ctx);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
// Visit a parse tree produced by BrettParser#SimpleType.
|
|
124
|
+
visitSimpleType(ctx) {
|
|
125
|
+
return this.visitChildren(ctx);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
// Visit a parse tree produced by BrettParser#baseType.
|
|
130
|
+
visitBaseType(ctx) {
|
|
131
|
+
return this.visitChildren(ctx);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
// Visit a parse tree produced by BrettParser#tryCatchStatement.
|
|
136
|
+
visitTryCatchStatement(ctx) {
|
|
137
|
+
return this.visitChildren(ctx);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
// Visit a parse tree produced by BrettParser#MemberExpression.
|
|
142
|
+
visitMemberExpression(ctx) {
|
|
143
|
+
return this.visitChildren(ctx);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
// Visit a parse tree produced by BrettParser#PrimaryExpression.
|
|
148
|
+
visitPrimaryExpression(ctx) {
|
|
149
|
+
return this.visitChildren(ctx);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
// Visit a parse tree produced by BrettParser#AssignmentExpression.
|
|
154
|
+
visitAssignmentExpression(ctx) {
|
|
155
|
+
return this.visitChildren(ctx);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
// Visit a parse tree produced by BrettParser#BinaryExpression.
|
|
160
|
+
visitBinaryExpression(ctx) {
|
|
161
|
+
return this.visitChildren(ctx);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// Visit a parse tree produced by BrettParser#NewExpression.
|
|
166
|
+
visitNewExpression(ctx) {
|
|
167
|
+
return this.visitChildren(ctx);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
// Visit a parse tree produced by BrettParser#PreIncrementDecrement.
|
|
172
|
+
visitPreIncrementDecrement(ctx) {
|
|
173
|
+
return this.visitChildren(ctx);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
// Visit a parse tree produced by BrettParser#IndexExpression.
|
|
178
|
+
visitIndexExpression(ctx) {
|
|
179
|
+
return this.visitChildren(ctx);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
// Visit a parse tree produced by BrettParser#PostIncrementDecrement.
|
|
184
|
+
visitPostIncrementDecrement(ctx) {
|
|
185
|
+
return this.visitChildren(ctx);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
// Visit a parse tree produced by BrettParser#LiteralExpression.
|
|
190
|
+
visitLiteralExpression(ctx) {
|
|
191
|
+
return this.visitChildren(ctx);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
// Visit a parse tree produced by BrettParser#IdentifierExpression.
|
|
196
|
+
visitIdentifierExpression(ctx) {
|
|
197
|
+
return this.visitChildren(ctx);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
// Visit a parse tree produced by BrettParser#ParenthesizedExpression.
|
|
202
|
+
visitParenthesizedExpression(ctx) {
|
|
203
|
+
return this.visitChildren(ctx);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
// Visit a parse tree produced by BrettParser#FunctionCallExpression.
|
|
208
|
+
visitFunctionCallExpression(ctx) {
|
|
209
|
+
return this.visitChildren(ctx);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
// Visit a parse tree produced by BrettParser#ArrayLiteralExpression.
|
|
214
|
+
visitArrayLiteralExpression(ctx) {
|
|
215
|
+
return this.visitChildren(ctx);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
// Visit a parse tree produced by BrettParser#ObjectLiteralExpression.
|
|
220
|
+
visitObjectLiteralExpression(ctx) {
|
|
221
|
+
return this.visitChildren(ctx);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
// Visit a parse tree produced by BrettParser#arrayLiteral.
|
|
226
|
+
visitArrayLiteral(ctx) {
|
|
227
|
+
return this.visitChildren(ctx);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
// Visit a parse tree produced by BrettParser#objectLiteral.
|
|
232
|
+
visitObjectLiteral(ctx) {
|
|
233
|
+
return this.visitChildren(ctx);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
// Visit a parse tree produced by BrettParser#property.
|
|
238
|
+
visitProperty(ctx) {
|
|
239
|
+
return this.visitChildren(ctx);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
// Visit a parse tree produced by BrettParser#argList.
|
|
244
|
+
visitArgList(ctx) {
|
|
245
|
+
return this.visitChildren(ctx);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brett-compiler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Een compiler voor de .Brett taal",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,13 +18,10 @@
|
|
|
18
18
|
"test": "vitest",
|
|
19
19
|
"build": "npm run antlrci && node build.js",
|
|
20
20
|
"prepublishOnly": "npm run build",
|
|
21
|
-
"release": "
|
|
21
|
+
"release": "semantic-release"
|
|
22
22
|
},
|
|
23
|
-
"keywords": [],
|
|
24
|
-
"author": "",
|
|
25
|
-
"license": "ISC",
|
|
26
23
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
24
|
+
"vitest": "^4.0.10",
|
|
25
|
+
"standard-version": "^9.5.0"
|
|
29
26
|
}
|
|
30
27
|
}
|