Name Date Size

..25-Oct-20244 KiB

arrowFunctionExpressionBuilder.hH A D25-Oct-20241.4 KiB

assertStatementBuilder.hH A D25-Oct-20241.5 KiB

assignmentExpressionBuilder.hH A D25-Oct-20241.8 KiB

astBuilder.hH A D25-Oct-20241.7 KiB

awaitExpressionBuilder.hH A D25-Oct-20241.4 KiB

bigintLiteralBuilder.hH A D25-Oct-20241.3 KiB

binaryExpressionBuilder.hH A D25-Oct-20241.8 KiB

blockExpressionBuilder.hH A D25-Oct-20241.6 KiB

blockStatementBuilder.hH A D25-Oct-20241.6 KiB

booleanLiteralBuilder.hH A D25-Oct-20241.3 KiB

breakStatementBuilder.hH A D25-Oct-20241.2 KiB

callExpressionBuilder.hH A D25-Oct-20241.8 KiB

catchClauseBuilder.hH A D25-Oct-20241.4 KiB

chainExpressionBuilder.hH A D25-Oct-20241.4 KiB

charLiteralBuilder.hH A D25-Oct-20241.3 KiB

classDeclarationBuilder.hH A D25-Oct-20241.7 KiB

classDefinitionBuilder.hH A D25-Oct-20243 KiB

classExpressionBuilder.hH A D25-Oct-20241.3 KiB

classPropertyBuilder.hH A D25-Oct-20241.7 KiB

classStaticBlockBuilder.hH A D25-Oct-20241.4 KiB

conditionalExpressionBuilder.hH A D25-Oct-20241.7 KiB

continueStatementBuilder.hH A D25-Oct-20241.2 KiB

debuggerStatementBuilder.hH A D25-Oct-20241.2 KiB

decoratorBuilder.hH A D25-Oct-20241.3 KiB

directEvalExpressionBuilder.hH A D25-Oct-20242 KiB

doWhileStatementBuilder.hH A D25-Oct-20241.5 KiB

emptyStatementBuilder.hH A D25-Oct-20241.2 KiB

etsClassLiteralBuilder.hH A D25-Oct-20241.3 KiB

etsFunctionTypeBuilder.hH A D25-Oct-20241.6 KiB

etsLaunchExpressionBuilder.hH A D25-Oct-20241.4 KiB

etsNewArrayInstanceExpressionBuilder.hH A D25-Oct-20241.7 KiB

etsNewClassInstanceExpressionBuilder.hH A D25-Oct-20242 KiB

etsNewMultiDivArrayInstanceExpressionBuilder.hH A D25-Oct-20241.9 KiB

etsNullTypeBuilder.hH A D25-Oct-20241.2 KiB

etsPackageDeclarationBuilder.hH A D25-Oct-20241.4 KiB

etsParameterExpressionBuilder.hH A D25-Oct-20241.6 KiB

etsPrimitiveTypeBuilder.hH A D25-Oct-20241.4 KiB

etsReExportDeclarationBuilder.hH A D25-Oct-20241.9 KiB

etsStructDeclarationBuilder.hH A D25-Oct-20241.4 KiB

etsTupleBuilder.hH A D25-Oct-20241.4 KiB

etsTypeReferenceBuilder.hH A D25-Oct-20241.5 KiB

etsTypeReferencePartBuilder.hH A D25-Oct-20241.8 KiB

etsUndefinedTypeBuilder.hH A D25-Oct-20241.2 KiB

etsUnionTypeBuilder.hH A D25-Oct-20241.4 KiB

etsWildcardTypeBuilder.hH A D25-Oct-20241.6 KiB

exportAllDeclarationBuilder.hH A D25-Oct-20241.6 KiB

exportDefaultDeclarationBuilder.hH A D25-Oct-20241.6 KiB

exportNamedDeclarationBuilder.hH A D25-Oct-20241.6 KiB

exportSpecifierBuilder.hH A D25-Oct-20241.5 KiB

expressionStatementBuilder.hH A D25-Oct-20241.4 KiB

forInStatementBuilder.hH A D25-Oct-20241.6 KiB

forOfStatementBuilder.hH A D25-Oct-20241.8 KiB

forUpdateStatementBuilder.hH A D25-Oct-20241.8 KiB

functionDeclarationBuilder.hH A D25-Oct-20241.6 KiB

functionExpressionBuilder.hH A D25-Oct-20241.4 KiB

identifierBuilder.hH A D25-Oct-20241.3 KiB

ifStatementBuilder.hH A D25-Oct-20241.6 KiB

importDeclarationBuilder.hH A D25-Oct-20241.8 KiB

importDefaultSpecifierBuilder.hH A D25-Oct-20241.4 KiB

importExpressionBuilder.hH A D25-Oct-20241.4 KiB

importNamespaceSpecifierBuilder.hH A D25-Oct-20241.4 KiB

importSpecifierBuilder.hH A D25-Oct-20241.5 KiB

labelledStatementBuilder.hH A D25-Oct-20241.5 KiB

memberExpressionBuilder.hH A D25-Oct-20241.7 KiB

metaPropertyBuilder.hH A D25-Oct-20241.4 KiB

methodDefinitionBuilder.hH A D25-Oct-20241.9 KiB

namedTypeBuilder.hH A D25-Oct-20241.3 KiB

newExpressionBuilder.hH A D25-Oct-20241.7 KiB

nullLiteralBuilder.hH A D25-Oct-20241.2 KiB

numberLiteralBuilder.hH A D25-Oct-20241.3 KiB

omittedExpressionBuilder.hH A D25-Oct-20241.2 KiB

opaqueTypeNodeBuilder.hH A D25-Oct-20241.3 KiB

prefixAssertionExpressionBuilder.hH A D25-Oct-20241.6 KiB

propertyBuilder.hH A D25-Oct-20241.9 KiB

README.mdH A D25-Oct-20242.6 KiB

regExpLiteralBuilder.hH A D25-Oct-20241.7 KiB

returnStatementBuilder.hH A D25-Oct-20241.2 KiB

scriptFunctionBuilder.hH A D25-Oct-20241.7 KiB

sequenceExpressionBuilder.hH A D25-Oct-20241.5 KiB

stringLiteralBuilder.hH A D25-Oct-20241.3 KiB

superExpressionBuilder.hH A D25-Oct-20241.2 KiB

switchCaseStatementBuilder.hH A D25-Oct-20241.7 KiB

switchStatementBuilder.hH A D25-Oct-20241.8 KiB

taggedTemplateExpressionBuilder.hH A D25-Oct-20241.8 KiB

templateElementBuilder.hH A D25-Oct-20241.5 KiB

templateLiteralBuilder.hH A D25-Oct-20241.7 KiB

thisExpressionBuilder.hH A D25-Oct-20241.2 KiB

throwStatementBuilder.hH A D25-Oct-20241.3 KiB

tryStatementBuilder.hH A D25-Oct-20242.1 KiB

tsAnyKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsArrayTypeBuilder.hH A D25-Oct-20241.3 KiB

tsAsExpressionBuilder.hH A D25-Oct-20241.7 KiB

tsBigintKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsBooleanKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsClassImplementsBuilder.hH A D25-Oct-20241.6 KiB

tsConditionalTypeBuilder.hH A D25-Oct-20241.9 KiB

tsEnumDeclarationBuilder.hH A D25-Oct-20242.1 KiB

tsEnumMemberBuilder.hH A D25-Oct-20241.4 KiB

tsFunctionTypeBuilder.hH A D25-Oct-20241.4 KiB

tsImportEqualsDeclarationBuilder.hH A D25-Oct-20241.8 KiB

tsImportTypeBuilder.hH A D25-Oct-20241.8 KiB

tsIndexedAccessTypeBuilder.hH A D25-Oct-20241.6 KiB

tsIndexSignatureBuilder.hH A D25-Oct-20241.7 KiB

tsInferTypeBuilder.hH A D25-Oct-20241.3 KiB

tsInterfaceBodyBuilder.hH A D25-Oct-20241.4 KiB

tsInterfaceHeritageBuilder.hH A D25-Oct-20241.4 KiB

tsIntersectionTypeBuilder.hH A D25-Oct-20241.4 KiB

tsLiteralTypeBuilder.hH A D25-Oct-20241.3 KiB

tsMappedTypeBuilder.hH A D25-Oct-20241.9 KiB

tsMethodSignatureBuilder.hH A D25-Oct-20241.9 KiB

tsModuleBlockBuilder.hH A D25-Oct-20241.4 KiB

tsModuleDeclarationBuilder.hH A D25-Oct-20242.1 KiB

tsNamedTupleMemberBuilder.hH A D25-Oct-20241.7 KiB

tsNeverKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsNonNullExpressionBuilder.hH A D25-Oct-20241.4 KiB

tsNullKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsNumberKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsObjectKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsParenthesizedTypeBuilder.hH A D25-Oct-20241.4 KiB

tsPropertySignatureBuilder.hH A D25-Oct-20242 KiB

tsQualifiedNameBuilder.hH A D25-Oct-20241.5 KiB

tsSignatureDeclarationBuilder.hH A D25-Oct-20241.8 KiB

tsStringKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsThisTypeBuilder.hH A D25-Oct-20241.1 KiB

tsTupleTypeBuilder.hH A D25-Oct-20241.4 KiB

tsTypeAliasDeclarationBuilder.hH A D25-Oct-20242 KiB

tsTypeAssertionBuilder.hH A D25-Oct-20241.6 KiB

tsTypeLiteralBuilder.hH A D25-Oct-20241.4 KiB

tsTypeOperatorBuilder.hH A D25-Oct-20241.5 KiB

tsTypeParameterBuilder.hH A D25-Oct-20241.7 KiB

tsTypeParameterDeclarationBuilder.hH A D25-Oct-20241.7 KiB

tsTypeParameterInstantiationBuilder.hH A D25-Oct-20241.7 KiB

tsTypePredicateBuilder.hH A D25-Oct-20241.7 KiB

tsTypeQueryBuilder.hH A D25-Oct-20241.3 KiB

tsTypeReferenceBuilder.hH A D25-Oct-20241.6 KiB

tsUndefinedKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsUnionTypeBuilder.hH A D25-Oct-20241.4 KiB

tsUnknownKeywordBuilder.hH A D25-Oct-20241.2 KiB

tsVoidKeywordBuilder.hH A D25-Oct-20241.2 KiB

typeofExpressionBuilder.hH A D25-Oct-20241.4 KiB

unaryExpressionBuilder.hH A D25-Oct-20241.5 KiB

undefinedLiteralBuilder.hH A D25-Oct-20241.2 KiB

updateExpressionBuilder.hH A D25-Oct-20241.7 KiB

variableDeclarationBuilder.hH A D25-Oct-20242.1 KiB

variableDeclaratorBuilder.hH A D25-Oct-20241.6 KiB

whileStatementBuilder.hH A D25-Oct-20241.5 KiB

yieldExpressionBuilder.hH A D25-Oct-20241.5 KiB

README.md

1# DSL for build AST tree
2 
3## Usage
4
5All nodes of AST tree builder is header only.
6
7For use DSL for AST tree builder:
8
91. Include header with needed node
102. Create builder:
11    
12    1. All builder methods, except method `Build`, return `ASTBuilder` class.
13    2. Builder constructor have `Allocator` argument, that must be sended.
14    3. For set arguments for construct node we have methods that starts with `Set` or `Add`. For all necessary fields for constructor we have methods for set them.
15    4. All builders have method `SetParent`, it can be used for set parent node.
16    5. To get node from builder you must to use method `Build`
17
18    Example:
19    ```cpp
20    // Create NumberLiteralBuildr, set value and build it. Variable `left` is NumberLiteral after call `Build` method.
21    auto left = NumberLiteralBuilder(Allocator()).SetValue("10").Build();
22    auto right = NumberLiteralBuilder(Allocator()).SetValue("5").Build();
23    // Create BinaryExpressionBuilder, set left operand, set right operand, set operator and build BinaryExpression node.
24    auto binaryExpr = BinaryExpressionBuilder(Allocator())
25                          .SetLeft(left)
26                          .SetRight(right)
27                          .SetOperator(ark::es2panda::lexer::TokenType::PUNCTUATOR_PLUS)
28                          .Build();
29    ```
30
31    *Note: More examples can be found in `ets_frontend/ets2panda/test/unit/public/ast_builder_test.cpp`*
32
33## List of implemented nodes
34
35<details>
36    <summary>Implemented nodes</summary>
37
38        * AwaitExpression
39        * BigintLiteral
40        * BinaryExpression
41        * BlockExpression
42        * BlockStatement
43        * BooleanLiteral
44        * BreakStatement
45        * CallExpression
46        * CharLiteral
47        * ClassDeclaration
48        * ClassDefenition
49        * ClassPropery
50        * ETSTypeReference
51        * ETSTypeReferencePart
52        * ExportDefaultDeclaration
53        * ExpressionStatement
54        * FunctionExpression
55        * Identifier
56        * IfStatement
57        * MemberExpression
58        * MethodDefinition
59        * NullLiteral
60        * NumberLiteral
61        * OpaqueTypeNode
62        * ScriptFunction
63        * Statement
64        * StringLiteral
65        * SuperExpression
66        * SwitchCaseStatement
67        * SwitchStatement
68        * ThisExpression
69        * TSClassImplements
70        * TSEnumDeclaration
71        * TSEnumMember
72        * TSTypeParameterInstantiation
73        * UnaryExpression
74        * UndefinedLiteral
75        * UpdateExpression
76        * VariableDeclaration
77        * VariableDeclarator
78        * WhileStatement
79        * YieldExpression
80
81</details>
82
83*Note: list of implemented nodes actual by 2024.07.03*