Make FirClass a kind of FirClassLikeDeclaration, introduce FirRegularClass/AnonymousObject symbols
This commit is contained in:
+4
-4
@@ -40,11 +40,11 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
val valueParameter = element("ValueParameter", Declaration, variable)
|
||||
val property = element("Property", Declaration, variable, controlFlowGraphOwner, typeParametersOwner, callableMemberDeclaration)
|
||||
val field = element("Field", Declaration, variable, callableMemberDeclaration) // TODO: add noImpl
|
||||
val klass = element("Class", Declaration, declaration, statement, annotationContainer)
|
||||
val classLikeDeclaration = element("ClassLikeDeclaration", Declaration, statement, memberDeclaration, symbolOwner, typeParametersOwner)
|
||||
val regularClass = element("RegularClass", Declaration, namedDeclaration, classLikeDeclaration, klass)
|
||||
val classLikeDeclaration = element("ClassLikeDeclaration", Declaration, declaration, statement, symbolOwner)
|
||||
val klass = element("Class", Declaration, classLikeDeclaration, statement, annotationContainer)
|
||||
val regularClass = element("RegularClass", Declaration, memberDeclaration, typeParametersOwner, klass)
|
||||
val sealedClass = element("SealedClass", Declaration, regularClass)
|
||||
val typeAlias = element("TypeAlias", Declaration, classLikeDeclaration)
|
||||
val typeAlias = element("TypeAlias", Declaration, classLikeDeclaration, memberDeclaration, typeParametersOwner)
|
||||
val enumEntry = element("EnumEntry", Declaration, regularClass)
|
||||
|
||||
val function = element("Function", Declaration, callableDeclaration, controlFlowGraphOwner, targetElement, annotationContainer, typeParametersOwner, statement)
|
||||
|
||||
+4
-3
@@ -54,7 +54,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
val modifiableClass = impl(klass, "FirModifiableClass")
|
||||
|
||||
val modifiableRegularClass = impl(regularClass, "FirModifiableRegularClass") {
|
||||
parents += modifiableClass
|
||||
parents += modifiableClass.withArg(regularClass)
|
||||
parents += modifiableTypeParametersOwner
|
||||
}
|
||||
|
||||
@@ -68,15 +68,16 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
impl(sealedClass, config = regularClassConfig)
|
||||
|
||||
impl(anonymousObject) {
|
||||
parents += modifiableClass
|
||||
parents += modifiableClass.withArg(anonymousObject)
|
||||
default("classKind") {
|
||||
value = "ClassKind.OBJECT"
|
||||
withGetter = true
|
||||
}
|
||||
defaultSupertypesComputationStatus()
|
||||
}
|
||||
|
||||
impl(enumEntry) {
|
||||
parents += modifiableClass
|
||||
parents += modifiableClass.withArg(regularClass)
|
||||
parents += modifiableTypeParametersOwner
|
||||
default("status", "FirDeclarationStatusImpl(Visibilities.UNKNOWN, Modality.FINAL)")
|
||||
default("classKind") {
|
||||
|
||||
+17
-9
@@ -199,13 +199,6 @@ object NodeConfigurator : AbstractFieldConfigurator() {
|
||||
needTransformOtherChildren()
|
||||
}
|
||||
|
||||
klass.configure {
|
||||
+classKind
|
||||
+superTypeRefs(withReplace = true)
|
||||
+declarations
|
||||
+annotations
|
||||
}
|
||||
|
||||
classLikeDeclaration.configure {
|
||||
withArg("F", "FirClassLikeDeclaration<F>")
|
||||
parentArg(symbolOwner, "F", "F")
|
||||
@@ -213,13 +206,28 @@ object NodeConfigurator : AbstractFieldConfigurator() {
|
||||
+symbol("FirClassLikeSymbol", "F")
|
||||
}
|
||||
|
||||
klass.configure {
|
||||
withArg("F", "FirClass<F>")
|
||||
parentArg(classLikeDeclaration, "F", "F")
|
||||
+symbol("FirClassSymbol", "F")
|
||||
+classKind
|
||||
+superTypeRefs(withReplace = true)
|
||||
+declarations
|
||||
+annotations
|
||||
}
|
||||
|
||||
regularClass.configure {
|
||||
parentArg(classLikeDeclaration, "F", regularClass)
|
||||
+symbol("FirClassSymbol")
|
||||
parentArg(klass, "F", regularClass)
|
||||
+symbol("FirRegularClassSymbol")
|
||||
+field("companionObject", regularClass, nullable = true)
|
||||
+superTypeRefs(withReplace = true)
|
||||
}
|
||||
|
||||
anonymousObject.configure {
|
||||
parentArg(klass, "F", anonymousObject)
|
||||
+symbol("FirAnonymousObjectSymbol")
|
||||
}
|
||||
|
||||
sealedClass.configure {
|
||||
+fieldList("inheritors", classIdType, withReplace = true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user