Frontend Passes
AST Processing and the ASTAPI
Internal AST passes may transform the AST iteratively. Internal AST passes are executed as follows:
- FindHelpersPass
- RelaxExpressionsASTPass
- RelaxValueASTPass
The FindHelpersPass
This pass traverses the AST, and generates errors for recovery AST nodes.
The RelaxExpressionsASTPass
This pass transforms all expressions into expressionNodes. This transformation is necessary, as the grammar needs to be non-left-recursive, but transformed rules yield non-trivial trees. These trees are transformed into nicer equivalents, and in that process Expression (which are internal nodes) tree nodes are replaced with ExpressionNode nodes (which are final AST Nodes).
SymbolDB Passes
Internal SymbolDB passes have mutable access to the SymbolDB, and may apply arbitrary transformations/changes.
The internal SymbolDB executes passes in the following order:
- GenerateOperationEntitiesPass
- GenerateOperationContainerSlotsPass
- ResolveEntityMetasPass
- ResolveSlotMetasPass
- ResolveAnnotationMetasPass
- ResolveSlotMetasPass //With annotation resolution enabled
- MarkAndAssignContractsPass
- ResolveReturnTypesPass
- ResolveOverridingOperationsPass
- ResolveReferenceValuesPass
- ResolveDefaultParametersPass
- ParseOperationNodesPass