Pseudocode: Implement computation of expected type predicates

This commit is contained in:
Alexey Sedunov
2014-06-23 14:02:22 +04:00
parent 50228fa085
commit 5e2c2b4eca
87 changed files with 1154 additions and 803 deletions
@@ -0,0 +1,65 @@
== Bar ==
class Bar {
}
---------------------
L0:
1 <START>
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== Foo ==
class Foo() {
fun Bar.invoke() {}
}
---------------------
L0:
1 <START>
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== invoke ==
fun Bar.invoke() {}
---------------------
L0:
1 <START>
2 mark({})
read (Unit)
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== foobar ==
fun foobar(f: Foo) {
Bar().f()
}
---------------------
L0:
1 <START>
v(f: Foo)
magic(f: Foo) -> <v0>
w(f|<v0>)
2 mark({ Bar().f() })
mark(Bar().f())
r(f) -> <v1>
mark(Bar())
call(Bar, <init>) -> <v2>
mark(f())
call(f, invoke|<v1>, <v2>) -> <v3>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================