generate pseudocode for functions in local classes

#KT-4405 In progress
 #KT-3501 Fixed
This commit is contained in:
Svetlana Isakova
2014-01-17 18:12:18 +04:00
parent f74fbf9f8b
commit 5ef320173c
9 changed files with 183 additions and 12 deletions
@@ -0,0 +1,113 @@
== f ==
fun f() {
class LocalClass() {
fun f() {
val x = ""
fun loc() {
val x3 = ""
}
}
}
}
---------------------
L0:
<START>
mark({ class LocalClass() { fun f() { val x = "" fun loc() { val x3 = "" } } } })
jmp?(L2) NEXT:[<END>, d(fun f() { val x = "" fun loc() { val x3 = "" } })]
d(fun f() { val x = "" fun loc() { val x3 = "" } }) NEXT:[<SINK>]
L1:
L2:
<END> NEXT:[<SINK>] PREV:[jmp?(L2)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(fun f() { val x = "" fun loc() { val x3 = "" } })]
L3:
<START>
mark({ val x = "" fun loc() { val x3 = "" } })
v(val x = "")
mark("")
r("")
w(x)
jmp?(L5) NEXT:[<END>, d(fun loc() { val x3 = "" })]
d(fun loc() { val x3 = "" }) NEXT:[<SINK>]
L4:
L5:
<END> NEXT:[<SINK>] PREV:[jmp?(L5)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(fun loc() { val x3 = "" })]
L6:
<START>
mark({ val x3 = "" })
v(val x3 = "")
mark("")
r("")
w(x3)
L7:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== f ==
fun f() {
val x = ""
fun loc() {
val x3 = ""
}
}
---------------------
L3:
<START>
mark({ val x = "" fun loc() { val x3 = "" } })
v(val x = "")
mark("")
r("")
w(x)
jmp?(L5) NEXT:[<END>, d(fun loc() { val x3 = "" })]
d(fun loc() { val x3 = "" }) NEXT:[<SINK>]
L4:
L5:
<END> NEXT:[<SINK>] PREV:[jmp?(L5)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(fun loc() { val x3 = "" })]
L6:
<START>
mark({ val x3 = "" })
v(val x3 = "")
mark("")
r("")
w(x3)
L7:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== loc ==
fun loc() {
val x3 = ""
}
---------------------
L6:
<START>
mark({ val x3 = "" })
v(val x3 = "")
mark("")
r("")
w(x3)
L7:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
+11
View File
@@ -0,0 +1,11 @@
fun f() {
class LocalClass() {
fun f() {
val x = ""
fun loc() {
val x3 = ""
}
}
}
}