• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//arkcompiler/runtime_core/static_core/ark_config.gni")
15
16if (ark_standalone_build) {
17  import("$build_root/ark.gni")
18} else {
19  import("//build/ohos.gni")
20}
21
22config("libes2panda_public_config") {
23  include_dirs = [
24    "$target_gen_dir",
25    "$target_gen_dir/include",
26    "$target_gen_dir/generated",
27    "//third_party/icu/icu4c/source/common",
28    "//third_party/icu/icu4c/source/i18n",
29    "//third_party/icu/icu4c/source",
30    "$ark_es2panda_root",
31  ]
32}
33
34libes2panda_sources = [
35  "ast_verifier/ASTVerifier.cpp",
36  "ast_verifier/arithmeticOperationValid.cpp",
37  "ast_verifier/checkAbstractMethod.cpp",
38  "ast_verifier/checkConstProperties.cpp",
39  "ast_verifier/checkContext.cpp",
40  "ast_verifier/checkInfiniteLoop.cpp",
41  "ast_verifier/checkScopeDeclaration.cpp",
42  "ast_verifier/everyChildHasValidParent.cpp",
43  "ast_verifier/everyChildInParentRange.cpp",
44  "ast_verifier/forLoopCorrectlyInitialized.cpp",
45  "ast_verifier/getterSetterValidation.cpp",
46  "ast_verifier/helpers.cpp",
47  "ast_verifier/identifierHasVariable.cpp",
48  "ast_verifier/importExportAccessValid.cpp",
49  "ast_verifier/modifierAccessValid.cpp",
50  "ast_verifier/nodeHasParent.cpp",
51  "ast_verifier/nodeHasSourceRange.cpp",
52  "ast_verifier/nodeHasType.cpp",
53  "ast_verifier/referenceTypeAnnotationIsNull.cpp",
54  "ast_verifier/sequenceExpressionHasLastType.cpp",
55  "ast_verifier/variableHasEnclosingScope.cpp",
56  "ast_verifier/variableHasScope.cpp",
57  "ast_verifier/variableNameIdentifierNameSame.cpp",
58  "checker/ASchecker.cpp",
59  "checker/ETSAnalyzer.cpp",
60  "checker/ETSAnalyzerHelpers.cpp",
61  "checker/ETSAnalyzerUnreachable.cpp",
62  "checker/ETSchecker.cpp",
63  "checker/JSchecker.cpp",
64  "checker/TSAnalyzer.cpp",
65  "checker/TSAnalyzerUnreachable.cpp",
66  "checker/TSchecker.cpp",
67  "checker/checker.cpp",
68  "checker/checkerContext.cpp",
69  "checker/ets/aliveAnalyzer.cpp",
70  "checker/ets/arithmetic.cpp",
71  "checker/ets/assignAnalyzer.cpp",
72  "checker/ets/baseAnalyzer.cpp",
73  "checker/ets/boxingConverter.cpp",
74  "checker/ets/castingContext.cpp",
75  "checker/ets/conversion.cpp",
76  "checker/ets/dynamic.cpp",
77  "checker/ets/dynamic/dynamicCall.cpp",
78  "checker/ets/etsWarningAnalyzer.cpp",
79  "checker/ets/function.cpp",
80  "checker/ets/helpers.cpp",
81  "checker/ets/narrowingConverter.cpp",
82  "checker/ets/narrowingWideningConverter.cpp",
83  "checker/ets/object.cpp",
84  "checker/ets/primitiveWrappers.cpp",
85  "checker/ets/typeCheckingHelpers.cpp",
86  "checker/ets/typeConverter.cpp",
87  "checker/ets/typeCreation.cpp",
88  "checker/ets/typeRelationContext.cpp",
89  "checker/ets/unboxingConverter.cpp",
90  "checker/ets/utilityTypeHandlers.cpp",
91  "checker/ets/validateHelpers.cpp",
92  "checker/ets/wideningConverter.cpp",
93  "checker/ts/binaryLikeExpression.cpp",
94  "checker/ts/destructuringContext.cpp",
95  "checker/ts/function.cpp",
96  "checker/ts/helpers.cpp",
97  "checker/ts/object.cpp",
98  "checker/ts/typeCreation.cpp",
99  "checker/ts/typeElaborationContext.cpp",
100  "checker/ts/util.cpp",
101  "checker/typeChecker/TypeChecker.cpp",
102  "checker/types/ets/byteType.cpp",
103  "checker/types/ets/charType.cpp",
104  "checker/types/ets/doubleType.cpp",
105  "checker/types/ets/etsArrayType.cpp",
106  "checker/types/ets/etsAsyncFuncReturnType.cpp",
107  "checker/types/ets/etsBigIntType.cpp",
108  "checker/types/ets/etsBooleanType.cpp",
109  "checker/types/ets/etsDynamicType.cpp",
110  "checker/types/ets/etsEnumType.cpp",
111  "checker/types/ets/etsExtensionFuncHelperType.cpp",
112  "checker/types/ets/etsFunctionType.cpp",
113  "checker/types/ets/etsNeverType.cpp",
114  "checker/types/ets/etsNonNullishType.cpp",
115  "checker/types/ets/etsNullishTypes.cpp",
116  "checker/types/ets/etsObjectType.cpp",
117  "checker/types/ets/etsPartialTypeParameter.cpp",
118  "checker/types/ets/etsReadonlyType.cpp",
119  "checker/types/ets/etsStringType.cpp",
120  "checker/types/ets/etsTupleType.cpp",
121  "checker/types/ets/etsTypeAliasType.cpp",
122  "checker/types/ets/etsTypeParameter.cpp",
123  "checker/types/ets/etsUnionType.cpp",
124  "checker/types/ets/etsVoidType.cpp",
125  "checker/types/ets/floatType.cpp",
126  "checker/types/ets/intType.cpp",
127  "checker/types/ets/longType.cpp",
128  "checker/types/ets/shortType.cpp",
129  "checker/types/ets/wildcardType.cpp",
130  "checker/types/globalTypesHolder.cpp",
131  "checker/types/signature.cpp",
132  "checker/types/ts/anyType.cpp",
133  "checker/types/ts/arrayType.cpp",
134  "checker/types/ts/bigintLiteralType.cpp",
135  "checker/types/ts/bigintType.cpp",
136  "checker/types/ts/booleanLiteralType.cpp",
137  "checker/types/ts/booleanType.cpp",
138  "checker/types/ts/constructorType.cpp",
139  "checker/types/ts/enumLiteralType.cpp",
140  "checker/types/ts/enumType.cpp",
141  "checker/types/ts/functionType.cpp",
142  "checker/types/ts/indexInfo.cpp",
143  "checker/types/ts/interfaceType.cpp",
144  "checker/types/ts/neverType.cpp",
145  "checker/types/ts/nonPrimitiveType.cpp",
146  "checker/types/ts/nullType.cpp",
147  "checker/types/ts/numberLiteralType.cpp",
148  "checker/types/ts/numberType.cpp",
149  "checker/types/ts/objectDescriptor.cpp",
150  "checker/types/ts/objectLiteralType.cpp",
151  "checker/types/ts/objectType.cpp",
152  "checker/types/ts/stringLiteralType.cpp",
153  "checker/types/ts/stringType.cpp",
154  "checker/types/ts/tupleType.cpp",
155  "checker/types/ts/typeParameter.cpp",
156  "checker/types/ts/typeReference.cpp",
157  "checker/types/ts/undefinedType.cpp",
158  "checker/types/ts/unionType.cpp",
159  "checker/types/ts/unknownType.cpp",
160  "checker/types/ts/voidType.cpp",
161  "checker/types/type.cpp",
162  "checker/types/typeRelation.cpp",
163  "compiler/base/catchTable.cpp",
164  "compiler/base/condition.cpp",
165  "compiler/base/destructuring.cpp",
166  "compiler/base/hoisting.cpp",
167  "compiler/base/iterators.cpp",
168  "compiler/base/lexenv.cpp",
169  "compiler/base/literals.cpp",
170  "compiler/base/lreference.cpp",
171  "compiler/base/optionalChain.cpp",
172  "compiler/core/ETSCompiler.cpp",
173  "compiler/core/ETSCompilerUnrechable.cpp",
174  "compiler/core/ETSGen.cpp",
175  "compiler/core/ETSemitter.cpp",
176  "compiler/core/ETSfunction.cpp",
177  "compiler/core/JSCompiler.cpp",
178  "compiler/core/JSCompilerUnreachable.cpp",
179  "compiler/core/JSemitter.cpp",
180  "compiler/core/codeGen.cpp",
181  "compiler/core/compileJob.cpp",
182  "compiler/core/compileQueue.cpp",
183  "compiler/core/compilerImpl.cpp",
184  "compiler/core/dynamicContext.cpp",
185  "compiler/core/emitter.cpp",
186  "compiler/core/envScope.cpp",
187  "compiler/core/function.cpp",
188  "compiler/core/labelTarget.cpp",
189  "compiler/core/moduleContext.cpp",
190  "compiler/core/pandagen.cpp",
191  "compiler/core/programElement.cpp",
192  "compiler/core/regAllocator.cpp",
193  "compiler/core/regScope.cpp",
194  "compiler/core/regSpiller.cpp",
195  "compiler/core/switchBuilder.cpp",
196  "compiler/core/targetTypeContext.cpp",
197  "compiler/core/vReg.cpp",
198  "compiler/debugger/debuginfoDumper.cpp",
199  "compiler/function/asyncFunctionBuilder.cpp",
200  "compiler/function/asyncGeneratorFunctionBuilder.cpp",
201  "compiler/function/functionBuilder.cpp",
202  "compiler/function/generatorFunctionBuilder.cpp",
203  "compiler/lowering/checkerPhase.cpp",
204  "compiler/lowering/ets/ambientLowering.cpp",
205  "compiler/lowering/ets/bigintLowering.cpp",
206  "compiler/lowering/ets/boxingForLocals.cpp",
207  "compiler/lowering/ets/capturedVariables.cpp",
208  "compiler/lowering/ets/constStringToCharLowering.cpp",
209  "compiler/lowering/ets/defaultParameterLowering.cpp",
210  "compiler/lowering/ets/enumLowering.cpp",
211  "compiler/lowering/ets/enumPostCheckLowering.cpp",
212  "compiler/lowering/ets/expandBrackets.cpp",
213  "compiler/lowering/ets/expressionLambdaLowering.cpp",
214  "compiler/lowering/ets/genericBridgesLowering.cpp",
215  "compiler/lowering/ets/interfaceObjectLiteralLowering.cpp",
216  "compiler/lowering/ets/interfacePropertyDeclarations.cpp",
217  "compiler/lowering/ets/lambdaLowering.cpp",
218  "compiler/lowering/ets/localClassLowering.cpp",
219  "compiler/lowering/ets/objectIndexAccess.cpp",
220  "compiler/lowering/ets/objectIterator.cpp",
221  "compiler/lowering/ets/objectLiteralLowering.cpp",
222  "compiler/lowering/ets/opAssignment.cpp",
223  "compiler/lowering/ets/optionalLowering.cpp",
224  "compiler/lowering/ets/packageImplicitImport.cpp",
225  "compiler/lowering/ets/partialExportClassGen.cpp",
226  "compiler/lowering/ets/promiseVoid.cpp",
227  "compiler/lowering/ets/recordLowering.cpp",
228  "compiler/lowering/ets/spreadLowering.cpp",
229  "compiler/lowering/ets/stringComparison.cpp",
230  "compiler/lowering/ets/stringConstantsLowering.cpp",
231  "compiler/lowering/ets/stringConstructorLowering.cpp",
232  "compiler/lowering/ets/structLowering.cpp",
233  "compiler/lowering/ets/topLevelStmts/globalClassHandler.cpp",
234  "compiler/lowering/ets/topLevelStmts/globalDeclTransformer.cpp",
235  "compiler/lowering/ets/topLevelStmts/importExportDecls.cpp",
236  "compiler/lowering/ets/topLevelStmts/topLevelStmts.cpp",
237  "compiler/lowering/ets/tupleLowering.cpp",
238  "compiler/lowering/ets/unionLowering.cpp",
239  "compiler/lowering/phase.cpp",
240  "compiler/lowering/plugin_phase.cpp",
241  "compiler/lowering/resolveIdentifiers.cpp",
242  "compiler/lowering/scopesInit/savedBindingsCtx.cpp",
243  "compiler/lowering/scopesInit/scopesInitPhase.cpp",
244  "compiler/lowering/util.cpp",
245  "es2panda.cpp",
246  "evaluate/debugInfoDeserialization/classBuilder.cpp",
247  "evaluate/debugInfoDeserialization/debugInfoDeserializer.cpp",
248  "evaluate/debugInfoDeserialization/inheritanceResolution.cpp",
249  "evaluate/debugInfoDeserialization/methodBuilder.cpp",
250  "evaluate/debugInfoStorage.cpp",
251  "evaluate/entityDeclarator.cpp",
252  "evaluate/evaluateContext.cpp",
253  "evaluate/helpers.cpp",
254  "evaluate/irCheckHelper.cpp",
255  "evaluate/pathResolver.cpp",
256  "evaluate/proxyProgramsCache.cpp",
257  "evaluate/scopedDebugInfoPlugin.cpp",
258  "ir/as/namedType.cpp",
259  "ir/as/prefixAssertionExpression.cpp",
260  "ir/astDump.cpp",
261  "ir/astNode.cpp",
262  "ir/base/catchClause.cpp",
263  "ir/base/classDefinition.cpp",
264  "ir/base/classElement.cpp",
265  "ir/base/classProperty.cpp",
266  "ir/base/classStaticBlock.cpp",
267  "ir/base/decorator.cpp",
268  "ir/base/metaProperty.cpp",
269  "ir/base/methodDefinition.cpp",
270  "ir/base/namespaceDefinition.cpp",
271  "ir/base/property.cpp",
272  "ir/base/scriptFunction.cpp",
273  "ir/base/scriptFunctionSignature.cpp",
274  "ir/base/spreadElement.cpp",
275  "ir/base/templateElement.cpp",
276  "ir/base/tsIndexSignature.cpp",
277  "ir/base/tsMethodSignature.cpp",
278  "ir/base/tsPropertySignature.cpp",
279  "ir/base/tsSignatureDeclaration.cpp",
280  "ir/ets/etsClassLiteral.cpp",
281  "ir/ets/etsFunctionType.cpp",
282  "ir/ets/etsImportSource.cpp",
283  "ir/ets/etsLaunchExpression.cpp",
284  "ir/ets/etsNeverType.cpp",
285  "ir/ets/etsNewArrayInstanceExpression.cpp",
286  "ir/ets/etsNewClassInstanceExpression.cpp",
287  "ir/ets/etsNewMultiDimArrayInstanceExpression.cpp",
288  "ir/ets/etsNullishTypes.cpp",
289  "ir/ets/etsPackageDeclaration.cpp",
290  "ir/ets/etsParameterExpression.cpp",
291  "ir/ets/etsPrimitiveType.cpp",
292  "ir/ets/etsReExportDeclaration.cpp",
293  "ir/ets/etsScript.cpp",
294  "ir/ets/etsStringLiteralType.cpp",
295  "ir/ets/etsStructDeclaration.cpp",
296  "ir/ets/etsTuple.cpp",
297  "ir/ets/etsTypeReference.cpp",
298  "ir/ets/etsTypeReferencePart.cpp",
299  "ir/ets/etsUnionType.cpp",
300  "ir/ets/etsWildcardType.cpp",
301  "ir/expression.cpp",
302  "ir/expressions/arrayExpression.cpp",
303  "ir/expressions/arrowFunctionExpression.cpp",
304  "ir/expressions/assignmentExpression.cpp",
305  "ir/expressions/awaitExpression.cpp",
306  "ir/expressions/binaryExpression.cpp",
307  "ir/expressions/blockExpression.cpp",
308  "ir/expressions/callExpression.cpp",
309  "ir/expressions/chainExpression.cpp",
310  "ir/expressions/classExpression.cpp",
311  "ir/expressions/conditionalExpression.cpp",
312  "ir/expressions/directEvalExpression.cpp",
313  "ir/expressions/dummyNode.cpp",
314  "ir/expressions/functionExpression.cpp",
315  "ir/expressions/identifier.cpp",
316  "ir/expressions/importExpression.cpp",
317  "ir/expressions/literal.cpp",
318  "ir/expressions/literals/bigIntLiteral.cpp",
319  "ir/expressions/literals/booleanLiteral.cpp",
320  "ir/expressions/literals/charLiteral.cpp",
321  "ir/expressions/literals/nullLiteral.cpp",
322  "ir/expressions/literals/numberLiteral.cpp",
323  "ir/expressions/literals/regExpLiteral.cpp",
324  "ir/expressions/literals/stringLiteral.cpp",
325  "ir/expressions/literals/undefinedLiteral.cpp",
326  "ir/expressions/memberExpression.cpp",
327  "ir/expressions/newExpression.cpp",
328  "ir/expressions/objectExpression.cpp",
329  "ir/expressions/omittedExpression.cpp",
330  "ir/expressions/sequenceExpression.cpp",
331  "ir/expressions/superExpression.cpp",
332  "ir/expressions/taggedTemplateExpression.cpp",
333  "ir/expressions/templateLiteral.cpp",
334  "ir/expressions/thisExpression.cpp",
335  "ir/expressions/typeofExpression.cpp",
336  "ir/expressions/unaryExpression.cpp",
337  "ir/expressions/updateExpression.cpp",
338  "ir/expressions/yieldExpression.cpp",
339  "ir/irnode.cpp",
340  "ir/module/exportAllDeclaration.cpp",
341  "ir/module/exportDefaultDeclaration.cpp",
342  "ir/module/exportNamedDeclaration.cpp",
343  "ir/module/exportSpecifier.cpp",
344  "ir/module/importDeclaration.cpp",
345  "ir/module/importDefaultSpecifier.cpp",
346  "ir/module/importNamespaceSpecifier.cpp",
347  "ir/module/importSpecifier.cpp",
348  "ir/opaqueTypeNode.cpp",
349  "ir/srcDump.cpp",
350  "ir/statement.cpp",
351  "ir/statements/annotationDeclaration.cpp",
352  "ir/statements/annotationUsage.cpp",
353  "ir/statements/assertStatement.cpp",
354  "ir/statements/blockStatement.cpp",
355  "ir/statements/breakStatement.cpp",
356  "ir/statements/classDeclaration.cpp",
357  "ir/statements/continueStatement.cpp",
358  "ir/statements/debuggerStatement.cpp",
359  "ir/statements/doWhileStatement.cpp",
360  "ir/statements/emptyStatement.cpp",
361  "ir/statements/expressionStatement.cpp",
362  "ir/statements/forInStatement.cpp",
363  "ir/statements/forOfStatement.cpp",
364  "ir/statements/forUpdateStatement.cpp",
365  "ir/statements/functionDeclaration.cpp",
366  "ir/statements/ifStatement.cpp",
367  "ir/statements/labelledStatement.cpp",
368  "ir/statements/loopStatement.cpp",
369  "ir/statements/namespaceDeclaration.cpp",
370  "ir/statements/returnStatement.cpp",
371  "ir/statements/switchCaseStatement.cpp",
372  "ir/statements/switchStatement.cpp",
373  "ir/statements/throwStatement.cpp",
374  "ir/statements/tryStatement.cpp",
375  "ir/statements/variableDeclaration.cpp",
376  "ir/statements/variableDeclarator.cpp",
377  "ir/statements/whileStatement.cpp",
378  "ir/ts/tsAnyKeyword.cpp",
379  "ir/ts/tsArrayType.cpp",
380  "ir/ts/tsAsExpression.cpp",
381  "ir/ts/tsBigintKeyword.cpp",
382  "ir/ts/tsBooleanKeyword.cpp",
383  "ir/ts/tsClassImplements.cpp",
384  "ir/ts/tsConditionalType.cpp",
385  "ir/ts/tsConstructorType.cpp",
386  "ir/ts/tsEnumDeclaration.cpp",
387  "ir/ts/tsEnumMember.cpp",
388  "ir/ts/tsExternalModuleReference.cpp",
389  "ir/ts/tsFunctionType.cpp",
390  "ir/ts/tsImportEqualsDeclaration.cpp",
391  "ir/ts/tsImportType.cpp",
392  "ir/ts/tsIndexedAccessType.cpp",
393  "ir/ts/tsInferType.cpp",
394  "ir/ts/tsInterfaceBody.cpp",
395  "ir/ts/tsInterfaceDeclaration.cpp",
396  "ir/ts/tsInterfaceHeritage.cpp",
397  "ir/ts/tsIntersectionType.cpp",
398  "ir/ts/tsLiteralType.cpp",
399  "ir/ts/tsMappedType.cpp",
400  "ir/ts/tsModuleBlock.cpp",
401  "ir/ts/tsModuleDeclaration.cpp",
402  "ir/ts/tsNamedTupleMember.cpp",
403  "ir/ts/tsNeverKeyword.cpp",
404  "ir/ts/tsNonNullExpression.cpp",
405  "ir/ts/tsNullKeyword.cpp",
406  "ir/ts/tsNumberKeyword.cpp",
407  "ir/ts/tsObjectKeyword.cpp",
408  "ir/ts/tsParameterProperty.cpp",
409  "ir/ts/tsParenthesizedType.cpp",
410  "ir/ts/tsQualifiedName.cpp",
411  "ir/ts/tsStringKeyword.cpp",
412  "ir/ts/tsThisType.cpp",
413  "ir/ts/tsTupleType.cpp",
414  "ir/ts/tsTypeAliasDeclaration.cpp",
415  "ir/ts/tsTypeAssertion.cpp",
416  "ir/ts/tsTypeLiteral.cpp",
417  "ir/ts/tsTypeOperator.cpp",
418  "ir/ts/tsTypeParameter.cpp",
419  "ir/ts/tsTypeParameterDeclaration.cpp",
420  "ir/ts/tsTypeParameterInstantiation.cpp",
421  "ir/ts/tsTypePredicate.cpp",
422  "ir/ts/tsTypeQuery.cpp",
423  "ir/ts/tsTypeReference.cpp",
424  "ir/ts/tsUndefinedKeyword.cpp",
425  "ir/ts/tsUnionType.cpp",
426  "ir/ts/tsUnknownKeyword.cpp",
427  "ir/ts/tsVoidKeyword.cpp",
428  "ir/typeNode.cpp",
429  "lexer/ASLexer.cpp",
430  "lexer/ETSLexer.cpp",
431  "lexer/TSLexer.cpp",
432  "lexer/keywords.cpp",
433  "lexer/keywordsUtil.cpp",
434  "lexer/lexer.cpp",
435  "lexer/regexp/regexp.cpp",
436  "lexer/token/number.cpp",
437  "lexer/token/sourceLocation.cpp",
438  "lexer/token/token.cpp",
439  "parser/ASparser.cpp",
440  "parser/ETSFormattedParser.cpp",
441  "parser/ETSNolintParser.cpp",
442  "parser/ETSparser.cpp",
443  "parser/ETSparserClasses.cpp",
444  "parser/ETSparserEnums.cpp",
445  "parser/ETSparserExpressions.cpp",
446  "parser/ETSparserNamespaces.cpp",
447  "parser/ETSparserStatements.cpp",
448  "parser/ETSparserTypes.cpp",
449  "parser/JSparser.cpp",
450  "parser/TSparser.cpp",
451  "parser/TypedParser.cpp",
452  "parser/context/classPrivateContext.cpp",
453  "parser/context/parserContext.cpp",
454  "parser/expressionParser.cpp",
455  "parser/expressionTSParser.cpp",
456  "parser/parserImpl.cpp",
457  "parser/program/entityNameVisitor.cpp",
458  "parser/program/program.cpp",
459  "parser/statementParser.cpp",
460  "parser/statementTSParser.cpp",
461  "util/arktsconfig.cpp",
462  "util/bitset.cpp",
463  "util/errorHandler.cpp",
464  "util/errorLogger.cpp",
465  "util/errorRecovery.cpp",
466  "util/helpers.cpp",
467  "util/importPathManager.cpp",
468  "util/path.cpp",
469  "util/plugin.cpp",
470  "util/ustring.cpp",
471  "varbinder/ASBinder.cpp",
472  "varbinder/ETSBinder.cpp",
473  "varbinder/JSBinder.cpp",
474  "varbinder/TSBinder.cpp",
475  "varbinder/TypedBinder.cpp",
476  "varbinder/declaration.cpp",
477  "varbinder/recordTable.cpp",
478  "varbinder/scope.cpp",
479  "varbinder/varbinder.cpp",
480  "varbinder/variable.cpp",
481]
482
483LIB_NAME = "es2panda_lib"
484LIBGEN_DIR = "$target_gen_dir/generated/${LIB_NAME}"
485RB_LIST = []
486
487HEADERS_TO_BE_PARSED = [
488  "ir/astNodeMapping.h",
489  "checker/types/typeMapping.h",
490  "varbinder/variableFlags.h",
491  "lexer/regexp/regexp.h",
492  "util/language.h",
493  "lexer/token/tokenType.h",
494  "ir/astNodeFlags.h",
495  "ir/module/exportDefaultDeclaration.h",
496  "ir/statements/forInStatement.h",
497  "checker/types/ts/voidType.h",
498  "ir/expressions/classExpression.h",
499  "ir/ts/tsConditionalType.h",
500  "ir/expressions/templateLiteral.h",
501  "ir/statements/breakStatement.h",
502  "ir/ets/etsImportDeclaration.h",
503  "ir/ts/tsArrayType.h",
504  "checker/types/ts/numberType.h",
505  "ir/module/importDefaultSpecifier.h",
506  "checker/types/ets/etsFunctionType.h",
507  "ir/base/classDefinition.h",
508  "checker/types/ts/typeParameter.h",
509  "checker/types/ets/etsEnumType.h",
510  "ir/statement.h",
511  "ir/irnode.h",
512  "checker/types/typeRelation.h",
513  "ir/visitor/AstVisitor.h",
514  "ir/statements/classDeclaration.h",
515  "ir/base/tsMethodSignature.h",
516  "ir/ts/tsExternalModuleReference.h",
517  "ir/ts/tsInterfaceBody.h",
518  "checker/types/ts/nonPrimitiveType.h",
519  "ir/ts/tsTypeParameterInstantiation.h",
520  "ir/module/importDeclaration.h",
521  "checker/types/ets/etsDynamicType.h",
522  "ir/statements/doWhileStatement.h",
523  "ir/expressions/literals/bigIntLiteral.h",
524  "ir/expressions/assignmentExpression.h",
525  "ir/srcDump.h",
526  "checker/types/ets/etsBooleanType.h",
527  "ir/expressions/sequenceExpression.h",
528  "ir/expressions/literals/nullLiteral.h",
529  "ir/ts/tsStringKeyword.h",
530  "ir/ts/tsUnionType.h",
531  "ir/ts/tsClassImplements.h",
532  "checker/types/typeFlag.h",
533  "ir/base/tsPropertySignature.h",
534  "checker/types/ts/stringLiteralType.h",
535  "ir/expressions/conditionalExpression.h",
536  "ir/ts/tsFunctionType.h",
537  "checker/types/ts/undefinedType.h",
538  "checker/types/ts/numberLiteralType.h",
539  "ir/ts/tsObjectKeyword.h",
540  "checker/types/ts/tupleType.h",
541  "checker/types/ets/etsStringType.h",
542  "ir/base/property.h",
543  "ir/astDump.h",
544  "ir/base/tsSignatureDeclaration.h",
545  "ir/ets/etsReExportDeclaration.h",
546  "ir/ts/tsUndefinedKeyword.h",
547  "ir/expressions/arrowFunctionExpression.h",
548  "ir/expressions/callExpression.h",
549  "ir/ts/tsInterfaceHeritage.h",
550  "ir/expressions/updateExpression.h",
551  "ir/module/importSpecifier.h",
552  "ir/ets/etsNewClassInstanceExpression.h",
553  "ir/statements/labelledStatement.h",
554  "ir/ts/tsModuleBlock.h",
555  "ir/ts/tsTypePredicate.h",
556  "ir/base/catchClause.h",
557  "ir/base/classProperty.h",
558  "ir/base/tsIndexSignature.h",
559  "checker/types/ts/arrayType.h",
560  "ir/astNode.h",
561  "ir/typed.h",
562  "ir/statements/ifStatement.h",
563  "ir/ets/etsTuple.h",
564  "ir/module/exportSpecifier.h",
565  "ir/ts/tsNamedTupleMember.h",
566  "ir/statements/returnStatement.h",
567  "checker/types/ts/neverType.h",
568  "checker/types/ts/unionType.h",
569  "ir/statements/tryStatement.h",
570  "ir/ts/tsQualifiedName.h",
571  "checker/types/ts/types.h",
572  "ir/ts/tsLiteralType.h",
573  "checker/types/ets/etsBigIntType.h",
574  "ir/expressions/arrayExpression.h",
575  "ir/ets/etsUnionType.h",
576  "ir/ts/tsTypeParameter.h",
577  "ir/ts/tsConstructorType.h",
578  "ir/ts/tsTypeParameterDeclaration.h",
579  "checker/types/ts/enumLiteralType.h",
580  "ir/expressions/literals/charLiteral.h",
581  "ir/base/classElement.h",
582  "ir/statements/switchStatement.h",
583  "ir/expressions/identifier.h",
584  "ir/expressions/objectExpression.h",
585  "ir/statements/functionDeclaration.h",
586  "ir/as/prefixAssertionExpression.h",
587  "checker/types/ts/typeReference.h",
588  "ir/expressions/memberExpression.h",
589  "checker/types/ets/etsExtensionFuncHelperType.h",
590  "ir/ets/etsNeverType.h",
591  "ir/ets/etsNullishTypes.h",
592  "ir/ets/etsLaunchExpression.h",
593  "ir/expressions/awaitExpression.h",
594  "ir/ets/etsFunctionType.h",
595  "checker/types/ets/etsArrayType.h",
596  "ir/expressions/binaryExpression.h",
597  "checker/types/ets/etsNeverType.h",
598  "checker/types/ets/etsNullishTypes.h",
599  "ir/expressions/newExpression.h",
600  "ir/expressions/literals/stringLiteral.h",
601  "ir/ts/tsTupleType.h",
602  "checker/types/ets/longType.h",
603  "ir/module/exportAllDeclaration.h",
604  "checker/types/ts/bigintType.h",
605  "ir/ts/tsParenthesizedType.h",
606  "ir/ts/tsModuleDeclaration.h",
607  "ir/ets/etsPackageDeclaration.h",
608  "checker/types/ets/etsDynamicFunctionType.h",
609  "ir/expressions/literals/regExpLiteral.h",
610  "ir/ets/etsNewArrayInstanceExpression.h",
611  "checker/types/ets/etsVoidType.h",
612  "ir/base/metaProperty.h",
613  "checker/types/type.h",
614  "checker/types/ts/booleanLiteralType.h",
615  "checker/types/ts/anyType.h",
616  "ir/ets/etsScript.h",
617  "ir/ts/tsInferType.h",
618  "ir/ts/tsMappedType.h",
619  "ir/statements/debuggerStatement.h",
620  "ir/ts/tsBooleanKeyword.h",
621  "ir/ts/tsEnumDeclaration.h",
622  "checker/types/ets/etsObjectType.h",
623  "checker/types/ts/interfaceType.h",
624  "checker/types/ts/functionType.h",
625  "ir/statements/emptyStatement.h",
626  "ir/expressions/omittedExpression.h",
627  "ir/ts/tsNeverKeyword.h",
628  "ir/expressions/blockExpression.h",
629  "checker/types/ts/objectDescriptor.h",
630  "ir/ts/tsBigintKeyword.h",
631  "ir/statements/blockStatement.h",
632  "ir/expressions/literals/numberLiteral.h",
633  "checker/types/ets/shortType.h",
634  "checker/types/ts/bigintLiteralType.h",
635  "ir/expression.h",
636  "checker/types/ts/objectLiteralType.h",
637  "ir/typeNode.h",
638  "ir/base/spreadElement.h",
639  "ir/ts/tsTypeAssertion.h",
640  "ir/ts/tsTypeOperator.h",
641  "ir/ts/tsAsExpression.h",
642  "ir/statements/expressionStatement.h",
643  "checker/types/ts/elementFlags.h",
644  "ir/ts/tsImportType.h",
645  "checker/types/ts/indexInfo.h",
646  "checker/types/ets/etsTupleType.h",
647  "checker/types/signature.h",
648  "ir/ets/etsPrimitiveType.h",
649  "ir/as/namedType.h",
650  "ir/statements/throwStatement.h",
651  "ir/statements/forOfStatement.h",
652  "ir/statements/switchCaseStatement.h",
653  "ir/base/templateElement.h",
654  "checker/types/ets/charType.h",
655  "checker/types/ets/intType.h",
656  "ir/statements/forUpdateStatement.h",
657  "checker/types/ets/floatType.h",
658  "ir/ets/etsImportSource.h",
659  "ir/ets/etsTypeReferencePart.h",
660  "ir/ts/tsUnknownKeyword.h",
661  "ir/ets/etsStructDeclaration.h",
662  "checker/types/ts/objectType.h",
663  "ir/expressions/chainExpression.h",
664  "checker/types/ets/byteType.h",
665  "ir/ts/tsVoidKeyword.h",
666  "ir/statements/whileStatement.h",
667  "ir/expressions/taggedTemplateExpression.h",
668  "ir/statements/assertStatement.h",
669  "checker/types/ets/etsUnionType.h",
670  "checker/types/ts/stringType.h",
671  "ir/expressions/literals/booleanLiteral.h",
672  "ir/expressions/functionExpression.h",
673  "ir/statements/variableDeclarator.h",
674  "ir/module/importNamespaceSpecifier.h",
675  "ir/module/exportNamedDeclaration.h",
676  "ir/expressions/thisExpression.h",
677  "ir/ts/tsTypeReference.h",
678  "ir/base/classStaticBlock.h",
679  "ir/expressions/unaryExpression.h",
680  "ir/ts/tsThisType.h",
681  "ir/ts/tsNullKeyword.h",
682  "checker/types/ets/etsTypeParameter.h",
683  "checker/types/typeFacts.h",
684  "ir/base/decorator.h",
685  "checker/types/globalTypesHolder.h",
686  "ir/ets/etsClassLiteral.h",
687  "ir/ts/tsTypeAliasDeclaration.h",
688  "ir/ts/tsNonNullExpression.h",
689  "ir/ts/tsTypeLiteral.h",
690  "ir/ts/tsNumberKeyword.h",
691  "ir/opaqueTypeNode.h",
692  "ir/base/scriptFunction.h",
693  "ir/expressions/literal.h",
694  "ir/ts/tsInterfaceDeclaration.h",
695  "ir/ts/tsImportEqualsDeclaration.h",
696  "ir/validationInfo.h",
697  "ir/base/methodDefinition.h",
698  "ir/ts/tsIntersectionType.h",
699  "checker/types/ts/nullType.h",
700  "checker/types/ts/unknownType.h",
701  "ir/ts/tsEnumMember.h",
702  "ir/expressions/superExpression.h",
703  "checker/types/ts/constructorType.h",
704  "ir/ets/etsTypeReference.h",
705  "checker/types/ets/etsNonNullishType.h",
706  "checker/types/ets/etsObjectTypeConstants.h",
707  "checker/types/ets/types.h",
708  "ir/statements/variableDeclaration.h",
709  "ir/opcodeMap.h",
710  "ir/ts/tsAnyKeyword.h",
711  "checker/types/ets/doubleType.h",
712  "ir/visitor/IterateAstVisitor.h",
713  "checker/types/ts/enumType.h",
714  "ir/expressions/directEvalExpression.h",
715  "ir/ts/tsParameterProperty.h",
716  "ir/statements/continueStatement.h",
717  "ir/ets/etsWildcardType.h",
718  "ir/expressions/literals/undefinedLiteral.h",
719  "ir/ts/tsIndexedAccessType.h",
720  "checker/types/ets/wildcardType.h",
721  "checker/types/ts/booleanType.h",
722  "ir/expressions/typeofExpression.h",
723  "checker/types/ets/etsAsyncFuncReturnType.h",
724  "ir/statements/loopStatement.h",
725  "ir/base/scriptFunctionSignature.h",
726  "ir/expressions/yieldExpression.h",
727  "ir/ets/etsNewMultiDimArrayInstanceExpression.h",
728  "ir/ets/etsParameterExpression.h",
729  "ir/ts/tsTypeQuery.h",
730  "ir/expressions/importExpression.h",
731  "varbinder/variable.h",
732  "varbinder/scope.h",
733  "varbinder/varbinder.h",
734  "varbinder/ETSBinder.h",
735  "varbinder/declaration.h",
736  "varbinder/recordTable.h",
737  "checker/checker.h",
738  "checker/ETSchecker.h",
739  "checker/checkerContext.h",
740  "checker/resolveResult.h",
741  "parser/ETSparser.h",
742  "parser/parserFlags.h",
743  "es2panda.h",
744]
745
746ES2PANDA_API_GENERATED = [
747  "$LIBGEN_DIR/gen/headers/ir/astNodeMapping.yaml",
748  "$LIBGEN_DIR/gen/headers/checker/types/typeMapping.yaml",
749  "$LIBGEN_DIR/gen/headers/varbinder/variableFlags.yaml",
750  "$LIBGEN_DIR/gen/headers/es2panda.yaml",
751  "$LIBGEN_DIR/gen/headers/checker/types/ts/bigintLiteralType.yaml",
752  "$LIBGEN_DIR/gen/headers/ir/statements/switchCaseStatement.yaml",
753  "$LIBGEN_DIR/gen/headers/ir/ets/etsNewArrayInstanceExpression.yaml",
754  "$LIBGEN_DIR/gen/headers/ir/ets/etsTypeReferencePart.yaml",
755  "$LIBGEN_DIR/gen/headers/ir/astDump.yaml",
756  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeOperator.yaml",
757  "$LIBGEN_DIR/gen/headers/checker/types/ts/constructorType.yaml",
758  "$LIBGEN_DIR/gen/headers/ir/statements/expressionStatement.yaml",
759  "$LIBGEN_DIR/gen/headers/checker/types/ets/types.yaml",
760  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsObjectTypeConstants.yaml",
761  "$LIBGEN_DIR/gen/headers/checker/types/ts/stringType.yaml",
762  "$LIBGEN_DIR/gen/headers/ir/base/classDefinition.yaml",
763  "$LIBGEN_DIR/gen/headers/ir/ts/tsClassImplements.yaml",
764  "$LIBGEN_DIR/gen/headers/ir/expressions/chainExpression.yaml",
765  "$LIBGEN_DIR/gen/headers/ir/expressions/memberExpression.yaml",
766  "$LIBGEN_DIR/gen/headers/ir/ts/tsFunctionType.yaml",
767  "$LIBGEN_DIR/gen/headers/ir/ts/tsBigintKeyword.yaml",
768  "$LIBGEN_DIR/gen/headers/ir/ts/tsAsExpression.yaml",
769  "$LIBGEN_DIR/gen/headers/checker/types/ts/stringLiteralType.yaml",
770  "$LIBGEN_DIR/gen/headers/ir/module/importNamespaceSpecifier.yaml",
771  "$LIBGEN_DIR/gen/headers/ir/base/metaProperty.yaml",
772  "$LIBGEN_DIR/gen/headers/ir/ts/tsInterfaceBody.yaml",
773  "$LIBGEN_DIR/gen/headers/ir/statements/tryStatement.yaml",
774  "$LIBGEN_DIR/gen/headers/checker/types/ts/unknownType.yaml",
775  "$LIBGEN_DIR/gen/headers/ir/base/classStaticBlock.yaml",
776  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/undefinedLiteral.yaml",
777  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsBigIntType.yaml",
778  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypePredicate.yaml",
779  "$LIBGEN_DIR/gen/headers/checker/types/ts/unionType.yaml",
780  "$LIBGEN_DIR/gen/headers/checker/types/ets/floatType.yaml",
781  "$LIBGEN_DIR/gen/headers/ir/statements/emptyStatement.yaml",
782  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeParameterDeclaration.yaml",
783  "$LIBGEN_DIR/gen/headers/ir/statements/whileStatement.yaml",
784  "$LIBGEN_DIR/gen/headers/ir/ts/tsParenthesizedType.yaml",
785  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeParameterInstantiation.yaml",
786  "$LIBGEN_DIR/gen/headers/ir/module/exportSpecifier.yaml",
787  "$LIBGEN_DIR/gen/headers/ir/base/property.yaml",
788  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/stringLiteral.yaml",
789  "$LIBGEN_DIR/gen/headers/ir/ts/tsVoidKeyword.yaml",
790  "$LIBGEN_DIR/gen/headers/ir/statements/classDeclaration.yaml",
791  "$LIBGEN_DIR/gen/headers/ir/statements/assertStatement.yaml",
792  "$LIBGEN_DIR/gen/headers/checker/types/globalTypesHolder.yaml",
793  "$LIBGEN_DIR/gen/headers/ir/base/classElement.yaml",
794  "$LIBGEN_DIR/gen/headers/ir/statement.yaml",
795  "$LIBGEN_DIR/gen/headers/ir/ts/tsNullKeyword.yaml",
796  "$LIBGEN_DIR/gen/headers/lexer/regexp/regexp.yaml",
797  "$LIBGEN_DIR/gen/headers/checker/types/typeRelation.yaml",
798  "$LIBGEN_DIR/gen/headers/checker/types/ts/objectDescriptor.yaml",
799  "$LIBGEN_DIR/gen/headers/checker/types/signature.yaml",
800  "$LIBGEN_DIR/gen/headers/ir/expressions/taggedTemplateExpression.yaml",
801  "$LIBGEN_DIR/gen/headers/checker/types/ts/enumType.yaml",
802  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeReference.yaml",
803  "$LIBGEN_DIR/gen/headers/checker/types/ts/indexInfo.yaml",
804  "$LIBGEN_DIR/gen/headers/ir/base/scriptFunctionSignature.yaml",
805  "$LIBGEN_DIR/gen/headers/pathsToHeaders.yaml",
806  "$LIBGEN_DIR/gen/headers/ir/ts/tsInferType.yaml",
807  "$LIBGEN_DIR/gen/headers/ir/statements/forUpdateStatement.yaml",
808  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/regExpLiteral.yaml",
809  "$LIBGEN_DIR/gen/headers/ir/module/exportAllDeclaration.yaml",
810  "$LIBGEN_DIR/gen/headers/ir/expressions/binaryExpression.yaml",
811  "$LIBGEN_DIR/gen/headers/checker/types/ets/doubleType.yaml",
812  "$LIBGEN_DIR/gen/headers/ir/expressions/templateLiteral.yaml",
813  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/bigIntLiteral.yaml",
814  "$LIBGEN_DIR/gen/headers/ir/base/tsPropertySignature.yaml",
815  "$LIBGEN_DIR/gen/headers/ir/ts/tsInterfaceHeritage.yaml",
816  "$LIBGEN_DIR/gen/headers/ir/ets/etsTuple.yaml",
817  "$LIBGEN_DIR/gen/headers/ir/statements/returnStatement.yaml",
818  "$LIBGEN_DIR/gen/headers/checker/types/ts/neverType.yaml",
819  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsArrayType.yaml",
820  "$LIBGEN_DIR/gen/headers/ir/expression.yaml",
821  "$LIBGEN_DIR/gen/headers/ir/ts/tsUnknownKeyword.yaml",
822  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsAsyncFuncReturnType.yaml",
823  "$LIBGEN_DIR/gen/headers/ir/ts/tsModuleBlock.yaml",
824  "$LIBGEN_DIR/gen/headers/ir/ts/tsConditionalType.yaml",
825  "$LIBGEN_DIR/gen/headers/ir/statements/variableDeclarator.yaml",
826  "$LIBGEN_DIR/gen/headers/ir/statements/throwStatement.yaml",
827  "$LIBGEN_DIR/gen/headers/lexer/token/tokenType.yaml",
828  "$LIBGEN_DIR/gen/headers/ir/module/exportNamedDeclaration.yaml",
829  "$LIBGEN_DIR/gen/headers/ir/ts/tsNamedTupleMember.yaml",
830  "$LIBGEN_DIR/gen/headers/checker/types/ts/typeParameter.yaml",
831  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsTypeParameter.yaml",
832  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsStringType.yaml",
833  "$LIBGEN_DIR/gen/headers/ir/validationInfo.yaml",
834  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeAliasDeclaration.yaml",
835  "$LIBGEN_DIR/gen/headers/checker/types/ts/objectLiteralType.yaml",
836  "$LIBGEN_DIR/gen/headers/ir/expressions/yieldExpression.yaml",
837  "$LIBGEN_DIR/gen/headers/ir/ts/tsTupleType.yaml",
838  "$LIBGEN_DIR/gen/headers/ir/visitor/AstVisitor.yaml",
839  "$LIBGEN_DIR/gen/headers/ir/module/exportDefaultDeclaration.yaml",
840  "$LIBGEN_DIR/gen/headers/ir/base/catchClause.yaml",
841  "$LIBGEN_DIR/gen/headers/ir/expressions/identifier.yaml",
842  "$LIBGEN_DIR/gen/headers/checker/types/ts/anyType.yaml",
843  "$LIBGEN_DIR/gen/headers/ir/expressions/objectExpression.yaml",
844  "$LIBGEN_DIR/gen/headers/checker/types/ts/booleanType.yaml",
845  "$LIBGEN_DIR/gen/headers/ir/ts/tsNumberKeyword.yaml",
846  "$LIBGEN_DIR/gen/headers/ir/ets/etsUnionType.yaml",
847  "$LIBGEN_DIR/gen/headers/ir/ts/tsStringKeyword.yaml",
848  "$LIBGEN_DIR/gen/headers/ir/expressions/arrowFunctionExpression.yaml",
849  "$LIBGEN_DIR/gen/headers/ir/base/classProperty.yaml",
850  "$LIBGEN_DIR/gen/headers/ir/expressions/sequenceExpression.yaml",
851  "$LIBGEN_DIR/gen/headers/checker/types/ts/enumLiteralType.yaml",
852  "$LIBGEN_DIR/gen/headers/ir/ts/tsImportType.yaml",
853  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsDynamicFunctionType.yaml",
854  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsDynamicType.yaml",
855  "$LIBGEN_DIR/gen/headers/ir/expressions/functionExpression.yaml",
856  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeParameter.yaml",
857  "$LIBGEN_DIR/gen/headers/ir/ts/tsIndexedAccessType.yaml",
858  "$LIBGEN_DIR/gen/headers/ir/expressions/thisExpression.yaml",
859  "$LIBGEN_DIR/gen/headers/ir/ts/tsThisType.yaml",
860  "$LIBGEN_DIR/gen/headers/ir/expressions/classExpression.yaml",
861  "$LIBGEN_DIR/gen/headers/ir/base/scriptFunction.yaml",
862  "$LIBGEN_DIR/gen/headers/checker/types/ts/booleanLiteralType.yaml",
863  "$LIBGEN_DIR/gen/headers/ir/expressions/conditionalExpression.yaml",
864  "$LIBGEN_DIR/gen/headers/ir/expressions/unaryExpression.yaml",
865  "$LIBGEN_DIR/gen/headers/ir/astNodeFlags.yaml",
866  "$LIBGEN_DIR/gen/headers/ir/expressions/updateExpression.yaml",
867  "$LIBGEN_DIR/gen/headers/ir/ts/tsNeverKeyword.yaml",
868  "$LIBGEN_DIR/gen/headers/checker/types/ets/longType.yaml",
869  "$LIBGEN_DIR/gen/headers/ir/statements/loopStatement.yaml",
870  "$LIBGEN_DIR/gen/headers/ir/ets/etsNewMultiDimArrayInstanceExpression.yaml",
871  "$LIBGEN_DIR/gen/headers/checker/types/ets/byteType.yaml",
872  "$LIBGEN_DIR/gen/headers/ir/opaqueTypeNode.yaml",
873  "$LIBGEN_DIR/gen/headers/checker/types/ets/intType.yaml",
874  "$LIBGEN_DIR/gen/headers/ir/ts/tsBooleanKeyword.yaml",
875  "$LIBGEN_DIR/gen/headers/checker/types/ts/elementFlags.yaml",
876  "$LIBGEN_DIR/gen/headers/ir/astNode.yaml",
877  "$LIBGEN_DIR/gen/headers/ir/typed.yaml",
878  "$LIBGEN_DIR/gen/headers/ir/ts/tsParameterProperty.yaml",
879  "$LIBGEN_DIR/gen/headers/ir/ts/tsExternalModuleReference.yaml",
880  "$LIBGEN_DIR/gen/headers/ir/expressions/awaitExpression.yaml",
881  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsBooleanType.yaml",
882  "$LIBGEN_DIR/gen/headers/ir/ts/tsObjectKeyword.yaml",
883  "$LIBGEN_DIR/gen/headers/ir/statements/forOfStatement.yaml",
884  "$LIBGEN_DIR/gen/headers/ir/statements/doWhileStatement.yaml",
885  "$LIBGEN_DIR/gen/headers/ir/expressions/directEvalExpression.yaml",
886  "$LIBGEN_DIR/gen/headers/checker/types/ts/undefinedType.yaml",
887  "$LIBGEN_DIR/gen/headers/ir/ets/etsWildcardType.yaml",
888  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeAssertion.yaml",
889  "$LIBGEN_DIR/gen/headers/ir/statements/switchStatement.yaml",
890  "$LIBGEN_DIR/gen/headers/ir/ets/etsImportSource.yaml",
891  "$LIBGEN_DIR/gen/headers/ir/module/importSpecifier.yaml",
892  "$LIBGEN_DIR/gen/headers/ir/ets/etsReExportDeclaration.yaml",
893  "$LIBGEN_DIR/gen/headers/ir/ets/etsPrimitiveType.yaml",
894  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/booleanLiteral.yaml",
895  "$LIBGEN_DIR/gen/headers/ir/statements/labelledStatement.yaml",
896  "$LIBGEN_DIR/gen/headers/ir/irnode.yaml",
897  "$LIBGEN_DIR/gen/headers/ir/ts/tsImportEqualsDeclaration.yaml",
898  "$LIBGEN_DIR/gen/headers/ir/ets/etsNullishTypes.yaml",
899  "$LIBGEN_DIR/gen/headers/ir/ets/etsParameterExpression.yaml",
900  "$LIBGEN_DIR/gen/headers/ir/ts/tsMappedType.yaml",
901  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsTupleType.yaml",
902  "$LIBGEN_DIR/gen/headers/ir/opcodeMap.yaml",
903  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsNullishTypes.yaml",
904  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/numberLiteral.yaml",
905  "$LIBGEN_DIR/gen/headers/ir/statements/breakStatement.yaml",
906  "$LIBGEN_DIR/gen/headers/checker/types/ts/numberLiteralType.yaml",
907  "$LIBGEN_DIR/gen/headers/checker/types/ts/voidType.yaml",
908  "$LIBGEN_DIR/gen/headers/checker/types/ts/nonPrimitiveType.yaml",
909  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeQuery.yaml",
910  "$LIBGEN_DIR/gen/headers/ir/statements/variableDeclaration.yaml",
911  "$LIBGEN_DIR/gen/headers/ir/base/methodDefinition.yaml",
912  "$LIBGEN_DIR/gen/headers/checker/types/ts/functionType.yaml",
913  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/nullLiteral.yaml",
914  "$LIBGEN_DIR/gen/headers/ir/expressions/literal.yaml",
915  "$LIBGEN_DIR/gen/headers/ir/expressions/importExpression.yaml",
916  "$LIBGEN_DIR/gen/headers/ir/expressions/callExpression.yaml",
917  "$LIBGEN_DIR/gen/headers/ir/ets/etsLaunchExpression.yaml",
918  "$LIBGEN_DIR/gen/headers/ir/ts/tsUnionType.yaml",
919  "$LIBGEN_DIR/gen/headers/ir/ts/tsUndefinedKeyword.yaml",
920  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsFunctionType.yaml",
921  "$LIBGEN_DIR/gen/headers/ir/ts/tsQualifiedName.yaml",
922  "$LIBGEN_DIR/gen/headers/ir/base/tsIndexSignature.yaml",
923  "$LIBGEN_DIR/gen/headers/ir/base/templateElement.yaml",
924  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsObjectType.yaml",
925  "$LIBGEN_DIR/gen/headers/ir/expressions/typeofExpression.yaml",
926  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsUnionType.yaml",
927  "$LIBGEN_DIR/gen/headers/ir/module/importDefaultSpecifier.yaml",
928  "$LIBGEN_DIR/gen/headers/ir/base/tsSignatureDeclaration.yaml",
929  "$LIBGEN_DIR/gen/headers/ir/ets/etsImportDeclaration.yaml",
930  "$LIBGEN_DIR/gen/headers/checker/types/ts/bigintType.yaml",
931  "$LIBGEN_DIR/gen/headers/ir/ts/tsNonNullExpression.yaml",
932  "$LIBGEN_DIR/gen/headers/ir/srcDump.yaml",
933  "$LIBGEN_DIR/gen/headers/checker/types/type.yaml",
934  "$LIBGEN_DIR/gen/headers/checker/types/ts/nullType.yaml",
935  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsNonNullishType.yaml",
936  "$LIBGEN_DIR/gen/headers/ir/ts/tsInterfaceDeclaration.yaml",
937  "$LIBGEN_DIR/gen/headers/ir/ts/tsAnyKeyword.yaml",
938  "$LIBGEN_DIR/gen/headers/checker/types/ets/wildcardType.yaml",
939  "$LIBGEN_DIR/gen/headers/ir/as/prefixAssertionExpression.yaml",
940  "$LIBGEN_DIR/gen/headers/checker/types/typeFacts.yaml",
941  "$LIBGEN_DIR/gen/headers/allEnums.yaml",
942  "$LIBGEN_DIR/gen/headers/ir/ts/tsConstructorType.yaml",
943  "$LIBGEN_DIR/gen/headers/ir/expressions/omittedExpression.yaml",
944  "$LIBGEN_DIR/gen/headers/ir/ts/tsIntersectionType.yaml",
945  "$LIBGEN_DIR/gen/headers/ir/ts/tsArrayType.yaml",
946  "$LIBGEN_DIR/gen/headers/ir/visitor/IterateAstVisitor.yaml",
947  "$LIBGEN_DIR/gen/headers/ir/typeNode.yaml",
948  "$LIBGEN_DIR/gen/headers/checker/types/ts/typeReference.yaml",
949  "$LIBGEN_DIR/gen/headers/checker/types/ts/interfaceType.yaml",
950  "$LIBGEN_DIR/gen/headers/ir/module/importDeclaration.yaml",
951  "$LIBGEN_DIR/gen/headers/ir/ets/etsPackageDeclaration.yaml",
952  "$LIBGEN_DIR/gen/headers/ir/expressions/superExpression.yaml",
953  "$LIBGEN_DIR/gen/headers/ir/statements/blockStatement.yaml",
954  "$LIBGEN_DIR/gen/headers/util/language.yaml",
955  "$LIBGEN_DIR/gen/headers/checker/types/ets/shortType.yaml",
956  "$LIBGEN_DIR/gen/headers/ir/ets/etsNewClassInstanceExpression.yaml",
957  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsExtensionFuncHelperType.yaml",
958  "$LIBGEN_DIR/gen/headers/ir/statements/continueStatement.yaml",
959  "$LIBGEN_DIR/gen/headers/ir/ets/etsClassLiteral.yaml",
960  "$LIBGEN_DIR/gen/headers/ir/expressions/assignmentExpression.yaml",
961  "$LIBGEN_DIR/gen/headers/ir/ets/etsTypeReference.yaml",
962  "$LIBGEN_DIR/gen/headers/checker/types/ts/tupleType.yaml",
963  "$LIBGEN_DIR/gen/headers/checker/types/ts/numberType.yaml",
964  "$LIBGEN_DIR/gen/headers/checker/types/ets/charType.yaml",
965  "$LIBGEN_DIR/gen/headers/checker/types/ts/arrayType.yaml",
966  "$LIBGEN_DIR/gen/headers/checker/types/ts/types.yaml",
967  "$LIBGEN_DIR/gen/headers/ir/ets/etsFunctionType.yaml",
968  "$LIBGEN_DIR/gen/headers/ir/ts/tsModuleDeclaration.yaml",
969  "$LIBGEN_DIR/gen/headers/ir/ts/tsLiteralType.yaml",
970  "$LIBGEN_DIR/gen/headers/checker/types/typeFlag.yaml",
971  "$LIBGEN_DIR/gen/headers/checker/types/ts/objectType.yaml",
972  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsEnumType.yaml",
973  "$LIBGEN_DIR/gen/headers/ir/statements/debuggerStatement.yaml",
974  "$LIBGEN_DIR/gen/headers/ir/ts/tsEnumMember.yaml",
975  "$LIBGEN_DIR/gen/headers/ir/expressions/arrayExpression.yaml",
976  "$LIBGEN_DIR/gen/headers/ir/statements/ifStatement.yaml",
977  "$LIBGEN_DIR/gen/headers/ir/base/tsMethodSignature.yaml",
978  "$LIBGEN_DIR/gen/headers/ir/as/namedType.yaml",
979  "$LIBGEN_DIR/gen/headers/ir/expressions/blockExpression.yaml",
980  "$LIBGEN_DIR/gen/headers/ir/statements/forInStatement.yaml",
981  "$LIBGEN_DIR/gen/headers/ir/statements/functionDeclaration.yaml",
982  "$LIBGEN_DIR/gen/headers/checker/types/ets/etsVoidType.yaml",
983  "$LIBGEN_DIR/gen/headers/ir/ts/tsEnumDeclaration.yaml",
984  "$LIBGEN_DIR/gen/headers/ir/ets/etsStructDeclaration.yaml",
985  "$LIBGEN_DIR/gen/headers/ir/expressions/literals/charLiteral.yaml",
986  "$LIBGEN_DIR/gen/headers/ir/base/decorator.yaml",
987  "$LIBGEN_DIR/gen/headers/ir/ts/tsTypeLiteral.yaml",
988  "$LIBGEN_DIR/gen/headers/ir/expressions/newExpression.yaml",
989  "$LIBGEN_DIR/gen/headers/ir/ets/etsScript.yaml",
990  "$LIBGEN_DIR/gen/headers/ir/base/spreadElement.yaml",
991  "$LIBGEN_DIR/gen/headers/varbinder/variable.yaml",
992  "$LIBGEN_DIR/gen/headers/varbinder/scope.yaml",
993  "$LIBGEN_DIR/gen/headers/varbinder/varbinder.yaml",
994  "$LIBGEN_DIR/gen/headers/varbinder/ETSBinder.yaml",
995  "$LIBGEN_DIR/gen/headers/varbinder/declaration.yaml",
996  "$LIBGEN_DIR/gen/headers/varbinder/recordTable.yaml",
997  "$LIBGEN_DIR/gen/headers/checker/checker.yaml",
998  "$LIBGEN_DIR/gen/headers/checker/ETSchecker.yaml",
999  "$LIBGEN_DIR/gen/headers/checker/checkerContext.yaml",
1000  "$LIBGEN_DIR/gen/headers/checker/resolveResult.yaml",
1001  "$LIBGEN_DIR/gen/headers/parser/parserFlags.yaml",
1002  "$LIBGEN_DIR/gen/headers/parser/ETSparser.yaml",
1003]
1004
1005ES2PANDA_API = [ "public/cppToCTypes.yaml" ]
1006
1007ES2PANDA_API += ES2PANDA_API_GENERATED
1008
1009foreach(i, ES2PANDA_API) {
1010  RB_LIST += [ "public/${LIB_NAME}.rb" ]
1011}
1012
1013action("libes2panda_public_parse_headers") {
1014  script = "./public/headers_parser/main.py"
1015
1016  args = [
1017           "--es2panda-root",
1018           rebase_path(".", ""),
1019           "--lib-gen-dir",
1020           rebase_path(LIBGEN_DIR, root_build_dir),
1021           "--headers",
1022         ] + rebase_path(HEADERS_TO_BE_PARSED, "")
1023
1024  sources = HEADERS_TO_BE_PARSED
1025  outputs = ES2PANDA_API_GENERATED
1026}
1027
1028ark_gen("gen") {
1029  data = ES2PANDA_API
1030  template_files = [
1031    "${LIB_NAME}_decl.inc.erb",
1032    "${LIB_NAME}_enums.inc.erb",
1033    "${LIB_NAME}_impl.inc.erb",
1034    "${LIB_NAME}_include.inc.erb",
1035    "${LIB_NAME}_list.inc.erb",
1036  ]
1037  sources = "public/"
1038  destination = "$LIBGEN_DIR/"
1039  api = RB_LIST
1040  extra_dependencies = [ ":libes2panda_public_parse_headers" ]
1041}
1042
1043# libes2panda does not include bytecode optimizer, because it is used in
1044# libarkruntime, and conflict with JIT setup ensues
1045libes2panda_public_sources = [
1046  "public/${LIB_NAME}.cpp",
1047  "util/generateBin.cpp",
1048  "util/options.cpp",
1049]
1050
1051config("libes2panda_config") {
1052  cflags_cc = [
1053    "-fexceptions",
1054    "-Werror=shadow",
1055  ]
1056}
1057
1058libes2panda_configs = [
1059  "$ark_root/assembler:arkassembler_public_config",
1060  "$ark_root:ark_config",
1061  ":libes2panda_public_config",
1062  ":libes2panda_config",
1063  "$ark_root/libpandabase:arkbase_public_config",
1064  "$ark_root/libpandafile:arkfile_public_config",
1065]
1066
1067libes2panda_public_configs = [
1068  "$ark_root/assembler:arkassembler_public_config",
1069  "$ark_root:ark_config",
1070  ":libes2panda_public_config",
1071  ":libes2panda_config",
1072  "$ark_root/libpandabase:arkbase_public_config",
1073  "$ark_root/libpandafile:arkfile_public_config",
1074  "$ark_root/bytecode_optimizer:bytecodeopt_public_config",
1075  "$ark_root/compiler:arkcompiler_public_config",
1076  "$ark_root/runtime:arkruntime_public_config",
1077]
1078
1079ohos_shared_library("libes2panda") {
1080  deps = [ ":libes2panda_frontend_static" ]
1081  output_extension = "so"
1082  part_name = "ets_frontend"
1083  subsystem_name = "arkcompiler"
1084}
1085
1086ohos_source_set("libes2panda_frontend_static") {
1087  sources = libes2panda_sources
1088
1089  configs = libes2panda_configs
1090
1091  deps = [
1092    ":gen_${LIB_NAME}_decl_inc",
1093    ":gen_${LIB_NAME}_enums_inc",
1094    ":gen_${LIB_NAME}_impl_inc",
1095    ":gen_${LIB_NAME}_include_inc",
1096    ":gen_${LIB_NAME}_list_inc",
1097    ":gen_es2panda_compiler_signatures_h",
1098    ":gen_es2panda_lexer_keywords_h",
1099    ":isa_gen_es2panda_formats_h",
1100    ":isa_gen_es2panda_isa_h",
1101    "$ark_third_party_root/icu/icu4c:static_icui18n",
1102    "$ark_third_party_root/icu/icu4c:static_icuuc",
1103  ]
1104  external_deps = [
1105    "runtime_core:libarktsassembler_package",
1106    "runtime_core:libarktsbase_package",
1107    "runtime_core:libarktscompiler_package",
1108    "runtime_core:libarktsfile_package",
1109    sdk_libc_secshared_dep,
1110  ]
1111  part_name = "ets_frontend"
1112  subsystem_name = "arkcompiler"
1113}
1114
1115ohos_shared_library("libes2panda_public") {
1116  deps = [ ":libes2panda_public_frontend_static" ]
1117  output_extension = "so"
1118  part_name = "ets_frontend"
1119  subsystem_name = "arkcompiler"
1120}
1121
1122ohos_source_set("libes2panda_public_frontend_static") {
1123  sources = libes2panda_public_sources
1124
1125  configs = libes2panda_public_configs
1126
1127  deps = [ ":libes2panda_frontend_static" ]
1128
1129  if (ark_standalone_build || ark_static_standalone_build) {
1130    deps += [ "$ark_root/bytecode_optimizer:libarktsbytecodeopt_package" ]
1131  }
1132
1133  external_deps = [
1134    "runtime_core:libarktsbytecodeopt_package",
1135    sdk_libc_secshared_dep,
1136  ]
1137  part_name = "ets_frontend"
1138  subsystem_name = "arkcompiler"
1139}
1140
1141ark_isa_gen("isa_gen_es2panda") {
1142  template_files = [
1143    "isa.h.erb",
1144    "formats.h.erb",
1145  ]
1146  sources = "compiler/templates"
1147  destination = "$target_gen_dir/generated"
1148}
1149
1150ark_gen("gen_es2panda_lexer") {
1151  data = [ "lexer/scripts/keywords.yaml" ]
1152  template_files = [ "keywords.h.erb" ]
1153  sources = "lexer/templates"
1154  destination = "$target_gen_dir/generated"
1155  api = [ "lexer/scripts/keywords.rb" ]
1156}
1157
1158ark_gen("gen_es2panda_compiler") {
1159  data = [ "compiler/scripts/signatures.yaml" ]
1160  template_files = [ "signatures.h.erb" ]
1161  sources = "compiler/templates"
1162  destination = "$target_gen_dir/generated"
1163  api = [ "compiler/scripts/signatures.rb" ]
1164}
1165