From 3661d03483a6c8b43e1a880fe6ccb1bbab8164b6 Mon Sep 17 00:00:00 2001 From: Konstantin Chukharev Date: Thu, 8 Aug 2024 15:55:21 +0300 Subject: [PATCH] Update code to match the current ArkAnalyzer (#255) --- .github/workflows/build-and-test.yml | 16 +- jacodb-ets/build.gradle.kts | 1 + .../kotlin/org/jacodb/ets/base/EtsExpr.kt | 38 +- .../main/kotlin/org/jacodb/ets/base/EtsRef.kt | 2 +- .../kotlin/org/jacodb/ets/base/EtsType.kt | 6 +- .../main/kotlin/org/jacodb/ets/dto/Convert.kt | 126 +- .../main/kotlin/org/jacodb/ets/dto/Model.kt | 3 +- .../main/kotlin/org/jacodb/ets/dto/Types.kt | 4 +- .../main/kotlin/org/jacodb/ets/dto/Values.kt | 39 +- .../kotlin/org/jacodb/ets/graph/EtsCfg.kt | 6 + .../kotlin/org/jacodb/ets/model/EtsMethod.kt | 5 +- .../org/jacodb/ets/utils/EtsFileDtoToDot.kt | 115 +- .../org/jacodb/ets/utils/EtsFileToDot.kt | 1 - .../org/jacodb/ets/utils/GetOperands.kt | 8 + .../main/kotlin/org/jacodb/ets/utils/Utils.kt | 20 +- .../kotlin/org/jacodb/ets/test/EtsFileTest.kt | 132 +- .../org/jacodb/ets/test/EtsFromJsonTest.kt | 5 +- .../jacodb/ets/test/EtsTaintAnalysisTest.kt | 8 +- .../org/jacodb/ets/test/utils/LoadEts.kt | 8 +- ...ity.ts.abc.json => TaintAnalysis.abc.json} | 4 +- .../etsir/samples/DataFlowSecurity.ts.json | 957 --- .../etsir/samples/DefaultConstructor.ts.json | 117 - .../etsir/samples/MethodCollision.ts.json | 389 +- .../etsir/samples/StaticField.ts.json | 183 - .../{taint.ts.json => TaintAnalysis.ts.json} | 39 +- .../etsir/samples/TypeMismatch.ts.json | 13 +- .../etsir/samples/binary/Bitwise.ts.json | 179 +- .../etsir/samples/binary/Division.ts.json | 42 +- .../etsir/samples/binary/Subtraction.ts.json | 42 +- .../etsir/samples/cases/case1.ts.json | 114 +- .../etsir/samples/cases/case2.ts.json | 1322 ++- .../etsir/samples/cases/case3.ts.json | 379 +- .../etsir/samples/catch/TryCatch.ts.json | 154 +- .../samples/catch/TryCatchFinally.ts.json | 199 +- .../samples/catch/TryCatchMultiple.ts.json | 286 +- .../samples/catch/TryCatchNested.ts.json | 182 +- .../etsir/samples/catch/TryFinally.ts.json | 176 +- .../samples/classes/AbstractClass.ts.json | 339 +- .../samples/classes/AccessModifiers.ts.json | 186 +- .../samples/classes/ConstructorClass.ts.json | 180 +- .../FieldInitializers.ts.json} | 218 +- .../samples/classes/GenericClass.ts.json | 204 +- .../samples/classes/InheritanceClass.ts.json | 307 +- .../classes/InterfaceImplementation.ts.json | 214 +- .../NestedInitializer.ts.json} | 826 +- .../etsir/samples/classes/SimpleClass.ts.json | 244 +- .../samples/classes/SingletonClass.ts.json | 237 +- .../etsir/samples/classes/StaticClass.ts.json | 290 +- .../resources/etsir/samples/enums.ts.json | 2026 ----- .../resources/etsir/samples/lang/in.ts.json | 457 ++ .../etsir/samples/lang/instanceof.ts.json | 407 + .../etsir/samples/lang/object.ts.json | 1414 ++++ .../samples/loop/BreadthFirstSearch.ts.json | 1358 +++- .../samples/loop/DepthFirstSearch.ts.json | 2278 +++++- .../samples/loop/DijkstrasAlgorithm.ts.json | 874 +- .../etsir/samples/loop/DoWhileLoop.ts.json | 63 +- .../etsir/samples/loop/ForInLoop.ts.json | 654 +- .../samples/loop/MatrixMultiplication.ts.json | 1119 ++- .../etsir/samples/loop/NestedLoops.ts.json | 790 +- .../etsir/samples/loop/WhileLoop.ts.json | 50 +- .../etsir/samples/{ => save}/basic.ts.json | 7136 ++++++++++++----- .../etsir/samples/save/enums.ts.json | 2206 +++++ .../resources/samples/DataFlowSecurity.ts | 29 - .../resources/samples/DefaultConstructor.ts | 3 - .../resources/samples/PrependInitializer.ts | 18 - .../src/test/resources/samples/StaticField.ts | 6 - .../samples/{taint.ts => TaintAnalysis.ts} | 16 +- .../samples/classes/FieldInitializers.ts | 19 + .../samples/classes/NestedInitializer.ts | 7 + .../src/test/resources/samples/enums.ts | 104 - .../src/test/resources/samples/lang/in.ts | 8 + .../test/resources/samples/lang/instanceof.ts | 5 + .../resources/samples/{ => lang}/object.ts | 0 .../resources/samples/{ => save}/basic.ts | 1 + .../src/test/resources/samples/save/enums.ts | 45 + jacodb-ets/src/test/resources/structure.txt | 38 + 76 files changed, 19755 insertions(+), 9941 deletions(-) rename jacodb-ets/src/test/resources/decompiled/{DataFlowSecurity.ts.abc.json => TaintAnalysis.abc.json} (99%) delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json rename jacodb-ets/src/test/resources/etsir/samples/{taint.ts.json => TaintAnalysis.ts.json} (98%) rename jacodb-ets/src/test/resources/etsir/samples/{PrependInitializer.ts.json => classes/FieldInitializers.ts.json} (69%) rename jacodb-ets/src/test/resources/etsir/samples/{object.ts.json => classes/NestedInitializer.ts.json} (54%) delete mode 100644 jacodb-ets/src/test/resources/etsir/samples/enums.ts.json create mode 100644 jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json create mode 100644 jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json create mode 100644 jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json rename jacodb-ets/src/test/resources/etsir/samples/{ => save}/basic.ts.json (61%) create mode 100644 jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json delete mode 100644 jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts delete mode 100644 jacodb-ets/src/test/resources/samples/DefaultConstructor.ts delete mode 100644 jacodb-ets/src/test/resources/samples/PrependInitializer.ts delete mode 100644 jacodb-ets/src/test/resources/samples/StaticField.ts rename jacodb-ets/src/test/resources/samples/{taint.ts => TaintAnalysis.ts} (59%) create mode 100644 jacodb-ets/src/test/resources/samples/classes/FieldInitializers.ts create mode 100644 jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts delete mode 100644 jacodb-ets/src/test/resources/samples/enums.ts create mode 100644 jacodb-ets/src/test/resources/samples/lang/in.ts create mode 100644 jacodb-ets/src/test/resources/samples/lang/instanceof.ts rename jacodb-ets/src/test/resources/samples/{ => lang}/object.ts (100%) rename jacodb-ets/src/test/resources/samples/{ => save}/basic.ts (99%) create mode 100644 jacodb-ets/src/test/resources/samples/save/enums.ts create mode 100644 jacodb-ets/src/test/resources/structure.txt diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3851c8d8e..0059e3cb5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -60,13 +60,14 @@ jobs: - name: Set up ArkAnalyzer run: | - REPO_URL="https://gitee.com/openharmony-sig/arkanalyzer.git" + REPO_URL="https://gitee.com/Lipenx/arkanalyzer.git" DEST_DIR="arkanalyzer" MAX_RETRIES=10 RETRY_DELAY=3 # Delay between retries in seconds + BRANCH="neo/2024-08-07" for ((i=1; i<=MAX_RETRIES; i++)); do - git clone --depth=1 $REPO_URL $DEST_DIR && break + git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break echo "Clone failed, retrying in $RETRY_DELAY seconds..." sleep "$RETRY_DELAY" done @@ -81,17 +82,6 @@ jobs: echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV cd $DEST_DIR - # checkout master on 2024-07-17 - rev=a9d9fd6070fce5896d8e760ed7fd175b62b16605 - - for ((i=1; i<=MAX_RETRIES; i++)); do - git fetch --depth=1 origin $rev && break - echo "Fetch failed, retrying in $RETRY_DELAY seconds..." - sleep "$RETRY_DELAY" - done - - git switch --detach $rev - npm install npm run build diff --git a/jacodb-ets/build.gradle.kts b/jacodb-ets/build.gradle.kts index 951e7dd33..7d63f4162 100644 --- a/jacodb-ets/build.gradle.kts +++ b/jacodb-ets/build.gradle.kts @@ -13,6 +13,7 @@ dependencies { implementation(Libs.kotlinx_serialization_json) implementation(Libs.jdot) + testImplementation(kotlin("test")) testImplementation(project(":jacodb-analysis")) testImplementation(testFixtures(project(":jacodb-core"))) testImplementation(Libs.mockk) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt index 309a667ee..c17cb586f 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsExpr.kt @@ -29,6 +29,8 @@ interface EtsExpr : EtsEntity { // Unary fun visit(expr: EtsDeleteExpr): R + fun visit(expr: EtsAwaitExpr): R + fun visit(expr: EtsYieldExpr): R fun visit(expr: EtsTypeOfExpr): R fun visit(expr: EtsVoidExpr): R fun visit(expr: EtsNotExpr): R @@ -88,6 +90,8 @@ interface EtsExpr : EtsEntity { override fun visit(expr: EtsInstanceOfExpr): R = defaultVisit(expr) override fun visit(expr: EtsDeleteExpr): R = defaultVisit(expr) + override fun visit(expr: EtsAwaitExpr): R = defaultVisit(expr) + override fun visit(expr: EtsYieldExpr): R = defaultVisit(expr) override fun visit(expr: EtsTypeOfExpr): R = defaultVisit(expr) override fun visit(expr: EtsVoidExpr): R = defaultVisit(expr) override fun visit(expr: EtsNotExpr): R = defaultVisit(expr) @@ -202,7 +206,7 @@ data class EtsCastExpr( data class EtsInstanceOfExpr( val arg: EtsEntity, - val checkType: String, // TODO: what should it be? + val checkType: EtsType, ) : EtsExpr { override val type: EtsType get() = EtsBooleanType @@ -235,6 +239,36 @@ data class EtsDeleteExpr( } } +data class EtsAwaitExpr( + override val arg: EtsEntity, +) : EtsUnaryExpr { + override val type: EtsType + get() = arg.type + + override fun toString(): String { + return "await $arg" + } + + override fun accept(visitor: EtsExpr.Visitor): R { + return visitor.visit(this) + } +} + +data class EtsYieldExpr( + override val arg: EtsEntity, +) : EtsUnaryExpr { + override val type: EtsType + get() = arg.type + + override fun toString(): String { + return "yield $arg" + } + + override fun accept(visitor: EtsExpr.Visitor): R { + return visitor.visit(this) + } +} + data class EtsTypeOfExpr( override val arg: EtsEntity, ) : EtsUnaryExpr { @@ -730,7 +764,7 @@ interface EtsCallExpr : EtsExpr, CommonCallExpr { } data class EtsInstanceCallExpr( - val instance: EtsEntity, + val instance: EtsLocal, override val method: EtsMethodSignature, override val args: List, ) : EtsCallExpr { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt index bba2641be..72a98493a 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsRef.kt @@ -67,7 +67,7 @@ interface EtsFieldRef : EtsRef, EtsLValue { } data class EtsInstanceFieldRef( - val instance: EtsEntity, // Local + val instance: EtsLocal, override val field: EtsFieldSignature, ) : EtsFieldRef { override fun toString(): String { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt index 4bd1696ca..b5e567c47 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/base/EtsType.kt @@ -41,7 +41,7 @@ interface EtsType : CommonType, CommonTypeName { fun visit(type: EtsNeverType): R fun visit(type: EtsLiteralType): R fun visit(type: EtsClassType): R - fun visit(type: EtsCallableType): R + fun visit(type: EtsFunctionType): R fun visit(type: EtsArrayType): R fun visit(type: EtsArrayObjectType): R fun visit(type: EtsUnclearRefType): R @@ -60,7 +60,7 @@ interface EtsType : CommonType, CommonTypeName { override fun visit(type: EtsNeverType): R = defaultVisit(type) override fun visit(type: EtsLiteralType): R = defaultVisit(type) override fun visit(type: EtsClassType): R = defaultVisit(type) - override fun visit(type: EtsCallableType): R = defaultVisit(type) + override fun visit(type: EtsFunctionType): R = defaultVisit(type) override fun visit(type: EtsArrayType): R = defaultVisit(type) override fun visit(type: EtsArrayObjectType): R = defaultVisit(type) override fun visit(type: EtsUnclearRefType): R = defaultVisit(type) @@ -227,7 +227,7 @@ data class EtsClassType( } } -data class EtsCallableType( +data class EtsFunctionType( val method: EtsMethodSignature, ) : EtsRefType { override val typeName: String diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt index c664c6110..acad74720 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt @@ -23,6 +23,7 @@ import org.jacodb.ets.base.EtsArrayAccess import org.jacodb.ets.base.EtsArrayLiteral import org.jacodb.ets.base.EtsArrayType import org.jacodb.ets.base.EtsAssignStmt +import org.jacodb.ets.base.EtsAwaitExpr import org.jacodb.ets.base.EtsBitAndExpr import org.jacodb.ets.base.EtsBitNotExpr import org.jacodb.ets.base.EtsBitOrExpr @@ -31,7 +32,6 @@ import org.jacodb.ets.base.EtsBooleanConstant import org.jacodb.ets.base.EtsBooleanType import org.jacodb.ets.base.EtsCallExpr import org.jacodb.ets.base.EtsCallStmt -import org.jacodb.ets.base.EtsCallableType import org.jacodb.ets.base.EtsCastExpr import org.jacodb.ets.base.EtsClassType import org.jacodb.ets.base.EtsCommaExpr @@ -43,6 +43,7 @@ import org.jacodb.ets.base.EtsEqExpr import org.jacodb.ets.base.EtsExpExpr import org.jacodb.ets.base.EtsExpr import org.jacodb.ets.base.EtsFieldRef +import org.jacodb.ets.base.EtsFunctionType import org.jacodb.ets.base.EtsGotoStmt import org.jacodb.ets.base.EtsGtEqExpr import org.jacodb.ets.base.EtsGtExpr @@ -102,6 +103,7 @@ import org.jacodb.ets.base.EtsUnknownType import org.jacodb.ets.base.EtsUnsignedRightShiftExpr import org.jacodb.ets.base.EtsValue import org.jacodb.ets.base.EtsVoidType +import org.jacodb.ets.base.EtsYieldExpr import org.jacodb.ets.base.Ops import org.jacodb.ets.graph.EtsCfg import org.jacodb.ets.model.EtsClass @@ -143,15 +145,12 @@ class EtsMethodBuilder( fun build(cfgDto: CfgDto): EtsMethod { require(!built) { "Method has already been built" } val cfg = convertToEtsCfg(cfgDto) - etsMethod.cfg = cfg + etsMethod._cfg = cfg built = true return etsMethod } private fun ensureOneAddress(entity: EtsEntity): EtsValue { - // TODO: think about whether 'CastExpr' should be considered "one-address". This would require changing the return type of this function to `EtsEntity`. - // if (entity is EtsCastExpr) return entity - if (entity is EtsExpr || entity is EtsFieldRef || entity is EtsArrayAccess) { val newLocal = newTempLocal(entity.type) currentStmts += EtsAssignStmt( @@ -161,7 +160,9 @@ class EtsMethodBuilder( ) return newLocal } else { - check(entity is EtsValue) + check(entity is EtsValue) { + "Expected EtsValue, but got $entity" + } return entity } } @@ -185,8 +186,14 @@ class EtsMethodBuilder( } is AssignStmtDto -> { - val lhv = convertToEtsEntity(stmt.left) as EtsValue - val rhv = ensureOneAddress(convertToEtsEntity(stmt.right)) + val lhv = convertToEtsEntity(stmt.left) as EtsValue // safe cast + val rhv = convertToEtsEntity(stmt.right).let { + if (it is EtsCastExpr || it is EtsNewExpr) { + it + } else { + ensureOneAddress(it) + } + } EtsAssignStmt( location = loc(), lhv = lhv, @@ -256,11 +263,7 @@ class EtsMethodBuilder( is UnknownValueDto -> object : EtsEntity { override val type: EtsType = EtsUnknownType - // TODO: change to this `toString()` implementation when `value.value` field is restored. - // override fun toString(): String = "Unknown(${value.value})" - // Note: `value` field was removed from `UnknownValueDto` due to circular references in ArkIR, - // which forbid their serialization. - override fun toString(): String = "Unknown" + override fun toString(): String = "Unknown(${value.value})" override fun accept(visitor: EtsEntity.Visitor): R { if (visitor is EtsEntity.Visitor.Default) { @@ -278,7 +281,7 @@ class EtsMethodBuilder( is ConstantDto -> convertToEtsConstant(value) is NewExprDto -> EtsNewExpr( - type = convertToEtsType(value.classType as ClassTypeDto) // safe cast + type = convertToEtsType(value.classType) // TODO: safe cast to ClassType ) is NewArrayExprDto -> EtsNewArrayExpr( @@ -290,13 +293,21 @@ class EtsMethodBuilder( arg = convertToEtsEntity(value.arg) ) + is AwaitExprDto -> EtsAwaitExpr( + arg = convertToEtsEntity(value.arg) + ) + + is YieldExprDto -> EtsYieldExpr( + arg = convertToEtsEntity(value.arg) + ) + is TypeOfExprDto -> EtsTypeOfExpr( arg = convertToEtsEntity(value.arg) ) is InstanceOfExprDto -> EtsInstanceOfExpr( arg = convertToEtsEntity(value.arg), - checkType = value.checkType, + checkType = convertToEtsType(value.checkType), ) is LengthExprDto -> EtsLengthExpr( @@ -361,7 +372,12 @@ class EtsMethodBuilder( // introduce a corresponding DTO for it. // Currently, `x instanceof T` is represented as `BinopExpr(Local("x"), Local("T"))`, // so we just *unsafely* extract the type name from the "pseudo-local" here: - "instanceof" -> EtsInstanceOfExpr(left, (right as EtsLocal).name) + // "instanceof" -> EtsInstanceOfExpr(left, (right as EtsLocal).name) + + // TODO: Currently, ArkIR treats "in" operation just as BinopExpr. + // Ideally, it would be represented as a separate `ArkInExpr`, + // or at least as `ArkConditionExpr`, since it inherently has a boolean type. + // Ops.IN -> EtsInExpr(left, right) // Note: `type` is ignored here! else -> error("Unknown binop: ${value.op}") } @@ -386,7 +402,7 @@ class EtsMethodBuilder( } is InstanceCallExprDto -> EtsInstanceCallExpr( - instance = convertToEtsEntity(value.instance), + instance = convertToEtsEntity(value.instance as LocalDto) as EtsLocal, // safe cast method = convertToEtsMethodSignature(value.method), args = value.args.map { ensureOneAddress(convertToEtsEntity(it)) @@ -401,7 +417,7 @@ class EtsMethodBuilder( ) is ThisRefDto -> EtsThis( - type = convertToEtsType(value.type) as EtsClassType // safe cast + type = convertToEtsType(value.type as ClassTypeDto) as EtsClassType // safe cast ) is ParameterRefDto -> EtsParameterRef( @@ -425,7 +441,7 @@ class EtsMethodBuilder( val field = convertToEtsFieldSignature(fieldRef.field) return when (fieldRef) { is InstanceFieldRefDto -> EtsInstanceFieldRef( - instance = convertToEtsEntity(fieldRef.instance), // as Local + instance = convertToEtsEntity(fieldRef.instance as LocalDto) as EtsLocal, // safe cast field = field, ) @@ -494,7 +510,7 @@ fun convertToEtsClass(classDto: ClassDto): EtsClass { successors = emptyList(), predecessors = emptyList(), stmts = listOf( - ReturnStmtDto(arg = ThisRefDto(type = ClassTypeDto(classSignatureDto))) + ReturnVoidStmtDto ) ) val cfg = CfgDto(blocks = listOf(zeroBlock)) @@ -513,69 +529,34 @@ fun convertToEtsClass(classDto: ClassDto): EtsClass { ) } - fun isStaticField(field: FieldDto): Boolean { - val modifiers = field.modifiers ?: return false - return modifiers.contains(ModifierDto.StringItem("StaticKeyword")) - } - val signature = EtsClassSignature( name = classDto.signature.name, namespace = null, // TODO file = null, // TODO ) - - val superclassSignature = classDto.superClassName?.takeIf { it != "" }?.let { spName -> + val superClassSignature = classDto.superClassName?.takeIf { it != "" }?.let { name -> EtsClassSignature( - name = spName, + name = name, namespace = null, // TODO file = null, // TODO ) } + val fields = classDto.fields.map { convertToEtsField(it) } + val (methodDtos, ctorDtos) = classDto.methods.partition { it.signature.name != "constructor" } check(ctorDtos.size <= 1) { "Class should not have multiple constructors" } - val ctorDto = ctorDtos.singleOrNull() ?: defaultConstructorDto(classDto.signature) + val ctorDto = ctorDtos.firstOrNull() ?: defaultConstructorDto(classDto.signature) - val fields = classDto.fields.map { convertToEtsField(it) } val methods = methodDtos.map { convertToEtsMethod(it) } - - val initializers = classDto.fields.mapNotNull { - if (it.initializer != null && !isStaticField(it)) { - AssignStmtDto( - left = InstanceFieldRefDto( - instance = ThisRefDto(ClassTypeDto(classDto.signature)), - field = it.signature, - ), - right = it.initializer, - ) - } else null - } - - val ctorBlocks = ctorDto.body.cfg.blocks - val ctorStartingBlock = ctorBlocks.single { it.id == 0 } - - check(ctorStartingBlock.predecessors.isEmpty()) { - "Starting block should not have predecessors, or else the (prepended) initializers will be evaluated multiple times" - } - - val newStartingBlock = ctorStartingBlock.copy( - stmts = initializers + ctorStartingBlock.stmts - ) - val ctorWithInitializersDto = ctorDto.copy( - body = ctorDto.body.copy( - cfg = CfgDto( - blocks = ctorBlocks - ctorStartingBlock + newStartingBlock - ) - ) - ) - val ctor = convertToEtsMethod(ctorWithInitializersDto) + val ctor = convertToEtsMethod(ctorDto) return EtsClassImpl( signature = signature, fields = fields, methods = methods, ctor = ctor, - superClass = superclassSignature + superClass = superClassSignature, ) } @@ -601,7 +582,7 @@ fun convertToEtsType(type: TypeDto): EtsType { dimensions = type.dimensions, ) - is CallableTypeDto -> EtsCallableType( + is FunctionTypeDto -> EtsFunctionType( method = convertToEtsMethodSignature(type.signature) ) @@ -715,17 +696,20 @@ fun convertToEtsMethodSignature(method: MethodSignatureDto): EtsMethodSignature fun convertToEtsMethod(method: MethodDto): EtsMethod { val signature = convertToEtsMethodSignature(method.signature) - // Note: locals are not used in the current implementation - // val locals = method.body.locals.map { - // convertToEtsEntity(it) as EtsLocal // safe cast - // } - val localsCount = method.body.locals.size val modifiers = method.modifiers .filterIsInstance() .map { it.modifier } - val builder = EtsMethodBuilder(signature, localsCount, modifiers) - val etsMethod = builder.build(method.body.cfg) - return etsMethod + if (method.body != null) { + // Note: locals are not used in the current implementation + // val locals = method.body.locals.map { + // convertToEtsEntity(it) as EtsLocal // safe cast + // } + val localsCount = method.body.locals.size + val builder = EtsMethodBuilder(signature, localsCount, modifiers) + return builder.build(method.body.cfg) + } else { + return EtsMethodImpl(signature, modifiers = modifiers) + } } fun convertToEtsField(field: FieldDto): EtsField { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt index a8a7eebf4..f3de099be 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Model.kt @@ -72,7 +72,6 @@ data class FieldDto( val modifiers: List? = null, @SerialName("questionToken") val isOptional: Boolean = false, // '?' @SerialName("exclamationToken") val isDefinitelyAssigned: Boolean = false, // '!' - val initializer: ValueDto? = null, ) @Serializable(with = ModifierSerializer::class) @@ -93,7 +92,7 @@ data class MethodDto( val signature: MethodSignatureDto, val modifiers: List, val typeParameters: List, - val body: BodyDto, + val body: BodyDto? = null, ) @Serializable diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt index 871e280d7..16ff8041d 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt @@ -162,8 +162,8 @@ data class ClassTypeDto( } @Serializable -@SerialName("CallableType") -data class CallableTypeDto( +@SerialName("FunctionType") +data class FunctionTypeDto( val signature: MethodSignatureDto, ) : TypeDto { override fun toString(): String { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt index d0e220ce3..4d501d1bb 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Values.kt @@ -20,6 +20,7 @@ import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonClassDiscriminator +import kotlinx.serialization.json.JsonElement @Serializable @OptIn(ExperimentalSerializationApi::class) @@ -30,12 +31,14 @@ sealed interface ValueDto { @Serializable @SerialName("UNKNOWN_VALUE") -object UnknownValueDto : ValueDto { +data class UnknownValueDto( + val value: JsonElement, +) : ValueDto { override val type: TypeDto get() = UnknownTypeDto override fun toString(): String { - return "UNKNOWN" + return "UNKNOWN($value)" } } @@ -135,7 +138,7 @@ sealed interface ExprDto : ValueDto @Serializable @SerialName("NewExpr") data class NewExprDto( - val classType: TypeDto, // ClassTypeDto + val classType: TypeDto, // ClassType ) : ExprDto { override val type: TypeDto get() = classType as ClassTypeDto // safe cast @@ -172,6 +175,32 @@ data class DeleteExprDto( } } +@Serializable +@SerialName("AwaitExpr") +data class AwaitExprDto( + val arg: ValueDto, +) : ExprDto { + override val type: TypeDto + get() = arg.type + + override fun toString(): String { + return "await $arg" + } +} + +@Serializable +@SerialName("YieldExpr") +data class YieldExprDto( + val arg: ValueDto, +) : ExprDto { + override val type: TypeDto + get() = arg.type + + override fun toString(): String { + return "yield $arg" + } +} + @Serializable @SerialName("TypeOfExpr") data class TypeOfExprDto( @@ -189,7 +218,7 @@ data class TypeOfExprDto( @SerialName("InstanceOfExpr") data class InstanceOfExprDto( val arg: ValueDto, - val checkType: String, + val checkType: TypeDto, ) : ExprDto { override val type: TypeDto get() = BooleanTypeDto @@ -386,7 +415,7 @@ sealed interface FieldRefDto : RefDto { @Serializable @SerialName("InstanceFieldRef") data class InstanceFieldRefDto( - val instance: ValueDto, + val instance: ValueDto, // Local override val field: FieldSignatureDto, ) : FieldRefDto { override fun toString(): String { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt index abf14b2f9..7803e107f 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/graph/EtsCfg.kt @@ -59,6 +59,12 @@ class EtsCfg( override fun predecessors(node: EtsStmt): Set { return predecessorMap[node]!! } + + companion object { + fun empty(): EtsCfg { + return EtsCfg(emptyList(), emptyMap()) + } + } } fun EtsCfg.findDominators(): GraphDominators { diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt index c05eba31c..44880a64f 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt @@ -64,7 +64,10 @@ class EtsMethodImpl( override val localsCount: Int = signature.parameters.size + 1, override val modifiers: List = emptyList(), ) : EtsMethod { - override lateinit var cfg: EtsCfg + internal var _cfg: EtsCfg? = null + + override val cfg: EtsCfg + get() = _cfg ?: EtsCfg.empty() override fun toString(): String { return signature.toString() diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt index a96dcde95..e00dda059 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileDtoToDot.kt @@ -24,7 +24,6 @@ import org.jacodb.ets.dto.MethodDto import org.jacodb.ets.dto.NopStmtDto import org.jacodb.ets.dto.StmtDto import org.jacodb.ets.dto.SwitchStmtDto -import java.io.BufferedWriter import java.io.File import java.nio.file.Path import kotlin.io.path.createDirectories @@ -107,72 +106,74 @@ fun EtsFileDto.toDot(useLR: Boolean = false): String { // Link class to method: lines += """ "$c" -> "$m" [dir=none];""" - // Link method to its first basic block: - if (method.body.cfg.blocks.isNotEmpty()) { - val b = blockId(clazz, method, method.body.cfg.blocks.first().id) - lines += """ "$m" -> "${b}.0" [lhead="$b"];""" - } - - // Basic blocks with instructions: - method.body.cfg.blocks.forEach { bb -> - // BLOCK - val b = blockId(clazz, method, bb.id) - val blabel = blockLabel(bb) - lines += "" - lines += """ subgraph "$b" {""" - lines += """ cluster=true;""" - lines += """ label="$blabel";""" - - // Empty block: - if (bb.stmts.isEmpty()) { - lines += """ "${b}.0" [shape=box, label="NOP"];""" - } - - // Instructions inside basic block: - bb.stmts.forEachIndexed { i, inst -> - val label = statementLabel(inst) - lines += """ "${b}.${i}" [shape=box, label="$label"];""" + if (method.body != null) { + // Link method to its first basic block: + if (method.body.cfg.blocks.isNotEmpty()) { + val b = blockId(clazz, method, method.body.cfg.blocks.first().id) + lines += """ "$m" -> "${b}.0" [lhead="$b"];""" } - // Instructions chain: - if (bb.stmts.isNotEmpty()) { - val ids = List(bb.stmts.size) { i -> - "${b}.${i}" + // Basic blocks with instructions: + method.body.cfg.blocks.forEach { bb -> + // BLOCK + val b = blockId(clazz, method, bb.id) + val blabel = blockLabel(bb) + lines += "" + lines += """ subgraph "$b" {""" + lines += """ cluster=true;""" + lines += """ label="$blabel";""" + + // Empty block: + if (bb.stmts.isEmpty()) { + lines += """ "${b}.0" [shape=box, label="NOP"];""" } - lines += " ${ids.joinToString(" -> ") { "\"$it\"" }};" - } - lines += " }" - } + // Instructions inside basic block: + bb.stmts.forEachIndexed { i, inst -> + val label = statementLabel(inst) + lines += """ "${b}.${i}" [shape=box, label="$label"];""" + } - // Links to successor blocks: - method.body.cfg.blocks.forEach { bb -> - val last = bb.stmts.lastOrNull() - val i = if (bb.stmts.isNotEmpty()) bb.stmts.lastIndex else 0 - when (last ?: NopStmtDto) { - is IfStmtDto -> { - for ((j, succ) in bb.successors.withIndex()) { - val b = blockId(clazz, method, bb.id) - val bs = blockId(clazz, method, succ) - val label = if (j == 0) "true" else "false" - lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs", label="$label"];""" + // Instructions chain: + if (bb.stmts.isNotEmpty()) { + val ids = List(bb.stmts.size) { i -> + "${b}.${i}" } + lines += " ${ids.joinToString(" -> ") { "\"$it\"" }};" } - is SwitchStmtDto -> { - for ((j, succ) in bb.successors.withIndex()) { - val b = blockId(clazz, method, bb.id) - val bs = blockId(clazz, method, succ) - val label = if (j == 0) "default" else "case ${j - 1}" - lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$b", label="$label"];""" + lines += " }" + } + + // Links to successor blocks: + method.body.cfg.blocks.forEach { bb -> + val last = bb.stmts.lastOrNull() + val i = if (bb.stmts.isNotEmpty()) bb.stmts.lastIndex else 0 + when (last ?: NopStmtDto) { + is IfStmtDto -> { + for ((j, succ) in bb.successors.withIndex()) { + val b = blockId(clazz, method, bb.id) + val bs = blockId(clazz, method, succ) + val label = if (j == 0) "true" else "false" + lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs", label="$label"];""" + } + } + + is SwitchStmtDto -> { + for ((j, succ) in bb.successors.withIndex()) { + val b = blockId(clazz, method, bb.id) + val bs = blockId(clazz, method, succ) + val label = if (j == 0) "default" else "case ${j - 1}" + lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$b", label="$label"];""" + } } - } - else -> { - for (succ in bb.successors) { - val b = blockId(clazz, method, bb.id) - val bs = blockId(clazz, method, succ) - lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs"];""" + else -> { + for (succ in bb.successors) { + val b = blockId(clazz, method, bb.id) + val bs = blockId(clazz, method, succ) + lines += """ "${b}.${i}" -> "${bs}.0" [lhead="$bs"];""" + } } } } diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt index 7344e9134..f1f2b0520 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/EtsFileToDot.kt @@ -20,7 +20,6 @@ import org.jacodb.ets.base.EtsStmt import org.jacodb.ets.model.EtsClass import org.jacodb.ets.model.EtsFile import org.jacodb.ets.model.EtsMethod -import java.io.BufferedWriter import java.io.File import java.nio.file.Path import kotlin.io.path.createDirectories diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt index d29520c4c..73a54ae30 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/GetOperands.kt @@ -21,6 +21,7 @@ import org.jacodb.ets.base.EtsAndExpr import org.jacodb.ets.base.EtsArrayAccess import org.jacodb.ets.base.EtsArrayLiteral import org.jacodb.ets.base.EtsAssignStmt +import org.jacodb.ets.base.EtsAwaitExpr import org.jacodb.ets.base.EtsBitAndExpr import org.jacodb.ets.base.EtsBitNotExpr import org.jacodb.ets.base.EtsBitOrExpr @@ -83,6 +84,7 @@ import org.jacodb.ets.base.EtsUnaryPlusExpr import org.jacodb.ets.base.EtsUndefinedConstant import org.jacodb.ets.base.EtsUnsignedRightShiftExpr import org.jacodb.ets.base.EtsVoidExpr +import org.jacodb.ets.base.EtsYieldExpr fun EtsStmt.getOperands(): Sequence { return accept(StmtGetOperands) @@ -179,6 +181,12 @@ private object EntityGetOperands : EtsEntity.Visitor> { override fun visit(expr: EtsDeleteExpr): Sequence = sequenceOf(expr.arg) + override fun visit(expr: EtsAwaitExpr): Sequence = + sequenceOf(expr.arg) + + override fun visit(expr: EtsYieldExpr): Sequence = + sequenceOf(expr.arg) + override fun visit(expr: EtsTypeOfExpr): Sequence = sequenceOf(expr.arg) diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/Utils.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/Utils.kt index 569b984f5..73c341591 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/Utils.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/Utils.kt @@ -68,16 +68,18 @@ fun EtsFileDto.toText(): String { lines += " methods: ${clazz.methods.size}" clazz.methods.forEach { method -> lines += " - METHOD '${method.signature}'" - lines += " locals = ${method.body.locals}" lines += " typeParameters = ${method.typeParameters}" - lines += " blocks: ${method.body.cfg.blocks.size}" - method.body.cfg.blocks.forEach { block -> - lines += " - BLOCK ${block.id}" - lines += " successors = ${block.successors}" - lines += " predecessors = ${block.predecessors}" - lines += " statements: ${block.stmts.size}" - block.stmts.forEachIndexed { i, stmt -> - lines += " ${i + 1}. $stmt" + if (method.body != null) { + lines += " locals = ${method.body.locals}" + lines += " blocks: ${method.body.cfg.blocks.size}" + method.body.cfg.blocks.forEach { block -> + lines += " - BLOCK ${block.id}" + lines += " successors = ${block.successors}" + lines += " predecessors = ${block.predecessors}" + lines += " statements: ${block.stmts.size}" + block.stmts.forEachIndexed { i, stmt -> + lines += " ${i + 1}. $stmt" + } } } } diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt index 5e7d26c21..5da8bddb5 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFileTest.kt @@ -18,11 +18,15 @@ package org.jacodb.ets.test import org.jacodb.ets.base.EtsAssignStmt import org.jacodb.ets.base.EtsInstanceFieldRef +import org.jacodb.ets.base.EtsLocal +import org.jacodb.ets.base.EtsNumberConstant +import org.jacodb.ets.base.EtsReturnStmt import org.jacodb.ets.base.EtsThis import org.jacodb.ets.model.EtsFile import org.jacodb.ets.test.utils.loadEtsFileFromResource -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertIs private val logger = mu.KotlinLogging.logger {} @@ -50,17 +54,17 @@ class EtsFileTest { } @Test - fun `test etsFile on TypeMismatch`() { + fun `test sample TypeMismatch`() { val etsFile = load("etsir/samples/TypeMismatch") etsFile.classes.forEach { cls -> cls.methods.forEach { method -> when (method.name) { "add" -> { - Assertions.assertEquals(11, method.cfg.instructions.size) + assertEquals(10, method.cfg.instructions.size) } "main" -> { - Assertions.assertEquals(5, method.cfg.instructions.size) + assertEquals(5, method.cfg.instructions.size) } } } @@ -68,31 +72,103 @@ class EtsFileTest { } @Test - fun `test initializers prepended to class constructor`() { - val etsFile = load("etsir/samples/PrependInitializer") - val cls = etsFile.classes.single { it.name == "Foo" } - val ctorBegin = cls.ctor.cfg.instructions.first() as EtsAssignStmt - val fieldRef = ctorBegin.lhv as EtsInstanceFieldRef - Assertions.assertTrue(fieldRef.instance is EtsThis) - Assertions.assertEquals("x", fieldRef.field.name) - } + fun `test sample FieldInitializers`() { + val etsFile = load("etsir/samples/classes/FieldInitializers") - @Test - fun `test static field should not be initialized in constructor`() { - val etsFile = load("etsir/samples/StaticField") val cls = etsFile.classes.single { it.name == "Foo" } - Assertions.assertFalse(cls.ctor.cfg.stmts.any { - it is EtsAssignStmt && it.lhv is EtsInstanceFieldRef - }) - } - @Test - fun `test default constructor should be synthesized`() { - val etsFile = load("etsir/samples/DefaultConstructor") - val cls = etsFile.classes.single { it.name == "Foo" } - val fieldInit = cls.ctor.cfg.instructions.first() as EtsAssignStmt - val fieldRef = fieldInit.lhv as EtsInstanceFieldRef - Assertions.assertTrue(fieldRef.instance is EtsThis) - Assertions.assertEquals("x", fieldRef.field.name) + // instance initializer + run { + val method = cls.methods.single { it.name == "@instance_init" } + assertEquals(3, method.cfg.instructions.size) + + // Local("this") := ThisRef + run { + val stmt = method.cfg.instructions[0] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + assertEquals("this", lhv.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals("Foo", rhv.type.typeName) + } + + // Local("this").x := 99 + run { + val stmt = method.cfg.instructions[1] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + + val instance = lhv.instance + assertIs(instance) + assertEquals("this", instance.name) + + val field = lhv.field + assertEquals("x", field.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals(99.0, rhv.value) + } + + // return + run { + val stmt = method.cfg.instructions[2] + assertIs(stmt) + assertEquals(null, stmt.returnValue) + } + } + + // static initializer + run { + val method = cls.methods.single { it.name == "@static_init" } + assertEquals(3, method.cfg.instructions.size) + + // Local("this") := ThisRef + run { + val stmt = method.cfg.instructions[0] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + assertEquals("this", lhv.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals("Foo", rhv.type.typeName) + } + + // Local("this").y := 111 + run { + val stmt = method.cfg.instructions[1] + assertIs(stmt) + + val lhv = stmt.lhv + assertIs(lhv) + + val instance = lhv.instance + assertIs(instance) + assertEquals("this", instance.name) + + val field = lhv.field + assertEquals("y", field.name) + + val rhv = stmt.rhv + assertIs(rhv) + assertEquals(111.0, rhv.value) + } + + // return + run { + val stmt = method.cfg.instructions[2] + assertIs(stmt) + assertEquals(null, stmt.returnValue) + } + } } } diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt index 7942469e4..1ad19ee42 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsFromJsonTest.kt @@ -26,7 +26,6 @@ import org.jacodb.ets.base.EtsReturnStmt import org.jacodb.ets.base.EtsUnknownType import org.jacodb.ets.dto.AnyTypeDto import org.jacodb.ets.dto.ClassSignatureDto -import org.jacodb.ets.dto.ConstantDto import org.jacodb.ets.dto.EtsMethodBuilder import org.jacodb.ets.dto.FieldDto import org.jacodb.ets.dto.FieldSignatureDto @@ -63,7 +62,8 @@ class EtsFromJsonTest { @Test fun testLoadEtsFileFromJson() { - val etsDto = loadEtsFileDtoFromResource("/etsir/samples/basic.ts.json") + val path = "/etsir/samples/save/basic.ts.json" + val etsDto = loadEtsFileDtoFromResource("$path") println("etsDto = $etsDto") val ets = convertToEtsFile(etsDto) println("ets = $ets") @@ -120,7 +120,6 @@ class EtsFromJsonTest { typeParameters = emptyList(), isOptional = true, isDefinitelyAssigned = false, - initializer = ConstantDto("0", NumberTypeDto), ) println("field = $field") diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt index c9bb2ed03..2e8cafaf6 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/EtsTaintAnalysisTest.kt @@ -39,6 +39,7 @@ import org.jacodb.taint.configuration.TaintMethodSink import org.jacodb.taint.configuration.TaintMethodSource import org.jacodb.taint.configuration.TaintPassThrough import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import kotlin.time.Duration.Companion.seconds @@ -56,7 +57,7 @@ class EtsTaintAnalysisTest { } private fun loadDecompiled(name: String): EtsFile { - return loadEtsFileFromResource("$DECOMPILED_PATH/$name.ts.abc.json") + return loadEtsFileFromResource("$DECOMPILED_PATH/$name.abc.json") } val getConfigForMethod: ForwardTaintFlowFunctions.(EtsMethod) -> List? = @@ -124,13 +125,14 @@ class EtsTaintAnalysisTest { @Test fun `test taint analysis`() { - val etsFile = loadFromProject("taint") + val etsFile = loadFromProject("TaintAnalysis") runTaintAnalysis(etsFile) } + @Disabled("Need to update the EtsIR-ABC json file") @Test fun `test taint analysis on decompiled file`() { - val etsFile = loadDecompiled("DataFlowSecurity") + val etsFile = loadDecompiled("TaintAnalysis") runTaintAnalysis(etsFile) } } diff --git a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt index 1e693df76..05bbabf83 100644 --- a/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt +++ b/jacodb-ets/src/test/kotlin/org/jacodb/ets/test/utils/LoadEts.kt @@ -16,15 +16,19 @@ package org.jacodb.ets.test.utils +import mu.KotlinLogging import org.jacodb.ets.dto.EtsFileDto import org.jacodb.ets.dto.convertToEtsFile import org.jacodb.ets.model.EtsFile +private val logger = KotlinLogging.logger {} + fun loadEtsFileDtoFromResource(jsonPath: String): EtsFileDto { require(jsonPath.startsWith("/")) { "Resource path must start with '/': $jsonPath" } - val sampleFilePath = object {}::class.java.getResourceAsStream(jsonPath) + logger.debug { "Loading EtsIR from resource: '$jsonPath'" } + val stream = object {}::class.java.getResourceAsStream(jsonPath) ?: error("Resource not found: $jsonPath") - return EtsFileDto.loadFromJson(sampleFilePath) + return EtsFileDto.loadFromJson(stream) } fun loadEtsFileFromResource(jsonPath: String): EtsFile { diff --git a/jacodb-ets/src/test/resources/decompiled/DataFlowSecurity.ts.abc.json b/jacodb-ets/src/test/resources/decompiled/TaintAnalysis.abc.json similarity index 99% rename from jacodb-ets/src/test/resources/decompiled/DataFlowSecurity.ts.abc.json rename to jacodb-ets/src/test/resources/decompiled/TaintAnalysis.abc.json index 2ef5e709f..f7a05bc22 100644 --- a/jacodb-ets/src/test/resources/decompiled/DataFlowSecurity.ts.abc.json +++ b/jacodb-ets/src/test/resources/decompiled/TaintAnalysis.abc.json @@ -1,5 +1,5 @@ { - "name": "samples/DataFlowSecurity.ts", + "name": "samples/TaintAnalysis", "namespaces": [], "classes": [ { @@ -1050,4 +1050,4 @@ "modifiers": [] } ] -} \ No newline at end of file +} diff --git a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json b/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json deleted file mode 100644 index 7c34410f7..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/DataFlowSecurity.ts.json +++ /dev/null @@ -1,957 +0,0 @@ -{ - "name": "DataFlowSecurity.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "source", - "parameters": [], - "returnType": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnStmt", - "arg": { - "_": "Constant", - "value": "null", - "type": { - "_": "NullType" - } - } - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "pass", - "parameters": [ - { - "name": "data", - "type": { - "_": "BooleanType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "BooleanType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "BooleanType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "BooleanType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "data", - "type": { - "_": "BooleanType" - } - } - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "validate", - "parameters": [ - { - "name": "data", - "type": { - "_": "UnknownType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [ - 1, - 2 - ], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": "!=", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "Constant", - "value": "null", - "type": { - "_": "NullType" - } - }, - "type": { - "_": "UnknownType" - } - } - } - ] - }, - { - "id": 1, - "successors": [], - "predecessors": [ - 0, - 2 - ], - "stmts": [ - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - } - ] - }, - { - "id": 2, - "successors": [ - 1 - ], - "predecessors": [ - 0 - ], - "stmts": [ - { - "_": "ReturnStmt", - "arg": { - "_": "Constant", - "value": "OK", - "type": { - "_": "StringType" - } - } - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "sink", - "parameters": [ - { - "name": "data", - "type": { - "_": "UnknownType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - }, - { - "name": "$temp0", - "type": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [ - 1 - ], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": "!=", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "Constant", - "value": "null", - "type": { - "_": "NullType" - } - }, - "type": { - "_": "UnknownType" - } - } - } - ] - }, - { - "id": 1, - "successors": [], - "predecessors": [ - 0 - ], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - }, - "right": { - "_": "NewExpr", - "classType": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", - "instance": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - }, - "method": { - "enclosingClass": { - "name": "Error" - }, - "name": "constructor", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Constant", - "value": "Error!", - "type": { - "_": "StringType" - } - } - ] - } - }, - { - "_": "ThrowStmt", - "arg": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ClassType", - "signature": { - "name": "Error" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "bad", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - }, - { - "name": "source", - "type": { - "_": "UnknownType" - } - }, - { - "name": "pass", - "type": { - "_": "UnknownType" - } - }, - { - "name": "sink", - "type": { - "_": "UnknownType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "source", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "pass", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "sink", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "good", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "data", - "type": { - "_": "UnknownType" - } - }, - { - "name": "source", - "type": { - "_": "UnknownType" - } - }, - { - "name": "validate", - "type": { - "_": "UnknownType" - } - }, - { - "name": "sink", - "type": { - "_": "UnknownType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "source", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "validate", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "" - }, - "name": "sink", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "data", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json b/jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json deleted file mode 100644 index eeb72b5bd..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/DefaultConstructor.ts.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "name": "DefaultConstructor.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - }, - { - "signature": { - "name": "Foo" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Foo" - }, - "name": "x", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "99", - "type": { - "_": "NumberType" - } - } - } - ], - "methods": [] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json index 746f7430c..e8b4d8ba7 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/MethodCollision.ts.json @@ -212,7 +212,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "TypeOfExpr", "arg": { @@ -234,7 +234,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -243,10 +243,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -293,9 +290,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -701,7 +696,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp2", @@ -717,7 +712,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } }, @@ -1000,11 +995,110 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -1052,7 +1146,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } } ], @@ -1140,11 +1234,11 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "===", "left": { "_": "Local", @@ -1159,6 +1253,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -1167,10 +1264,84 @@ "arg": { "_": "Local", "name": "$temp1", + "type": { + "_": "BooleanType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -1202,11 +1373,110 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -1254,7 +1524,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } } ], @@ -1342,11 +1612,11 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "===", "left": { "_": "Local", @@ -1361,6 +1631,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -1369,10 +1642,84 @@ "arg": { "_": "Local", "name": "$temp1", + "type": { + "_": "BooleanType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json b/jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json deleted file mode 100644 index 03cb7938f..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/StaticField.ts.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "name": "StaticField.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - }, - { - "signature": { - "name": "Foo" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Foo" - }, - "name": "y", - "type": { - "_": "NumberType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "109", - "type": { - "_": "NumberType" - } - } - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "Foo" - }, - "name": "constructor", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Foo" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Foo" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "Foo" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - } - ] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json b/jacodb-ets/src/test/resources/etsir/samples/TaintAnalysis.ts.json similarity index 98% rename from jacodb-ets/src/test/resources/etsir/samples/taint.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/TaintAnalysis.ts.json index 3933ebc94..14629f710 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/taint.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/TaintAnalysis.ts.json @@ -1,5 +1,5 @@ { - "name": "taint.ts", + "name": "TaintAnalysis.ts", "namespaces": [], "classes": [ { @@ -426,7 +426,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!=", + "op": "==", "left": { "_": "Local", "name": "data", @@ -450,7 +450,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -459,10 +459,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -489,9 +486,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -578,7 +573,8 @@ { "id": 0, "successors": [ - 1 + 1, + 2 ], "predecessors": [], "stmts": [ @@ -641,7 +637,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!=", + "op": "==", "left": { "_": "Local", "name": "data", @@ -665,7 +661,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -674,9 +670,19 @@ { "id": 1, "successors": [], - "predecessors": [ - 0 + "predecessors": [], + "stmts": [ + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 2, + "successors": [ + 1 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -747,9 +753,6 @@ } } } - }, - { - "_": "ReturnVoidStmt" } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json index b6faff907..1ee5f8b65 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/TypeMismatch.ts.json @@ -212,7 +212,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "TypeOfExpr", "arg": { @@ -234,7 +234,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -243,10 +243,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -293,9 +290,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json b/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json index dfea01dd0..36a88238e 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/binary/Bitwise.ts.json @@ -10,184 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "a", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "b", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "andResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "orResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "xorResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "notResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "leftShiftResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "rightShiftResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "unsignedRightShiftResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "c", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "unsignedRightShiftNegativeResult", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json b/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json index 5b927ad80..c99f4881f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/binary/Division.ts.json @@ -116,7 +116,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -172,7 +172,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -200,7 +200,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -251,7 +251,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -307,7 +307,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -335,7 +335,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -399,7 +399,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -472,7 +472,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -500,7 +500,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -564,7 +564,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -637,7 +637,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -665,7 +665,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -716,7 +716,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -772,7 +772,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -800,7 +800,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -851,7 +851,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -907,7 +907,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -935,7 +935,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -1011,7 +1011,7 @@ { "name": "$temp2", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -1126,7 +1126,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1154,7 +1154,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "NumberType" } } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json b/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json index 67fc9b7f4..9ed3373c5 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/binary/Subtraction.ts.json @@ -116,7 +116,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -172,7 +172,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -200,7 +200,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -251,7 +251,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -307,7 +307,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -335,7 +335,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -399,7 +399,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -472,7 +472,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -500,7 +500,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -564,7 +564,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -637,7 +637,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -665,7 +665,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -716,7 +716,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -772,7 +772,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -800,7 +800,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -851,7 +851,7 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -907,7 +907,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -935,7 +935,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -1005,7 +1005,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -1099,7 +1099,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1127,7 +1127,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "NumberType" } } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json index 79bfb760f..8e5c48761 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case1.ts.json @@ -10,24 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "RESULT", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -373,20 +356,7 @@ } ] } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -403,12 +373,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -424,35 +404,7 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } @@ -461,9 +413,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -482,9 +432,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", @@ -517,6 +465,34 @@ } ] } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json index ea7afb1cb..0e651c4a5 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case2.ts.json @@ -301,18 +301,50 @@ }, "modifiers": [], "typeParameters": [], + "body": null + }, + { + "signature": { + "enclosingClass": { + "name": "Message" + }, + "name": "readBoolean", + "parameters": [], + "returnType": { + "_": "BooleanType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "PixelMap" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "PixelMap" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Message" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -326,10 +358,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Message" - } + "_": "UnknownType" } }, "right": { @@ -337,7 +366,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Message" + "name": "PixelMap" } } } @@ -354,28 +383,18 @@ { "signature": { "enclosingClass": { - "name": "Message" + "name": "PixelMap" }, - "name": "readBoolean", + "name": "@static_init", "parameters": [], "returnType": { - "_": "BooleanType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Message" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -388,23 +407,94 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Message" + "name": "PixelMap" } } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "PixelMap" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } }, "right": { "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Message" + "name": "PixelMap" } } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "PixelMap" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -416,17 +506,6 @@ } ] }, - { - "signature": { - "name": "PixelMap" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [] - }, { "signature": { "name": "Size" @@ -449,8 +528,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -465,146 +543,837 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "Request" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], "methods": [ { "signature": { "enclosingClass": { - "name": "Request" + "name": "Size" }, - "name": "onRemoteMessageRequest", - "parameters": [ - { - "name": "data", - "type": { - "_": "UnclearReferenceType", - "name": "Message" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { - "_": "BooleanType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Request" - } - } - }, - { - "name": "data", - "type": { - "_": "UnclearReferenceType", - "name": "Message" - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - { - "name": "height", - "type": { - "_": "UnknownType" - } - }, - { - "name": "width", - "type": { - "_": "UnknownType" - } - }, - { - "name": "bytesNumber", - "type": { - "_": "UnknownType" - } - }, - { - "name": "pixelMap", - "type": { - "_": "UnknownType" - } - }, - { - "name": "$temp1", - "type": { - "_": "ClassType", - "signature": { - "name": "ArrayBuffer" - } - } - }, - { - "name": "createPixelMap", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { "id": 0, - "successors": [ - 1 - ], + "successors": [], "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "data", + "name": "this", "type": { - "_": "UnclearReferenceType", - "name": "Message" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "UnclearReferenceType", - "name": "Message" + "_": "ClassType", + "signature": { + "name": "Size" + } } } }, { - "_": "AssignStmt", - "left": { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Size" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Size" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Size" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Size" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Size" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Request" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "onRemoteMessageRequest", + "parameters": [ + { + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + }, + "isOptional": false + } + ], + "returnType": { + "_": "BooleanType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + }, + { + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + { + "name": "height", + "type": { + "_": "UnknownType" + } + }, + { + "name": "width", + "type": { + "_": "UnknownType" + } + }, + { + "name": "bytesNumber", + "type": { + "_": "UnknownType" + } + }, + { + "name": "pixelMap", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + { + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + { + "name": "createPixelMap", + "type": { + "_": "UnknownType" + } + }, + { + "name": "e", + "type": { + "_": "UnknownType" + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [ + 1, + 3 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Request" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readBoolean", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "!=", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 1, + "successors": [ + 2 + ], + "predecessors": [], + "stmts": [ + { + "_": "ReturnStmt", + "arg": { + "_": "Constant", + "value": "true", + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 2, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "ReturnStmt", + "arg": { + "_": "Constant", + "value": "false", + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 3, + "successors": [ + 1 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "height", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readInt", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "width", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readInt", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "bytesNumber", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "data", + "type": { + "_": "UnclearReferenceType", + "name": "Message" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "readInt", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + "method": { + "enclosingClass": { + "name": "ArrayBuffer" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "bytesNumber", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "pixelMap", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "" + }, + "name": "createPixelMap", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "ArrayBuffer" + } + } + }, + { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + ] + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Request" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Request" - } + "_": "UnknownType" } }, "right": { @@ -616,25 +1385,33 @@ } } } - } - ] - }, - { - "id": 1, - "successors": [], - "predecessors": [ - 0 - ], - "stmts": [ + }, { - "_": "ReturnStmt", - "arg": { - "_": "Constant", - "value": "false", - "type": { - "_": "BooleanType" - } + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Request" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -646,7 +1423,7 @@ }, { "signature": { - "name": "AnonymousClass-onRemoteMessageRequest-0" + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" }, "modifiers": [], "typeParameters": [], @@ -656,7 +1433,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-onRemoteMessageRequest-0" + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" }, "name": "height", "type": { @@ -666,19 +1443,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "height", - "type": { - "_": "UnknownType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-onRemoteMessageRequest-0" + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" }, "name": "width", "type": { @@ -688,17 +1458,199 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "width", - "type": { + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "height", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "height", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "width", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "width", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-Request-onRemoteMessageRequest-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } } } - ], - "methods": [] + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json index 3bab770f8..6f0ac287d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/cases/case3.ts.json @@ -97,81 +97,7 @@ }, "modifiers": [], "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "err", - "type": { - "_": "UnclearReferenceType", - "name": "MyError" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "err", - "type": { - "_": "UnclearReferenceType", - "name": "MyError" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "UnclearReferenceType", - "name": "MyError" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } + "body": null }, { "signature": { @@ -198,7 +124,7 @@ { "name": "callback", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -255,7 +181,7 @@ { "name": "callback", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -327,7 +253,7 @@ "_": "Local", "name": "callback", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -353,7 +279,7 @@ "_": "ParameterRef", "index": 2, "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -432,8 +358,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -448,8 +373,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -464,8 +388,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -480,8 +403,7 @@ "modifiers": [], "typeParameters": [], "questionToken": true, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [] @@ -511,17 +433,143 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "\"\"", - "type": { - "_": "StringType" - } - } + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + }, + "field": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "publish", + "type": { + "_": "UnclearReferenceType", + "name": "String" + } + } + }, + "right": { + "_": "Constant", + "value": "", + "type": { + "_": "StringType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -629,7 +677,7 @@ { "name": "AnonymousMethod-publishEventWithData-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "CommonSecurity" @@ -753,7 +801,7 @@ "_": "Local", "name": "AnonymousMethod-publishEventWithData-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "CommonSecurity" @@ -839,13 +887,13 @@ { "name": "$temp2", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp3", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -857,13 +905,13 @@ { "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -875,13 +923,13 @@ { "name": "$temp8", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp9", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -893,7 +941,7 @@ { "name": "$temp11", "type": { - "_": "UnknownType" + "_": "StringType" } } ], @@ -903,7 +951,7 @@ "id": 0, "successors": [ 1, - 2 + 3 ], "predecessors": [], "stmts": [ @@ -979,7 +1027,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp0", @@ -995,7 +1043,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1003,10 +1051,10 @@ }, { "id": 1, - "successors": [], - "predecessors": [ - 0 + "successors": [ + 2 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1045,9 +1093,19 @@ { "id": 2, "successors": [], - "predecessors": [ - 0 + "predecessors": [], + "stmts": [ + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 3, + "successors": [ + 2 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1084,7 +1142,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1112,7 +1170,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1122,7 +1180,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1169,7 +1227,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1179,7 +1237,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1197,7 +1255,7 @@ "_": "Local", "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1207,7 +1265,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1254,7 +1312,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1264,7 +1322,7 @@ "_": "Local", "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1282,7 +1340,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1292,7 +1350,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1339,7 +1397,7 @@ "_": "Local", "name": "$temp11", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1349,7 +1407,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1388,9 +1446,80 @@ "right": { "_": "Local", "name": "$temp11", + "type": { + "_": "StringType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "CommonSecurity" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "CommonSecurity" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] } }, { diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json index 2e82605a8..d37d8057b 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatch.ts.json @@ -10,56 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -111,6 +62,18 @@ "type": { "_": "UnknownType" } + }, + { + "name": "error", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -160,15 +123,100 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, { "id": 1, "successors": [], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json index 082dacc1f..4bc336957 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchFinally.ts.json @@ -10,56 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -106,6 +57,18 @@ } } }, + { + "name": "error", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, { "name": "console", "type": { @@ -160,15 +123,145 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, { "id": 1, - "successors": [], - "predecessors": [ - 0 + "successors": [ + 2 + ], + "predecessors": [], + "stmts": [] + }, + { + "id": 2, + "successors": [ + 3 ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "result", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "result", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": " Finally block executed.", + "type": { + "_": "StringType" + } + } + } + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json index c30fa1ed7..74d6d199d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchMultiple.ts.json @@ -10,88 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result1", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result2", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message1", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message2", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -164,6 +83,24 @@ "type": { "_": "UnknownType" } + }, + { + "name": "error", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp3", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -230,6 +167,93 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message1", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred in try block 1!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message1", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, @@ -238,17 +262,101 @@ "successors": [ 2 ], - "predecessors": [ - 0 - ], - "stmts": [] + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message2", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred in try block 2!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message2", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + } + ] }, { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json index 679eeb5d1..3b64bfb99 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryCatchNested.ts.json @@ -10,72 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "outerResult", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "innerResult", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "innerMessage", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -133,6 +68,30 @@ "type": { "_": "UnknownType" } + }, + { + "name": "innerError", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, + { + "name": "outerError", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } } ], "cfg": { @@ -199,15 +158,100 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "innerMessage", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred in inner try block!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "innerMessage", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, { "id": 1, "successors": [], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json index 17b2cec3f..1573fe4fe 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/catch/TryFinally.ts.json @@ -10,56 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "result", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "message", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -160,15 +111,134 @@ "_": "StringType" } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "An error occurred!", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + }, + "method": { + "enclosingClass": { + "name": "Error" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "message", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ThrowStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Error" + } + } + } } ] }, { "id": 1, - "successors": [], - "predecessors": [ - 0 + "successors": [ + 2 + ], + "predecessors": [], + "stmts": [] + }, + { + "id": 2, + "successors": [ + 3 ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "result", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "Finally block executed.", + "type": { + "_": "StringType" + } + } + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [], "stmts": [ { "_": "CallStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json index c74eb153d..18334a4ac 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AbstractClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "rectangle", - "type": { - "_": "ClassType", - "signature": { - "name": "Rectangle" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Rectangle" - } + "_": "UnknownType" } }, "args": [ @@ -228,7 +189,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { @@ -245,12 +206,12 @@ }, "method": { "enclosingClass": { - "name": "Rectangle" + "name": "" }, "name": "getArea", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -282,7 +243,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -316,28 +277,66 @@ "enclosingClass": { "name": "Shape" }, - "name": "getArea", + "name": "@instance_init", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, - "modifiers": [ - "AbstractKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Shape" - } + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Shape" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] } - } - ], + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Shape" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], "cfg": { "blocks": [ { @@ -350,12 +349,76 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { "name": "Shape" } } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Shape" + }, + "name": "getArea", + "parameters": [], + "returnType": { + "_": "NumberType" + } + }, + "modifiers": [ + "AbstractKeyword" + ], + "typeParameters": [], + "body": null + }, + { + "signature": { + "enclosingClass": { + "name": "Shape" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } }, "right": { "_": "ThisRef", @@ -367,6 +430,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Shape" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -400,8 +487,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -416,11 +502,110 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Rectangle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Rectangle" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Rectangle" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Rectangle" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -480,6 +665,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Rectangle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json index 2eae18fd8..cd3631785 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/AccessModifiers.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "user", - "type": { - "_": "ClassType", - "signature": { - "name": "User" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "User" - } + "_": "UnknownType" } }, "args": [ @@ -235,7 +196,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { @@ -252,11 +213,11 @@ }, "field": { "enclosingClass": { - "name": "User" + "name": "" }, "name": "name", "type": { - "_": "StringType" + "_": "UnknownType" } } } @@ -287,7 +248,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } } ] @@ -328,8 +289,7 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -346,8 +306,7 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -364,11 +323,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "User" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "User" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "User" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "User" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -441,6 +499,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "User" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json index 4f976cd95..6a086583d 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/ConstructorClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "constructorObj", - "type": { - "_": "ClassType", - "signature": { - "name": "ConstructorClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "ConstructorClass" - } + "_": "UnknownType" } }, "args": [ @@ -221,7 +182,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { @@ -238,12 +199,12 @@ }, "method": { "enclosingClass": { - "name": "ConstructorClass" + "name": "" }, "name": "getName", "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "args": [] @@ -275,7 +236,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } } ] @@ -317,11 +278,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ConstructorClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ConstructorClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ConstructorClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ConstructorClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -368,6 +428,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ConstructorClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/PrependInitializer.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/FieldInitializers.ts.json similarity index 69% rename from jacodb-ets/src/test/resources/etsir/samples/PrependInitializer.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/classes/FieldInitializers.ts.json index ecc1dbb7b..013407036 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/PrependInitializer.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/FieldInitializers.ts.json @@ -1,5 +1,5 @@ { - "name": "PrependInitializer.ts", + "name": "classes/FieldInitializers.ts", "namespaces": [], "classes": [ { @@ -99,14 +99,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "99", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { @@ -123,17 +116,174 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "109", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "field": { + "enclosingClass": { + "name": "Foo" + }, + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "99", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + }, + "field": { + "enclosingClass": { + "name": "Foo" + }, + "name": "y", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "111", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -194,6 +344,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "CallStmt", "expr": { @@ -218,7 +392,7 @@ "args": [ { "_": "Constant", - "value": "new Foo", + "value": "inside Foo::constructor", "type": { "_": "StringType" } @@ -324,7 +498,7 @@ }, "right": { "_": "Constant", - "value": "112", + "value": "222", "type": { "_": "NumberType" } @@ -354,7 +528,7 @@ "args": [ { "_": "Constant", - "value": "print-foo", + "value": "inside Foo::foo", "type": { "_": "StringType" } @@ -459,7 +633,7 @@ }, "right": { "_": "Constant", - "value": "111", + "value": "333", "type": { "_": "NumberType" } @@ -489,7 +663,7 @@ "args": [ { "_": "Constant", - "value": "print-bar", + "value": "inside Foo::bar", "type": { "_": "StringType" } diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json index c8465bd41..dba309813 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/GenericClass.ts.json @@ -10,62 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "stringObj", - "type": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "numberObj", - "type": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -218,10 +163,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } + "_": "UnknownType" } }, "args": [ @@ -281,13 +223,12 @@ }, "method": { "enclosingClass": { - "name": "GenericClass" + "name": "" }, "name": "getData", "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "T" + "_": "UnknownType" } }, "args": [] @@ -368,10 +309,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "GenericClass" - } + "_": "UnknownType" } }, "args": [ @@ -431,13 +369,12 @@ }, "method": { "enclosingClass": { - "name": "GenericClass" + "name": "" }, "name": "getData", "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "T" + "_": "UnknownType" } }, "args": [] @@ -517,11 +454,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "GenericClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "GenericClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "GenericClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "GenericClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -570,6 +606,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "GenericClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json index 92e46df40..f97f61133 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InheritanceClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "childObj", - "type": { - "_": "ClassType", - "signature": { - "name": "ChildClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -105,7 +69,7 @@ { "name": "$temp2", "type": { - "_": "NumberType" + "_": "UnknownType" } } ], @@ -181,10 +145,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "ChildClass" - } + "_": "UnknownType" } }, "args": [ @@ -300,7 +261,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { @@ -317,12 +278,12 @@ }, "method": { "enclosingClass": { - "name": "ChildClass" + "name": "" }, "name": "getAge", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -354,7 +315,7 @@ "_": "Local", "name": "$temp2", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -395,11 +356,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ParentClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ParentClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ParentClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ParentClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -446,6 +506,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ParentClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { @@ -661,11 +745,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ChildClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ChildClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ChildClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ChildClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -725,6 +908,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ChildClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json index 6b4081054..3cd0fc1d2 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/InterfaceImplementation.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "circle", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Circle" - } + "_": "UnknownType" } }, "args": [ @@ -221,7 +182,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { @@ -238,12 +199,12 @@ }, "method": { "enclosingClass": { - "name": "Circle" + "name": "" }, "name": "getArea", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -282,7 +243,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -322,18 +283,56 @@ }, "modifiers": [], "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "Circle" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [ + "Shape" + ], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "Circle" + }, + "name": "radius", + "type": { + "_": "NumberType" + } + }, + "modifiers": [ + "PrivateKeyword", + "ReadonlyKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Circle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Shape" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -347,10 +346,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Shape" - } + "_": "UnknownType" } }, "right": { @@ -358,7 +354,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Shape" + "name": "Circle" } } } @@ -371,41 +367,57 @@ ] } } - } - ] - }, - { - "signature": { - "name": "Circle" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [ - "Shape" - ], - "fields": [ + }, { "signature": { "enclosingClass": { "name": "Circle" }, - "name": "radius", - "type": { - "_": "NumberType" + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" } }, - "modifiers": [ - "PrivateKeyword", - "ReadonlyKeyword" - ], + "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [ + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Circle" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -452,6 +464,30 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Circle" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/NestedInitializer.ts.json similarity index 54% rename from jacodb-ets/src/test/resources/etsir/samples/object.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/classes/NestedInitializer.ts.json index e1d1812a5..cc1a10325 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/object.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/NestedInitializer.ts.json @@ -1,5 +1,5 @@ { - "name": "object.ts", + "name": "classes/NestedInitializer.ts", "namespaces": [], "classes": [ { @@ -10,24 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "main", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -54,132 +37,22 @@ } }, { - "name": "main", - "type": { - "_": "UnknownType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "main", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "main", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "b", - "type": { - "_": "NumberType" - } - }, - { - "name": "c", + "name": "foo", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-0" + "name": "Foo" } } }, { - "name": "obj", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Foo" } } - }, - { - "name": "console", - "type": { - "_": "UnknownType" - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - { - "name": "$temp1", - "type": { - "_": "UnknownType" - } } ], "cfg": { @@ -215,65 +88,20 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "b", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "2", - "type": { - "_": "NumberType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-0" - } - } - }, - "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-main-0" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-0" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "obj", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Foo" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-main-1" - }, - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Foo" } } } @@ -284,54 +112,19 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "method": { - "enclosingClass": { - "name": "" - }, - "name": "log", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "obj", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } - } - } - ] - } - }, - { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", - "instance": { - "_": "Local", - "name": "obj", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Foo" } } }, "method": { "enclosingClass": { - "name": "" + "name": "Foo" }, - "name": "method", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" @@ -344,126 +137,183 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "foo", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "Foo" + } } }, "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "obj", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "accessor", - "type": { - "_": "UnknownType" + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" } } } }, { - "_": "CallStmt", - "expr": { - "_": "InstanceCallExpr", - "instance": { - "_": "Local", - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "method": { - "enclosingClass": { - "name": "" - }, - "name": "log", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Bar" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" } - ] + } } }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "obj", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "accessor", - "type": { - "_": "UnknownType" - } + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" } }, "right": { - "_": "Constant", - "value": "new value", + "_": "ThisRef", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "Bar" + } } } }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Bar" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp1", + "name": "this", "type": { "_": "UnknownType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "obj", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "accessor", - "type": { - "_": "UnknownType" + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" } } } @@ -474,30 +324,22 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "console", + "name": "this", "type": { "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "" + "name": "Bar" }, - "name": "log", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Local", - "name": "$temp1", - "type": { - "_": "UnknownType" - } - } - ] + "args": [] } }, { @@ -513,63 +355,7 @@ }, { "signature": { - "name": "AnonymousClass-main-0" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-main-0" - }, - "name": "c1", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "3", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-main-0" - }, - "name": "c2", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "4", - "type": { - "_": "NumberType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-main-1" + "name": "Foo" }, "modifiers": [], "typeParameters": [], @@ -579,93 +365,27 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" - }, - "name": "a", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-main-1" - }, - "name": "b", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-main-1" - }, - "name": "", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "c", - "type": { - "_": "UnknownType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "Foo" }, - "name": "_value", + "name": "bar", "type": { - "_": "UnknownType" + "_": "UnclearReferenceType", + "name": "Bar" } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "Foo" }, - "name": "method", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" @@ -676,19 +396,13 @@ "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Bar" } } - }, - { - "name": "console", - "type": { - "_": "UnknownType" - } } ], "cfg": { @@ -703,19 +417,38 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Bar" } } }, "right": { - "_": "ThisRef", - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Bar" } } } @@ -726,30 +459,61 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "console", + "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "Bar" + } } }, "method": { "enclosingClass": { - "name": "" + "name": "Bar" }, - "name": "log", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Constant", - "value": "method", - "type": { - "_": "StringType" + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Foo" } } - ] + }, + "field": { + "enclosingClass": { + "name": "Foo" + }, + "name": "bar", + "type": { + "_": "UnclearReferenceType", + "name": "Bar" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Bar" + } + } } }, { @@ -764,9 +528,9 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "Foo" }, - "name": "Get-accessor", + "name": "@static_init", "parameters": [], "returnType": { "_": "UnknownType" @@ -775,17 +539,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -799,10 +553,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } + "_": "UnknownType" } }, "right": { @@ -810,20 +561,13 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-main-1" + "name": "Foo" } } } }, { - "_": "ReturnStmt", - "arg": { - "_": "Constant", - "value": "getter", - "type": { - "_": "StringType" - } - } + "_": "ReturnVoidStmt" } ] } @@ -834,18 +578,10 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-main-1" + "name": "Foo" }, - "name": "Set-accessor", - "parameters": [ - { - "name": "value", - "type": { - "_": "UnknownType" - }, - "isOptional": false - } - ], + "name": "constructor", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -853,23 +589,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" - } - } - }, - { - "name": "value", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -881,39 +601,43 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "value", + "name": "this", "type": { "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "Foo" + } } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-main-1" + }, + "method": { + "enclosingClass": { + "name": "Foo" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" } - } + }, + "args": [] } }, { diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json index 9cf15f262..8d07d55ec 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SimpleClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "simpleObj", - "type": { - "_": "ClassType", - "signature": { - "name": "SimpleClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,7 +57,7 @@ { "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, { @@ -175,10 +139,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "SimpleClass" - } + "_": "UnknownType" } }, "args": [] @@ -223,20 +184,12 @@ }, "method": { "enclosingClass": { - "name": "SimpleClass" + "name": "" }, "name": "setName", - "parameters": [ - { - "name": "name", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "args": [ @@ -256,7 +209,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { @@ -273,12 +226,12 @@ }, "method": { "enclosingClass": { - "name": "SimpleClass" + "name": "" }, "name": "getName", "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "args": [] @@ -310,7 +263,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "StringType" + "_": "UnknownType" } } ] @@ -351,11 +304,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SimpleClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SimpleClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -589,6 +641,80 @@ ] } } + }, + { + "signature": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SimpleClass" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "SimpleClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } } ] } diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json index b7257e240..7c3df21bd 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/SingletonClass.ts.json @@ -10,46 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "logger", - "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Logger", - "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -78,19 +39,13 @@ { "name": "logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, { "name": "Logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } } ], @@ -129,25 +84,26 @@ "_": "Local", "name": "logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, "right": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "Logger", + "type": { + "_": "UnknownType" + } + }, "method": { "enclosingClass": { - "name": "Logger" + "name": "" }, "name": "getInstance", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, "args": [] @@ -161,28 +117,17 @@ "_": "Local", "name": "logger", "type": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "Logger" + "name": "" }, "name": "log", - "parameters": [ - { - "name": "message", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "args": [ @@ -233,11 +178,110 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Logger" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Logger" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Logger" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Logger" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { @@ -294,6 +338,30 @@ } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Logger" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -445,10 +513,8 @@ "name": "getInstance", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "Logger" - } + "_": "UnclearReferenceType", + "name": "Logger" } }, "modifiers": [ @@ -587,7 +653,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp1", @@ -603,7 +669,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -612,10 +678,7 @@ { "id": 1, "successors": [], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -663,9 +726,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json index d0e912a92..913786f0f 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/classes/StaticClass.ts.json @@ -10,43 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "StaticClass", - "type": { - "_": "ClassType", - "signature": { - "name": "StaticClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -75,16 +39,13 @@ { "name": "StaticClass", "type": { - "_": "ClassType", - "signature": { - "name": "StaticClass" - } + "_": "UnknownType" } }, { "name": "$temp0", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { @@ -126,15 +87,22 @@ { "_": "CallStmt", "expr": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "StaticClass", + "type": { + "_": "UnknownType" + } + }, "method": { "enclosingClass": { - "name": "StaticClass" + "name": "" }, "name": "incrementCount", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "args": [] @@ -146,19 +114,26 @@ "_": "Local", "name": "$temp0", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "StaticClass", + "type": { + "_": "UnknownType" + } + }, "method": { "enclosingClass": { - "name": "StaticClass" + "name": "" }, "name": "getCount", "parameters": [], "returnType": { - "_": "NumberType" + "_": "UnknownType" } }, "args": [] @@ -190,7 +165,7 @@ "_": "Local", "name": "$temp0", "type": { - "_": "NumberType" + "_": "UnknownType" } } ] @@ -231,17 +206,216 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], "methods": [ + { + "signature": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + }, + "field": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "count", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "StaticClass" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "StaticClass" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, { "signature": { "enclosingClass": { diff --git a/jacodb-ets/src/test/resources/etsir/samples/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/enums.ts.json deleted file mode 100644 index b40cb20b9..000000000 --- a/jacodb-ets/src/test/resources/etsir/samples/enums.ts.json +++ /dev/null @@ -1,2026 +0,0 @@ -{ - "name": "enums.ts", - "namespaces": [], - "classes": [ - { - "signature": { - "name": "_DEFAULT_ARK_CLASS" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "a2", - "type": { - "_": "AnyType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Response1", - "type": { - "_": "ClassType", - "signature": { - "name": "Response1" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "respond", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "E", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "f", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Enum", - "type": { - "_": "ClassType", - "signature": { - "name": "Enum" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "Directions", - "type": { - "_": "ClassType", - "signature": { - "name": "Directions" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "_DEFAULT_ARK_METHOD", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "$temp0", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - }, - { - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - { - "name": "a2", - "type": { - "_": "AnyType" - } - }, - { - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - { - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - { - "name": "$temp1", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp2", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp3", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp4", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - { - "name": "Response1", - "type": { - "_": "ClassType", - "signature": { - "name": "Response1" - } - } - }, - { - "name": "respond", - "type": { - "_": "UnknownType" - } - }, - { - "name": "", - "type": { - "_": "UnknownType" - } - }, - { - "name": "E", - "type": { - "_": "UnknownType" - } - }, - { - "name": "f", - "type": { - "_": "UnknownType" - } - }, - { - "name": "Enum", - "type": { - "_": "ClassType", - "signature": { - "name": "Enum" - } - } - }, - { - "name": "Directions", - "type": { - "_": "ClassType", - "signature": { - "name": "Directions" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "a2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp3", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp4", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Response1" - }, - "name": "Yes", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "respond", - "parameters": [ - { - "name": "recipient", - "type": { - "_": "StringType" - }, - "isOptional": false - }, - { - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - }, - "isOptional": false - } - ], - "returnType": { - "_": "VoidType" - } - }, - "args": [ - { - "_": "Constant", - "value": "Princess Caroline", - "type": { - "_": "StringType" - } - }, - { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - } - ] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "c", - "type": { - "_": "ClassType", - "signature": { - "name": "Circle" - } - } - }, - "right": { - "_": "Local", - "name": "", - "type": { - "_": "UnknownType" - } - } - }, - { - "_": "CallStmt", - "expr": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "f", - "parameters": [ - { - "name": "obj", - "type": { - "_": "AnyType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "args": [ - { - "_": "Local", - "name": "E", - "type": { - "_": "UnknownType" - } - } - ] - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "a2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Enum" - }, - "name": "A", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "nameOfA", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "Enum", - "type": { - "_": "ClassType", - "signature": { - "name": "Enum" - } - } - }, - "field": { - "enclosingClass": { - "name": "Enum" - }, - "name": "a2", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp2", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp3", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp4", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "StaticFieldRef", - "field": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "NewArrayExpr", - "elementType": { - "_": "AnyType" - }, - "size": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "directions", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - }, - "right": { - "_": "Local", - "name": "$temp5", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnknownType" - }, - "dimensions": 1 - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "respond", - "parameters": [ - { - "name": "recipient", - "type": { - "_": "StringType" - }, - "isOptional": false - }, - { - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - }, - "isOptional": false - } - ], - "returnType": { - "_": "VoidType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "recipient", - "type": { - "_": "StringType" - } - }, - { - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "recipient", - "type": { - "_": "StringType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "StringType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "message", - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - } - }, - "right": { - "_": "ParameterRef", - "index": 1, - "type": { - "_": "UnclearReferenceType", - "name": "Response1" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "ReturnVoidStmt" - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "f", - "parameters": [ - { - "name": "obj", - "type": { - "_": "AnyType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - { - "name": "obj", - "type": { - "_": "AnyType" - } - }, - { - "name": "$temp0", - "type": { - "_": "AnyType" - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, - "successors": [], - "predecessors": [], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "obj", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "AnyType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - }, - "right": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "_DEFAULT_ARK_CLASS" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - }, - "right": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "obj", - "type": { - "_": "AnyType" - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "X", - "type": { - "_": "UnknownType" - } - } - } - }, - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "AnyType" - } - } - } - ] - } - ] - } - } - } - ] - }, - { - "signature": { - "name": "Direction1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction1" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Direction2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Direction2" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "BooleanLikeHeterogeneousEnum" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "BooleanLikeHeterogeneousEnum" - }, - "name": "No", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "BooleanLikeHeterogeneousEnum" - }, - "name": "Yes", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "E1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "E1" - }, - "name": "X", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E1" - }, - "name": "Y", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E1" - }, - "name": "Z", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "E2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "E2" - }, - "name": "A", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E2" - }, - "name": "B", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E2" - }, - "name": "C", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "FileAccess" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "None", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "Read", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "Write", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "ReadWrite", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "FileAccess" - }, - "name": "G", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Response1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Response1" - }, - "name": "No", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Response1" - }, - "name": "Yes", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "ShapeKind" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "ShapeKind" - }, - "name": "Circle", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "ShapeKind" - }, - "name": "Square", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Circle" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Circle" - }, - "name": "kind", - "type": { - "_": "UnclearReferenceType", - "name": "ShapeKind.Circle" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Circle" - }, - "name": "radius", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Square" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Square" - }, - "name": "kind", - "type": { - "_": "UnclearReferenceType", - "name": "ShapeKind.Square" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Square" - }, - "name": "sideLength", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "E" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "E" - }, - "name": "X", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E" - }, - "name": "Y", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "E" - }, - "name": "Z", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Enum" - }, - "modifiers": [ - "DeclareKeyword" - ], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Enum" - }, - "name": "A", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - }, - { - "signature": { - "name": "Directions" - }, - "modifiers": [ - "ConstKeyword" - ], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Up", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Down", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "Directions" - }, - "name": "Right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "StaticKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [] - } - ], - "importInfos": [], - "exportInfos": [] -} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json b/jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json new file mode 100644 index 000000000..3b55d41de --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/lang/in.ts.json @@ -0,0 +1,457 @@ +{ + "name": "lang/in.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "cat", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "catHasName", + "type": { + "_": "UnknownType" + } + }, + { + "name": "catHasMeow", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "Barsik", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "cat", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "catHasName", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "undefined", + "type": { + "_": "UndefinedType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "catHasMeow", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "undefined", + "type": { + "_": "UndefinedType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Cat" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [ + { + "name": "name", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "name", + "type": { + "_": "StringType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "name", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json b/jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json new file mode 100644 index 000000000..399955335 --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/lang/instanceof.ts.json @@ -0,0 +1,407 @@ +{ + "name": "lang/instanceof.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "InstanceOfExpr", + "arg": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + }, + "checkType": { + "_": "UnclearReferenceType", + "name": "Cat" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Cat" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Cat" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Cat" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Cat" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json b/jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json new file mode 100644 index 000000000..49c342744 --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/lang/object.ts.json @@ -0,0 +1,1414 @@ +{ + "name": "lang/object.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "main", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "" + }, + "name": "main", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "main", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "b", + "type": { + "_": "NumberType" + } + }, + { + "name": "c", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + { + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp3", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "b", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "c", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + ] + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "method", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "accessor", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "$temp2", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "accessor", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "new value", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "accessor", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "$temp3", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "c1", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "c2", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "c1", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "c2", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "4", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "b", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "_value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "_value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "method", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "method", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "Get-accessor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "ReturnStmt", + "arg": { + "_": "Constant", + "value": "getter", + "type": { + "_": "StringType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "Set-accessor", + "parameters": [ + { + "name": "value", + "type": { + "_": "UnknownType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + { + "name": "value", + "type": { + "_": "UnknownType" + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "setter", + "type": { + "_": "StringType" + } + }, + { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-main-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json index 9b964cf5c..524121725 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/BreadthFirstSearch.ts.json @@ -10,75 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "graph", - "type": { - "_": "ClassType", - "signature": { - "name": "Graph" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "visitOrder", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "bfs", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -106,10 +38,17 @@ }, { "name": "graph", + "type": { + "_": "UnclearReferenceType", + "name": "Graph" + } + }, + { + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Graph" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, @@ -165,23 +104,68 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "graph", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "Graph" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "graph", + "type": { + "_": "UnclearReferenceType", + "name": "Graph" + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } @@ -199,29 +183,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "bfs", - "parameters": [ - { - "name": "graph", - "type": { - "_": "UnclearReferenceType", - "name": "Graph" - }, - "isOptional": false - }, - { - "name": "startNode", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -229,10 +196,8 @@ "_": "Local", "name": "graph", "type": { - "_": "ClassType", - "signature": { - "name": "Graph" - } + "_": "UnclearReferenceType", + "name": "Graph" } }, { @@ -317,8 +282,11 @@ } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 } }, "modifiers": [], @@ -418,31 +386,49 @@ } }, { - "name": "neighbour", + "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, { - "name": "$temp5", + "name": "$temp6", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, { - "name": "$temp6", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "BooleanType" } }, { - "name": "$temp7", + "name": "$temp8", "type": { "_": "UnknownType" } }, { - "name": "$temp8", + "name": "neighbour", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp10", "type": { "_": "UnknownType" } @@ -658,14 +644,18 @@ { "id": 1, "successors": [ - 2, - 3 + 2 ], - "predecessors": [ - 0, + "predecessors": [], + "stmts": [] + }, + { + "id": 2, + "successors": [ 3, - 5 + 4 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -704,7 +694,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "<=", + "op": ">", "left": { "_": "Local", "name": "$temp2", @@ -720,18 +710,16 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -750,14 +738,12 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 1, - 4 - ], - "predecessors": [ - 1 + 2, + 5 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -862,7 +848,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp4", @@ -878,20 +864,18 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 4, + "id": 5, "successors": [ - 5 - ], - "predecessors": [ - 3 + 6 ], + "predecessors": [], "stmts": [ { "_": "CallStmt", @@ -958,126 +942,189 @@ } } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "neighbours", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] + } } ] }, { - "id": 5, + "id": 6, "successors": [ - 1, - 6 - ], - "predecessors": [ - 4, - 6, + 2, 7 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "neighbour", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "LengthExpr", - "arg": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "neighbours", + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", "type": { "_": "UnknownType" } } } }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp6", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "==", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp7", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "Local", - "name": "$temp5", + "_": "Constant", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 7, + "successors": [ + 6, + 8 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "neighbour", + "name": "$temp8", "type": { "_": "UnknownType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "neighbours", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "index": { - "_": "Local", - "name": "$temp6", + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", "type": { - "_": "NumberType" + "_": "UnknownType" } - }, - "type": { - "_": "UnknownType" } } }, @@ -1085,47 +1132,30 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "neighbour", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "BinopExpr", - "op": "+", - "left": { + "_": "CastExpr", + "arg": { "_": "Local", - "name": "$temp6", + "name": "$temp8", "type": { - "_": "NumberType" + "_": "UnknownType" } }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "type": { + "_": "UnknownType" } } - } - ] - }, - { - "id": 6, - "successors": [ - 5, - 7 - ], - "predecessors": [ - 5 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { "_": "UnknownType" } @@ -1168,7 +1198,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp10", "type": { "_": "UnknownType" } @@ -1178,7 +1208,7 @@ "op": "!", "arg": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { "_": "UnknownType" } @@ -1189,10 +1219,10 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp10", "type": { "_": "UnknownType" } @@ -1205,20 +1235,18 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 7, + "id": 8, "successors": [ - 5 - ], - "predecessors": [ 6 ], + "predecessors": [], "stmts": [ { "_": "CallStmt", @@ -1280,22 +1308,24 @@ }, "name": "IndexSignature-Graph-0", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [] }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "modifiers": [], "typeParameters": [], @@ -1305,7 +1335,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "a", "type": { @@ -1315,42 +1345,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'b'", - "type": { - "_": "StringType" - } - }, - { - "_": "Constant", - "value": "'c'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - }, - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "b", "type": { @@ -1360,32 +1360,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'d'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "c", "type": { @@ -1395,32 +1375,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'e'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "d", "type": { @@ -1430,32 +1390,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'f'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "StringType" - } - ] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "e", "type": { @@ -1465,20 +1405,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [], - "type": { - "_": "UnionType", - "types": [] - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "f", "type": { @@ -1488,18 +1420,744 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [], - "type": { - "_": "UnionType", - "types": [] - } - } + "exclamationToken": false } ], - "methods": [] + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp4", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + }, + { + "name": "$temp5", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "b", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "c", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "d", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "b", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "e", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "c", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "f", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "d", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "AnyType" + }, + "size": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "e", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "AnyType" + }, + "size": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "f", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "ArrayType", + "elementType": { + "_": "AnyType" + }, + "dimensions": 1 + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json index a00ff49d2..d0f9de350 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DepthFirstSearch.ts.json @@ -10,75 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "tree", - "type": { - "_": "ClassType", - "signature": { - "name": "TreeNode" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "traversalResult", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "iterativeDFS", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -106,10 +38,17 @@ }, { "name": "tree", + "type": { + "_": "UnclearReferenceType", + "name": "TreeNode" + } + }, + { + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "TreeNode" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, @@ -165,23 +104,68 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "tree", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "TreeNode" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "tree", + "type": { + "_": "UnclearReferenceType", + "name": "TreeNode" + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } @@ -199,30 +183,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "iterativeDFS", - "parameters": [ - { - "name": "root", - "type": { - "_": "UnionType", - "types": [ - { - "_": "UnclearReferenceType", - "name": "TreeNode" - }, - { - "_": "UndefinedType" - } - ] - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -230,10 +196,8 @@ "_": "Local", "name": "tree", "type": { - "_": "ClassType", - "signature": { - "name": "TreeNode" - } + "_": "UnclearReferenceType", + "name": "TreeNode" } } ] @@ -312,8 +276,11 @@ } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "modifiers": [], @@ -572,7 +539,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp0", @@ -597,7 +564,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -608,10 +575,7 @@ "successors": [ 2 ], - "predecessors": [ - 0, - 9 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -814,12 +778,7 @@ 3, 4 ], - "predecessors": [ - 1, - 4, - 6, - 7 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -859,7 +818,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp4", @@ -875,7 +834,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -884,9 +843,7 @@ { "id": 3, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -910,9 +867,7 @@ 2, 5 ], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -954,7 +909,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "node", @@ -970,7 +925,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -982,9 +937,7 @@ 6, 8 ], - "predecessors": [ - 4 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1084,7 +1037,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp6", @@ -1100,7 +1053,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1112,10 +1065,7 @@ 2, 7 ], - "predecessors": [ - 5, - 8 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1150,7 +1100,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp8", @@ -1166,7 +1116,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1177,9 +1127,7 @@ "successors": [ 2 ], - "predecessors": [ - 6 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1254,9 +1202,7 @@ "successors": [ 6 ], - "predecessors": [ - 5 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1331,9 +1277,7 @@ "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1406,8 +1350,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -1423,8 +1366,7 @@ "modifiers": [], "typeParameters": [], "questionToken": true, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { @@ -1440,15 +1382,14 @@ "modifiers": [], "typeParameters": [], "questionToken": true, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [] }, { "signature": { - "name": "AnonymousClass-2" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, "modifiers": [], "typeParameters": [], @@ -1458,7 +1399,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-2" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, "name": "value", "type": { @@ -1468,143 +1409,171 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "4", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-3" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-3" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, - "name": "value", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "5", - "type": { - "_": "NumberType" + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "4", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-1" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-1" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" }, - "name": "value", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "2", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-1" - }, - "name": "left", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-2" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-2" - } - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-1" - }, - "name": "right", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-3" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-3" - } + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-5" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" }, "modifiers": [], "typeParameters": [], @@ -1614,7 +1583,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-5" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" }, "name": "value", "type": { @@ -1624,55 +1593,171 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "6", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-6" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-6" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" }, - "name": "value", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "7", - "type": { - "_": "NumberType" + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "5", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "modifiers": [], "typeParameters": [], @@ -1682,7 +1767,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "name": "value", "type": { @@ -1692,19 +1777,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "3", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "name": "left", "type": { @@ -1714,24 +1792,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-5" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-5" - } - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, "name": "right", "type": { @@ -1741,110 +1807,1524 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-6" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-6" - } - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, - "name": "value", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "name": "left", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-1" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-1" + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-2" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1-@instance_init-3" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" }, - "name": "right", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-4" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-4" - } - } - } - } - ], - "methods": [] + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "6", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "7", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4-@instance_init-6" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + { + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "left", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-1" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "right", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0-@instance_init-4" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json index 012de868f..3c62c8ca9 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DijkstrasAlgorithm.ts.json @@ -10,90 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "graph", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnionType", - "types": [ - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - ] - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "dijkstra", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -985,7 +902,37 @@ "right": { "_": "NewArrayExpr", "elementType": { - "_": "AnyType" + "_": "UnionType", + "types": [ + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + ] }, "size": { "_": "Constant", @@ -1486,29 +1433,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "dijkstra", - "parameters": [ - { - "name": "graph", - "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - }, - "isOptional": false - }, - { - "name": "startVertex", - "type": { - "_": "NumberType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -1621,8 +1551,15 @@ { "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 }, "isOptional": false }, @@ -1635,8 +1572,11 @@ } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "modifiers": [], @@ -1655,8 +1595,15 @@ { "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, { @@ -1774,13 +1721,13 @@ { "name": "$temp8", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { "name": "$temp9", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { @@ -1804,25 +1751,29 @@ { "name": "$temp13", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp14", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp15", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { "name": "$temp16", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { @@ -1834,19 +1785,23 @@ { "name": "$temp18", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp19", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp20", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { @@ -1858,13 +1813,13 @@ { "name": "$temp22", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { "name": "$temp23", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, { @@ -1876,19 +1831,23 @@ { "name": "$temp25", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp26", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp27", "type": { - "_": "UnknownType" + "_": "NumberType" } } ], @@ -1907,16 +1866,30 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "right": { "_": "ParameterRef", "index": 0, "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } } }, @@ -1983,8 +1956,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2104,8 +2084,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2172,13 +2159,9 @@ { "id": 1, "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 6 + 2 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2196,7 +2179,17 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { @@ -2212,8 +2205,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2259,7 +2259,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -2275,55 +2275,25 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [], + "stmts": [ { - "_": "AssignStmt", - "left": { + "_": "ReturnStmt", + "arg": { "_": "Local", - "name": "i", + "name": "distances", "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - } - } - ] - }, - { - "id": 2, - "successors": [], - "predecessors": [ - 1 - ], - "stmts": [ - { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "distances", - "type": { - "_": "ArrayType", - "elementType": { + "_": "ArrayType", + "elementType": { "_": "NumberType" }, "dimensions": 1 @@ -2333,13 +2303,11 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 4 - ], - "predecessors": [ - 1 + 5 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2378,21 +2346,7 @@ } } } - } - ] - }, - { - "id": 4, - "successors": [ - 5, - 9 - ], - "predecessors": [ - 3, - 9, - 10 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -2409,7 +2363,17 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 5, + "successors": [ + 6, + 11 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { @@ -2425,8 +2389,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2444,7 +2415,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "v", @@ -2460,48 +2431,18 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 5, + "id": 6, "successors": [ - 6 - ], - "predecessors": [ - 4 + 7 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2536,21 +2477,7 @@ "_": "BooleanType" } } - } - ] - }, - { - "id": 6, - "successors": [ - 1, - 7 - ], - "predecessors": [ - 5, - 7, - 8 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -2567,7 +2494,17 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 7, + "successors": [ + 2, + 8 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { @@ -2583,8 +2520,15 @@ "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -2602,7 +2546,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "v", @@ -2618,49 +2562,19 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "v", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 7, + "id": 8, "successors": [ - 6, - 8 - ], - "predecessors": [ - 6 + 9, + 10 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2723,27 +2637,43 @@ "_": "Local", "name": "$temp13", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "minIndex", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2753,26 +2683,31 @@ "_": "Local", "name": "$temp14", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "$temp13", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "v", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2782,17 +2717,17 @@ "_": "Local", "name": "$temp15", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "!==", "left": { "_": "Local", "name": "$temp14", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -2801,6 +2736,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -2810,7 +2748,7 @@ "_": "Local", "name": "$temp16", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -2827,7 +2765,7 @@ "_": "Local", "name": "$temp15", "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -2872,27 +2810,43 @@ "_": "Local", "name": "$temp18", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "minIndex", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2902,26 +2856,31 @@ "_": "Local", "name": "$temp19", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "$temp18", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "v", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2931,7 +2890,7 @@ "_": "Local", "name": "$temp20", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -2948,7 +2907,7 @@ "_": "Local", "name": "$temp19", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -2993,17 +2952,17 @@ "_": "Local", "name": "$temp22", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "<", "left": { "_": "Local", "name": "$temp20", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -3012,6 +2971,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -3021,7 +2983,7 @@ "_": "Local", "name": "$temp23", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3031,14 +2993,14 @@ "_": "Local", "name": "$temp16", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { "_": "Local", "name": "$temp22", "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -3047,12 +3009,12 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp23", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3063,20 +3025,83 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 8, + "id": 9, "successors": [ - 6 - ], - "predecessors": [ 7 ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + } + ] + }, + { + "id": 10, + "successors": [ + 9 + ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3118,27 +3143,43 @@ "_": "Local", "name": "$temp25", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "graph", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "minIndex", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -3148,26 +3189,31 @@ "_": "Local", "name": "$temp26", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "$temp25", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "v", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -3177,7 +3223,7 @@ "_": "Local", "name": "$temp27", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -3194,7 +3240,7 @@ "_": "Local", "name": "$temp26", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -3229,21 +3275,19 @@ "_": "Local", "name": "$temp27", "type": { - "_": "UnknownType" + "_": "NumberType" } } } ] }, { - "id": 9, + "id": 11, "successors": [ - 4, - 10 - ], - "predecessors": [ - 4 + 12, + 13 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3340,11 +3384,11 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { - "_": "BinopExpr", + "_": "ConditionExpr", "op": "<=", "left": { "_": "Local", @@ -3359,6 +3403,9 @@ "type": { "_": "NumberType" } + }, + "type": { + "_": "BooleanType" } } }, @@ -3368,7 +3415,7 @@ "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3385,7 +3432,7 @@ "_": "Local", "name": "$temp8", "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -3394,12 +3441,12 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "==", + "op": "!=", "left": { "_": "Local", "name": "$temp9", "type": { - "_": "UnknownType" + "_": "BooleanType" } }, "right": { @@ -3410,20 +3457,55 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 10, + "id": 12, "successors": [ - 4 + 5 ], - "predecessors": [ - 9 + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "v", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + } + ] + }, + { + "id": 13, + "successors": [ + 12 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json index ff4df00a8..01a4f8c27 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/DoWhileLoop.ts.json @@ -10,40 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "count", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -147,12 +114,10 @@ { "id": 1, "successors": [ + 1, 2 ], - "predecessors": [ - 0, - 2 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -269,24 +234,12 @@ } } } - } - ] - }, - { - "id": 2, - "successors": [ - 1, - 3 - ], - "predecessors": [ - 1 - ], - "stmts": [ + }, { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "count", @@ -309,11 +262,9 @@ ] }, { - "id": 3, + "id": 2, "successors": [], - "predecessors": [ - 2 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json index 7bbbd89d5..e33ef2eb0 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/ForInLoop.ts.json @@ -10,59 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "person", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "key", - "type": { - "_": "UndefinedType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -93,48 +41,75 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, { - "name": "key", + "name": "$temp0", "type": { - "_": "UndefinedType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, { - "name": "$temp0", + "name": "$temp1", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, { - "name": "$temp1", + "name": "$temp2", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, { - "name": "$temp2", + "name": "$temp3", + "type": { + "_": "BooleanType" + } + }, + { + "name": "$temp4", + "type": { + "_": "UnknownType" + } + }, + { + "name": "key", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp5", "type": { "_": "StringType" } }, { - "name": "$temp3", + "name": "$temp6", "type": { "_": "StringType" } }, { - "name": "$temp4", + "name": "$temp7", "type": { "_": "StringType" } }, { - "name": "$temp5", + "name": "$temp8", "type": { "_": "StringType" } @@ -181,54 +156,71 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "person", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "key", + "name": "person", "type": { - "_": "UndefinedType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, "right": { - "_": "Constant", - "value": "undefined", + "_": "Local", + "name": "$temp0", "type": { - "_": "UndefinedType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } } }, @@ -236,124 +228,145 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, "right": { - "_": "LengthExpr", - "arg": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "person", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } - } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp2", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": ">=", - "left": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "$temp1", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, - "right": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "NumberType" + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "type": { - "_": "BooleanType" - } + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "key", + "name": "$temp3", "type": { - "_": "UndefinedType" + "_": "BooleanType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "person", + "name": "$temp2", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "IteratorResult" } } }, - "index": { - "_": "Local", - "name": "$temp1", + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", "type": { - "_": "NumberType" + "_": "UnknownType" } - }, - "type": { - "_": "UnknownType" } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp3", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { "_": "Constant", - "value": "1", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } + }, + "type": { + "_": "BooleanType" } } } @@ -362,9 +375,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -376,15 +387,68 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp4", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "key", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "CastExpr", + "arg": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "UnknownType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", "type": { "_": "StringType" } @@ -403,7 +467,7 @@ "_": "Local", "name": "key", "type": { - "_": "UndefinedType" + "_": "UnknownType" } } } @@ -412,7 +476,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp3", + "name": "$temp6", "type": { "_": "StringType" } @@ -422,7 +486,7 @@ "op": "+", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp5", "type": { "_": "StringType" } @@ -440,7 +504,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp7", "type": { "_": "StringType" } @@ -450,7 +514,7 @@ "op": "+", "left": { "_": "Local", - "name": "$temp3", + "name": "$temp6", "type": { "_": "StringType" } @@ -463,13 +527,13 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } }, "field": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "" }, "name": "key", "type": { @@ -483,7 +547,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp8", "type": { "_": "StringType" } @@ -493,7 +557,7 @@ "op": "+", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp7", "type": { "_": "StringType" } @@ -531,7 +595,7 @@ "args": [ { "_": "Local", - "name": "$temp5", + "name": "$temp8", "type": { "_": "StringType" } @@ -549,7 +613,7 @@ }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "modifiers": [], "typeParameters": [], @@ -559,7 +623,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "firstName", "type": { @@ -569,19 +633,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "\"John\"", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "lastName", "type": { @@ -591,19 +648,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "\"Doe\"", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "age", "type": { @@ -613,17 +663,231 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "30", - "type": { - "_": "NumberType" + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "firstName", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "John", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "lastName", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "Doe", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "age", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "30", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json index 713beda96..e35bd8de6 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/MatrixMultiplication.ts.json @@ -10,128 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "A", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnionType", - "types": [ - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - ] - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "B", - "type": { - "_": "ArrayType", - "elementType": { - "_": "UnionType", - "types": [ - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - }, - { - "_": "ArrayType", - "elementType": { - "_": "NumberType" - }, - "dimensions": 1 - } - ] - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "product", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "multiplyMatrices", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -571,7 +450,23 @@ "right": { "_": "NewArrayExpr", "elementType": { - "_": "AnyType" + "_": "UnionType", + "types": [ + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + ] }, "size": { "_": "Constant", @@ -1001,7 +896,23 @@ "right": { "_": "NewArrayExpr", "elementType": { - "_": "AnyType" + "_": "UnionType", + "types": [ + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + ] }, "size": { "_": "Constant", @@ -1222,30 +1133,12 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "multiplyMatrices", - "parameters": [ - { - "name": "A", - "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - }, - "isOptional": false - }, - { - "name": "B", - "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - }, - "isOptional": false - } - ], + "parameters": [], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "UnknownType" } }, "args": [ @@ -1364,23 +1257,44 @@ { "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 }, "isOptional": false }, { "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 }, "isOptional": false } ], "returnType": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "modifiers": [], @@ -1399,15 +1313,29 @@ { "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, { "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, { @@ -1425,7 +1353,11 @@ { "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { @@ -1443,7 +1375,11 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { @@ -1452,10 +1388,19 @@ "_": "UnknownType" } }, + { + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, { "name": "AnonymousMethod-multiplyMatrices-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -1475,7 +1420,7 @@ } }, { - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -1501,12 +1446,6 @@ "_": "NumberType" } }, - { - "name": "$temp3", - "type": { - "_": "UnknownType" - } - }, { "name": "$temp4", "type": { @@ -1516,25 +1455,39 @@ { "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp6", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp7", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, { "name": "$temp8", "type": { - "_": "UnknownType" + "_": "NumberType" + } + }, + { + "name": "$temp9", + "type": { + "_": "NumberType" } } ], @@ -1544,7 +1497,7 @@ "id": 0, "successors": [ 1, - 6 + 9 ], "predecessors": [], "stmts": [ @@ -1554,16 +1507,30 @@ "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "right": { "_": "ParameterRef", "index": 0, "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } } }, @@ -1573,16 +1540,30 @@ "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" - } - }, - "right": { - "_": "ParameterRef", + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 + } + }, + "right": { + "_": "ParameterRef", "index": 1, "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } } }, @@ -1623,8 +1604,15 @@ "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -1644,27 +1632,43 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "0", + "index": { + "_": "Constant", + "value": "0", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -1683,7 +1687,11 @@ "_": "Local", "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "field": { @@ -1712,8 +1720,15 @@ "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, "field": { @@ -1733,27 +1748,43 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "0", + "index": { + "_": "Constant", + "value": "0", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -1772,7 +1803,11 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "field": { @@ -1786,6 +1821,55 @@ } } }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { @@ -1816,14 +1900,12 @@ }, "args": [ { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-multiplyMatrices-0" - }, + "_": "Local", + "name": "$temp2", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-multiplyMatrices-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" } } }, @@ -1831,7 +1913,7 @@ "_": "Local", "name": "AnonymousMethod-multiplyMatrices-0", "type": { - "_": "CallableType", + "_": "FunctionType", "signature": { "enclosingClass": { "name": "_DEFAULT_ARK_CLASS" @@ -1851,7 +1933,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "===", + "op": "!==", "left": { "_": "Local", "name": "colsA", @@ -1867,7 +1949,7 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } @@ -1876,14 +1958,9 @@ { "id": 1, "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3, - 6 + 2 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1901,12 +1978,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -1922,46 +2009,16 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -1976,15 +2033,11 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 1, - 4 - ], - "predecessors": [ - 1, - 4 + 5 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2002,12 +2055,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 5, + "successors": [ + 2, + 6 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "j", @@ -2023,73 +2086,51 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 6, + "successors": [ + 7 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "j", + "name": "k", "type": { "_": "NumberType" } }, "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "j", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" } } } ] }, { - "id": 4, + "id": 7, "successors": [ - 3, - 5 - ], - "predecessors": [ - 3, - 5 + 5, + 8 ], + "predecessors": [], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "k", @@ -2105,54 +2146,24 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 5, + "id": 8, "successors": [ - 4 - ], - "predecessors": [ - 4 + 7 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp3", + "name": "$temp4", "type": { "_": "UnknownType" } @@ -2181,29 +2192,45 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "A", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "i", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2211,28 +2238,33 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", - "name": "$temp4", + "name": "$temp5", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "k", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2240,29 +2272,45 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", "name": "B", "type": { - "_": "UnclearReferenceType", - "name": "ArrayType" + "_": "ArrayType", + "elementType": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "k", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -2270,28 +2318,33 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp7", + "name": "$temp8", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { - "_": "InstanceFieldRef", - "instance": { + "_": "ArrayRef", + "array": { "_": "Local", - "name": "$temp6", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } }, - "field": { - "enclosingClass": { - "name": "" - }, + "index": { + "_": "Local", "name": "j", "type": { - "_": "UnknownType" + "_": "NumberType" } + }, + "type": { + "_": "NumberType" } } }, @@ -2299,9 +2352,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -2309,16 +2362,16 @@ "op": "*", "left": { "_": "Local", - "name": "$temp5", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp8", "type": { - "_": "UnknownType" + "_": "NumberType" } } } @@ -2329,7 +2382,7 @@ "_": "InstanceFieldRef", "instance": { "_": "Local", - "name": "$temp3", + "name": "$temp4", "type": { "_": "UnknownType" } @@ -2351,7 +2404,7 @@ "_": "InstanceFieldRef", "instance": { "_": "Local", - "name": "$temp3", + "name": "$temp4", "type": { "_": "UnknownType" } @@ -2368,9 +2421,93 @@ }, "right": { "_": "Local", - "name": "$temp8", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "j", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "j", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" } } } @@ -2378,19 +2515,17 @@ ] }, { - "id": 6, + "id": 9, "successors": [ 1 ], - "predecessors": [ - 0 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -2414,7 +2549,7 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -2447,7 +2582,7 @@ "_": "ThrowStmt", "arg": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "ClassType", "signature": { @@ -2529,7 +2664,7 @@ }, { "signature": { - "name": "AnonymousClass-multiplyMatrices-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" }, "modifiers": [], "typeParameters": [], @@ -2539,7 +2674,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-multiplyMatrices-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" }, "name": "length", "type": { @@ -2549,17 +2684,167 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "rowsA", - "type": { + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "length", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "rowsA", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-multiplyMatrices-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } } } - ], - "methods": [] + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json index 2929b6235..415e87ebb 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/NestedLoops.ts.json @@ -10,116 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "colors", - "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "sizes", - "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "combinations", - "type": { - "_": "ArrayType", - "elementType": { - "_": "AnyType" - }, - "dimensions": 1 - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "color", - "type": { - "_": "UndefinedType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "size", - "type": { - "_": "UndefinedType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -205,40 +96,85 @@ "dimensions": 1 } }, + { + "name": "$temp3", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + { + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + { + "name": "$temp5", + "type": { + "_": "BooleanType" + } + }, + { + "name": "$temp6", + "type": { + "_": "UnknownType" + } + }, { "name": "color", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, { - "name": "$temp3", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + { + "name": "$temp8", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, { - "name": "$temp4", + "name": "$temp9", "type": { - "_": "NumberType" + "_": "BooleanType" } }, { - "name": "size", + "name": "$temp10", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, { - "name": "$temp5", + "name": "size", "type": { - "_": "NumberType" + "_": "UnknownType" } }, { - "name": "$temp6", + "name": "$temp11", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, { @@ -644,43 +580,25 @@ { "id": 1, "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 + 2 ], + "predecessors": [], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "color", - "type": { - "_": "UndefinedType" - } - }, - "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" - } - } - }, { "_": "AssignStmt", "left": { "_": "Local", "name": "$temp3", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, "right": { - "_": "LengthExpr", - "arg": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "colors", "type": { @@ -690,120 +608,135 @@ }, "dimensions": 1 } - } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", "name": "$temp4", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, - { - "_": "IfStmt", - "condition": { - "_": "ConditionExpr", - "op": ">=", - "left": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", - "name": "$temp4", + "name": "$temp3", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Iterator" + } } }, - "right": { - "_": "Local", - "name": "$temp3", - "type": { - "_": "NumberType" + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "type": { - "_": "BooleanType" - } + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "color", + "name": "$temp5", "type": { - "_": "UndefinedType" + "_": "BooleanType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "colors", + "name": "$temp4", "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "index": { - "_": "Local", - "name": "$temp4", + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", "type": { - "_": "NumberType" + "_": "UnknownType" } - }, - "type": { - "_": "StringType" } } }, { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp4", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", "left": { "_": "Local", - "name": "$temp4", + "name": "$temp5", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { "_": "Constant", - "value": "1", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } + }, + "type": { + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "CallStmt", @@ -854,30 +787,41 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 1, - 4 - ], - "predecessors": [ - 1, - 4 + 5 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "size", + "name": "$temp6", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, "right": { - "_": "Constant", - "value": "undefined", - "type": { - "_": "UndefinedType" + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } } } }, @@ -885,14 +829,40 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp5", + "name": "color", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "LengthExpr", + "_": "CastExpr", "arg": { + "_": "Local", + "name": "$temp6", + "type": { + "_": "UnknownType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", "name": "sizes", "type": { @@ -902,23 +872,102 @@ }, "dimensions": 1 } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] + } + } + ] + }, + { + "id": 5, + "successors": [ + 2, + 6 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "args": [] } }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp9", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", + "type": { + "_": "UnknownType" + } } } }, @@ -926,57 +975,87 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "==", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp9", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "right": { - "_": "Local", - "name": "$temp5", + "_": "Constant", + "value": "true", "type": { - "_": "NumberType" + "_": "BooleanType" } }, "type": { "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 6, + "successors": [ + 5 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "size", + "name": "$temp10", "type": { - "_": "UndefinedType" + "_": "UnknownType" } }, "right": { - "_": "ArrayRef", - "array": { + "_": "InstanceFieldRef", + "instance": { "_": "Local", - "name": "sizes", + "name": "$temp8", "type": { - "_": "ArrayType", - "elementType": { - "_": "StringType" - }, - "dimensions": 1 + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } } }, - "index": { + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "size", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "CastExpr", + "arg": { "_": "Local", - "name": "$temp6", + "name": "$temp10", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "type": { - "_": "StringType" + "_": "UnknownType" } } }, @@ -984,41 +1063,51 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp11", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, "right": { - "_": "BinopExpr", - "op": "+", - "left": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { "_": "Local", - "name": "$temp6", + "name": "$temp11", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } } }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" } - } + }, + "args": [] } - } - ] - }, - { - "id": 4, - "successors": [ - 3 - ], - "predecessors": [ - 3 - ], - "stmts": [ + }, { "_": "CallStmt", "expr": { @@ -1046,14 +1135,12 @@ }, "args": [ { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" - }, + "_": "Local", + "name": "$temp11", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" } } } @@ -1070,7 +1157,7 @@ }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "modifiers": [], "typeParameters": [], @@ -1080,7 +1167,7 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "color", "type": { @@ -1090,13 +1177,12 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-0" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" }, "name": "size", "type": { @@ -1106,11 +1192,135 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], - "methods": [] + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] } ], "importInfos": [], diff --git a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json index af9b429a5..d956e5b75 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/loop/WhileLoop.ts.json @@ -10,40 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "counter", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "console", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -150,16 +117,13 @@ 2, 3 ], - "predecessors": [ - 0, - 3 - ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "counter", @@ -184,9 +148,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -198,9 +160,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", diff --git a/jacodb-ets/src/test/resources/etsir/samples/basic.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json similarity index 61% rename from jacodb-ets/src/test/resources/etsir/samples/basic.ts.json rename to jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json index e025c1465..6ed227019 100644 --- a/jacodb-ets/src/test/resources/etsir/samples/basic.ts.json +++ b/jacodb-ets/src/test/resources/etsir/samples/save/basic.ts.json @@ -1,5 +1,5 @@ { - "name": "basic.ts", + "name": "save/basic.ts", "namespaces": [], "classes": [ { @@ -10,161 +10,7 @@ "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "logger", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "someClass", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "m", - "type": { - "_": "ClassType", - "signature": { - "name": "someClass" - } - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "x", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "soo", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "forLoopTest", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "controlTest", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "deleteTest", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null - } - ], + "fields": [], "methods": [ { "signature": { @@ -190,6 +36,15 @@ } } }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, { "name": "configure", "type": { @@ -213,16 +68,16 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7", + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, @@ -236,7 +91,7 @@ } }, { - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -304,6 +159,55 @@ } } }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "CallStmt", "expr": { @@ -320,14 +224,12 @@ }, "args": [ { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" - }, + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" } } } @@ -366,17 +268,17 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, "right": { "_": "Local", - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7", + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } } @@ -385,7 +287,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -409,7 +311,7 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -424,10 +326,7 @@ "name": "constructor", "parameters": [], "returnType": { - "_": "ClassType", - "signature": { - "name": "someClass" - } + "_": "UnknownType" } }, "args": [ @@ -455,7 +354,7 @@ }, "right": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "ClassType", "signature": { @@ -504,7 +403,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "forLoopTest", "parameters": [], @@ -521,7 +420,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "controlTest", "parameters": [], @@ -538,7 +437,7 @@ "_": "StaticCallExpr", "method": { "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" + "name": "" }, "name": "deleteTest", "parameters": [], @@ -735,20 +634,7 @@ } } } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -765,12 +651,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -786,68 +682,36 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 3, + "successors": [ + 1 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "i", + "name": "$temp1", "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } - } - } - ] - }, - { - "id": 2, - "successors": [], - "predecessors": [ - 1 - ], - "stmts": [ - { - "_": "ReturnVoidStmt" - } - ] - }, - { - "id": 3, - "successors": [ - 1 - ], - "predecessors": [ - 1 - ], - "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "$temp1", - "type": { - "_": "UnknownType" + "_": "UnknownType" } }, "right": { @@ -932,6 +796,34 @@ } ] } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "i", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] } @@ -1004,19 +896,19 @@ { "name": "$temp3", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp4", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -1028,13 +920,13 @@ { "name": "$temp6", "type": { - "_": "NumberType" + "_": "StringType" } }, { "name": "$temp7", "type": { - "_": "UnknownType" + "_": "StringType" } }, { @@ -1046,7 +938,7 @@ { "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { @@ -1058,7 +950,7 @@ { "name": "$temp11", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { @@ -1069,12 +961,6 @@ }, { "name": "$temp13", - "type": { - "_": "UnknownType" - } - }, - { - "name": "count", "type": { "_": "NumberType" } @@ -1088,103 +974,109 @@ { "name": "$temp15", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp16", "type": { - "_": "UnknownType" - } - }, - { - "name": "j", - "type": { - "_": "NumberType" + "_": "StringType" } }, { "name": "$temp17", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp18", "type": { - "_": "UnknownType" + "_": "StringType" } }, { - "name": "k", + "name": "$temp19", "type": { - "_": "NumberType" + "_": "StringType" } }, { - "name": "$temp19", + "name": "$temp20", "type": { - "_": "UnknownType" + "_": "StringType" } }, { - "name": "$temp20", + "name": "$temp21", "type": { - "_": "UnknownType" + "_": "StringType" } }, { - "name": "$temp21", + "name": "count", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp22", "type": { - "_": "UnknownType" + "_": "NumberType" } }, { "name": "$temp23", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp24", "type": { - "_": "UnknownType" + "_": "StringType" + } + }, + { + "name": "j", + "type": { + "_": "NumberType" } }, { "name": "$temp25", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp26", "type": { - "_": "UnknownType" + "_": "StringType" + } + }, + { + "name": "k", + "type": { + "_": "NumberType" } }, { "name": "$temp27", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp28", "type": { - "_": "UnknownType" + "_": "StringType" } }, { "name": "$temp29", "type": { - "_": "UnknownType" + "_": "StringType" } } ], @@ -1446,13 +1338,9 @@ { "id": 1, "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 10 + 2 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1470,7 +1358,17 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { @@ -1508,7 +1406,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "i", @@ -1524,46 +1422,16 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "i", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 2, + "id": 3, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnVoidStmt" @@ -1571,14 +1439,12 @@ ] }, { - "id": 3, + "id": 4, "successors": [ - 4, - 20 - ], - "predecessors": [ - 1 + 5, + 23 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -1620,7 +1486,7 @@ "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1646,12 +1512,12 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!==", + "op": "===", "left": { "_": "Local", "name": "$temp3", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1662,28 +1528,26 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 4, + "id": 5, "successors": [ - 5 - ], - "predecessors": [ - 3 + 6 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp28", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1726,9 +1590,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp29", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1736,9 +1600,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp28", + "name": "$temp6", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -1774,9 +1638,9 @@ "args": [ { "_": "Local", - "name": "$temp29", + "name": "$temp7", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -1785,23 +1649,20 @@ ] }, { - "id": 5, + "id": 6, "successors": [ - 6, - 17, - 18, - 19 - ], - "predecessors": [ - 4, - 20 + 7, + 20, + 21, + 22 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp8", "type": { "_": "NumberType" } @@ -1835,9 +1696,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { @@ -1845,7 +1706,7 @@ "op": "%", "left": { "_": "Local", - "name": "$temp6", + "name": "$temp8", "type": { "_": "NumberType" } @@ -1863,7 +1724,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp8", + "name": "$temp10", "type": { "_": "NumberType" } @@ -1897,16 +1758,16 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp9", + "name": "$temp11", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } } }, @@ -1914,7 +1775,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp10", + "name": "$temp12", "type": { "_": "NumberType" } @@ -1948,16 +1809,16 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp11", + "name": "$temp13", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } } }, @@ -1965,7 +1826,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp12", + "name": "$temp14", "type": { "_": "NumberType" } @@ -1999,29 +1860,27 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp13", + "name": "$temp15", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "Local", - "name": "$temp7", + "name": "$temp9", "type": { - "_": "UnknownType" + "_": "NumberType" } } } ] }, { - "id": 6, + "id": 7, "successors": [ - 7 - ], - "predecessors": [ - 5 + 8 ], + "predecessors": [], "stmts": [ { "_": "CallStmt", @@ -2058,13 +1917,11 @@ ] }, { - "id": 7, + "id": 8, "successors": [ - 8 - ], - "predecessors": [ - 6 + 9 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2086,21 +1943,18 @@ ] }, { - "id": 8, + "id": 9, "successors": [ - 9, - 16 - ], - "predecessors": [ - 7, - 16 + 10, + 19 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp14", + "name": "$temp22", "type": { "_": "NumberType" } @@ -2134,7 +1988,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "count", @@ -2144,29 +1998,24 @@ }, "right": { "_": "Local", - "name": "$temp14", + "name": "$temp22", "type": { "_": "NumberType" } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 9, + "id": 10, "successors": [ - 10, - 13 - ], - "predecessors": [ - 8, - 14, - 15 + 11 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2184,12 +2033,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 11, + "successors": [ + 12, + 16 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "j", @@ -2205,50 +2064,18 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "j", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "j", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } ] }, { - "id": 10, + "id": 12, "successors": [ - 1, - 11 - ], - "predecessors": [ - 9, - 11 + 13 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -2266,12 +2093,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 13, + "successors": [ + 14, + 15 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "k", @@ -2287,15 +2124,24 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - }, + } + ] + }, + { + "id": 14, + "successors": [ + 2 + ], + "predecessors": [], + "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "k", + "name": "i", "type": { "_": "NumberType" } @@ -2305,7 +2151,7 @@ "op": "+", "left": { "_": "Local", - "name": "k", + "name": "i", "type": { "_": "NumberType" } @@ -2322,22 +2168,20 @@ ] }, { - "id": 11, + "id": 15, "successors": [ - 10, - 12 - ], - "predecessors": [ - 10 + 13, + 14 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp19", + "name": "$temp27", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2363,9 +2207,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp20", + "name": "$temp28", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2373,9 +2217,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp19", + "name": "$temp27", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2411,9 +2255,9 @@ "args": [ { "_": "Local", - "name": "$temp20", + "name": "$temp28", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2423,9 +2267,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp21", + "name": "$temp29", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2471,9 +2315,9 @@ "args": [ { "_": "Local", - "name": "$temp21", + "name": "$temp29", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2483,7 +2327,7 @@ "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!==", + "op": "===", "left": { "_": "Local", "name": "k", @@ -2499,39 +2343,53 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } - } - ] - }, - { - "id": 12, - "successors": [], - "predecessors": [ - 11 - ], - "stmts": [ + }, { - "_": "GotoStmt" + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] }, { - "id": 13, + "id": 16, "successors": [ - 14, - 15 - ], - "predecessors": [ - 9 + 17, + 18 ], + "predecessors": [], "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": "!==", + "op": "===", "left": { "_": "Local", "name": "j", @@ -2547,28 +2405,26 @@ } }, "type": { - "_": "UnknownType" + "_": "BooleanType" } } } ] }, { - "id": 14, + "id": 17, "successors": [ - 9 - ], - "predecessors": [ - 13 + 18 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp17", + "name": "$temp25", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2594,9 +2450,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp18", + "name": "$temp26", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2604,9 +2460,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp17", + "name": "$temp25", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2642,9 +2498,9 @@ "args": [ { "_": "Local", - "name": "$temp18", + "name": "$temp26", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2653,50 +2509,71 @@ ] }, { - "id": 15, - "successors": [ - 9 - ], - "predecessors": [ - 13 - ], - "stmts": [ - { - "_": "GotoStmt" - } - ] - }, - { - "id": 16, + "id": 18, "successors": [ - 8 - ], - "predecessors": [ - 8 + 11 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp15", + "name": "j", "type": { - "_": "UnknownType" + "_": "NumberType" } }, "right": { "_": "BinopExpr", "op": "+", "left": { - "_": "Constant", - "value": "当前计数: ", + "_": "Local", + "name": "j", "type": { - "_": "StringType" + "_": "NumberType" } }, "right": { - "_": "Local", - "name": "count", + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + } + ] + }, + { + "id": 19, + "successors": [ + 9 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp23", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Constant", + "value": "当前计数: ", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Local", + "name": "count", "type": { "_": "NumberType" } @@ -2707,9 +2584,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp16", + "name": "$temp24", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2717,9 +2594,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp15", + "name": "$temp23", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2755,9 +2632,9 @@ "args": [ { "_": "Local", - "name": "$temp16", + "name": "$temp24", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -2794,19 +2671,19 @@ ] }, { - "id": 17, - "successors": [], - "predecessors": [ - 5 + "id": 20, + "successors": [ + 8 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp22", + "name": "$temp16", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2849,9 +2726,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp23", + "name": "$temp17", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2859,9 +2736,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp22", + "name": "$temp16", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2897,33 +2774,30 @@ "args": [ { "_": "Local", - "name": "$temp23", + "name": "$temp17", "type": { - "_": "UnknownType" + "_": "StringType" } } ] } - }, - { - "_": "GotoStmt" } ] }, { - "id": 18, - "successors": [], - "predecessors": [ - 5 + "id": 21, + "successors": [ + 8 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp24", + "name": "$temp18", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2966,9 +2840,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp25", + "name": "$temp19", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -2976,9 +2850,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp24", + "name": "$temp18", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3014,33 +2888,30 @@ "args": [ { "_": "Local", - "name": "$temp25", + "name": "$temp19", "type": { - "_": "UnknownType" + "_": "StringType" } } ] } - }, - { - "_": "GotoStmt" } ] }, { - "id": 19, - "successors": [], - "predecessors": [ - 5 + "id": 22, + "successors": [ + 8 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp26", + "name": "$temp20", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3083,9 +2954,9 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp27", + "name": "$temp21", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3093,9 +2964,9 @@ "op": "+", "left": { "_": "Local", - "name": "$temp26", + "name": "$temp20", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3131,27 +3002,22 @@ "args": [ { "_": "Local", - "name": "$temp27", + "name": "$temp21", "type": { - "_": "UnknownType" + "_": "StringType" } } ] } - }, - { - "_": "GotoStmt" } ] }, { - "id": 20, + "id": 23, "successors": [ - 5 - ], - "predecessors": [ - 3 + 6 ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3159,7 +3025,7 @@ "_": "Local", "name": "$temp4", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3204,7 +3070,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3214,7 +3080,7 @@ "_": "Local", "name": "$temp4", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -3252,7 +3118,7 @@ "_": "Local", "name": "$temp5", "type": { - "_": "UnknownType" + "_": "StringType" } } ] @@ -3855,20 +3721,7 @@ "_": "NumberType" } } - } - ] - }, - { - "id": 1, - "successors": [ - 2, - 3 - ], - "predecessors": [ - 0, - 3 - ], - "stmts": [ + }, { "_": "AssignStmt", "left": { @@ -3885,12 +3738,22 @@ "_": "NumberType" } } - }, + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 3 + ], + "predecessors": [], + "stmts": [ { "_": "IfStmt", "condition": { "_": "ConditionExpr", - "op": ">=", + "op": "<", "left": { "_": "Local", "name": "k", @@ -3906,35 +3769,7 @@ } }, "type": { - "_": "UnknownType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "k", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } + "_": "BooleanType" } } } @@ -3943,9 +3778,7 @@ { "id": 2, "successors": [], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "ReturnStmt", @@ -3964,9 +3797,7 @@ "successors": [ 1 ], - "predecessors": [ - 1 - ], + "predecessors": [], "stmts": [ { "_": "AssignStmt", @@ -3995,6 +3826,34 @@ } } } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "k", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } } ] } @@ -4070,6 +3929,15 @@ "type": { "_": "StringType" } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } } ], "cfg": { @@ -4153,43 +4021,90 @@ } }, { - "_": "ReturnStmt", - "arg": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-listParameters-8" - }, + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-listParameters-8" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" } } } - } - ] - } - ] - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "_DEFAULT_ARK_CLASS" - }, - "name": "deleteTest", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "deleteTest", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", "type": { "_": "ClassType", "signature": { @@ -4202,7 +4117,16 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, @@ -4217,13 +4141,13 @@ } }, { - "name": "$temp0", + "name": "$temp1", "type": { "_": "BooleanType" } }, { - "name": "$temp1", + "name": "$temp2", "type": { "_": "BooleanType" } @@ -4235,7 +4159,7 @@ } }, { - "name": "$temp2", + "name": "$temp3", "type": { "_": "BooleanType" } @@ -4274,23 +4198,70 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "x", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, "right": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-deleteTest-9" + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "x", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } } @@ -4316,7 +4287,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, @@ -4335,7 +4306,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp0", + "name": "$temp1", "type": { "_": "BooleanType" } @@ -4350,7 +4321,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, @@ -4370,7 +4341,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp1", + "name": "$temp2", "type": { "_": "BooleanType" } @@ -4431,7 +4402,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } } @@ -4442,7 +4413,7 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "$temp2", + "name": "$temp3", "type": { "_": "BooleanType" } @@ -4455,7 +4426,7 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-deleteTest-9" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } } @@ -4494,14 +4465,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } + "exclamationToken": false }, { "signature": { @@ -4516,21 +4480,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "Person" - }, - "name": "AnonymousMethod-0", - "parameters": [], - "returnType": { - "_": "UnknownType" - } - }, - "args": [] - } + "exclamationToken": false } ], "methods": [ @@ -4539,16 +4489,8 @@ "enclosingClass": { "name": "Person" }, - "name": "constructor", - "parameters": [ - { - "name": "age", - "type": { - "_": "NumberType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -4556,23 +4498,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Person" - } - } - }, - { - "name": "age", - "type": { - "_": "NumberType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -4584,37 +4510,91 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "age", + "name": "this", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Person" + } } } }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "this", + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "field": { + "enclosingClass": { + "name": "Person" + }, + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", "type": { - "_": "ClassType", - "signature": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "field": { + "enclosingClass": { "name": "Person" + }, + "name": "growOld", + "type": { + "_": "UnknownType" } } }, "right": { - "_": "ThisRef", + "_": "Local", + "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "ClassType", + "_": "FunctionType", "signature": { - "name": "Person" + "enclosingClass": { + "name": "Person" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [], + "returnType": { + "_": "UnknownType" + } } } } @@ -4633,7 +4613,7 @@ "enclosingClass": { "name": "Person" }, - "name": "AnonymousMethod-0", + "name": "@static_init", "parameters": [], "returnType": { "_": "UnknownType" @@ -4642,23 +4622,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Person" - } - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -4672,7 +4636,193 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Person" + }, + "name": "constructor", + "parameters": [ + { + "name": "age", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + { + "name": "age", + "type": { + "_": "NumberType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Person" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "age", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Person" + }, + "name": "getAge", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", "signature": { "name": "Person" } @@ -4721,35 +4871,14 @@ } }, { - "_": "AssignStmt", - "left": { + "_": "ReturnStmt", + "arg": { "_": "Local", "name": "$temp0", "type": { "_": "UnknownType" } - }, - "right": { - "_": "BinopExpr", - "op": "+", - "left": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } - }, - "right": { - "_": "Constant", - "value": "1", - "type": { - "_": "NumberType" - } - } } - }, - { - "_": "ReturnVoidStmt" } ] } @@ -4762,15 +4891,13 @@ "enclosingClass": { "name": "Person" }, - "name": "getAge", + "name": "AnonymousMethod-@instance_init-0", "parameters": [], "returnType": { "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { "locals": [ @@ -4852,14 +4979,35 @@ } }, { - "_": "ReturnStmt", - "arg": { + "_": "AssignStmt", + "left": { "_": "Local", "name": "$temp0", "type": { "_": "UnknownType" } + }, + "right": { + "_": "BinopExpr", + "op": "+", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } } + }, + { + "_": "ReturnVoidStmt" } ] } @@ -4995,22 +5143,66 @@ }, "modifiers": [], "typeParameters": [], - "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Alarm" - } - } - } - ], - "cfg": { - "blocks": [ - { - "id": 0, + "body": null + } + ] + }, + { + "signature": { + "name": "Alarm2" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Alarm2" + }, + "name": "alert2", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "Door" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Door" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, "successors": [], "predecessors": [], "stmts": [ @@ -5020,10 +5212,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Alarm" - } + "_": "UnknownType" } }, "right": { @@ -5031,7 +5220,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Alarm" + "name": "Door" } } } @@ -5044,44 +5233,22 @@ ] } } - } - ] - }, - { - "signature": { - "name": "Alarm2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [ + }, { "signature": { "enclosingClass": { - "name": "Alarm2" + "name": "Door" }, - "name": "alert2", + "name": "@static_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Alarm2" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5094,23 +5261,94 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Alarm2" + "name": "Door" } } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Door" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } }, "right": { "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "Alarm2" + "name": "Door" } } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Door" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "ReturnVoidStmt" } @@ -5122,17 +5360,6 @@ } ] }, - { - "signature": { - "name": "Door" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [], - "methods": [] - }, { "signature": { "name": "Adder" @@ -5155,37 +5382,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "Adder" - }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "StringType" - } - }, - "args": [ - { - "_": "Local", - "name": "b", - "type": { - "_": "UnknownType" - } - } - ] - } + "exclamationToken": false } ], "methods": [ @@ -5194,16 +5391,8 @@ "enclosingClass": { "name": "Adder" }, - "name": "constructor", - "parameters": [ - { - "name": "a", - "type": { - "_": "NumberType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -5211,23 +5400,7 @@ "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Adder" - } - } - }, - { - "name": "a", - "type": { - "_": "NumberType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5239,37 +5412,67 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "a", + "name": "this", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "ThisRef", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "Adder" + } } } }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + "field": { + "enclosingClass": { "name": "Adder" + }, + "name": "add", + "type": { + "_": "UnknownType" } } }, "right": { - "_": "ThisRef", + "_": "Local", + "name": "AnonymousMethod-@instance_init-0", "type": { - "_": "ClassType", + "_": "FunctionType", "signature": { - "name": "Adder" + "enclosingClass": { + "name": "Adder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } } } } @@ -5288,13 +5491,181 @@ "enclosingClass": { "name": "Adder" }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Adder" + }, + "name": "constructor", + "parameters": [ + { + "name": "a", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + { + "name": "a", + "type": { + "_": "NumberType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Adder" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "a", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Adder" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Adder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, "isOptional": false } ], @@ -5330,7 +5701,7 @@ { "name": "$temp1", "type": { - "_": "UnknownType" + "_": "StringType" } } ], @@ -5418,7 +5789,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "StringType" } }, "right": { @@ -5446,7 +5817,7 @@ "_": "Local", "name": "$temp1", "type": { - "_": "UnknownType" + "_": "StringType" } } } @@ -5482,28 +5853,7 @@ ], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "InstanceFieldRef", - "instance": { - "_": "ThisRef", - "type": { - "_": "ClassType", - "signature": { - "name": "ExtendedAdder" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "add", - "type": { - "_": "UnknownType" - } - } - } + "exclamationToken": false }, { "signature": { @@ -5518,37 +5868,7 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "StaticCallExpr", - "method": { - "enclosingClass": { - "name": "ExtendedAdder" - }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], - "returnType": { - "_": "StringType" - } - }, - "args": [ - { - "_": "Local", - "name": "b", - "type": { - "_": "UnknownType" - } - } - ] - } + "exclamationToken": false } ], "methods": [ @@ -5557,46 +5877,16 @@ "enclosingClass": { "name": "ExtendedAdder" }, - "name": "AnonymousMethod-0", - "parameters": [ - { - "name": "b", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { - "_": "StringType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "ExtendedAdder" - } - } - }, - { - "name": "b", - "type": { - "_": "StringType" - } - }, - { - "name": "$temp0", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5604,33 +5894,13 @@ "successors": [], "predecessors": [], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "b", - "type": { - "_": "StringType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "StringType" - } - } - }, { "_": "AssignStmt", "left": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "ExtendedAdder" - } + "_": "UnknownType" } }, "right": { @@ -5646,54 +5916,2761 @@ { "_": "AssignStmt", "left": { - "_": "Local", + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "superAdd", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "add", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "add", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "AnonymousMethod-@instance_init-0", + "type": { + "_": "FunctionType", + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "AnonymousMethod-@instance_init-0", + "parameters": [ + { + "name": "b", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + { + "name": "b", + "type": { + "_": "StringType" + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "b", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "superAdd", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "b", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnStmt", + "arg": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "constructor", + "parameters": [ + { + "name": "a", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "a", + "type": { + "_": "NumberType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExtendedAdder" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "CallStmt", + "expr": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "ExtendedAdder" + }, + "name": "super", + "parameters": [ + { + "name": "a", + "type": { + "_": "NumberType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "a", + "type": { + "_": "NumberType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-0" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-0" + }, + "name": "x", + "type": { + "_": "NumberType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-0" + }, + "name": "y", + "type": { + "_": "NumberType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-0" + }, + "name": "z", + "type": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [] + }, + { + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "SecurityDoor" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "Door", + "implementedInterfaceNames": [ + "Alarm", + "Alarm2" + ], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "x", + "type": { + "_": "NumberType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "y", + "type": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "z", + "type": { + "_": "UnclearReferenceType", + "name": "Person" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "Members", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "y", + "type": { + "_": "StringType" + } + } + }, + "right": { + "_": "Constant", + "value": "", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + }, + "method": { + "enclosingClass": { + "name": "Person" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "10", + "type": { + "_": "NumberType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "z", + "type": { + "_": "UnclearReferenceType", + "name": "Person" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "Person" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "Members", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "AnonymousClass-SecurityDoor-@instance_init-1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-SecurityDoor-@instance_init-1" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "alert", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "SecurityDoor alert", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "alert2", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "SecurityDoor alert2", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "fooo", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "This is fooo!", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "constructor", + "parameters": [ + { + "name": "x", + "type": { + "_": "NumberType" + }, + "isOptional": false + }, + { + "name": "y", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + { + "name": "x", + "type": { + "_": "NumberType" + } + }, + { + "name": "y", + "type": { + "_": "StringType" + } + }, + { + "name": "logger", + "type": { + "_": "UnknownType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "SecurityDoor" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "x", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "y", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 1, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "StaticCallExpr", + "method": { + "enclosingClass": { + "name": "" + }, + "name": "super", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "x", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SecurityDoor" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "y", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "y", + "type": { + "_": "StringType" + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "logger", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "info", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "This is a constrctor!", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "Animal" + }, + "modifiers": [ + "AbstractKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "name", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "constructor", + "parameters": [ + { + "name": "name", + "type": { + "_": "StringType" + }, + "isOptional": false + } + ], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [ + "PublicKeyword" + ], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + }, + { + "name": "name", + "type": { + "_": "StringType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "Animal" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "name", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "ParameterRef", + "index": 0, + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "Animal" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "name", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "name", + "type": { + "_": "StringType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "Animal" + }, + "name": "sayHi", + "parameters": [], + "returnType": { + "_": "VoidType" + } + }, + "modifiers": [ + "PublicKeyword", + "AbstractKeyword" + ], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "StringValidator" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "StringValidator" + }, + "name": "color", + "type": { + "_": "StringType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": true, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "StringValidator" + }, + "name": "width", + "type": { + "_": "NumberType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": true, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "StringValidator" + }, + "name": "isAcceptable", + "parameters": [ + { + "name": "s", + "type": { + "_": "StringType" + }, + "isOptional": true + } + ], + "returnType": { + "_": "BooleanType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": null + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "pattern", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "pattern", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "pattern", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "[%d] [%p] [%z] [ArkAnalyzer] - %m", + "type": { + "_": "StringType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "layout", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "type", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "console", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "layout", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4-@instance_init-5" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "console", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3-@instance_init-4" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", "type": { "_": "UnknownType" } }, "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "CallStmt", + "expr": { "_": "InstanceCallExpr", "instance": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "ExtendedAdder" - } + "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" }, - "name": "superAdd", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Local", - "name": "b", - "type": { - "_": "StringType" - } - } - ] + "args": [] } }, { - "_": "ReturnStmt", - "arg": { - "_": "Local", - "name": "$temp0", - "type": { - "_": "UnknownType" - } - } + "_": "ReturnVoidStmt" } ] } @@ -5705,7 +8682,7 @@ }, { "signature": { - "name": "AnonymousClass-0" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, "modifiers": [], "typeParameters": [], @@ -5715,169 +8692,287 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-0" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "x", + "name": "appenders", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-0" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "y", + "name": "level", "type": { - "_": "NumberType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-0" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "z", + "name": "enableCallStack", "type": { - "_": "StringType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "SecurityDoor" - }, - "modifiers": [ - "ExportKeyword" - ], - "typeParameters": [], - "superClassName": "Door", - "implementedInterfaceNames": [ - "Alarm", - "Alarm2" - ], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "SecurityDoor" - }, - "name": "x", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "0", - "type": { - "_": "NumberType" - } - } - }, + "methods": [ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "y", - "type": { - "_": "StringType" + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "''", - "type": { - "_": "StringType" + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "StringType" + }, + "size": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "console", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "appenders", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "StringType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "level", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "info", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + }, + "name": "enableCallStack", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "false", + "type": { + "_": "BooleanType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } }, { "signature": { "enclosingClass": { - "name": "SecurityDoor" - }, - "name": "Members", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [ - "PublicKeyword" - ], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "", - "type": { - "_": "UnknownType" - } - } - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "alert", + "name": "constructor", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } - } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -5891,10 +8986,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } + "_": "UnknownType" } }, "right": { @@ -5902,7 +8994,7 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } } @@ -5913,30 +9005,22 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "logger", + "name": "this", "type": { "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "info", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Constant", - "value": "SecurityDoor alert", - "type": { - "_": "StringType" - } - } - ] + "args": [] } }, { @@ -5947,16 +9031,44 @@ ] } } - }, + } + ] + }, + { + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" }, - "name": "alert2", + "name": "default", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "@instance_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, "modifiers": [], @@ -5964,19 +9076,13 @@ "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } } ], "cfg": { @@ -5991,19 +9097,38 @@ "left": { "_": "Local", "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } }, "right": { - "_": "ThisRef", - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" } } } @@ -6014,30 +9139,60 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "logger", + "name": "$temp0", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } } }, "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" }, - "name": "info", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Constant", - "value": "SecurityDoor alert2", - "type": { - "_": "StringType" + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" } } - ] + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "default", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6-@instance_init-7" + } + } } }, { @@ -6052,36 +9207,18 @@ { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" }, - "name": "fooo", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" } - }, - "modifiers": [ - "PublicKeyword" - ], + }, + "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } - } - }, - { - "name": "logger", - "type": { - "_": "UnknownType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -6095,10 +9232,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "SecurityDoor" - } + "_": "UnknownType" } }, "right": { @@ -6106,7 +9240,7 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" } } } @@ -6117,30 +9251,22 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "logger", + "name": "this", "type": { "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" }, - "name": "info", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Constant", - "value": "This is fooo!", - "type": { - "_": "StringType" - } - } - ] + "args": [] } }, { @@ -6151,29 +9277,57 @@ ] } } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "appenders", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "SecurityDoor" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "constructor", - "parameters": [ - { - "name": "x", - "type": { - "_": "NumberType" - }, - "isOptional": false - }, - { - "name": "y", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "categories", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -6183,30 +9337,21 @@ "body": { "locals": [ { - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" } } }, { - "name": "x", - "type": { - "_": "NumberType" - } - }, - { - "name": "y", - "type": { - "_": "StringType" - } - }, - { - "name": "logger", + "name": "$temp1", "type": { - "_": "UnknownType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } } } ], @@ -6221,33 +9366,18 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "x", - "type": { - "_": "NumberType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "NumberType" - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "y", + "name": "this", "type": { - "_": "StringType" + "_": "UnknownType" } }, "right": { - "_": "ParameterRef", - "index": 1, + "_": "ThisRef", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } } } }, @@ -6255,20 +9385,20 @@ "_": "AssignStmt", "left": { "_": "Local", - "name": "this", + "name": "$temp0", "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" } } }, "right": { - "_": "ThisRef", - "type": { + "_": "NewExpr", + "classType": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" } } } @@ -6276,12 +9406,22 @@ { "_": "CallStmt", "expr": { - "_": "StaticCallExpr", + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + }, "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" }, - "name": "super", + "name": "constructor", "parameters": [], "returnType": { "_": "UnknownType" @@ -6300,15 +9440,15 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" } } }, "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "x", + "name": "appenders", "type": { "_": "UnknownType" } @@ -6316,12 +9456,64 @@ }, "right": { "_": "Local", - "name": "x", + "name": "$temp0", "type": { - "_": "NumberType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-3" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } } } }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { @@ -6332,25 +9524,78 @@ "type": { "_": "ClassType", "signature": { - "name": "SecurityDoor" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" } } }, "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "y", + "name": "categories", "type": { "_": "UnknownType" } } }, "right": { - "_": "Local", - "name": "y", + "_": "Local", + "name": "$temp1", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2-@instance_init-6" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", "type": { - "_": "StringType" + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" + } } } }, @@ -6360,30 +9605,22 @@ "_": "InstanceCallExpr", "instance": { "_": "Local", - "name": "logger", + "name": "this", "type": { "_": "UnknownType" } }, "method": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-2" }, - "name": "info", + "name": "@instance_init", "parameters": [], "returnType": { "_": "UnknownType" } }, - "args": [ - { - "_": "Constant", - "value": "This is a constrctor!", - "type": { - "_": "StringType" - } - } - ] + "args": [] } }, { @@ -6399,76 +9636,51 @@ }, { "signature": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "modifiers": [ - "AbstractKeyword" + "modifiers": [], + "typeParameters": [ + { + "_": "UNKNOWN_TYPE", + "type": "Type" + } ], - "typeParameters": [], "superClassName": "", "implementedInterfaceNames": [], "fields": [ { "signature": { "enclosingClass": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "name", + "name": "content", "type": { - "_": "UnknownType" + "_": "UnclearReferenceType", + "name": "Type" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ { "signature": { "enclosingClass": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "constructor", - "parameters": [ - { - "name": "name", - "type": { - "_": "StringType" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } - } - }, - { - "name": "name", - "type": { - "_": "StringType" - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -6476,33 +9688,13 @@ "successors": [], "predecessors": [], "stmts": [ - { - "_": "AssignStmt", - "left": { - "_": "Local", - "name": "name", - "type": { - "_": "StringType" - } - }, - "right": { - "_": "ParameterRef", - "index": 0, - "type": { - "_": "StringType" - } - } - }, { "_": "AssignStmt", "left": { "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } + "_": "UnknownType" } }, "right": { @@ -6510,41 +9702,9 @@ "type": { "_": "ClassType", "signature": { - "name": "Animal" - } - } - } - }, - { - "_": "AssignStmt", - "left": { - "_": "InstanceFieldRef", - "instance": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } - } - }, - "field": { - "enclosingClass": { - "name": "" - }, - "name": "name", - "type": { - "_": "UnknownType" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } - }, - "right": { - "_": "Local", - "name": "name", - "type": { - "_": "StringType" - } } }, { @@ -6559,31 +9719,18 @@ { "signature": { "enclosingClass": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "sayHi", + "name": "@static_init", "parameters": [], "returnType": { - "_": "VoidType" + "_": "UnknownType" } }, - "modifiers": [ - "PublicKeyword", - "AbstractKeyword" - ], + "modifiers": [], "typeParameters": [], "body": { - "locals": [ - { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } - } - } - ], + "locals": [], "cfg": { "blocks": [ { @@ -6597,10 +9744,7 @@ "_": "Local", "name": "this", "type": { - "_": "ClassType", - "signature": { - "name": "Animal" - } + "_": "UnknownType" } }, "right": { @@ -6608,7 +9752,7 @@ "type": { "_": "ClassType", "signature": { - "name": "Animal" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } } @@ -6621,71 +9765,25 @@ ] } } - } - ] - }, - { - "signature": { - "name": "StringValidator" - }, - "modifiers": [ - "ExportKeyword" - ], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "StringValidator" - }, - "name": "color", - "type": { - "_": "StringType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": true, - "exclamationToken": false, - "initializer": null }, { "signature": { "enclosingClass": { - "name": "StringValidator" - }, - "name": "width", - "type": { - "_": "NumberType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": true, - "exclamationToken": false, - "initializer": null - } - ], - "methods": [ - { - "signature": { - "enclosingClass": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" }, - "name": "isAcceptable", + "name": "constructor", "parameters": [ { - "name": "s", + "name": "value", "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" }, - "isOptional": true + "isOptional": false } ], "returnType": { - "_": "BooleanType" + "_": "UnknownType" } }, "modifiers": [], @@ -6697,14 +9795,15 @@ "type": { "_": "ClassType", "signature": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, { - "name": "s", + "name": "value", "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" } } ], @@ -6715,20 +9814,46 @@ "successors": [], "predecessors": [], "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, { "_": "AssignStmt", "left": { "_": "Local", - "name": "s", + "name": "value", "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" } }, "right": { "_": "ParameterRef", "index": 0, "type": { - "_": "StringType" + "_": "UnclearReferenceType", + "name": "Type" } } }, @@ -6740,7 +9865,7 @@ "type": { "_": "ClassType", "signature": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" } } }, @@ -6749,9 +9874,42 @@ "type": { "_": "ClassType", "signature": { - "name": "StringValidator" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-8" + } + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "content", + "type": { + "_": "UnknownType" } } + }, + "right": { + "_": "Local", + "name": "value", + "type": { + "_": "UnclearReferenceType", + "name": "Type" + } } }, { @@ -6767,7 +9925,7 @@ }, { "signature": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, "modifiers": [], "typeParameters": [], @@ -6777,9 +9935,9 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "type", + "name": "x", "type": { "_": "UnknownType" } @@ -6787,55 +9945,14 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'pattern'", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-4" - }, - "name": "pattern", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'[%d] [%p] [%z] [ArkAnalyzer] - %m'", - "type": { - "_": "StringType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-3" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-3" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "type", + "name": "y", "type": { "_": "UnknownType" } @@ -6843,60 +9960,14 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'console'", - "type": { - "_": "StringType" - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-3" - }, - "name": "layout", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-4" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-4" - } - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-2" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-2" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "console", + "name": "z", "type": { "_": "UnknownType" } @@ -6904,62 +9975,151 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-3" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-3" - } - } - } + "exclamationToken": false } ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-6" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ + "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-6" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "appenders", - "type": { + "name": "@instance_init", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "'console'", - "type": { - "_": "StringType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ + "body": { + "locals": [], + "cfg": { + "blocks": [ { - "_": "StringType" + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "u", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "y", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "v", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "z", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "w", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] } ] } @@ -6968,92 +10128,82 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-6" - }, - "name": "level", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "'info'", - "type": { - "_": "StringType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-6" - }, - "name": "enableCallStack", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "false", - "type": { - "_": "BooleanType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-5" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-5" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" }, - "name": "default", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-6" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-6" - } + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-listParameters-9" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] } } } - ], - "methods": [] + ] }, { "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, "modifiers": [], "typeParameters": [], @@ -7063,9 +10213,9 @@ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "appenders", + "name": "a", "type": { "_": "UnknownType" } @@ -7073,26 +10223,14 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-2" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-2" - } - } - } + "exclamationToken": false }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-1" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "categories", + "name": "b", "type": { "_": "UnknownType" } @@ -7100,72 +10238,17 @@ "modifiers": [], "typeParameters": [], "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ObjectLiteralExpr", - "anonymousClass": { - "name": "AnonymousClass-5" - }, - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-5" - } - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - }, - "modifiers": [], - "typeParameters": [ - { - "_": "UNKNOWN_TYPE", - "type": "Type" - } - ], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - }, - "name": "content", - "type": { - "_": "UnclearReferenceType", - "name": "Type" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": null + "exclamationToken": false } ], "methods": [ { "signature": { "enclosingClass": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "constructor", - "parameters": [ - { - "name": "value", - "type": { - "_": "UnclearReferenceType", - "name": "Type" - }, - "isOptional": false - } - ], + "name": "@instance_init", + "parameters": [], "returnType": { "_": "UnknownType" } @@ -7175,19 +10258,13 @@ "body": { "locals": [ { - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } - } - }, - { - "name": "value", + "name": "$temp0", "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } ], @@ -7201,41 +10278,146 @@ { "_": "AssignStmt", "left": { - "_": "Local", - "name": "value", + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + }, + "name": "a", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "42", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "NumberType" + }, + "size": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "NumberType" } }, "right": { - "_": "ParameterRef", - "index": 0, + "_": "Constant", + "value": "5", "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "NumberType" } } }, { "_": "AssignStmt", "left": { - "_": "Local", - "name": "this", - "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "NumberType" } }, "right": { - "_": "ThisRef", + "_": "Constant", + "value": "100", "type": { - "_": "ClassType", - "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" - } + "_": "NumberType" } } }, @@ -7249,15 +10431,15 @@ "type": { "_": "ClassType", "signature": { - "name": "AnonymousClass-_DEFAULT_ARK_METHOD-7" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" } } }, "field": { "enclosingClass": { - "name": "" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "content", + "name": "b", "type": { "_": "UnknownType" } @@ -7265,10 +10447,13 @@ }, "right": { "_": "Local", - "name": "value", + "name": "$temp0", "type": { - "_": "UnclearReferenceType", - "name": "Type" + "_": "ArrayType", + "elementType": { + "_": "NumberType" + }, + "dimensions": 1 } } }, @@ -7280,165 +10465,82 @@ ] } } - } - ] - }, - { - "signature": { - "name": "AnonymousClass-listParameters-8" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-listParameters-8" - }, - "name": "x", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "u", - "type": { - "_": "UnknownType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-listParameters-8" - }, - "name": "y", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "v", - "type": { - "_": "UnknownType" - } - } }, { "signature": { "enclosingClass": { - "name": "AnonymousClass-listParameters-8" + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" }, - "name": "z", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Local", - "name": "w", - "type": { - "_": "UnknownType" - } - } - } - ], - "methods": [] - }, - { - "signature": { - "name": "AnonymousClass-deleteTest-9" - }, - "modifiers": [], - "typeParameters": [], - "superClassName": "", - "implementedInterfaceNames": [], - "fields": [ - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-deleteTest-9" - }, - "name": "a", - "type": { - "_": "UnknownType" - } - }, - "modifiers": [], - "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "Constant", - "value": "42", - "type": { - "_": "NumberType" - } - } - }, - { - "signature": { - "enclosingClass": { - "name": "AnonymousClass-deleteTest-9" - }, - "name": "b", - "type": { + "name": "constructor", + "parameters": [], + "returnType": { "_": "UnknownType" } }, "modifiers": [], "typeParameters": [], - "questionToken": false, - "exclamationToken": false, - "initializer": { - "_": "ArrayLiteralExpr", - "elements": [ - { - "_": "Constant", - "value": "5", - "type": { - "_": "NumberType" - } - }, - { - "_": "Constant", - "value": "100", - "type": { - "_": "NumberType" - } - } - ], - "type": { - "_": "UnionType", - "types": [ - { - "_": "NumberType" - }, + "body": { + "locals": [], + "cfg": { + "blocks": [ { - "_": "NumberType" + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-deleteTest-10" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] } ] } } } - ], - "methods": [] + ] } ], "importInfos": [ @@ -7467,7 +10569,6 @@ { "exportClauseName": "classMethodTest", "exportClauseType": 2, - "nameBeforeAs": "classMethodTest", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7480,7 +10581,6 @@ { "exportClauseName": "foo", "exportClauseType": 2, - "nameBeforeAs": "foo", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7493,7 +10593,6 @@ { "exportClauseName": "listParameters", "exportClauseType": 2, - "nameBeforeAs": "listParameters", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7506,7 +10605,6 @@ { "exportClauseName": "SecurityDoor", "exportClauseType": 1, - "nameBeforeAs": "SecurityDoor", "isDefault": false, "modifiers": [ "ExportKeyword" @@ -7524,7 +10622,7 @@ "DefaultKeyword" ], "originTsPosition": { - "line": 199, + "line": 200, "col": 1 } }, @@ -7536,7 +10634,7 @@ "ExportKeyword" ], "originTsPosition": { - "line": 200, + "line": 201, "col": 1 } }, @@ -7548,44 +10646,40 @@ "ExportKeyword" ], "originTsPosition": { - "line": 201, + "line": 202, "col": 1 } }, { "exportClauseName": "StringValidator", "exportClauseType": 1, - "nameBeforeAs": "StringValidator", "isDefault": false, "modifiers": [ "ExportKeyword" ], "originTsPosition": { - "line": 202, + "line": 203, "col": 1 } }, { "exportClauseName": "ExtAdder", "exportClauseType": 4, - "exportFrom": "", "nameBeforeAs": "ExtendedAdder", "isDefault": false, "modifiers": [], "originTsPosition": { - "line": 207, + "line": 208, "col": 1 } }, { "exportClauseName": "ExtendedAdder", "exportClauseType": 4, - "exportFrom": "", - "nameBeforeAs": "ExtendedAdder", "isDefault": false, "modifiers": [], "originTsPosition": { - "line": 207, + "line": 208, "col": 1 } } diff --git a/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json new file mode 100644 index 000000000..9ea70d8af --- /dev/null +++ b/jacodb-ets/src/test/resources/etsir/samples/save/enums.ts.json @@ -0,0 +1,2206 @@ +{ + "name": "save/enums.ts", + "namespaces": [], + "classes": [ + { + "signature": { + "name": "_DEFAULT_ARK_CLASS" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "_DEFAULT_ARK_CLASS" + }, + "name": "_DEFAULT_ARK_METHOD", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + { + "name": "ALL_BUILD_STAGE", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + { + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + { + "name": "systemComponent", + "type": { + "_": "UnknownType" + } + }, + { + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + }, + { + "name": "nameOfsystemComponent", + "type": { + "_": "UnknownType" + } + }, + { + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + { + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + { + "name": "Object", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp5", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + { + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + { + "name": "$temp8", + "type": { + "_": "BooleanType" + } + }, + { + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + { + "name": "key", + "type": { + "_": "UnknownType" + } + }, + { + "name": "value", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp11", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp12", + "type": { + "_": "UnknownType" + } + }, + { + "name": "console", + "type": { + "_": "UnknownType" + } + }, + { + "name": "$temp13", + "type": { + "_": "BooleanType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [ + 1 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "_DEFAULT_ARK_CLASS" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "SceneBuildStage", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "METHOD_DONE", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "NewArrayExpr", + "elementType": { + "_": "UnknownType" + }, + "size": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "$temp1", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "$temp2", + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "ALL_BUILD_STAGE", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "Local", + "name": "$temp3", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "systemComponent", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "SystemComponent", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "nameOfsystemComponent", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "systemComponent", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "right": { + "_": "NewExpr", + "classType": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "right": { + "_": "Local", + "name": "$temp4", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "Object", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "entries", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Local", + "name": "ViewTreeNodeType", + "type": { + "_": "UnknownType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp5", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "iterator", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "args": [] + } + } + ] + }, + { + "id": 1, + "successors": [ + 2, + 5 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "$temp6", + "type": { + "_": "ClassType", + "signature": { + "name": "Iterator" + } + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "next", + "parameters": [], + "returnType": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "args": [] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "BooleanType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "done", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "==", + "left": { + "_": "Local", + "name": "$temp8", + "type": { + "_": "BooleanType" + } + }, + "right": { + "_": "Constant", + "value": "true", + "type": { + "_": "BooleanType" + } + }, + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 2, + "successors": [ + 3, + 4 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp11", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "hasOwnProperty", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "SystemComponent", + "type": { + "_": "StringType" + } + } + ] + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp12", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "UnopExpr", + "op": "!", + "arg": { + "_": "Local", + "name": "$temp11", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "IfStmt", + "condition": { + "_": "ConditionExpr", + "op": "!=", + "left": { + "_": "Local", + "name": "$temp12", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "BooleanType" + } + } + } + ] + }, + { + "id": 3, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp13", + "type": { + "_": "BooleanType" + } + }, + "right": { + "_": "DeleteExpr", + "arg": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "'x'", + "type": { + "_": "UnknownType" + } + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + }, + { + "id": 4, + "successors": [ + 3 + ], + "predecessors": [], + "stmts": [ + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "console", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "" + }, + "name": "log", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [ + { + "_": "Constant", + "value": "error", + "type": { + "_": "StringType" + } + } + ] + } + } + ] + }, + { + "id": 5, + "successors": [ + 1 + ], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp7", + "type": { + "_": "ClassType", + "signature": { + "name": "IteratorResult" + } + } + }, + "field": { + "enclosingClass": { + "name": "IteratorResult" + }, + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "right": { + "_": "CastExpr", + "arg": { + "_": "Local", + "name": "$temp9", + "type": { + "_": "UnknownType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "key", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ArrayRef", + "array": { + "_": "Local", + "name": "$temp10", + "type": { + "_": "ArrayType", + "elementType": { + "_": "UnknownType" + }, + "dimensions": 1 + } + }, + "index": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "type": { + "_": "UnknownType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "obj", + "type": { + "_": "UnclearReferenceType", + "name": "Object" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "key", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Local", + "name": "value", + "type": { + "_": "UnknownType" + } + } + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "SceneBuildStage" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "METHOD_DONE", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "ALL", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [ + { + "name": "$temp0", + "type": { + "_": "StringType" + } + } + ], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "BinopExpr", + "op": "<<", + "left": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "BinopExpr", + "op": "<<", + "left": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "METHOD_DONE", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "BinopExpr", + "op": "|", + "left": { + "_": "Local", + "name": "BUILD_INIT", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "Local", + "name": "CLASS_DONE", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "StringType" + } + }, + "right": { + "_": "Constant", + "value": "all", + "type": { + "_": "StringType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "SceneBuildStage" + } + } + }, + "field": { + "enclosingClass": { + "name": "SceneBuildStage" + }, + "name": "ALL", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "$temp0", + "type": { + "_": "StringType" + } + }, + "field": { + "enclosingClass": { + "name": "" + }, + "name": "length", + "type": { + "_": "UnknownType" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "ValueTag" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "ValueTag" + }, + "name": "TAINT", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ValueTag" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ValueTag" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "ExportType" + }, + "modifiers": [ + "ExportKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "NAME_SPACE", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "CLASS", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "METHOD", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "LOCAL", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "UNKNOWN", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "NAME_SPACE", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "0", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "CLASS", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "METHOD", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "2", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "LOCAL", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "3", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "ExportType" + } + } + }, + "field": { + "enclosingClass": { + "name": "ExportType" + }, + "name": "UNKNOWN", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "4", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "ViewTreeNodeType" + }, + "modifiers": [ + "DeclareKeyword" + ], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "SystemComponent", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "CustomComponent", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "Builder", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + }, + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "BuilderParam", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [ + "StaticKeyword" + ], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "ViewTreeNodeType" + }, + "name": "@static_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "ViewTreeNodeType" + } + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + }, + { + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "modifiers": [], + "typeParameters": [], + "superClassName": "", + "implementedInterfaceNames": [], + "fields": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "questionToken": false, + "exclamationToken": false + } + ], + "methods": [ + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "AssignStmt", + "left": { + "_": "InstanceFieldRef", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + }, + "field": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "x", + "type": { + "_": "UnknownType" + } + } + }, + "right": { + "_": "Constant", + "value": "1", + "type": { + "_": "NumberType" + } + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + }, + { + "signature": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "constructor", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "modifiers": [], + "typeParameters": [], + "body": { + "locals": [], + "cfg": { + "blocks": [ + { + "id": 0, + "successors": [], + "predecessors": [], + "stmts": [ + { + "_": "AssignStmt", + "left": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "right": { + "_": "ThisRef", + "type": { + "_": "ClassType", + "signature": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + } + } + } + }, + { + "_": "CallStmt", + "expr": { + "_": "InstanceCallExpr", + "instance": { + "_": "Local", + "name": "this", + "type": { + "_": "UnknownType" + } + }, + "method": { + "enclosingClass": { + "name": "AnonymousClass-_DEFAULT_ARK_CLASS-_DEFAULT_ARK_METHOD-0" + }, + "name": "@instance_init", + "parameters": [], + "returnType": { + "_": "UnknownType" + } + }, + "args": [] + } + }, + { + "_": "ReturnVoidStmt" + } + ] + } + ] + } + } + } + ] + } + ], + "importInfos": [], + "exportInfos": [ + { + "exportClauseName": "ValueTag", + "exportClauseType": 1, + "isDefault": false, + "modifiers": [ + "ExportKeyword" + ], + "originTsPosition": { + "line": 14, + "col": 1 + } + }, + { + "exportClauseName": "ExportType", + "exportClauseType": 1, + "isDefault": false, + "modifiers": [ + "ExportKeyword" + ], + "originTsPosition": { + "line": 18, + "col": 1 + } + } + ] +} \ No newline at end of file diff --git a/jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts b/jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts deleted file mode 100644 index ba726bcd3..000000000 --- a/jacodb-ets/src/test/resources/samples/DataFlowSecurity.ts +++ /dev/null @@ -1,29 +0,0 @@ -function source(): number { - return null -} - -function pass(data: boolean) { - return data -} - -function validate(data) { - if (data == null) return "OK" - return data -} - -function sink(data) { - if (data == null) throw new Error("Error!") -} - -function bad() { - let data = source() - // @ts-ignore - data = pass(data) - sink(data) -} - -function good() { - let data = source() - data = validate(data) - sink(data) -} diff --git a/jacodb-ets/src/test/resources/samples/DefaultConstructor.ts b/jacodb-ets/src/test/resources/samples/DefaultConstructor.ts deleted file mode 100644 index 4146eab96..000000000 --- a/jacodb-ets/src/test/resources/samples/DefaultConstructor.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - x: number = 99 -} diff --git a/jacodb-ets/src/test/resources/samples/PrependInitializer.ts b/jacodb-ets/src/test/resources/samples/PrependInitializer.ts deleted file mode 100644 index e2dbaddeb..000000000 --- a/jacodb-ets/src/test/resources/samples/PrependInitializer.ts +++ /dev/null @@ -1,18 +0,0 @@ -class Foo { - constructor() { - console.log("new Foo"); - } - - foo() { - Foo.y = 112; - console.log('print-foo'); - } - - static bar() { - this.y = 111; - console.log('print-bar') - } - - x: number = 99 - static y: number = 109 -} diff --git a/jacodb-ets/src/test/resources/samples/StaticField.ts b/jacodb-ets/src/test/resources/samples/StaticField.ts deleted file mode 100644 index beeb26ce0..000000000 --- a/jacodb-ets/src/test/resources/samples/StaticField.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - constructor() { - } - - static y: number = 109 -} diff --git a/jacodb-ets/src/test/resources/samples/taint.ts b/jacodb-ets/src/test/resources/samples/TaintAnalysis.ts similarity index 59% rename from jacodb-ets/src/test/resources/samples/taint.ts rename to jacodb-ets/src/test/resources/samples/TaintAnalysis.ts index 7b245f285..ea6ee035b 100644 --- a/jacodb-ets/src/test/resources/samples/taint.ts +++ b/jacodb-ets/src/test/resources/samples/TaintAnalysis.ts @@ -1,26 +1,30 @@ -function source(): number|null { +function source(): number | null { return null; } -function pass(data: number|null): number|null { + +function pass(data: number | null): number | null { return data; } -function validate(data: number|null): number { + +function validate(data: number | null): number { if (data == null) { return 0; } return data; } -function sink(data: number|null) { + +function sink(data: number | null) { if (data == null) { - new Error('Error!'); - throw $temp0 + throw new Error("Error!"); } } + function bad() { let data = source(); data = pass(data); sink(data); } + function good() { let data = source(); data = validate(data); diff --git a/jacodb-ets/src/test/resources/samples/classes/FieldInitializers.ts b/jacodb-ets/src/test/resources/samples/classes/FieldInitializers.ts new file mode 100644 index 000000000..b85051440 --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/classes/FieldInitializers.ts @@ -0,0 +1,19 @@ +class Foo { + x: number = 99 + + static y: number = 111 + + constructor() { + console.log("inside Foo::constructor"); + } + + foo() { + Foo.y = 222; + console.log('inside Foo::foo'); + } + + static bar() { + this.y = 333; + console.log('inside Foo::bar') + } +} diff --git a/jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts b/jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts new file mode 100644 index 000000000..e8f4ee2c2 --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/classes/NestedInitializer.ts @@ -0,0 +1,7 @@ +class Bar {} + +class Foo { + bar: Bar = new Bar(); +} + +let foo = new Foo(); diff --git a/jacodb-ets/src/test/resources/samples/enums.ts b/jacodb-ets/src/test/resources/samples/enums.ts deleted file mode 100644 index 32910152b..000000000 --- a/jacodb-ets/src/test/resources/samples/enums.ts +++ /dev/null @@ -1,104 +0,0 @@ -let $temp0: any; -let c: Circle; -let a2: any; -let nameOfA: any; -let directions: (any)[]; -let $temp1: any; -let $temp2: any; -let $temp3: any; -let $temp4: any; -let $temp5: (any)[]; - -$temp0 = Response1.Yes; -respond('Princess Caroline',$temp0); -c = @save/enums: AnonymousClass-enums.ts-1; -f(E); -a2 = Enum.A; -nameOfA = Enum.a2; -$temp1 = Directions.Up; -$temp2 = Directions.Down; -$temp3 = Directions.Left; -$temp4 = Directions.Right; -$temp5 = new Array(1); -directions = $temp5; -return; -enum Direction1{ - Up, - Down, - Left, - Right, -} -enum Direction2{ - Up, - Down, - Left, - Right, -} -enum BooleanLikeHeterogeneousEnum{ - No, - Yes, -} -enum E1{ - X, - Y, - Z, -} -enum E2{ - A, - B, - C, -} -enum FileAccess{ - None, - Read, - Write, - ReadWrite, - G, -} -enum Response1{ - No, - Yes, -} -function respond(recipient: string,message: Response1): void { - - - - return; -} -enum ShapeKind{ - Circle, - Square, -} -interface Circle{ - kind:ShapeKind.Circle; - radius:number; -} -interface Square{ - kind:ShapeKind.Square; - sideLength:number; -} -object AnonymousClass-enums.ts-1{ - kind; - radius; -} -enum E{ - X, - Y, - Z, -} -function f(obj: any){ - let $temp0: any; - - - $temp0 = obj.X; - return $temp0; -} -declare enum Enum{ - A, -} -const enum Directions{ - Up, - Down, - Left, - Right, -} diff --git a/jacodb-ets/src/test/resources/samples/lang/in.ts b/jacodb-ets/src/test/resources/samples/lang/in.ts new file mode 100644 index 000000000..7d1793cfc --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/lang/in.ts @@ -0,0 +1,8 @@ +class Cat { + constructor(public name: string) { + } +} + +let cat = new Cat("Barsik"); +let catHasName = "name" in cat; // true +let catHasMeow = "meow" in cat; // false diff --git a/jacodb-ets/src/test/resources/samples/lang/instanceof.ts b/jacodb-ets/src/test/resources/samples/lang/instanceof.ts new file mode 100644 index 000000000..0f3a0427f --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/lang/instanceof.ts @@ -0,0 +1,5 @@ +class Cat { +} + +let x = new Cat(); +console.log(x instanceof Cat); // true diff --git a/jacodb-ets/src/test/resources/samples/object.ts b/jacodb-ets/src/test/resources/samples/lang/object.ts similarity index 100% rename from jacodb-ets/src/test/resources/samples/object.ts rename to jacodb-ets/src/test/resources/samples/lang/object.ts diff --git a/jacodb-ets/src/test/resources/samples/basic.ts b/jacodb-ets/src/test/resources/samples/save/basic.ts similarity index 99% rename from jacodb-ets/src/test/resources/samples/basic.ts rename to jacodb-ets/src/test/resources/samples/save/basic.ts index c152b5911..09bf3ea36 100644 --- a/jacodb-ets/src/test/resources/samples/basic.ts +++ b/jacodb-ets/src/test/resources/samples/save/basic.ts @@ -151,6 +151,7 @@ export function listParameters(u: number, v: number, w: string): { x: number, y: export class SecurityDoor extends Door implements Alarm, Alarm2 { x: number = 0; y: string = ''; + z: Person = new Person(10); alert(): void { logger.info("SecurityDoor alert"); } diff --git a/jacodb-ets/src/test/resources/samples/save/enums.ts b/jacodb-ets/src/test/resources/samples/save/enums.ts new file mode 100644 index 000000000..375202b3d --- /dev/null +++ b/jacodb-ets/src/test/resources/samples/save/enums.ts @@ -0,0 +1,45 @@ +enum SceneBuildStage { + BUILD_INIT = 1 << 1, + CLASS_DONE = 1 << 2, + METHOD_DONE = BUILD_INIT | CLASS_DONE, + ALL = 'all'.length, +} + +const ALL_BUILD_STAGE = [ + SceneBuildStage.BUILD_INIT, + SceneBuildStage.CLASS_DONE, + SceneBuildStage.METHOD_DONE, +]; + +export enum ValueTag { + TAINT, +} + +export enum ExportType { + NAME_SPACE = 0, + CLASS = 1, + METHOD = 2, + LOCAL = 3, + UNKNOWN = 4, +} + +declare enum ViewTreeNodeType { + SystemComponent, + CustomComponent, + Builder, + BuilderParam, +} + +let systemComponent = ViewTreeNodeType.SystemComponent; +let nameOfsystemComponent = ViewTreeNodeType[systemComponent]; + +let obj: Object = { x: 1 }; +for (const [key, value] of Object.entries(ViewTreeNodeType)) { + obj[key] = value; +} + +if (!obj.hasOwnProperty('SystemComponent')) { + console.log('error'); +} + +delete obj['x']; diff --git a/jacodb-ets/src/test/resources/structure.txt b/jacodb-ets/src/test/resources/structure.txt new file mode 100644 index 000000000..fff9e895f --- /dev/null +++ b/jacodb-ets/src/test/resources/structure.txt @@ -0,0 +1,38 @@ +resources/ # +├── source/ # Sample source (TS/ETS) files +│ ├── *.ts # +│ └── *.ets # +├── etsir/ # EtsIR (JSON dump of ArkIR for ETS sources) for samples +│ └── *.ts.json # +├── abc/ # Compiled samples (ABC) +│ └── *.abc # +├── abcir/ # AbcIR (JSON dump of ArkIR for ABC inputs) for samples +│ └── *.abc.json # +├── dot/ # DOT files for visualizing IRs +│ ├── *.ts.json.dot # +│ └── *.abc.json.dot # +├── pdf/ # Rendered PDFs from DOT files +│ └── *.ts.json.pdf # +│ └── *.abc.json.pdf # +│ # +└── projects/ # Directory for individual projects + ├── projects.txt # List of projects and their URLs + ├── / # Some individual project + │ ├── README.md # + │ ├── source/ # TS/ETS files for the project + │ │ ├── *.ts # (note: can be an actual git repo) + │ │ └── *.ets # (note: typically, deeply nested) + │ ├── etsir/ # JSON dump of ArkIR for TS files in the project + │ │ └── *.ts.json # + │ ├── hap/ # HAP files for the project + │ │ └── *.hap # + │ ├── abc/ # Compiled ABC files (or extracted from HAP) for the project + │ │ └── *.abc # + │ ├── abcir/ # IR for ABC files for the project + │ │ └── *.abc.json # + │ ├── dot/ # DOT files for visualizing IRs for the project + │ │ └── *.dot # + │ └── pdf/ # Rendered PDFs from DOT files for the project + │ └── *.pdf # + ├── / # + ...