[SIR] Auto-generate the Swift IR tree

Co-authored-by: Gleb Lukianets <gleb.lukianets@jetbrains.com>
This commit is contained in:
Sergej Jaskiewicz
2023-12-06 13:07:46 +01:00
committed by Space Team
parent 39c84bca06
commit 0d2032f3ef
34 changed files with 968 additions and 2 deletions
@@ -6,7 +6,11 @@
package org.jetbrains.kotlin.generators.tree
/**
* A class representing a FIR or IR tree element.
* Represents an abstract class/interface for a tree node in the tree generator.
*
* Examples: `IrElement`, `FirRegularClass`.
*
* Subclasses may contain additional properties/logic specific to a particular tree.
*/
abstract class AbstractElement<Element, Field, Implementation>(
val name: String,
@@ -49,7 +49,8 @@ abstract class AbstractVisitorPrinter<Element : AbstractElement<Element, Field,
* If `true`, visitor methods for generic tree elements will be parameterized correspondingly.
* Otherwise, type arguments of generic tree elements will be replaced with `*`.
*/
abstract val allowTypeParametersInVisitorMethods: Boolean
open val allowTypeParametersInVisitorMethods: Boolean
get() = false
/**
* Allows to customize the default element to visit if the method for visiting this [element] is not overridden.