commit 27bddcd2a4b08dde73812ebc42cf28d3e78e297e Author: Pavel Talanov Date: Wed Nov 2 15:38:44 2011 +0400 initial commit diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 00000000000..09b0cd3eaf8 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2js \ No newline at end of file diff --git a/.idea/ant.xml b/.idea/ant.xml new file mode 100644 index 00000000000..2581ca3fe84 --- /dev/null +++ b/.idea/ant.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000000..a1b41c52c72 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000000..3572571ad83 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000000..e206d70d859 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/libraries/guava_10_0_1.xml b/.idea/libraries/guava_10_0_1.xml new file mode 100644 index 00000000000..4aa7ba867e9 --- /dev/null +++ b/.idea/libraries/guava_10_0_1.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 00000000000..07e08852a4c --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000000..b60725bcb96 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + http://www.w3.org/1999/xhtml + + + + + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000000..f3a426e5e8c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000000..922003b8433 --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 00000000000..3b000203088 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000000..def6a6a1845 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000000..1f331a79f5a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,953 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + + + 1319812241928 + 1319812241928 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android + + + + + + + + guava-10.0.1 + + + + + + + + IDEA IC-110.283 + + + + + + + + k2js + + + + + + + + 1.6 + + + + + + + + lib + + + + + + + + + diff --git a/k2js.iml b/k2js.iml new file mode 100644 index 00000000000..76d429039ae --- /dev/null +++ b/k2js.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/lib/guava-10.0.1.jar b/lib/guava-10.0.1.jar new file mode 100644 index 00000000000..d107c0f3b0c Binary files /dev/null and b/lib/guava-10.0.1.jar differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$1.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$1.class new file mode 100644 index 00000000000..577b97fd522 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$1.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$2.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$2.class new file mode 100644 index 00000000000..328f585e8af Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$2.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.class new file mode 100644 index 00000000000..5e65943d811 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassDescriptor.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassDescriptor.class new file mode 100644 index 00000000000..cdb6c9242d8 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassDescriptor.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.class new file mode 100644 index 00000000000..052a39ec656 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDefaultImports$1.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDefaultImports$1.class new file mode 100644 index 00000000000..3388fa7201d Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDefaultImports$1.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDefaultImports.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDefaultImports.class new file mode 100644 index 00000000000..c603113c44a Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDefaultImports.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1.class new file mode 100644 index 00000000000..6fda58246b3 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$2.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$2.class new file mode 100644 index 00000000000..875e20eaaec Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$2.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.class new file mode 100644 index 00000000000..d4bf81d5e7a Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaNamespaceDescriptor.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaNamespaceDescriptor.class new file mode 100644 index 00000000000..a1d12117edc Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaNamespaceDescriptor.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.class new file mode 100644 index 00000000000..760c6a3a4ab Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaSemanticServices.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaSemanticServices.class new file mode 100644 index 00000000000..1dd39802d71 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaSemanticServices.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$1.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$1.class new file mode 100644 index 00000000000..237854b3ba1 Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$1.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$2.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$2.class new file mode 100644 index 00000000000..da8a8b3e3af Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$2.class differ diff --git a/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.class b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.class new file mode 100644 index 00000000000..621a776607d Binary files /dev/null and b/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.class differ diff --git a/out/production/frontend/jet/Library.jet b/out/production/frontend/jet/Library.jet new file mode 100644 index 00000000000..b88e5eb0287 --- /dev/null +++ b/out/production/frontend/jet/Library.jet @@ -0,0 +1,670 @@ +namespace jet + +namespace typeinfo { + class TypeInfo { + fun isSubtypeOf(other : TypeInfo<*>) : Boolean + fun isInstance(obj : Any?) : Boolean + } + + fun typeinfo() : TypeInfo + fun typeinfo(expression : T) : TypeInfo +} + +namespace io { + fun print(message : Any?) + fun print(message : Int) + fun print(message : Long) + fun print(message : Byte) + fun print(message : Short) + fun print(message : Char) + fun print(message : Boolean) + fun print(message : Float) + fun print(message : Double) + + fun println(message : Any?) + fun println(message : Int) + fun println(message : Long) + fun println(message : Byte) + fun println(message : Short) + fun println(message : Char) + fun println(message : Boolean) + fun println(message : Float) + fun println(message : Double) + + fun readLine() : String? +} + +// Can't write a body due to a bootstrapping problem (see JET-74) +fun Any?.equals(other : Any?) : Boolean// = this === other + +// Returns "null" for null +fun Any?.toString() : String// = this === other + +fun String?.plus(other: Any?) : String + +trait Iterator { + fun next() : T + val hasNext : Boolean +} + +trait Iterable { + fun iterator() : Iterator +} + +class Array(val size : Int, init : fun(Int) : T = null ) { + fun get(index : Int) : T + fun set(index : Int, value : T) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class ByteArray(val size : Int) { + fun get(index : Int) : Byte + fun set(index : Int, value : Byte) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class ShortArray(val size : Int) { + fun get(index : Int) : Short + fun set(index : Int, value : Short) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class IntArray(val size : Int) { + fun get(index : Int) : Int + fun set(index : Int, value : Int) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class LongArray(val size : Int) { + fun get(index : Int) : Long + fun set(index : Int, value : Long) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class FloatArray(val size : Int) { + fun get(index : Int) : Float + fun set(index : Int, value : Float) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class DoubleArray(val size : Int) { + fun get(index : Int) : Double + fun set(index : Int, value : Double) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class CharArray(val size : Int) { + fun get(index : Int) : Char + fun set(index : Int, value : Char) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class BooleanArray(val size : Int) { + fun get(index : Int) : Boolean + fun set(index : Int, value : Boolean) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +trait Comparable { + fun compareTo(other : T) : Int +} + +trait Hashable { + fun hashCode() : Int + fun equals(other : Any?) : Boolean +} + +class Boolean : Comparable { + fun not() : Boolean + + fun xor(other : Boolean) : Boolean + + fun equals(other : Any?) : Boolean +} + +class String() : Comparable { + fun get(index : Int) : Char + val length : Int + + fun plus(other : Any?) : String + + fun equals(other : Any?) : Boolean + fun equalsIgnoreCase(other: String?) : Boolean + + fun substring(start: Int): String + fun substring(start: Int, end: Int): String + + fun startsWith(prefix: String, toffset: Int): Boolean + fun startsWith(prefix: String): Boolean + fun endsWith(suffix: String): Boolean + + fun trim(): String +} + +trait Range> { + fun contains(item : T) : Boolean +} + +class IntRange(val start : Int, size : Int, reversed : Boolean = false) : Range, Iterable { + fun iterator () : Iterator + + fun contains (elem: Int) : Boolean + + val size : Int + + val end : Int + + val reversed : Boolean +} + +class LongRange(val start : Long, size : Long, reversed : Boolean = false) : Range, Iterable { + fun iterator () : Iterator + + fun contains (elem: Long) : Boolean + + val size : Long + + val end : Long + + val reversed : Boolean +} + +abstract class Number : Hashable { + abstract val dbl : Double + abstract val flt : Float + abstract val lng : Long + abstract val int : Int + abstract val chr : Char + abstract val sht : Short + abstract val byt : Byte +// fun equals(other : Double) : Boolean +// fun equals(other : Float) : Boolean +// fun equals(other : Long) : Boolean +// fun equals(other : Byte) : Boolean +// fun equals(other : Int) : Boolean +// fun equals(other : Short) : Boolean +// fun equals(other : Char) : Boolean +} + +class Double : Number, Comparable { + override fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Double + fun plus(other : Long) : Double + fun plus(other : Int) : Double + fun plus(other : Short) : Double + fun plus(other : Byte) : Double + fun plus(other : Char) : Double + + fun minus(other : Double) : Double + fun minus(other : Float) : Double + fun minus(other : Long) : Double + fun minus(other : Int) : Double + fun minus(other : Short) : Double + fun minus(other : Byte) : Double + fun minus(other : Char) : Double + + fun times(other : Double) : Double + fun times(other : Float) : Double + fun times(other : Long) : Double + fun times(other : Int) : Double + fun times(other : Short) : Double + fun times(other : Byte) : Double + fun times(other : Char) : Double + + fun div(other : Double) : Double + fun div(other : Float) : Double + fun div(other : Long) : Double + fun div(other : Int) : Double + fun div(other : Short) : Double + fun div(other : Byte) : Double + fun div(other : Char) : Double + + fun mod(other : Double) : Double + fun mod(other : Float) : Double + fun mod(other : Long) : Double + fun mod(other : Int) : Double + fun mod(other : Short) : Double + fun mod(other : Byte) : Double + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : Range + fun rangeTo(other : Int) : Range + fun rangeTo(other : Short) : Range + fun rangeTo(other : Byte) : Range + fun rangeTo(other : Char) : Range + + fun inc() : Double + fun dec() : Double + fun plus() : Double + fun minus() : Double +} + +class Float : Number, Comparable { + fun compareTo(other : Double) : Int + override fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Float + fun plus(other : Int) : Float + fun plus(other : Short) : Float + fun plus(other : Byte) : Float + fun plus(other : Char) : Float + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Float + fun minus(other : Int) : Float + fun minus(other : Short) : Float + fun minus(other : Byte) : Float + fun minus(other : Char) : Float + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Float + fun times(other : Int) : Float + fun times(other : Short) : Float + fun times(other : Byte) : Float + fun times(other : Char) : Float + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Float + fun div(other : Int) : Float + fun div(other : Short) : Float + fun div(other : Byte) : Float + fun div(other : Char) : Float + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Float + fun mod(other : Int) : Float + fun mod(other : Short) : Float + fun mod(other : Byte) : Float + fun mod(other : Char) : Float + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : Range + fun rangeTo(other : Int) : Range + fun rangeTo(other : Short) : Range + fun rangeTo(other : Byte) : Range + fun rangeTo(other : Char) : Range + + fun inc() : Float + fun dec() : Float + fun plus() : Float + fun minus() : Float +} + +class Long : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + override fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Long + fun plus(other : Short) : Long + fun plus(other : Byte) : Long + fun plus(other : Char) : Long + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Long + fun minus(other : Short) : Long + fun minus(other : Byte) : Long + fun minus(other : Char) : Long + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Long + fun times(other : Short) : Long + fun times(other : Byte) : Long + fun times(other : Char) : Long + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Long + fun div(other : Short) : Long + fun div(other : Byte) : Long + fun div(other : Char) : Long + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Long + fun mod(other : Short) : Long + fun mod(other : Byte) : Long + fun mod(other : Char) : Long + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : LongRange + fun rangeTo(other : Short) : LongRange + fun rangeTo(other : Byte) : LongRange + fun rangeTo(other : Char) : LongRange + + fun inc() : Long + fun dec() : Long + fun plus() : Long + fun minus() : Long + + fun shl(bits : Int) : Long + fun shr(bits : Int) : Long + fun ushr(bits : Int) : Long + fun and(other : Long) : Long + fun or(other : Long) : Long + fun xor(other : Long) : Long + fun inv() : Long +} + +class Int : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + override fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Int + fun dec() : Int + fun plus() : Int + fun minus() : Int + + fun shl(bits : Int) : Int + fun shr(bits : Int) : Int + fun ushr(bits : Int) : Int + fun and(other : Int) : Int + fun or(other : Int) : Int + fun xor(other : Int) : Int + fun inv() : Int +} + +class Char : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + override fun compareTo(other : Char) : Int + fun compareTo(other : Byte) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Char + fun dec() : Char + fun plus() : Int + fun minus() : Int +} + +class Short : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + override fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Short + fun dec() : Short + fun plus() : Int + fun minus() : Int +} + +class Byte : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Char) : Int + override fun compareTo(other : Byte) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Byte + fun dec() : Byte + fun plus() : Int + fun minus() : Int +} diff --git a/out/production/frontend/org/jetbrains/jet/JetCoreEnvironment.class b/out/production/frontend/org/jetbrains/jet/JetCoreEnvironment.class new file mode 100644 index 00000000000..28bffdfc9d0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/JetCoreEnvironment.class differ diff --git a/out/production/frontend/org/jetbrains/jet/JetNodeType.class b/out/production/frontend/org/jetbrains/jet/JetNodeType.class new file mode 100644 index 00000000000..41d9ba4b60f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/JetNodeType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/JetNodeTypes.class b/out/production/frontend/org/jetbrains/jet/JetNodeTypes.class new file mode 100644 index 00000000000..9fccd2abbf8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/JetNodeTypes.class differ diff --git a/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$1.class b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$1.class new file mode 100644 index 00000000000..1fdc216c71b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosedRange.class b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosedRange.class new file mode 100644 index 00000000000..45170b634ff Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosedRange.class differ diff --git a/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDescriptor.class b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDescriptor.class new file mode 100644 index 00000000000..038dc624913 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDiffCallbacks.class b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDiffCallbacks.class new file mode 100644 index 00000000000..2be9b97bd0e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDiffCallbacks.class differ diff --git a/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil.class b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil.class new file mode 100644 index 00000000000..df820d45c50 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/JetSemanticServices.class b/out/production/frontend/org/jetbrains/jet/lang/JetSemanticServices.class new file mode 100644 index 00000000000..8d2e9795ec2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/JetSemanticServices.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/BlockInfo.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/BlockInfo.class new file mode 100644 index 00000000000..d250b88a4c5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/BlockInfo.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/BreakableBlockInfo.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/BreakableBlockInfo.class new file mode 100644 index 00000000000..a5a300142f3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/BreakableBlockInfo.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/GenerationTrigger.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/GenerationTrigger.class new file mode 100644 index 00000000000..9d580f0bbc7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/GenerationTrigger.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilder.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilder.class new file mode 100644 index 00000000000..72a0e912639 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilder.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilderAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilderAdapter.class new file mode 100644 index 00000000000..94e04f11f3f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilderAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataAnalyzeStrategy.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataAnalyzeStrategy.class new file mode 100644 index 00000000000..a5fdc30ab96 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataAnalyzeStrategy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionsMergeStrategy.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionsMergeStrategy.class new file mode 100644 index 00000000000..58ade569e2a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionsMergeStrategy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser.class new file mode 100644 index 00000000000..72ad7bd763d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$1.class new file mode 100644 index 00000000000..e45891174bf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$1.class new file mode 100644 index 00000000000..76c33f22617 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$2.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$2.class new file mode 100644 index 00000000000..3c3d3a73f5a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$3.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$3.class new file mode 100644 index 00000000000..6e3a4f165f3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor.class new file mode 100644 index 00000000000..1c1d03c9997 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.class new file mode 100644 index 00000000000..a0cab29075b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$1.class new file mode 100644 index 00000000000..c0d3b270230 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$2.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$2.class new file mode 100644 index 00000000000..470cec24488 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$3.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$3.class new file mode 100644 index 00000000000..35eb0111d71 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$4.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$4.class new file mode 100644 index 00000000000..3435accbb3a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$4.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$5.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$5.class new file mode 100644 index 00000000000..850bf0b47a6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$5.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$6.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$6.class new file mode 100644 index 00000000000..604b5b400b1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$6.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$7.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$7.class new file mode 100644 index 00000000000..34a9112f0e3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$7.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$InitializationPoints.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$InitializationPoints.class new file mode 100644 index 00000000000..501bfcfb86c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$InitializationPoints.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.class new file mode 100644 index 00000000000..ed724665639 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/Label.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/Label.class new file mode 100644 index 00000000000..0ce041257be Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/Label.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/LoopInfo.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/LoopInfo.class new file mode 100644 index 00000000000..b5955b13a3e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/LoopInfo.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/AbstractJumpInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/AbstractJumpInstruction.class new file mode 100644 index 00000000000..d76b7ed0a13 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/AbstractJumpInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ConditionalJumpInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ConditionalJumpInstruction.class new file mode 100644 index 00000000000..61e10a6ae41 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ConditionalJumpInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Instruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Instruction.class new file mode 100644 index 00000000000..ab34334e01e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Instruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionImpl.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionImpl.class new file mode 100644 index 00000000000..3a5d0ff188c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionVisitor.class new file mode 100644 index 00000000000..cfaf0e5030e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionWithNext.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionWithNext.class new file mode 100644 index 00000000000..e7d94a60d3c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionWithNext.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory$1.class new file mode 100644 index 00000000000..f610d72ec1c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory.class new file mode 100644 index 00000000000..46dd02f5744 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$1.class new file mode 100644 index 00000000000..4a9798be6c7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$JetControlFlowInstructionsGeneratorWorker.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$JetControlFlowInstructionsGeneratorWorker.class new file mode 100644 index 00000000000..69914db2382 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$JetControlFlowInstructionsGeneratorWorker.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$TryFinallyBlockInfo.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$TryFinallyBlockInfo.class new file mode 100644 index 00000000000..f70cd24298d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$TryFinallyBlockInfo.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator.class new file mode 100644 index 00000000000..64e600cb599 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstruction.class new file mode 100644 index 00000000000..faadd7ad89c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstructionImpl.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstructionImpl.class new file mode 100644 index 00000000000..7be87f81243 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstructionImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace$1.class new file mode 100644 index 00000000000..8013cac8ab1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace.class new file mode 100644 index 00000000000..4c3aa6039cc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/LocalDeclarationInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/LocalDeclarationInstruction.class new file mode 100644 index 00000000000..ba77093ef08 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/LocalDeclarationInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/NondeterministicJumpInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/NondeterministicJumpInstruction.class new file mode 100644 index 00000000000..655cf6f66cd Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/NondeterministicJumpInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$1.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$1.class new file mode 100644 index 00000000000..6b886a849c9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$PseudocodeLabel.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$PseudocodeLabel.class new file mode 100644 index 00000000000..4d09a17e529 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$PseudocodeLabel.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode.class new file mode 100644 index 00000000000..e8a097b42d1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadUnitValueInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadUnitValueInstruction.class new file mode 100644 index 00000000000..d19a89fa7c6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadUnitValueInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadValueInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadValueInstruction.class new file mode 100644 index 00000000000..9fddc94f15b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadValueInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnNoValueInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnNoValueInstruction.class new file mode 100644 index 00000000000..421fe8e702c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnNoValueInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnValueInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnValueInstruction.class new file mode 100644 index 00000000000..48c1b22891d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnValueInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineEnterInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineEnterInstruction.class new file mode 100644 index 00000000000..421972aecfc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineEnterInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineExitInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineExitInstruction.class new file mode 100644 index 00000000000..3c035301582 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineExitInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnconditionalJumpInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnconditionalJumpInstruction.class new file mode 100644 index 00000000000..d86f1d410c6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnconditionalJumpInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnsupportedElementInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnsupportedElementInstruction.class new file mode 100644 index 00000000000..5ac3dafe21d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnsupportedElementInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/WriteValueInstruction.class b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/WriteValueInstruction.class new file mode 100644 index 00000000000..13603f240ba Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/WriteValueInstruction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/AbstractNamespaceDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/AbstractNamespaceDescriptorImpl.class new file mode 100644 index 00000000000..b3364cb71ee Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/AbstractNamespaceDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/Annotation.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Annotation.class new file mode 100644 index 00000000000..d185fb3a7e5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Annotation.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableDescriptor.class new file mode 100644 index 00000000000..73e96d171d2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor.class new file mode 100644 index 00000000000..548899c7bd4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptor.class new file mode 100644 index 00000000000..500ee38a721 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptorImpl.class new file mode 100644 index 00000000000..0951b65c5c6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassKind.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassKind.class new file mode 100644 index 00000000000..89ddb199976 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassKind.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassifierDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassifierDescriptor.class new file mode 100644 index 00000000000..9fd2ddf8adb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassifierDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptor.class new file mode 100644 index 00000000000..0750f718927 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptorImpl.class new file mode 100644 index 00000000000..0406aefa4a1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.class new file mode 100644 index 00000000000..96e25833bf3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.class new file mode 100644 index 00000000000..538ff4c6cf1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.class new file mode 100644 index 00000000000..a5ee145e85e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorWithVisibility.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorWithVisibility.class new file mode 100644 index 00000000000..ebb2b1da852 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorWithVisibility.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ExtensionDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ExtensionDescriptor.class new file mode 100644 index 00000000000..0f4c2f34b2d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ExtensionDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptor.class new file mode 100644 index 00000000000..de01d9b848a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorImpl.class new file mode 100644 index 00000000000..2d1e7a749ad Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil.class new file mode 100644 index 00000000000..016382cb0af Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/LazySubstitutingClassDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/LazySubstitutingClassDescriptor.class new file mode 100644 index 00000000000..2fcd3dbf50b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/LazySubstitutingClassDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/LocalVariableDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/LocalVariableDescriptor.class new file mode 100644 index 00000000000..76a5106e0e3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/LocalVariableDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/MemberDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MemberDescriptor.class new file mode 100644 index 00000000000..55c6d768756 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MemberDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/Modality.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Modality.class new file mode 100644 index 00000000000..5b763dca484 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Modality.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ModuleDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ModuleDescriptor.class new file mode 100644 index 00000000000..1a990425ebe Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ModuleDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.class new file mode 100644 index 00000000000..c0600faead8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableDeclarationDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableDeclarationDescriptor.class new file mode 100644 index 00000000000..df01125513e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableDeclarationDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableValueParameterDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableValueParameterDescriptor.class new file mode 100644 index 00000000000..42b91231a95 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableValueParameterDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/Named.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Named.class new file mode 100644 index 00000000000..24655c10c9a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Named.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.class new file mode 100644 index 00000000000..4aaff2aa0d0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptorImpl.class new file mode 100644 index 00000000000..b934066961f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$Adapter.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$Adapter.class new file mode 100644 index 00000000000..b47d1478b40 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$Adapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$ClassObjectStatus.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$ClassObjectStatus.class new file mode 100644 index 00000000000..66e255dc5ea Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$ClassObjectStatus.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike.class new file mode 100644 index 00000000000..3046d064d05 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyAccessorDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyAccessorDescriptor.class new file mode 100644 index 00000000000..11a8107f0a9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyAccessorDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.class new file mode 100644 index 00000000000..18dfa6ed177 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyGetterDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyGetterDescriptor.class new file mode 100644 index 00000000000..4467c943c16 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyGetterDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertySetterDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertySetterDescriptor.class new file mode 100644 index 00000000000..028c24741a6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertySetterDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor$1.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor$1.class new file mode 100644 index 00000000000..331213af439 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.class new file mode 100644 index 00000000000..35d9bf9d44d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptor.class new file mode 100644 index 00000000000..492bc403bd4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptorImpl.class new file mode 100644 index 00000000000..ce8728accbb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableAsFunctionDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableAsFunctionDescriptor.class new file mode 100644 index 00000000000..be23e9d479f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableAsFunctionDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptor.class new file mode 100644 index 00000000000..fb5ce7276ff Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptorImpl.class new file mode 100644 index 00000000000..41ed34a384c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/Visibility.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Visibility.class new file mode 100644 index 00000000000..cd83d7489d2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/Visibility.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/Annotated.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/Annotated.class new file mode 100644 index 00000000000..e92a9a8bea0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/Annotated.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotatedImpl.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotatedImpl.class new file mode 100644 index 00000000000..64a88bd53b6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotatedImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationArgumentVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationArgumentVisitor.class new file mode 100644 index 00000000000..2509d42f9b8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationArgumentVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptor.class new file mode 100644 index 00000000000..8cf327a2f51 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AbstractDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AbstractDiagnosticFactory.class new file mode 100644 index 00000000000..c10ccff2738 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AbstractDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.class new file mode 100644 index 00000000000..ac7c589394a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Diagnostic.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Diagnostic.class new file mode 100644 index 00000000000..d7d97ca9316 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Diagnostic.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory.class new file mode 100644 index 00000000000..cda2303cabf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.class new file mode 100644 index 00000000000..c0334122027 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement1.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement1.class new file mode 100644 index 00000000000..3f0571b76f0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement2.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement2.class new file mode 100644 index 00000000000..78e26b4094f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement3.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement3.class new file mode 100644 index 00000000000..a7b53e012d3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithSeverity.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithSeverity.class new file mode 100644 index 00000000000..1560ab918ca Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithSeverity.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$1.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$1.class new file mode 100644 index 00000000000..b747064fc6e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$2.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$2.class new file mode 100644 index 00000000000..05147c4dc59 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.class new file mode 100644 index 00000000000..aaf68fc9805 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameter.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameter.class new file mode 100644 index 00000000000..473c3c12b23 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameterImpl.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameterImpl.class new file mode 100644 index 00000000000..4d8de40bb11 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameterImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameters.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameters.class new file mode 100644 index 00000000000..e32e9bc4e9e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameters.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.class new file mode 100644 index 00000000000..e51d3683bbc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameterFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameterFactory.class new file mode 100644 index 00000000000..00014f78fd1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameterFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameters.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameters.class new file mode 100644 index 00000000000..bc0359b5fba Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameters.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElement.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElement.class new file mode 100644 index 00000000000..9d8eb9d6181 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElement.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElementImpl.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElementImpl.class new file mode 100644 index 00000000000..7e876f00405 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElementImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithTextRange.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithTextRange.class new file mode 100644 index 00000000000..6a187a7ab9b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithTextRange.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$1.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$1.class new file mode 100644 index 00000000000..2627a10bc73 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$10.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$10.class new file mode 100644 index 00000000000..c6dc97f1580 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$10.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$11.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$11.class new file mode 100644 index 00000000000..db0f37b2b37 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$11.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$12.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$12.class new file mode 100644 index 00000000000..80320abea96 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$12.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$13.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$13.class new file mode 100644 index 00000000000..d3029618426 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$13.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$14.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$14.class new file mode 100644 index 00000000000..691e464adee Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$14.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$15.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$15.class new file mode 100644 index 00000000000..285bafe76a5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$15.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$2.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$2.class new file mode 100644 index 00000000000..466fc382b43 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$3.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$3.class new file mode 100644 index 00000000000..a2cdcdfb83c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$4.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$4.class new file mode 100644 index 00000000000..4d5822db8db Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$4.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$5.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$5.class new file mode 100644 index 00000000000..24b254a70ab Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$5.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$6.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$6.class new file mode 100644 index 00000000000..2d026a8b45e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$6.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$7.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$7.class new file mode 100644 index 00000000000..03fc1218c45 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$7.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$8.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$8.class new file mode 100644 index 00000000000..82085eabb57 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$8.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$9.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$9.class new file mode 100644 index 00000000000..057e73f9228 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$9.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$Initializer.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$Initializer.class new file mode 100644 index 00000000000..b7f0f75aeef Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$Initializer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors.class new file mode 100644 index 00000000000..925173f59bd Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/GenericDiagnostic.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/GenericDiagnostic.class new file mode 100644 index 00000000000..f2382bb6c77 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/GenericDiagnostic.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory1.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory1.class new file mode 100644 index 00000000000..3a7d8859912 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory2.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory2.class new file mode 100644 index 00000000000..505cb12fea0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory3.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory3.class new file mode 100644 index 00000000000..779bc8eb518 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory.class new file mode 100644 index 00000000000..a99227214a3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory1.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory1.class new file mode 100644 index 00000000000..0fa8022d414 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory2.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory2.class new file mode 100644 index 00000000000..2d2ad5f06af Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory3.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory3.class new file mode 100644 index 00000000000..3ab25c02005 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$RedeclarationDiagnosticWithDeferredResolution.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$RedeclarationDiagnosticWithDeferredResolution.class new file mode 100644 index 00000000000..14b602a4588 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$RedeclarationDiagnosticWithDeferredResolution.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$SimpleRedeclarationDiagnostic.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$SimpleRedeclarationDiagnostic.class new file mode 100644 index 00000000000..018445f124c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$SimpleRedeclarationDiagnostic.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.class new file mode 100644 index 00000000000..2ec9be87b47 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnosticFactory.class new file mode 100644 index 00000000000..20d60adde10 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer$1.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer$1.class new file mode 100644 index 00000000000..b9475c8901c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer.class new file mode 100644 index 00000000000..84e4c45bd9a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Severity.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Severity.class new file mode 100644 index 00000000000..4ce91674e1e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Severity.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactory.class new file mode 100644 index 00000000000..94626c63138 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactoryWithPsiElement.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactoryWithPsiElement.class new file mode 100644 index 00000000000..e53d19a0b95 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactoryWithPsiElement.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimplePsiElementOnlyDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimplePsiElementOnlyDiagnosticFactory.class new file mode 100644 index 00000000000..22a8796d428 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimplePsiElementOnlyDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnostic.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnostic.class new file mode 100644 index 00000000000..eaa4cc49814 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnostic.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnosticFactory.class b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnosticFactory.class new file mode 100644 index 00000000000..94bcc2dfcea Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnosticFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$At.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$At.class new file mode 100644 index 00000000000..da8ad635a06 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$At.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtFirstTokenOfTokens.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtFirstTokenOfTokens.class new file mode 100644 index 00000000000..d9712a66b5c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtFirstTokenOfTokens.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtOffset.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtOffset.class new file mode 100644 index 00000000000..2dfdee1bbc1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtOffset.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtSet.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtSet.class new file mode 100644 index 00000000000..4e4e6b7ded2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtSet.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing.class new file mode 100644 index 00000000000..3578bbabb21 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPattern.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPattern.class new file mode 100644 index 00000000000..b437b0fb16e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate$1.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate$1.class new file mode 100644 index 00000000000..d813fa82fca Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate.class new file mode 100644 index 00000000000..89d47c51650 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/Consumer.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/Consumer.class new file mode 100644 index 00000000000..f9fdc101d29 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/Consumer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/FirstBefore.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/FirstBefore.class new file mode 100644 index 00000000000..965ed391c54 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/FirstBefore.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$1.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$1.class new file mode 100644 index 00000000000..e39e6e39931 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$2.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$2.class new file mode 100644 index 00000000000..7706c078d3a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$1.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$1.class new file mode 100644 index 00000000000..43ddc87bf30 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$2.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$2.class new file mode 100644 index 00000000000..1a674fde1c2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$3.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$3.class new file mode 100644 index 00000000000..3fc8c790217 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence.class new file mode 100644 index 00000000000..5d33ed05239 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing.class new file mode 100644 index 00000000000..5a3b9c6ad7c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParser.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParser.class new file mode 100644 index 00000000000..c33b088c2e1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParser.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParserDefinition.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParserDefinition.class new file mode 100644 index 00000000000..753e5b243e4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParserDefinition.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$1.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$1.class new file mode 100644 index 00000000000..dd959ecc896 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$2.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$2.class new file mode 100644 index 00000000000..5c662d98b26 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$TokenDetector.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$TokenDetector.class new file mode 100644 index 00000000000..2c5976513df Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$TokenDetector.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing.class new file mode 100644 index 00000000000..96c6fefafad Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/LastBefore.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/LastBefore.class new file mode 100644 index 00000000000..bfbeaa49dd8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/LastBefore.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/MarkerAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/MarkerAdapter.class new file mode 100644 index 00000000000..d71bc6ab507 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/MarkerAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilder.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilder.class new file mode 100644 index 00000000000..0ef37fd18d6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilder.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderAdapter.class new file mode 100644 index 00000000000..6a96cf9a0f8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderForByClause.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderForByClause.class new file mode 100644 index 00000000000..aab8a6531c7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderForByClause.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderImpl.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderImpl.class new file mode 100644 index 00000000000..909eb7a847f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPattern.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPattern.class new file mode 100644 index 00000000000..fe551549326 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPredicate.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPredicate.class new file mode 100644 index 00000000000..0eaa4c6d3f0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPredicate.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/parsing/TruncatedSemanticWhitespaceAwarePsiBuilder.class b/out/production/frontend/org/jetbrains/jet/lang/parsing/TruncatedSemanticWhitespaceAwarePsiBuilder.class new file mode 100644 index 00000000000..01b636c6dc7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/parsing/TruncatedSemanticWhitespaceAwarePsiBuilder.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/Call.class b/out/production/frontend/org/jetbrains/jet/lang/psi/Call.class new file mode 100644 index 00000000000..0cb06c9a1e2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/Call.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.class new file mode 100644 index 00000000000..0c0f444f2b4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotation.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotation.class new file mode 100644 index 00000000000..8ac9ce13fc4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotation.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotationEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotationEntry.class new file mode 100644 index 00000000000..72089d0a515 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotationEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.class new file mode 100644 index 00000000000..5b61e22f022 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpression.class new file mode 100644 index 00000000000..5e72416bbe9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.class new file mode 100644 index 00000000000..b13b54be698 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetBindingPattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBindingPattern.class new file mode 100644 index 00000000000..be2217d0d01 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBindingPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockExpression.class new file mode 100644 index 00000000000..325fd5fd149 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockStringTemplateEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockStringTemplateEntry.class new file mode 100644 index 00000000000..3297c2986ef Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockStringTemplateEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetBreakExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBreakExpression.class new file mode 100644 index 00000000000..d8ba3073317 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetBreakExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallElement.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallElement.class new file mode 100644 index 00000000000..835c4425de4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallElement.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallExpression.class new file mode 100644 index 00000000000..904aa6479d2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetCatchClause.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetCatchClause.class new file mode 100644 index 00000000000..081949503b1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetCatchClause.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetClass.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClass.class new file mode 100644 index 00000000000..cf2e58ba4d3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClass.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassBody.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassBody.class new file mode 100644 index 00000000000..522c371b025 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassBody.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassInitializer.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassInitializer.class new file mode 100644 index 00000000000..bba91c75ad9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassInitializer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassObject.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassObject.class new file mode 100644 index 00000000000..f270e75677a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassObject.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassOrObject.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassOrObject.class new file mode 100644 index 00000000000..f5838683a80 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassOrObject.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstantExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstantExpression.class new file mode 100644 index 00000000000..a8cfbfe28e2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstantExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructor.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructor.class new file mode 100644 index 00000000000..5a6789994a6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructorCalleeExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructorCalleeExpression.class new file mode 100644 index 00000000000..af5b5958875 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructorCalleeExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetContainerNode.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetContainerNode.class new file mode 100644 index 00000000000..4d2e0ea2896 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetContainerNode.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetContinueExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetContinueExpression.class new file mode 100644 index 00000000000..a710ec52d60 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetContinueExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclaration.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclaration.class new file mode 100644 index 00000000000..1c90e7269a7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclaration.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclarationWithBody.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclarationWithBody.class new file mode 100644 index 00000000000..2d17ccb4d45 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclarationWithBody.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDecomposerPattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDecomposerPattern.class new file mode 100644 index 00000000000..b1f13534003 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDecomposerPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.class new file mode 100644 index 00000000000..2eae73e5934 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.class new file mode 100644 index 00000000000..ab066a7c319 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.class new file mode 100644 index 00000000000..b398fb121a7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperCall.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperCall.class new file mode 100644 index 00000000000..9fef3d28ff3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperCall.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperClass.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperClass.class new file mode 100644 index 00000000000..6fe18acc76f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperClass.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToThisCall.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToThisCall.class new file mode 100644 index 00000000000..941fc940d02 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToThisCall.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDoWhileExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDoWhileExpression.class new file mode 100644 index 00000000000..218af3698b1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDoWhileExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.class new file mode 100644 index 00000000000..70ddae1f17f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement$IfNotParsed.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement$IfNotParsed.class new file mode 100644 index 00000000000..59c9d6c0b7a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement$IfNotParsed.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement.class new file mode 100644 index 00000000000..bccd965d759 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetEnumEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetEnumEntry.class new file mode 100644 index 00000000000..adda59c2559 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetEnumEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetEscapeStringTemplateEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetEscapeStringTemplateEntry.class new file mode 100644 index 00000000000..45d2e068a84 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetEscapeStringTemplateEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpression.class new file mode 100644 index 00000000000..d3b93832f17 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpressionPattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpressionPattern.class new file mode 100644 index 00000000000..b44349db467 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpressionPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetFile.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFile.class new file mode 100644 index 00000000000..7c21dc9db56 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFile.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetFinallySection.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFinallySection.class new file mode 100644 index 00000000000..9de7570e41d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFinallySection.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetForExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetForExpression.class new file mode 100644 index 00000000000..8f0ac0c0caf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetForExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunction.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunction.class new file mode 100644 index 00000000000..72daa93072b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteral.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteral.class new file mode 100644 index 00000000000..a4f386de0ed Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteral.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteralExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteralExpression.class new file mode 100644 index 00000000000..8011450a0fe Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteralExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionType.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionType.class new file mode 100644 index 00000000000..db5a5c09ce0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetHashQualifiedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetHashQualifiedExpression.class new file mode 100644 index 00000000000..f029bc94dab Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetHashQualifiedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetIfExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetIfExpression.class new file mode 100644 index 00000000000..10d0d0cf252 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetIfExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetImportDirective.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetImportDirective.class new file mode 100644 index 00000000000..5229ae34603 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetImportDirective.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetInitializerList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetInitializerList.class new file mode 100644 index 00000000000..e35251f91e9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetInitializerList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetIsExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetIsExpression.class new file mode 100644 index 00000000000..f50bedfecdb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetIsExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.class new file mode 100644 index 00000000000..e4d9054bb96 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedInstanceExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedInstanceExpression.class new file mode 100644 index 00000000000..79652998e96 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedInstanceExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetLiteralStringTemplateEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLiteralStringTemplateEntry.class new file mode 100644 index 00000000000..709bd69f716 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLiteralStringTemplateEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetLoopExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLoopExpression.class new file mode 100644 index 00000000000..2038eba1885 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetLoopExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierList.class new file mode 100644 index 00000000000..c1e4e1124f4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierListOwner.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierListOwner.class new file mode 100644 index 00000000000..71bfe2b7483 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierListOwner.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedArgumentImpl.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedArgumentImpl.class new file mode 100644 index 00000000000..7d8a9742466 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedArgumentImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedDeclaration.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedDeclaration.class new file mode 100644 index 00000000000..359debc2cbf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedDeclaration.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedFunction.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedFunction.class new file mode 100644 index 00000000000..070c641dcc6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedFunction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespace.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespace.class new file mode 100644 index 00000000000..77029981925 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespace.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceBody.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceBody.class new file mode 100644 index 00000000000..4c434ea42bc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceBody.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetNullableType.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNullableType.class new file mode 100644 index 00000000000..fd48eda218b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetNullableType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclaration.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclaration.class new file mode 100644 index 00000000000..f9825ab21ff Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclaration.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclarationName.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclarationName.class new file mode 100644 index 00000000000..37317199627 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclarationName.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectLiteralExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectLiteralExpression.class new file mode 100644 index 00000000000..42c5927d45e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectLiteralExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameter.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameter.class new file mode 100644 index 00000000000..ee734849c26 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameterList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameterList.class new file mode 100644 index 00000000000..03081d8a275 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameterList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.class new file mode 100644 index 00000000000..2aadffabb80 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPattern.class new file mode 100644 index 00000000000..e522afd6585 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPostfixExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPostfixExpression.class new file mode 100644 index 00000000000..abb1b573323 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPostfixExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPredicateExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPredicateExpression.class new file mode 100644 index 00000000000..e51f0949f22 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPredicateExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPrefixExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPrefixExpression.class new file mode 100644 index 00000000000..2473b3cb9c6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPrefixExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetProjectionKind.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetProjectionKind.class new file mode 100644 index 00000000000..855b5827df1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetProjectionKind.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetProperty.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetProperty.class new file mode 100644 index 00000000000..8b535acb0cc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetProperty.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPropertyAccessor.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPropertyAccessor.class new file mode 100644 index 00000000000..4bfd20e09c3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPropertyAccessor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiFactory.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiFactory.class new file mode 100644 index 00000000000..4579250c0ac Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil$1.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil$1.class new file mode 100644 index 00000000000..7c3e94655f2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil.class new file mode 100644 index 00000000000..5246fb031b3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetQualifiedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetQualifiedExpression.class new file mode 100644 index 00000000000..594822da150 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetQualifiedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetReferenceExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetReferenceExpression.class new file mode 100644 index 00000000000..2e365decb20 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetReferenceExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetReturnExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetReturnExpression.class new file mode 100644 index 00000000000..fedb59a3671 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetReturnExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetRootNamespaceExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetRootNamespaceExpression.class new file mode 100644 index 00000000000..bb0535ab008 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetRootNamespaceExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetSafeQualifiedExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSafeQualifiedExpression.class new file mode 100644 index 00000000000..7ff2399b6ed Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSafeQualifiedExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetSelfType.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSelfType.class new file mode 100644 index 00000000000..688d5724488 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSelfType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.class new file mode 100644 index 00000000000..674287aeb8c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameStringTemplateEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameStringTemplateEntry.class new file mode 100644 index 00000000000..2af730886b7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameStringTemplateEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.class new file mode 100644 index 00000000000..77ff4a722d4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntryWithExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntryWithExpression.class new file mode 100644 index 00000000000..2058c0230c7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntryWithExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateExpression.class new file mode 100644 index 00000000000..ed2a601432a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetSuperExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSuperExpression.class new file mode 100644 index 00000000000..83a043405d0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetSuperExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisExpression.class new file mode 100644 index 00000000000..2643b531c32 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisReferenceExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisReferenceExpression.class new file mode 100644 index 00000000000..b31d0c5559d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisReferenceExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetThrowExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetThrowExpression.class new file mode 100644 index 00000000000..7fc481e3509 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetThrowExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTreeVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTreeVisitor.class new file mode 100644 index 00000000000..15c9c8ed8b5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTreeVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTryExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTryExpression.class new file mode 100644 index 00000000000..5a7bf580f40 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTryExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleExpression.class new file mode 100644 index 00000000000..f9ea6a9ad00 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePattern.class new file mode 100644 index 00000000000..cc99622bce5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePatternEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePatternEntry.class new file mode 100644 index 00000000000..d48d2dc430e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePatternEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleType.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleType.class new file mode 100644 index 00000000000..dfa892bbc5a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeArgumentList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeArgumentList.class new file mode 100644 index 00000000000..b5874048afe Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeArgumentList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraint.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraint.class new file mode 100644 index 00000000000..ddc1bb3a2e4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraint.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraintList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraintList.class new file mode 100644 index 00000000000..99fd137ad74 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraintList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeElement.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeElement.class new file mode 100644 index 00000000000..272da95252a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeElement.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameter.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameter.class new file mode 100644 index 00000000000..21bb49d9aa0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterList.class new file mode 100644 index 00000000000..000d8c03ee6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.class new file mode 100644 index 00000000000..e43ea9e51ec Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypePattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypePattern.class new file mode 100644 index 00000000000..12c32d434a1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypePattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeProjection.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeProjection.class new file mode 100644 index 00000000000..a7567774a46 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeProjection.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeReference.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeReference.class new file mode 100644 index 00000000000..fca369d1dcb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeReference.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypedef.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypedef.class new file mode 100644 index 00000000000..9d491ca040b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypedef.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetUnaryExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetUnaryExpression.class new file mode 100644 index 00000000000..1f13d881a6e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetUnaryExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetUserType.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetUserType.class new file mode 100644 index 00000000000..0a5c13dcaf0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetUserType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgument.class new file mode 100644 index 00000000000..81ff475d780 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentList.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentList.class new file mode 100644 index 00000000000..f5f4478ed49 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentList.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentName.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentName.class new file mode 100644 index 00000000000..a97220a02af Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentName.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitor.class new file mode 100644 index 00000000000..0d0acae0c99 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitorVoid.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitorVoid.class new file mode 100644 index 00000000000..e0f5df1c90d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitorVoid.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenCondition.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenCondition.class new file mode 100644 index 00000000000..7d2a2f1c129 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenCondition.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionCall.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionCall.class new file mode 100644 index 00000000000..c9b70091953 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionCall.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.class new file mode 100644 index 00000000000..76b2bd3e6b7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionIsPattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionIsPattern.class new file mode 100644 index 00000000000..c25ba8cc666 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionIsPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenEntry.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenEntry.class new file mode 100644 index 00000000000..dfe6ccaa9a6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenEntry.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenExpression.class new file mode 100644 index 00000000000..30532c0e1fe Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhileExpression.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhileExpression.class new file mode 100644 index 00000000000..ef5b421cc8d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhileExpression.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/JetWildcardPattern.class b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWildcardPattern.class new file mode 100644 index 00000000000..e3d1033d431 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/JetWildcardPattern.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/psi/ValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/psi/ValueArgument.class new file mode 100644 index 00000000000..fe0ec932437 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/psi/ValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/AbstractScopeAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/AbstractScopeAdapter.class new file mode 100644 index 00000000000..1ce027e33b5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/AbstractScopeAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$1.class new file mode 100644 index 00000000000..bb86db70d69 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$2.class new file mode 100644 index 00000000000..1386417d65b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils.class new file mode 100644 index 00000000000..a69ea80ad16 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver.class new file mode 100644 index 00000000000..80e9bc8f357 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$1.class new file mode 100644 index 00000000000..430a43bfa12 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$2.class new file mode 100644 index 00000000000..fb7ed303cd2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$3.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$3.class new file mode 100644 index 00000000000..15b2c47f07e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$DeferredTypeKey.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$DeferredTypeKey.class new file mode 100644 index 00000000000..d1e7badafea Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$DeferredTypeKey.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext.class new file mode 100644 index 00000000000..d97809b3101 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContextUtils.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContextUtils.class new file mode 100644 index 00000000000..3ae665a522d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContextUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTrace.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTrace.class new file mode 100644 index 00000000000..a0ad7e421c4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTrace.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext$1.class new file mode 100644 index 00000000000..8fb3e2f3026 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext.class new file mode 100644 index 00000000000..18bebc32c80 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$1.class new file mode 100644 index 00000000000..27b0177264e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$2.class new file mode 100644 index 00000000000..73630fb42a7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$3.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$3.class new file mode 100644 index 00000000000..655b7fe0730 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$4.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$4.class new file mode 100644 index 00000000000..3989e4ea9c5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$4.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$5.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$5.class new file mode 100644 index 00000000000..4dd41d132b1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$5.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$6.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$6.class new file mode 100644 index 00000000000..98ba998bb0b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$6.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver.class new file mode 100644 index 00000000000..4b6fa757d41 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver$1.class new file mode 100644 index 00000000000..6b8d61e3835 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver$2.class new file mode 100644 index 00000000000..7fef07b82ec Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.class new file mode 100644 index 00000000000..3187640fee6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer$1.class new file mode 100644 index 00000000000..7842e3ad190 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer.class new file mode 100644 index 00000000000..e447512c7bb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver$1.class new file mode 100644 index 00000000000..f45663fbf67 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver.class new file mode 100644 index 00000000000..71fcf15fe81 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationsChecker.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationsChecker.class new file mode 100644 index 00000000000..1fa1ad96c87 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationsChecker.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace$1.class new file mode 100644 index 00000000000..33ea74c4881 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace.class new file mode 100644 index 00000000000..37c2ccdcf70 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegationResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegationResolver.class new file mode 100644 index 00000000000..b11fceee955 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegationResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$1.class new file mode 100644 index 00000000000..d93114e5048 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$2.class new file mode 100644 index 00000000000..8288e3b861e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$3.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$3.class new file mode 100644 index 00000000000..ac2a12b31bc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils.class new file mode 100644 index 00000000000..9af6db63f99 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportingStrategy$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportingStrategy$1.class new file mode 100644 index 00000000000..ef15d6803e5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportingStrategy$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportingStrategy.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportingStrategy.class new file mode 100644 index 00000000000..5d7b54fbe35 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportingStrategy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/JetModuleUtil.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/JetModuleUtil.class new file mode 100644 index 00000000000..eb3e7f2ecb7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/JetModuleUtil.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace$RecordHandler.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace$RecordHandler.class new file mode 100644 index 00000000000..070074d6fe0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace$RecordHandler.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace.class new file mode 100644 index 00000000000..c55ca848fe0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver.class new file mode 100644 index 00000000000..87b4325f9d2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil$OverrideCompatibilityInfo.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil$OverrideCompatibilityInfo.class new file mode 100644 index 00000000000..ef6a65321a0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil$OverrideCompatibilityInfo.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil.class new file mode 100644 index 00000000000..4513636db68 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TemporaryBindingTrace.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TemporaryBindingTrace.class new file mode 100644 index 00000000000..c5314cc1113 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TemporaryBindingTrace.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.class new file mode 100644 index 00000000000..dd5aacb0a6c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$1.class new file mode 100644 index 00000000000..25dfc8fad43 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$2.class new file mode 100644 index 00000000000..980abd247e0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.class new file mode 100644 index 00000000000..692d40c5999 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TraceBasedRedeclarationHandler.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TraceBasedRedeclarationHandler.class new file mode 100644 index 00000000000..6b7407cf901 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TraceBasedRedeclarationHandler.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1$1.class new file mode 100644 index 00000000000..9637697d089 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1.class new file mode 100644 index 00000000000..dd2131804f6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$2.class new file mode 100644 index 00000000000..5e1533c685c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$1.class new file mode 100644 index 00000000000..19f8d997f8a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$2.class new file mode 100644 index 00000000000..11d034f283c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter.class new file mode 100644 index 00000000000..f1c9a4450f2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.class new file mode 100644 index 00000000000..ce7088992da Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$1.class new file mode 100644 index 00000000000..2ccaf6f497f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$2.class new file mode 100644 index 00000000000..144d13662ae Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$3.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$3.class new file mode 100644 index 00000000000..9a451424b00 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver.class new file mode 100644 index 00000000000..5f38c6cfb6a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/AutoCastReceiver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/AutoCastReceiver.class new file mode 100644 index 00000000000..ceef415bfc4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/AutoCastReceiver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$1.class new file mode 100644 index 00000000000..b062a94ec4f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$CallImpl.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$CallImpl.class new file mode 100644 index 00000000000..e62907972e0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$CallImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$ExpressionValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$ExpressionValueArgument.class new file mode 100644 index 00000000000..e51486fdc15 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$ExpressionValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker.class new file mode 100644 index 00000000000..66c63324346 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$1.class new file mode 100644 index 00000000000..00b29a68c38 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$2.class new file mode 100644 index 00000000000..426bc40024f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver.class new file mode 100644 index 00000000000..3fad4fc1ba1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/DefaultValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/DefaultValueArgument.class new file mode 100644 index 00000000000..fa3698bb00d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/DefaultValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionValueArgument.class new file mode 100644 index 00000000000..32000aca743 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults$Code.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults$Code.class new file mode 100644 index 00000000000..26fa2e90c21 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults$Code.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults.class new file mode 100644 index 00000000000..77ec6ab4601 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver$1.class new file mode 100644 index 00000000000..28863c00bbf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.class new file mode 100644 index 00000000000..431beeeb0ab Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.class new file mode 100644 index 00000000000..90cfb87fcfa Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask$DescriptorCheckStrategy.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask$DescriptorCheckStrategy.class new file mode 100644 index 00000000000..f910d177c24 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask$DescriptorCheckStrategy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.class new file mode 100644 index 00000000000..7cac84f6e21 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.class new file mode 100644 index 00000000000..9e59948a962 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$1.class new file mode 100644 index 00000000000..656a9a21e70 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$2.class new file mode 100644 index 00000000000..3f370799d6a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.class new file mode 100644 index 00000000000..3228590d813 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedValueArgument.class new file mode 100644 index 00000000000..204389d8cfd Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.class new file mode 100644 index 00000000000..c03eb2b3050 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$1.class new file mode 100644 index 00000000000..0bc1a6e1137 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2.class new file mode 100644 index 00000000000..639635a209e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.class new file mode 100644 index 00000000000..7ebc238132a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy$1.class new file mode 100644 index 00000000000..3c8de8ed866 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy.class new file mode 100644 index 00000000000..87e7d2de630 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.class new file mode 100644 index 00000000000..3dbb0be4623 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/VarargValueArgument.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/VarargValueArgument.class new file mode 100644 index 00000000000..e6e2639c1e7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/VarargValueArgument.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService$1.class new file mode 100644 index 00000000000..922bb7ffb92 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService.class new file mode 100644 index 00000000000..7f0dee36ec1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastServiceImpl.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastServiceImpl.class new file mode 100644 index 00000000000..671a76b39e8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastServiceImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils$1.class new file mode 100644 index 00000000000..b61a5c12cca Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils.class new file mode 100644 index 00000000000..38947662382 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$1.class new file mode 100644 index 00000000000..474c2a49bf3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$2.class new file mode 100644 index 00000000000..48cce1d1443 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$CompositionOperator.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$CompositionOperator.class new file mode 100644 index 00000000000..1875563a6c1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$CompositionOperator.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo.class new file mode 100644 index 00000000000..10b032a506f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValue.class new file mode 100644 index 00000000000..041e8e9a39f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.class new file mode 100644 index 00000000000..800f2257da4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability$1.class new file mode 100644 index 00000000000..8bf52749652 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability.class new file mode 100644 index 00000000000..50825ee4c8b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/BooleanValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/BooleanValue.class new file mode 100644 index 00000000000..1774966048b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/BooleanValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue$1.class new file mode 100644 index 00000000000..d5fda480d3e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue.class new file mode 100644 index 00000000000..8f6d0605558 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CharValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CharValue.class new file mode 100644 index 00000000000..3f098857a51 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CharValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstant.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstant.class new file mode 100644 index 00000000000..4197af310ac Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstant.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver$1.class new file mode 100644 index 00000000000..98cea94577d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver.class new file mode 100644 index 00000000000..73021c6b0fc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/DoubleValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/DoubleValue.class new file mode 100644 index 00000000000..e23b3f2be23 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/DoubleValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ErrorValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ErrorValue.class new file mode 100644 index 00000000000..1dd5bb150f8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ErrorValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/FloatValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/FloatValue.class new file mode 100644 index 00000000000..10e0254505c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/FloatValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue$1.class new file mode 100644 index 00000000000..c1556390728 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue.class new file mode 100644 index 00000000000..020251cfe6e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue$1.class new file mode 100644 index 00000000000..a0a56741e2a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue.class new file mode 100644 index 00000000000..2e8e50a103d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/NullValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/NullValue.class new file mode 100644 index 00000000000..5b8569dc2e3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/NullValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue$1.class new file mode 100644 index 00000000000..968aa029238 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue.class new file mode 100644 index 00000000000..6ffb315db34 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/StringValue.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/StringValue.class new file mode 100644 index 00000000000..e03ea625762 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/StringValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/ChainedScope.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/ChainedScope.class new file mode 100644 index 00000000000..91cd0e78156 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/ChainedScope.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope$1.class new file mode 100644 index 00000000000..fabedc79c31 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope.class new file mode 100644 index 00000000000..8ecf902b752 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeAdapter.class new file mode 100644 index 00000000000..eacfddaa60b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeImpl.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeImpl.class new file mode 100644 index 00000000000..be08895842d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.class new file mode 100644 index 00000000000..3277d2de0e1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$1.class new file mode 100644 index 00000000000..a5d88c4fbfb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$2.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$2.class new file mode 100644 index 00000000000..bef7f4b5aad Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler.class new file mode 100644 index 00000000000..344d69030dc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.class new file mode 100644 index 00000000000..8e3425e1707 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope.class new file mode 100644 index 00000000000..8103aba34fb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.class new file mode 100644 index 00000000000..28dfd5e8daf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeWithImports.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeWithImports.class new file mode 100644 index 00000000000..25703f8a71e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeWithImports.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WriteThroughScope.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WriteThroughScope.class new file mode 100644 index 00000000000..7f4aec38033 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WriteThroughScope.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/AbstractReceiverDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/AbstractReceiverDescriptor.class new file mode 100644 index 00000000000..39811f1145a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/AbstractReceiverDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.class new file mode 100644 index 00000000000..9d27edc0f29 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExpressionReceiver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExpressionReceiver.class new file mode 100644 index 00000000000..6df951a9bc8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExpressionReceiver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExtensionReceiver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExtensionReceiver.class new file mode 100644 index 00000000000..9855b30c527 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExtensionReceiver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor$1.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor$1.class new file mode 100644 index 00000000000..352ab130802 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor.class new file mode 100644 index 00000000000..d9e3d7df9d8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptorVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptorVisitor.class new file mode 100644 index 00000000000..c1619acba1a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptorVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ThisReceiverDescriptor.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ThisReceiverDescriptor.class new file mode 100644 index 00000000000..bed1ca3411c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ThisReceiverDescriptor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/TransientReceiver.class b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/TransientReceiver.class new file mode 100644 index 00000000000..bd7e38372e9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/TransientReceiver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/CompositeTypeSubstitution.class b/out/production/frontend/org/jetbrains/jet/lang/types/CompositeTypeSubstitution.class new file mode 100644 index 00000000000..35b2f06af61 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/CompositeTypeSubstitution.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/DeferredType.class b/out/production/frontend/org/jetbrains/jet/lang/types/DeferredType.class new file mode 100644 index 00000000000..31cd6ea4725 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/DeferredType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor$1.class new file mode 100644 index 00000000000..691c0379b59 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor.class b/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor.class new file mode 100644 index 00000000000..3ec8aab8250 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$1.class new file mode 100644 index 00000000000..fefe61e1955 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$2.class new file mode 100644 index 00000000000..30fc6cdb1e6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorTypeImpl.class b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorTypeImpl.class new file mode 100644 index 00000000000..6fa53217d11 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorTypeImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils.class b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils.class new file mode 100644 index 00000000000..dbb8248b879 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$1.class new file mode 100644 index 00000000000..f10fb96b5ec Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$2.class new file mode 100644 index 00000000000..d88b71ffe36 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses.class new file mode 100644 index 00000000000..b65748647ce Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardLibrary.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardLibrary.class new file mode 100644 index 00000000000..353cf80b3a9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardLibrary.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetType.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetType.class new file mode 100644 index 00000000000..9bd400eedcf Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$1.class new file mode 100644 index 00000000000..7973127def2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$2.class new file mode 100644 index 00000000000..950ffbc0163 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$AbstractTypeCheckingProcedure$StatusAction.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$AbstractTypeCheckingProcedure$StatusAction.class new file mode 100644 index 00000000000..704ba222134 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$AbstractTypeCheckingProcedure$StatusAction.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$AbstractTypeCheckingProcedure.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$AbstractTypeCheckingProcedure.class new file mode 100644 index 00000000000..43d3997784f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$AbstractTypeCheckingProcedure.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$DfsNodeHandler.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$DfsNodeHandler.class new file mode 100644 index 00000000000..8a6ee05a168 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$DfsNodeHandler.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$OldProcedure.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$OldProcedure.class new file mode 100644 index 00000000000..5800dfac7e3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$OldProcedure.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$TypeCheckingProcedure.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$TypeCheckingProcedure.class new file mode 100644 index 00000000000..9c6a813a747 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker$TypeCheckingProcedure.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker.class new file mode 100644 index 00000000000..f7b65a9e377 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeChecker.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeImpl.class b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeImpl.class new file mode 100644 index 00000000000..4341eb9a3d0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/NamespaceType.class b/out/production/frontend/org/jetbrains/jet/lang/types/NamespaceType.class new file mode 100644 index 00000000000..b683882e37b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/NamespaceType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructor.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructor.class new file mode 100644 index 00000000000..9b740d37284 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructorImpl.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructorImpl.class new file mode 100644 index 00000000000..95266bdd258 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructorImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeProjection.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeProjection.class new file mode 100644 index 00000000000..12ad128d43f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeProjection.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$1.class new file mode 100644 index 00000000000..f251411e3ce Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$MapToTypeSubstitutionAdapter.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$MapToTypeSubstitutionAdapter.class new file mode 100644 index 00000000000..7609f1e1be5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$MapToTypeSubstitutionAdapter.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$SubstitutionException.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$SubstitutionException.class new file mode 100644 index 00000000000..29aac6ea28a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$SubstitutionException.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution$1.class new file mode 100644 index 00000000000..5a9b8ff1f0b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution.class new file mode 100644 index 00000000000..7a5cff45ee6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor.class new file mode 100644 index 00000000000..64ef9d2d24b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$1.class new file mode 100644 index 00000000000..428c991d5cc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$2.class new file mode 100644 index 00000000000..62bd17e14fa Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$3.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$3.class new file mode 100644 index 00000000000..fc8730a18a6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils.class b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils.class new file mode 100644 index 00000000000..74211124130 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/Variance$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/Variance$1.class new file mode 100644 index 00000000000..1bb22e5ee96 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/Variance$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/Variance.class b/out/production/frontend/org/jetbrains/jet/lang/types/Variance.class new file mode 100644 index 00000000000..e8dd10dc742 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/Variance.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor$1.class new file mode 100644 index 00000000000..ba2ba3394ed Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.class new file mode 100644 index 00000000000..2b9efd58d0a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1$1.class new file mode 100644 index 00000000000..4f78cf6a4f1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1.class new file mode 100644 index 00000000000..5675442ab6a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.class new file mode 100644 index 00000000000..66ef6f5f683 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/CoercionStrategy.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/CoercionStrategy.class new file mode 100644 index 00000000000..1d43e00d507 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/CoercionStrategy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor$1.class new file mode 100644 index 00000000000..87cee0f520e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor.class new file mode 100644 index 00000000000..45e7e941823 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils$1.class new file mode 100644 index 00000000000..69bc775e931 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils.class new file mode 100644 index 00000000000..c8316d8929b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.class new file mode 100644 index 00000000000..e26f6cae5f5 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingFacade.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingFacade.class new file mode 100644 index 00000000000..dc08aa5c522 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingFacade.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingInternals.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingInternals.class new file mode 100644 index 00000000000..2288c85830f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingInternals.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$1.class new file mode 100644 index 00000000000..75c62c72fed Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$2.class new file mode 100644 index 00000000000..5fc4f589cc1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.class new file mode 100644 index 00000000000..bc418d13cc7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.class new file mode 100644 index 00000000000..70c9e8c6b6f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitor.class new file mode 100644 index 00000000000..83855bddb4e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher$1.class new file mode 100644 index 00000000000..db677992dc8 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher$2.class new file mode 100644 index 00000000000..a3d126417d2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher.class new file mode 100644 index 00000000000..49700afdc47 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.class new file mode 100644 index 00000000000..e3be65b31b6 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/LabelResolver.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/LabelResolver.class new file mode 100644 index 00000000000..bd58581a3ff Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/LabelResolver.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/OperatorConventions.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/OperatorConventions.class new file mode 100644 index 00000000000..e785a7d8c80 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/OperatorConventions.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$1.class new file mode 100644 index 00000000000..7434b6482be Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$2.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$2.class new file mode 100644 index 00000000000..ac333ae7d1d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor.class b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor.class new file mode 100644 index 00000000000..8e49b9dfa31 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$1.class new file mode 100644 index 00000000000..4188ed6feea Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$KnownType.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$KnownType.class new file mode 100644 index 00000000000..e81c2753831 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$KnownType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$LoopInTypeVariableConstraintsException.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$LoopInTypeVariableConstraintsException.class new file mode 100644 index 00000000000..399709f30b1 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$LoopInTypeVariableConstraintsException.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$Solution$1.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$Solution$1.class new file mode 100644 index 00000000000..3c79a224e59 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$Solution$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$Solution.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$Solution.class new file mode 100644 index 00000000000..8a9ec2d24cb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$Solution.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$TypeConstraintExpander.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$TypeConstraintExpander.class new file mode 100644 index 00000000000..a869f1ef033 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$TypeConstraintExpander.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$TypeValue.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$TypeValue.class new file mode 100644 index 00000000000..f3dfdc24d26 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$TypeValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$UnknownType.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$UnknownType.class new file mode 100644 index 00000000000..13686468eb7 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem$UnknownType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem.class b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem.class new file mode 100644 index 00000000000..da0315fed71 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lang/types/inference/ConstraintSystem.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lexer/JetKeywordToken.class b/out/production/frontend/org/jetbrains/jet/lexer/JetKeywordToken.class new file mode 100644 index 00000000000..7a495f44eff Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lexer/JetKeywordToken.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lexer/JetLexer.class b/out/production/frontend/org/jetbrains/jet/lexer/JetLexer.class new file mode 100644 index 00000000000..4003e9666de Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lexer/JetLexer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lexer/JetToken.class b/out/production/frontend/org/jetbrains/jet/lexer/JetToken.class new file mode 100644 index 00000000000..bad046f057a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lexer/JetToken.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lexer/JetTokens.class b/out/production/frontend/org/jetbrains/jet/lexer/JetTokens.class new file mode 100644 index 00000000000..70a82e8c89c Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lexer/JetTokens.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer$State.class b/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer$State.class new file mode 100644 index 00000000000..03ffc5d8e46 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer$State.class differ diff --git a/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer.class b/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer.class new file mode 100644 index 00000000000..636a5711ea3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/plugin/JetFileType$1.class b/out/production/frontend/org/jetbrains/jet/plugin/JetFileType$1.class new file mode 100644 index 00000000000..6840869d24a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/plugin/JetFileType$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/plugin/JetFileType.class b/out/production/frontend/org/jetbrains/jet/plugin/JetFileType.class new file mode 100644 index 00000000000..6b8df033c90 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/plugin/JetFileType.class differ diff --git a/out/production/frontend/org/jetbrains/jet/plugin/JetLanguage.class b/out/production/frontend/org/jetbrains/jet/plugin/JetLanguage.class new file mode 100644 index 00000000000..a9082633978 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/plugin/JetLanguage.class differ diff --git a/out/production/frontend/org/jetbrains/jet/plugin/JetMainDetector.class b/out/production/frontend/org/jetbrains/jet/plugin/JetMainDetector.class new file mode 100644 index 00000000000..9966d131f11 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/plugin/JetMainDetector.class differ diff --git a/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$1.class b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$1.class new file mode 100644 index 00000000000..2951f3ce838 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$2.class b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$2.class new file mode 100644 index 00000000000..d0875900d65 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$3.class b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$3.class new file mode 100644 index 00000000000..f65781cee03 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$3.class differ diff --git a/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$RenderDeclarationDescriptorVisitor.class b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$RenderDeclarationDescriptorVisitor.class new file mode 100644 index 00000000000..40415d98b1d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$RenderDeclarationDescriptorVisitor.class differ diff --git a/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer.class b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer.class new file mode 100644 index 00000000000..3faecc33a5a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$1.class b/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$1.class new file mode 100644 index 00000000000..bbc6ca7ecdb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$2.class b/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$2.class new file mode 100644 index 00000000000..68f81532a14 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers.class b/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers.class new file mode 100644 index 00000000000..acf5736311d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$1.class b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$1.class new file mode 100644 index 00000000000..a774efe60cc Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$State.class b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$State.class new file mode 100644 index 00000000000..e0f6daca207 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$State.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue.class b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue.class new file mode 100644 index 00000000000..9c10086b6b4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValueWithDefault.class b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValueWithDefault.class new file mode 100644 index 00000000000..61e6b06925d Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValueWithDefault.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/lazy/ReenteringLazyValueComputationException.class b/out/production/frontend/org/jetbrains/jet/util/lazy/ReenteringLazyValueComputationException.class new file mode 100644 index 00000000000..e2255fc577b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/lazy/ReenteringLazyValueComputationException.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice$1.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice$1.class new file mode 100644 index 00000000000..b3d29f840d2 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice.class new file mode 100644 index 00000000000..4dd70f7d121 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/CollectionSliceWrapper.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/CollectionSliceWrapper.class new file mode 100644 index 00000000000..7f79201df54 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/CollectionSliceWrapper.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/DelegatingSlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/DelegatingSlice.class new file mode 100644 index 00000000000..77268b0c6b0 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/DelegatingSlice.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$1.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$1.class new file mode 100644 index 00000000000..aa80eb48994 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$2.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$2.class new file mode 100644 index 00000000000..c181466a8e3 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier.class new file mode 100644 index 00000000000..ce13f42ff35 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/MutableSlicedMap.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MutableSlicedMap.class new file mode 100644 index 00000000000..1f123ac48c9 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/MutableSlicedMap.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/ReadOnlySlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/ReadOnlySlice.class new file mode 100644 index 00000000000..dd6cc14a605 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/ReadOnlySlice.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/RemovableSlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/RemovableSlice.class new file mode 100644 index 00000000000..0af694ac797 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/RemovableSlice.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy$1.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy$1.class new file mode 100644 index 00000000000..9125552cb3f Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy.class new file mode 100644 index 00000000000..2fca300038e Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap.class new file mode 100644 index 00000000000..aa2329d4b55 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapImpl.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapImpl.class new file mode 100644 index 00000000000..1b47da3d53a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapImpl.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapKey.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapKey.class new file mode 100644 index 00000000000..7b52e6e2da4 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapKey.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$1.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$1.class new file mode 100644 index 00000000000..2061205e21a Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$BasicRemovableSlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$BasicRemovableSlice.class new file mode 100644 index 00000000000..8779fb1a409 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$BasicRemovableSlice.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer$1.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer$1.class new file mode 100644 index 00000000000..bc756eac366 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer.class new file mode 100644 index 00000000000..691527ce15b Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SetSlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SetSlice.class new file mode 100644 index 00000000000..c152df04541 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SetSlice.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$1.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$1.class new file mode 100644 index 00000000000..a540ca20e33 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$1.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$2.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$2.class new file mode 100644 index 00000000000..9c41eda41bb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$2.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder.class new file mode 100644 index 00000000000..c692728c172 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceWithOpposite.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceWithOpposite.class new file mode 100644 index 00000000000..ca6e28671fb Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceWithOpposite.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices.class new file mode 100644 index 00000000000..4f368b08c28 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices.class differ diff --git a/out/production/frontend/org/jetbrains/jet/util/slicedmap/WritableSlice.class b/out/production/frontend/org/jetbrains/jet/util/slicedmap/WritableSlice.class new file mode 100644 index 00000000000..94523ce1d24 Binary files /dev/null and b/out/production/frontend/org/jetbrains/jet/util/slicedmap/WritableSlice.class differ diff --git a/out/production/k2js/com/google/dart/compiler/InternalCompilerException.class b/out/production/k2js/com/google/dart/compiler/InternalCompilerException.class new file mode 100644 index 00000000000..d6b4979ae1a Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/InternalCompilerException.class differ diff --git a/out/production/k2js/com/google/dart/compiler/Source.class b/out/production/k2js/com/google/dart/compiler/Source.class new file mode 100644 index 00000000000..e73e44aefb6 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/Source.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/Cloner.class b/out/production/k2js/com/google/dart/compiler/backend/js/Cloner.class new file mode 100644 index 00000000000..f50c26588c9 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/Cloner.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.class new file mode 100644 index 00000000000..f479f1679dd Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.class new file mode 100644 index 00000000000..1e5f9b8d4a8 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsNamer.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsNamer.class new file mode 100644 index 00000000000..131cb28a062 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsNamer.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer$1.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer$1.class new file mode 100644 index 00000000000..c14ff4ed0fa Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer$1.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer$JsNormalizing.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer$JsNormalizing.class new file mode 100644 index 00000000000..8abebfac705 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer$JsNormalizing.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer.class new file mode 100644 index 00000000000..5efba56495c Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsNormalizer.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsParserException$SourceDetail.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsParserException$SourceDetail.class new file mode 100644 index 00000000000..7ce70619dcc Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsParserException$SourceDetail.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsParserException.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsParserException.class new file mode 100644 index 00000000000..697b6f743cc Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsParserException.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.class new file mode 100644 index 00000000000..6801fe0c8b2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsPrettyNamer.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsPrettyNamer.class new file mode 100644 index 00000000000..48779e9cac6 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsPrettyNamer.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.class new file mode 100644 index 00000000000..6854e11b283 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsReservedIdentifiers.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsReservedIdentifiers.class new file mode 100644 index 00000000000..f67cd055c8e Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsReservedIdentifiers.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.class new file mode 100644 index 00000000000..d2c179ccdd9 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.class new file mode 100644 index 00000000000..33990b10387 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/UncheckedJsParserException.class b/out/production/k2js/com/google/dart/compiler/backend/js/UncheckedJsParserException.class new file mode 100644 index 00000000000..81c5219e96e Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/UncheckedJsParserException.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/CanBooleanEval.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/CanBooleanEval.class new file mode 100644 index 00000000000..15d6ae505f1 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/CanBooleanEval.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasArguments.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasArguments.class new file mode 100644 index 00000000000..94165e6576b Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasArguments.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasCondition.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasCondition.class new file mode 100644 index 00000000000..2077546b216 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasCondition.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasName.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasName.class new file mode 100644 index 00000000000..417680c0165 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/HasName.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsArrayAccess.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsArrayAccess.class new file mode 100644 index 00000000000..f132430bee9 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsArrayAccess.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.class new file mode 100644 index 00000000000..8b03c27d3a3 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.class new file mode 100644 index 00000000000..0ed2e876b74 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.class new file mode 100644 index 00000000000..f991fe9845a Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBlock.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBlock.class new file mode 100644 index 00000000000..d7407fbb88e Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBlock.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.class new file mode 100644 index 00000000000..27ef1fb7cc5 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBreak.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBreak.class new file mode 100644 index 00000000000..226aabaa1d4 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsBreak.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCase.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCase.class new file mode 100644 index 00000000000..04f062b81a5 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCase.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatch.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatch.class new file mode 100644 index 00000000000..921ca66efbe Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatch.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatchScope$1.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatchScope$1.class new file mode 100644 index 00000000000..b712dc38424 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatchScope$1.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatchScope.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatchScope.class new file mode 100644 index 00000000000..79d916026f2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsCatchScope.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsConditional.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsConditional.class new file mode 100644 index 00000000000..87d66cb6ba5 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsConditional.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsContext.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsContext.class new file mode 100644 index 00000000000..f58b1aeb3a5 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsContext.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsContinue.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsContinue.class new file mode 100644 index 00000000000..4903a2e1b16 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsContinue.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDebugger.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDebugger.class new file mode 100644 index 00000000000..705b390cded Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDebugger.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDefault.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDefault.class new file mode 100644 index 00000000000..6fb2775caa9 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDefault.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDoWhile.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDoWhile.class new file mode 100644 index 00000000000..fac9cf24963 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsDoWhile.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsEmpty.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsEmpty.class new file mode 100644 index 00000000000..6ab94798f96 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsEmpty.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsExprStmt.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsExprStmt.class new file mode 100644 index 00000000000..fe37a59d21b Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsExprStmt.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsExpression.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsExpression.class new file mode 100644 index 00000000000..18ca0b9f0db Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsExpression.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsFor.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsFor.class new file mode 100644 index 00000000000..7e2a1d1967e Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsFor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsForIn.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsForIn.class new file mode 100644 index 00000000000..f4cb203defc Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsForIn.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsFunction.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsFunction.class new file mode 100644 index 00000000000..8a51551c47b Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsFunction.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.class new file mode 100644 index 00000000000..e21c684b5ea Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsIf.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsIf.class new file mode 100644 index 00000000000..f46b8108c29 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsIf.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsInvocation.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsInvocation.class new file mode 100644 index 00000000000..eaf7c7fe0d3 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsInvocation.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsLabel.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsLabel.class new file mode 100644 index 00000000000..73741e55002 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsLabel.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsLiteral.class new file mode 100644 index 00000000000..df8edac6ec9 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$1.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$1.class new file mode 100644 index 00000000000..d0b9a2a2f59 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$1.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$ListContext.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$ListContext.class new file mode 100644 index 00000000000..94cfc34a156 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$ListContext.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$LvalueContext.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$LvalueContext.class new file mode 100644 index 00000000000..985253beacc Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$LvalueContext.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$NodeContext.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$NodeContext.class new file mode 100644 index 00000000000..81b0f0b3f54 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor$NodeContext.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor.class new file mode 100644 index 00000000000..cf980ca14a2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsModVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsName.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsName.class new file mode 100644 index 00000000000..5ac00cd1ab7 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsName.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNameRef.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNameRef.class new file mode 100644 index 00000000000..d85c3e589de Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNameRef.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNew.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNew.class new file mode 100644 index 00000000000..d4770c5d3d2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNew.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNode.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNode.class new file mode 100644 index 00000000000..248329d29ee Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNode.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNullLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNullLiteral.class new file mode 100644 index 00000000000..5c628bbdfb6 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNullLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.class new file mode 100644 index 00000000000..23fe5d01642 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.class new file mode 100644 index 00000000000..5ccdcfef8fc Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsOperator.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsOperator.class new file mode 100644 index 00000000000..ce629c48ba2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsOperator.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsParameter.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsParameter.class new file mode 100644 index 00000000000..475a8a949fd Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsParameter.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.class new file mode 100644 index 00000000000..3e3a4594ec5 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.class new file mode 100644 index 00000000000..222ede739c1 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsProgram.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsProgram.class new file mode 100644 index 00000000000..92030c729fa Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsProgram.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsProgramFragment.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsProgramFragment.class new file mode 100644 index 00000000000..69146498243 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsProgramFragment.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.class new file mode 100644 index 00000000000..0495fdc0c42 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsRegExp.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsRegExp.class new file mode 100644 index 00000000000..633ce114d25 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsRegExp.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsReturn.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsReturn.class new file mode 100644 index 00000000000..5eaa52fa961 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsReturn.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsRootScope.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsRootScope.class new file mode 100644 index 00000000000..9d7aa936a36 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsRootScope.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsScope.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsScope.class new file mode 100644 index 00000000000..eac974f40c4 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsScope.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsStatement.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsStatement.class new file mode 100644 index 00000000000..78d1fe272d7 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsStatement.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsStringLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsStringLiteral.class new file mode 100644 index 00000000000..132ce3523d9 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsStringLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsSwitch.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsSwitch.class new file mode 100644 index 00000000000..5c379e89951 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsSwitch.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsSwitchMember.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsSwitchMember.class new file mode 100644 index 00000000000..53fc2bc70f2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsSwitchMember.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsThisRef.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsThisRef.class new file mode 100644 index 00000000000..73fbd96d93d Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsThisRef.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsThrow.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsThrow.class new file mode 100644 index 00000000000..121e5eccc63 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsThrow.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsTry.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsTry.class new file mode 100644 index 00000000000..aaa3ae3a154 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsTry.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.class new file mode 100644 index 00000000000..46eee0cf24d Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.class new file mode 100644 index 00000000000..43fd2531643 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsValueLiteral.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsValueLiteral.class new file mode 100644 index 00000000000..efa11a0343a Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsValueLiteral.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVars$JsVar.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVars$JsVar.class new file mode 100644 index 00000000000..24419894aac Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVars$JsVar.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVars.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVars.class new file mode 100644 index 00000000000..42107240c96 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVars.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitable.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitable.class new file mode 100644 index 00000000000..eb534b4f7a2 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitable.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor$1.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor$1.class new file mode 100644 index 00000000000..e86bd111f2d Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor$1.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor$2.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor$2.class new file mode 100644 index 00000000000..cf2a6c96e07 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor$2.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor.class new file mode 100644 index 00000000000..c693be7538b Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsVisitor.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsWhile.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsWhile.class new file mode 100644 index 00000000000..ba9265d782b Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/JsWhile.class differ diff --git a/out/production/k2js/com/google/dart/compiler/backend/js/ast/NodeKind.class b/out/production/k2js/com/google/dart/compiler/backend/js/ast/NodeKind.class new file mode 100644 index 00000000000..ae1f5036db6 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/backend/js/ast/NodeKind.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/AbstractNode.class b/out/production/k2js/com/google/dart/compiler/common/AbstractNode.class new file mode 100644 index 00000000000..3dd14c476bd Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/AbstractNode.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/HasSourceInfo.class b/out/production/k2js/com/google/dart/compiler/common/HasSourceInfo.class new file mode 100644 index 00000000000..57a76804dee Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/HasSourceInfo.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/Name.class b/out/production/k2js/com/google/dart/compiler/common/Name.class new file mode 100644 index 00000000000..f77a6855acb Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/Name.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/NameFactory$FakeKey.class b/out/production/k2js/com/google/dart/compiler/common/NameFactory$FakeKey.class new file mode 100644 index 00000000000..4fce36a1502 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/NameFactory$FakeKey.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/NameFactory$RealKey.class b/out/production/k2js/com/google/dart/compiler/common/NameFactory$RealKey.class new file mode 100644 index 00000000000..bc4cf8acaa0 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/NameFactory$RealKey.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/NameFactory.class b/out/production/k2js/com/google/dart/compiler/common/NameFactory.class new file mode 100644 index 00000000000..540c3acb103 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/NameFactory.class differ diff --git a/out/production/k2js/com/google/dart/compiler/common/SourceInfo.class b/out/production/k2js/com/google/dart/compiler/common/SourceInfo.class new file mode 100644 index 00000000000..c4d45213177 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/common/SourceInfo.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/AbstractTextOutput.class b/out/production/k2js/com/google/dart/compiler/util/AbstractTextOutput.class new file mode 100644 index 00000000000..37577bd157a Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/AbstractTextOutput.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/AstUtil.class b/out/production/k2js/com/google/dart/compiler/util/AstUtil.class new file mode 100644 index 00000000000..76e4d9911de Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/AstUtil.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/DefaultTextOutput.class b/out/production/k2js/com/google/dart/compiler/util/DefaultTextOutput.class new file mode 100644 index 00000000000..7e7f0ddc942 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/DefaultTextOutput.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/Hack.class b/out/production/k2js/com/google/dart/compiler/util/Hack.class new file mode 100644 index 00000000000..65e5ea9af77 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/Hack.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/Lists.class b/out/production/k2js/com/google/dart/compiler/util/Lists.class new file mode 100644 index 00000000000..92c839e1020 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/Lists.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/Maps.class b/out/production/k2js/com/google/dart/compiler/util/Maps.class new file mode 100644 index 00000000000..e60bb8cbd77 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/Maps.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/Paths.class b/out/production/k2js/com/google/dart/compiler/util/Paths.class new file mode 100644 index 00000000000..87dbac77f42 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/Paths.class differ diff --git a/out/production/k2js/com/google/dart/compiler/util/TextOutput.class b/out/production/k2js/com/google/dart/compiler/util/TextOutput.class new file mode 100644 index 00000000000..6f15b6041a3 Binary files /dev/null and b/out/production/k2js/com/google/dart/compiler/util/TextOutput.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/generate/CodeGenerator.class b/out/production/k2js/org/jetbrains/k2js/generate/CodeGenerator.class new file mode 100644 index 00000000000..e794109dcaa Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/generate/CodeGenerator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/AbstractTranslator.class b/out/production/k2js/org/jetbrains/k2js/translate/AbstractTranslator.class new file mode 100644 index 00000000000..33084bf5ad4 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/AbstractTranslator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/ContextType$1.class b/out/production/k2js/org/jetbrains/k2js/translate/ContextType$1.class new file mode 100644 index 00000000000..f489b64427d Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/ContextType$1.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/ContextType$2.class b/out/production/k2js/org/jetbrains/k2js/translate/ContextType$2.class new file mode 100644 index 00000000000..ab684b234af Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/ContextType$2.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/ContextType$3.class b/out/production/k2js/org/jetbrains/k2js/translate/ContextType$3.class new file mode 100644 index 00000000000..231222fecab Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/ContextType$3.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/ContextType.class b/out/production/k2js/org/jetbrains/k2js/translate/ContextType.class new file mode 100644 index 00000000000..7c41c676395 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/ContextType.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$FunctionVariableDeclaration.class b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$FunctionVariableDeclaration.class new file mode 100644 index 00000000000..e3be5d547b2 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$FunctionVariableDeclaration.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$NamespacePropertyDeclaration.class b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$NamespacePropertyDeclaration.class new file mode 100644 index 00000000000..af07015463a Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$NamespacePropertyDeclaration.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$State.class b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$State.class new file mode 100644 index 00000000000..cb07e026820 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator$State.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator.class b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator.class new file mode 100644 index 00000000000..8c220809ec2 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/DeclarationTranslator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/ExpressionTranslator.class b/out/production/k2js/org/jetbrains/k2js/translate/ExpressionTranslator.class new file mode 100644 index 00000000000..ed7b141ecfe Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/ExpressionTranslator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/FunctionTranslator.class b/out/production/k2js/org/jetbrains/k2js/translate/FunctionTranslator.class new file mode 100644 index 00000000000..f77c2090441 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/FunctionTranslator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/GenerationState.class b/out/production/k2js/org/jetbrains/k2js/translate/GenerationState.class new file mode 100644 index 00000000000..5fd4f17640f Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/GenerationState.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/NamespaceTranslator.class b/out/production/k2js/org/jetbrains/k2js/translate/NamespaceTranslator.class new file mode 100644 index 00000000000..09d4a4aba40 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/NamespaceTranslator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/OperationTranslator.class b/out/production/k2js/org/jetbrains/k2js/translate/OperationTranslator.class new file mode 100644 index 00000000000..4435469276e Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/OperationTranslator.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/TranslationContext.class b/out/production/k2js/org/jetbrains/k2js/translate/TranslationContext.class new file mode 100644 index 00000000000..00e82e41d54 Binary files /dev/null and b/out/production/k2js/org/jetbrains/k2js/translate/TranslationContext.class differ diff --git a/out/production/k2js/org/jetbrains/k2js/translate/jet/Library.jet b/out/production/k2js/org/jetbrains/k2js/translate/jet/Library.jet new file mode 100644 index 00000000000..b88e5eb0287 --- /dev/null +++ b/out/production/k2js/org/jetbrains/k2js/translate/jet/Library.jet @@ -0,0 +1,670 @@ +namespace jet + +namespace typeinfo { + class TypeInfo { + fun isSubtypeOf(other : TypeInfo<*>) : Boolean + fun isInstance(obj : Any?) : Boolean + } + + fun typeinfo() : TypeInfo + fun typeinfo(expression : T) : TypeInfo +} + +namespace io { + fun print(message : Any?) + fun print(message : Int) + fun print(message : Long) + fun print(message : Byte) + fun print(message : Short) + fun print(message : Char) + fun print(message : Boolean) + fun print(message : Float) + fun print(message : Double) + + fun println(message : Any?) + fun println(message : Int) + fun println(message : Long) + fun println(message : Byte) + fun println(message : Short) + fun println(message : Char) + fun println(message : Boolean) + fun println(message : Float) + fun println(message : Double) + + fun readLine() : String? +} + +// Can't write a body due to a bootstrapping problem (see JET-74) +fun Any?.equals(other : Any?) : Boolean// = this === other + +// Returns "null" for null +fun Any?.toString() : String// = this === other + +fun String?.plus(other: Any?) : String + +trait Iterator { + fun next() : T + val hasNext : Boolean +} + +trait Iterable { + fun iterator() : Iterator +} + +class Array(val size : Int, init : fun(Int) : T = null ) { + fun get(index : Int) : T + fun set(index : Int, value : T) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class ByteArray(val size : Int) { + fun get(index : Int) : Byte + fun set(index : Int, value : Byte) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class ShortArray(val size : Int) { + fun get(index : Int) : Short + fun set(index : Int, value : Short) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class IntArray(val size : Int) { + fun get(index : Int) : Int + fun set(index : Int, value : Int) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class LongArray(val size : Int) { + fun get(index : Int) : Long + fun set(index : Int, value : Long) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class FloatArray(val size : Int) { + fun get(index : Int) : Float + fun set(index : Int, value : Float) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class DoubleArray(val size : Int) { + fun get(index : Int) : Double + fun set(index : Int, value : Double) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class CharArray(val size : Int) { + fun get(index : Int) : Char + fun set(index : Int, value : Char) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +class BooleanArray(val size : Int) { + fun get(index : Int) : Boolean + fun set(index : Int, value : Boolean) : Unit + + fun iterator() : Iterator + + val indices : IntRange +} + +trait Comparable { + fun compareTo(other : T) : Int +} + +trait Hashable { + fun hashCode() : Int + fun equals(other : Any?) : Boolean +} + +class Boolean : Comparable { + fun not() : Boolean + + fun xor(other : Boolean) : Boolean + + fun equals(other : Any?) : Boolean +} + +class String() : Comparable { + fun get(index : Int) : Char + val length : Int + + fun plus(other : Any?) : String + + fun equals(other : Any?) : Boolean + fun equalsIgnoreCase(other: String?) : Boolean + + fun substring(start: Int): String + fun substring(start: Int, end: Int): String + + fun startsWith(prefix: String, toffset: Int): Boolean + fun startsWith(prefix: String): Boolean + fun endsWith(suffix: String): Boolean + + fun trim(): String +} + +trait Range> { + fun contains(item : T) : Boolean +} + +class IntRange(val start : Int, size : Int, reversed : Boolean = false) : Range, Iterable { + fun iterator () : Iterator + + fun contains (elem: Int) : Boolean + + val size : Int + + val end : Int + + val reversed : Boolean +} + +class LongRange(val start : Long, size : Long, reversed : Boolean = false) : Range, Iterable { + fun iterator () : Iterator + + fun contains (elem: Long) : Boolean + + val size : Long + + val end : Long + + val reversed : Boolean +} + +abstract class Number : Hashable { + abstract val dbl : Double + abstract val flt : Float + abstract val lng : Long + abstract val int : Int + abstract val chr : Char + abstract val sht : Short + abstract val byt : Byte +// fun equals(other : Double) : Boolean +// fun equals(other : Float) : Boolean +// fun equals(other : Long) : Boolean +// fun equals(other : Byte) : Boolean +// fun equals(other : Int) : Boolean +// fun equals(other : Short) : Boolean +// fun equals(other : Char) : Boolean +} + +class Double : Number, Comparable { + override fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Double + fun plus(other : Long) : Double + fun plus(other : Int) : Double + fun plus(other : Short) : Double + fun plus(other : Byte) : Double + fun plus(other : Char) : Double + + fun minus(other : Double) : Double + fun minus(other : Float) : Double + fun minus(other : Long) : Double + fun minus(other : Int) : Double + fun minus(other : Short) : Double + fun minus(other : Byte) : Double + fun minus(other : Char) : Double + + fun times(other : Double) : Double + fun times(other : Float) : Double + fun times(other : Long) : Double + fun times(other : Int) : Double + fun times(other : Short) : Double + fun times(other : Byte) : Double + fun times(other : Char) : Double + + fun div(other : Double) : Double + fun div(other : Float) : Double + fun div(other : Long) : Double + fun div(other : Int) : Double + fun div(other : Short) : Double + fun div(other : Byte) : Double + fun div(other : Char) : Double + + fun mod(other : Double) : Double + fun mod(other : Float) : Double + fun mod(other : Long) : Double + fun mod(other : Int) : Double + fun mod(other : Short) : Double + fun mod(other : Byte) : Double + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : Range + fun rangeTo(other : Int) : Range + fun rangeTo(other : Short) : Range + fun rangeTo(other : Byte) : Range + fun rangeTo(other : Char) : Range + + fun inc() : Double + fun dec() : Double + fun plus() : Double + fun minus() : Double +} + +class Float : Number, Comparable { + fun compareTo(other : Double) : Int + override fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Float + fun plus(other : Int) : Float + fun plus(other : Short) : Float + fun plus(other : Byte) : Float + fun plus(other : Char) : Float + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Float + fun minus(other : Int) : Float + fun minus(other : Short) : Float + fun minus(other : Byte) : Float + fun minus(other : Char) : Float + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Float + fun times(other : Int) : Float + fun times(other : Short) : Float + fun times(other : Byte) : Float + fun times(other : Char) : Float + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Float + fun div(other : Int) : Float + fun div(other : Short) : Float + fun div(other : Byte) : Float + fun div(other : Char) : Float + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Float + fun mod(other : Int) : Float + fun mod(other : Short) : Float + fun mod(other : Byte) : Float + fun mod(other : Char) : Float + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : Range + fun rangeTo(other : Int) : Range + fun rangeTo(other : Short) : Range + fun rangeTo(other : Byte) : Range + fun rangeTo(other : Char) : Range + + fun inc() : Float + fun dec() : Float + fun plus() : Float + fun minus() : Float +} + +class Long : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + override fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Long + fun plus(other : Short) : Long + fun plus(other : Byte) : Long + fun plus(other : Char) : Long + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Long + fun minus(other : Short) : Long + fun minus(other : Byte) : Long + fun minus(other : Char) : Long + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Long + fun times(other : Short) : Long + fun times(other : Byte) : Long + fun times(other : Char) : Long + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Long + fun div(other : Short) : Long + fun div(other : Byte) : Long + fun div(other : Char) : Long + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Long + fun mod(other : Short) : Long + fun mod(other : Byte) : Long + fun mod(other : Char) : Long + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : LongRange + fun rangeTo(other : Short) : LongRange + fun rangeTo(other : Byte) : LongRange + fun rangeTo(other : Char) : LongRange + + fun inc() : Long + fun dec() : Long + fun plus() : Long + fun minus() : Long + + fun shl(bits : Int) : Long + fun shr(bits : Int) : Long + fun ushr(bits : Int) : Long + fun and(other : Long) : Long + fun or(other : Long) : Long + fun xor(other : Long) : Long + fun inv() : Long +} + +class Int : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + override fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Int + fun dec() : Int + fun plus() : Int + fun minus() : Int + + fun shl(bits : Int) : Int + fun shr(bits : Int) : Int + fun ushr(bits : Int) : Int + fun and(other : Int) : Int + fun or(other : Int) : Int + fun xor(other : Int) : Int + fun inv() : Int +} + +class Char : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + override fun compareTo(other : Char) : Int + fun compareTo(other : Byte) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Char + fun dec() : Char + fun plus() : Int + fun minus() : Int +} + +class Short : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + override fun compareTo(other : Short) : Int + fun compareTo(other : Byte) : Int + fun compareTo(other : Char) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Short + fun dec() : Short + fun plus() : Int + fun minus() : Int +} + +class Byte : Number, Comparable { + fun compareTo(other : Double) : Int + fun compareTo(other : Float) : Int + fun compareTo(other : Long) : Int + fun compareTo(other : Int) : Int + fun compareTo(other : Short) : Int + fun compareTo(other : Char) : Int + override fun compareTo(other : Byte) : Int + + fun plus(other : Double) : Double + fun plus(other : Float) : Float + fun plus(other : Long) : Long + fun plus(other : Int) : Int + fun plus(other : Short) : Int + fun plus(other : Byte) : Int + fun plus(other : Char) : Int + + fun minus(other : Double) : Double + fun minus(other : Float) : Float + fun minus(other : Long) : Long + fun minus(other : Int) : Int + fun minus(other : Short) : Int + fun minus(other : Byte) : Int + fun minus(other : Char) : Int + + fun times(other : Double) : Double + fun times(other : Float) : Float + fun times(other : Long) : Long + fun times(other : Int) : Int + fun times(other : Short) : Int + fun times(other : Byte) : Int + fun times(other : Char) : Int + + fun div(other : Double) : Double + fun div(other : Float) : Float + fun div(other : Long) : Long + fun div(other : Int) : Int + fun div(other : Short) : Int + fun div(other : Byte) : Int + fun div(other : Char) : Int + + fun mod(other : Double) : Double + fun mod(other : Float) : Float + fun mod(other : Long) : Long + fun mod(other : Int) : Int + fun mod(other : Short) : Int + fun mod(other : Byte) : Int + fun mod(other : Char) : Int + + fun rangeTo(other : Double) : Range + fun rangeTo(other : Float) : Range + fun rangeTo(other : Long) : LongRange + fun rangeTo(other : Int) : IntRange + fun rangeTo(other : Short) : IntRange + fun rangeTo(other : Byte) : IntRange + fun rangeTo(other : Char) : IntRange + + fun inc() : Byte + fun dec() : Byte + fun plus() : Int + fun minus() : Int +} diff --git a/out/test/k2js/com/google/dart/compiler/backend/js/Test.class b/out/test/k2js/com/google/dart/compiler/backend/js/Test.class new file mode 100644 index 00000000000..99eaaf28327 Binary files /dev/null and b/out/test/k2js/com/google/dart/compiler/backend/js/Test.class differ diff --git a/src/com/google/dart/compiler/InternalCompilerException.java b/src/com/google/dart/compiler/InternalCompilerException.java new file mode 100644 index 00000000000..5db265e920a --- /dev/null +++ b/src/com/google/dart/compiler/InternalCompilerException.java @@ -0,0 +1,15 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler; + +/** + * Exception thrown when the compiler encounters an unexpected internal error. + */ +public class InternalCompilerException extends RuntimeException { + + public InternalCompilerException(String message) { + super(message); + } +} diff --git a/src/com/google/dart/compiler/Source.java b/src/com/google/dart/compiler/Source.java new file mode 100644 index 00000000000..13e6e16cbdd --- /dev/null +++ b/src/com/google/dart/compiler/Source.java @@ -0,0 +1,44 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler; + +import java.io.IOException; +import java.io.Reader; +import java.net.URI; + +/** + * Abstract interface to a source file. + */ +public interface Source { + + /** + * Determines whether the given source exists. + */ + boolean exists(); + + /** + * Returns the last-modified timestamp for this source, using the same units as + * {@link java.util.Date#getTime()}. + */ + long getLastModified(); + + /** + * Gets the name of this source. + */ + String getName(); + + /** + * Gets a reader for the dart file's source code. The caller is responsible for closing the + * returned reader. + */ + Reader getSourceReader() throws IOException; + + /** + * Gets the identifier for this source. This is used to uniquely identify the + * source, but should not be used to obtain the source content. Use + * {@link #getSourceReader()} to obtain the source content. + */ + URI getUri(); +} diff --git a/src/com/google/dart/compiler/backend/js/Cloner.java b/src/com/google/dart/compiler/backend/js/Cloner.java new file mode 100644 index 00000000000..fa3447fe168 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/Cloner.java @@ -0,0 +1,232 @@ +// Copyright 2011, the Dart project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.InternalCompilerException; +import com.google.dart.compiler.backend.js.ast.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +/** + * Implements actual cloning logic. We rely on the JsExpressions to provide + * traversal logic. The {@link #stack} field is used to accumulate + * already-cloned JsExpression instances. One gotcha that falls out of this is + * that argument lists are on the stack in reverse order, so lists should be + * constructed via inserts, rather than appends. + */ +public class Cloner extends JsVisitor { + protected final Stack stack = new Stack(); + private boolean successful = true; + + /** + * @param expression + * @return Return a clone of the expression tree + */ + public static JsExpression clone(JsExpression expression) { + Cloner c = new Cloner(); + c.accept(expression); + return c.getExpression(); + } + + @Override + public void endVisit(JsArrayAccess x, JsContext ctx) { + JsArrayAccess newExpression = new JsArrayAccess(); + newExpression.setIndexExpr(stack.pop()); + newExpression.setArrayExpr(stack.pop()); + stack.push(newExpression); + } + + @Override + public void endVisit(JsArrayLiteral x, JsContext ctx) { + JsArrayLiteral toReturn = new JsArrayLiteral(); + List expressions = toReturn.getExpressions(); + int size = x.getExpressions().size(); + while (size-- > 0) { + expressions.add(0, stack.pop()); + } + stack.push(toReturn); + } + + @Override + public void endVisit(JsBinaryOperation x, JsContext ctx) { + JsBinaryOperation toReturn = new JsBinaryOperation(x.getOperator()); + toReturn.setArg2(stack.pop()); + toReturn.setArg1(stack.pop()); + stack.push(toReturn); + } + + @Override + public void endVisit(JsBooleanLiteral x, JsContext ctx) { + stack.push(x); + } + + @Override + public void endVisit(JsConditional x, JsContext ctx) { + JsConditional toReturn = new JsConditional(); + toReturn.setElseExpression(stack.pop()); + toReturn.setThenExpression(stack.pop()); + toReturn.setTestExpression(stack.pop()); + stack.push(toReturn); + } + + /** + * The only functions that would get be visited are those being used as + * first-class objects. + */ + @Override + public void endVisit(JsFunction x, JsContext ctx) { + // Set a flag to indicate that we cannot continue, and push a null so + // we don't run out of elements on the stack. + successful = false; + stack.push(null); + } + + /** + * Cloning the invocation allows us to modify it without damaging other call + * sites. + */ + @Override + public void endVisit(JsInvocation x, JsContext ctx) { + JsInvocation toReturn = new JsInvocation(); + List params = toReturn.getArguments(); + int size = x.getArguments().size(); + while (size-- > 0) { + params.add(0, stack.pop()); + } + toReturn.setQualifier(stack.pop()); + stack.push(toReturn); + } + + /** + * Do a deep clone of a JsNameRef. Because JsNameRef chains are shared + * throughout the AST, you can't just go and change their qualifiers when + * re-writing an invocation. + */ + @Override + public void endVisit(JsNameRef x, JsContext ctx) { + JsNameRef toReturn; + JsName name = x.getName(); + if (name != null) { + toReturn = new JsNameRef(name); + } else { + toReturn = new JsNameRef(x.getIdent()); + } + + if (x.getQualifier() != null) { + toReturn.setQualifier(stack.pop()); + } + stack.push(toReturn); + } + + @Override + public void endVisit(JsNew x, JsContext ctx) { + int size = x.getArguments().size(); + List arguments = new ArrayList(size); + while (size-- > 0) { + arguments.add(0, stack.pop()); + } + JsNew toReturn = new JsNew(stack.pop()); + toReturn.getArguments().addAll(arguments); + stack.push(toReturn); + } + + @Override + public void endVisit(JsNullLiteral x, JsContext ctx) { + stack.push(x); + } + + @Override + public void endVisit(JsNumberLiteral x, JsContext ctx) { + stack.push(x); + } + + @Override + public void endVisit(JsObjectLiteral x, JsContext ctx) { + JsObjectLiteral toReturn = new JsObjectLiteral(); + List inits = toReturn.getPropertyInitializers(); + + int size = x.getPropertyInitializers().size(); + while (size-- > 0) { + /* + * JsPropertyInitializers are the only non-JsExpression objects that we + * care about, so we just go ahead and create the objects in the loop, + * rather than expecting it to be on the stack and having to perform + * narrowing casts at all stack.pop() invocations. + */ + JsPropertyInitializer newInit = new JsPropertyInitializer(); + newInit.setValueExpr(stack.pop()); + newInit.setLabelExpr(stack.pop()); + + inits.add(0, newInit); + } + stack.push(toReturn); + } + + @Override + public void endVisit(JsPostfixOperation x, JsContext ctx) { + JsPostfixOperation toReturn = new JsPostfixOperation(x.getOperator()); + toReturn.setArg(stack.pop()); + stack.push(toReturn); + } + + @Override + public void endVisit(JsPrefixOperation x, JsContext ctx) { + JsPrefixOperation toReturn = new JsPrefixOperation(x.getOperator()); + toReturn.setArg(stack.pop()); + stack.push(toReturn); + } + + @Override + public void endVisit(JsRegExp x, JsContext ctx) { + stack.push(x); + } + + @Override + public void endVisit(JsStringLiteral x, JsContext ctx) { + stack.push(x); + } + + @Override + public void endVisit(JsThisRef x, JsContext ctx) { + stack.push(new JsThisRef()); + } + + public JsExpression getExpression() { + return (successful && checkStack()) ? stack.peek() : null; + } + + private boolean checkStack() { + if (stack.size() > 1) { + throw new InternalCompilerException("Too many expressions on stack"); + } + + return stack.size() == 1; + } +} + diff --git a/src/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.java b/src/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.java new file mode 100644 index 00000000000..a15af6b44ed --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.java @@ -0,0 +1,104 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; + +/** + * Searches for method invocations in constructor expressions that would not + * normally be surrounded by parentheses. + */ +public class JsConstructExpressionVisitor extends JsVisitor { + + public static boolean exec(JsExpression expression) { + if (JsPrecedenceVisitor.exec(expression) < JsPrecedenceVisitor.PRECEDENCE_NEW) { + return true; + } + JsConstructExpressionVisitor visitor = new JsConstructExpressionVisitor(); + visitor.accept(expression); + return visitor.containsInvocation; + } + + private boolean containsInvocation = false; + + private JsConstructExpressionVisitor() { + } + + /** + * We only look at the array expression since the index has its own scope. + */ + @Override + public boolean visit(JsArrayAccess x, JsContext ctx) { + accept(x.getArrayExpr()); + return false; + } + + /** + * Array literals have their own scoping. + */ + @Override + public boolean visit(JsArrayLiteral x, JsContext ctx) { + return false; + } + + /** + * Functions have their own scoping. + */ + @Override + public boolean visit(JsFunction x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsInvocation x, JsContext ctx) { + containsInvocation = true; + return false; + } + + @Override + public boolean visit(JsNameRef x, JsContext ctx) { + if (!x.isLeaf()) { + accept(x.getQualifier()); + } + return false; + } + + /** + * New constructs bind to the nearest set of parentheses. + */ + @Override + public boolean visit(JsNew x, JsContext ctx) { + return false; + } + + /** + * Object literals have their own scope. + */ + @Override + public boolean visit(JsObjectLiteral x, JsContext ctx) { + return false; + } + + /** + * We only look at nodes that would not normally be surrounded by parentheses. + */ + @Override + protected T doAccept(T node) { + // Assign to Object to prevent 'inconvertible types' toJsAst errors due + // to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6548436 + // reproducible in jdk1.6.0_02. + Object o = node; + if (o instanceof JsExpression) { + JsExpression expression = (JsExpression) o; + int precedence = JsPrecedenceVisitor.exec(expression); + // Only visit expressions that won't automatically be surrounded by + // parentheses + if (precedence < JsPrecedenceVisitor.PRECEDENCE_NEW) { + return node; + } + } + return super.doAccept(node); + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.java b/src/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.java new file mode 100644 index 00000000000..0fdb8a5032b --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.java @@ -0,0 +1,119 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; + +/** + * Determines if an expression statement needs to be surrounded by parentheses. + * + * The statement or the left-most expression needs to be surrounded by + * parentheses if the left-most expression is an object literal or a function + * object. Function declarations do not need parentheses. + * + * For example the following require parentheses:
+ *
    + *
  • { key : 'value'}
  • + *
  • { key : 'value'}.key
  • + *
  • function () {return 1;}()
  • + *
  • function () {return 1;}.prototype
  • + *
+ * + * The following do not require parentheses:
+ *
    + *
  • var x = { key : 'value'}
  • + *
  • "string" + { key : 'value'}.key
  • + *
  • function func() {}
  • + *
  • function() {}
  • + *
+ */ +public class JsFirstExpressionVisitor extends JsVisitor { + + public static boolean exec(JsExprStmt statement) { + JsFirstExpressionVisitor visitor = new JsFirstExpressionVisitor(); + JsExpression expression = statement.getExpression(); + // Pure function declarations do not need parentheses + if (expression instanceof JsFunction) { + return false; + } + visitor.accept(statement.getExpression()); + return visitor.needsParentheses; + } + + private boolean needsParentheses = false; + + private JsFirstExpressionVisitor() { + } + + @Override + public boolean visit(JsArrayAccess x, JsContext ctx) { + accept(x.getArrayExpr()); + return false; + } + + @Override + public boolean visit(JsArrayLiteral x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsBinaryOperation x, JsContext ctx) { + accept(x.getArg1()); + return false; + } + + @Override + public boolean visit(JsConditional x, JsContext ctx) { + accept(x.getTestExpression()); + return false; + } + + @Override + public boolean visit(JsFunction x, JsContext ctx) { + needsParentheses = true; + return false; + } + + @Override + public boolean visit(JsInvocation x, JsContext ctx) { + accept(x.getQualifier()); + return false; + } + + @Override + public boolean visit(JsNameRef x, JsContext ctx) { + if (!x.isLeaf()) { + accept(x.getQualifier()); + } + return false; + } + + @Override + public boolean visit(JsNew x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsObjectLiteral x, JsContext ctx) { + needsParentheses = true; + return false; + } + + @Override + public boolean visit(JsPostfixOperation x, JsContext ctx) { + accept(x.getArg()); + return false; + } + + @Override + public boolean visit(JsPrefixOperation x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsRegExp x, JsContext ctx) { + return false; + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsNameProvider.java b/src/com/google/dart/compiler/backend/js/JsNameProvider.java new file mode 100644 index 00000000000..5cdab3dc714 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsNameProvider.java @@ -0,0 +1,85 @@ +//// Copyright 2011, the Dart project authors. All rights reserved. +//// Redistribution and use in source and binary forms, with or without +//// modification, are permitted provided that the following conditions are +//// met: +//// +//// * Redistributions of source code must retain the above copyright +//// notice, this list of conditions and the following disclaimer. +//// * Redistributions in binary form must reproduce the above +//// copyright notice, this list of conditions and the following +//// disclaimer in the documentation and/or other materials provided +//// with the distribution. +//// * Neither the name of Google Inc. nor the names of its +//// contributors may be used to endorse or promote products derived +//// from this software without specific prior written permission. +//// +//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +//// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +//// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +//// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +//// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +//// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +//// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +//// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//package com.google.dart.compiler.backend.js; +// +//import com.google.dart.compiler.backend.js.ast.JsName; +//import com.google.dart.compiler.backend.js.ast.JsProgram; +//import com.google.dart.compiler.backend.js.ast.JsScope; +//import com.google.dart.compiler.resolver.ClassElement; +//import com.google.dart.compiler.resolver.ElementKind; +// +//import java.util.HashMap; +//import java.util.Map; +// +///** +// * A helper class for managing global names. +// * @author johnlenz@google.com (John Lenz) +// */ +//class JsNameProvider { +// private final DartMangler mangler; +// private Map names = new HashMap(); +// private JsScope globalScope; +// +// JsNameProvider(JsProgram program, DartMangler mangler) { +// this.globalScope = program.getScope(); +// this.mangler = mangler; +// } +// +// /** +// * Returns the JsName for the given element. If the element is global and +// * hasn't been declared yet, it is done now. +// */ +// JsName getName(Symbol symbol) { +// JsName jsName = names.get(symbol); +// if (jsName != null) { +// assert !jsName.getShortIdent().equals("Object$Dart"); +// return jsName; +// } +// assert ElementKind.of(symbol).equals(ElementKind.CLASS) +// : "Only classes can be lazily declared. Undeclared: " +// + symbol.getOriginalSymbolName(); +// ClassElement classElement = (ClassElement) symbol; +// String name = classElement.getName(); +// String nativeName = classElement.getNativeName(); +// if (nativeName == null) { +// String mangledClassName = mangler.mangleClassName(classElement); +// jsName = globalScope.declareName(mangledClassName, mangledClassName, name); +// } else { +// jsName = globalScope.declareName(nativeName); +// } +// // Class names are globally accessible. +// jsName.setObfuscatable(false); +// names.put(symbol, jsName); +// assert !jsName.getShortIdent().equals("Object$Dart") : "unexpected " + ((ClassElement) symbol).getNode().getSource().getName(); +// return jsName; +// } +// +// void setName(Symbol symbol, JsName name) { +// names.put(symbol, name); +// } +//} diff --git a/src/com/google/dart/compiler/backend/js/JsNamer.java b/src/com/google/dart/compiler/backend/js/JsNamer.java new file mode 100644 index 00000000000..41e99061eda --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsNamer.java @@ -0,0 +1,23 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.JsProgram; + +/** + * A namer runs through a program and renames the short names of JsNames. + * Namers must assign short names that don't clash and that are valid + * JS-identifiers. Nested JsScopes must not shadow JsNames from outer + * scopes. + * If a JsName is marked as non-obfuscatable then it must retain its short + * name. + */ +public interface JsNamer { + /** + * Names the shortNames of all JsNames of the program so that they are valid + * JS-identifiers and that there are no clashes and no shadowing. + */ + public void exec(JsProgram program); +} diff --git a/src/com/google/dart/compiler/backend/js/JsNormalizer.java b/src/com/google/dart/compiler/backend/js/JsNormalizer.java new file mode 100644 index 00000000000..04c5530cd42 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsNormalizer.java @@ -0,0 +1,103 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; + +/** + * Fixes any semantic errors introduced by JS AST gen. + * + *
    + *
  • Creating clinit calls can put comma expressions as lvalues; the modifying + * operation must be moved inside the comma expression to the last argument.
  • + *
+ */ +public class JsNormalizer { + + /** + * Resolves any unresolved JsNameRefs. + */ + private static class JsNormalizing extends JsModVisitor { + + @Override + public void endVisit(JsBinaryOperation x, JsContext ctx) { + maybeShuffleModifyingBinary(x, ctx); + } + + @Override + public void endVisit(JsPostfixOperation x, JsContext ctx) { + maybeShuffleModifyingUnary(x, ctx); + } + + @Override + public void endVisit(JsPrefixOperation x, JsContext ctx) { + maybeShuffleModifyingUnary(x, ctx); + } + + /** + * Due to the way clinits are constructed, you can end up with a comma + * operation as the argument to a modifying operation, which is illegal. + * Juggle things to put the operator inside of the comma expression. + */ + private void maybeShuffleModifyingBinary(JsBinaryOperation x, JsContext ctx) { + JsBinaryOperator myOp = x.getOperator(); + JsExpression lhs = x.getArg1(); + + if (myOp.isAssignment() && (lhs instanceof JsBinaryOperation)) { + // Find the rightmost comma operation + JsBinaryOperation curLhs = (JsBinaryOperation) lhs; + assert (curLhs.getOperator() == JsBinaryOperator.COMMA); + while (curLhs.getArg2() instanceof JsBinaryOperation) { + curLhs = (JsBinaryOperation) curLhs.getArg2(); + assert (curLhs.getOperator() == JsBinaryOperator.COMMA); + } + // curLhs is now the rightmost comma operation; slide our operation in + x.setArg1(curLhs.getArg2()); + curLhs.setArg2(x); + // replace myself with the comma expression + ctx.replaceMe(lhs); + } + } + + /** + * Due to the way clinits are constructed, you can end up with a comma + * operation as the argument to a modifying operation, which is illegal. + * Juggle things to put the operator inside of the comma expression. + */ + private void maybeShuffleModifyingUnary(JsUnaryOperation x, JsContext ctx) { + JsUnaryOperator myOp = x.getOperator(); + JsExpression arg = x.getArg(); + if (myOp.isModifying() && (arg instanceof JsBinaryOperation)) { + // Find the rightmost comma operation + JsBinaryOperation curArg = (JsBinaryOperation) arg; + assert (curArg.getOperator() == JsBinaryOperator.COMMA); + while (curArg.getArg2() instanceof JsBinaryOperation) { + curArg = (JsBinaryOperation) curArg.getArg2(); + assert (curArg.getOperator() == JsBinaryOperator.COMMA); + } + // curArg is now the rightmost comma operation; slide our operation in + x.setArg(curArg.getArg2()); + curArg.setArg2(x); + // replace myself with the comma expression + ctx.replaceMe(arg); + } + } + } + + public static void exec(JsProgram program) { + new JsNormalizer(program).execImpl(); + } + + private final JsProgram program; + + private JsNormalizer(JsProgram program) { + this.program = program; + } + + private void execImpl() { + JsNormalizing normalizer = new JsNormalizing(); + normalizer.accept(program); + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsParserException.java b/src/com/google/dart/compiler/backend/js/JsParserException.java new file mode 100644 index 00000000000..79b53c1d69e --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsParserException.java @@ -0,0 +1,92 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +/** + * Indicates inability to parse JavaScript source. + */ +public class JsParserException extends Exception { + + /** + * Represents the location of a parser exception. + */ + public static class SourceDetail { + private final String fileName; + private final int line; + private final int lineOffset; + private final String lineSource; + + public SourceDetail(int line, String lineSource, int lineOffset, String fileName) { + this.line = line; + this.lineSource = lineSource; + this.lineOffset = lineOffset; + this.fileName = fileName; + } + + public String getFileName() { + return fileName; + } + + public int getLine() { + return line; + } + + public int getLineOffset() { + return lineOffset; + } + + public String getLineSource() { + return lineSource; + } + } + + private static String createMessageWithDetail(String msg, SourceDetail sourceDetail) { + if (sourceDetail == null) { + return msg; + } + StringBuffer sb = new StringBuffer(); + sb.append(sourceDetail.getFileName()); + sb.append('('); + sb.append(sourceDetail.getLine()); + sb.append(')'); + sb.append(": "); + sb.append(msg); + if (sourceDetail.getLineSource() != null) { + sb.append("\n> "); + sb.append(sourceDetail.getLineSource()); + sb.append("\n> "); + for (int i = 0, n = sourceDetail.getLineOffset(); i < n; ++i) { + sb.append('-'); + } + sb.append('^'); + } + return sb.toString(); + } + + private final SourceDetail sourceDetail; + + public JsParserException(String msg) { + this(msg, null); + } + + public JsParserException(String msg, int line, String lineSource, int lineOffset, String fileName) { + this(msg, new SourceDetail(line, lineSource, lineOffset, fileName)); + } + + public JsParserException(String msg, SourceDetail sourceDetail) { + super(createMessageWithDetail(msg, sourceDetail)); + this.sourceDetail = sourceDetail; + } + + /** + * Provides additional source detail in some cases. + * + * @return additional detail regarding the error, or null if no + * additional detail is available + */ + public SourceDetail getSourceDetail() { + return sourceDetail; + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.java b/src/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.java new file mode 100644 index 00000000000..2cc6a3b16ed --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.java @@ -0,0 +1,275 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.backend.js.ast.JsVars.JsVar; + +/** + * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition (page + * 57) + * + * Precedence 17 is for indivisible primaries that either don't have children, + * or provide their own delimiters. + * + * Precedence 16 is for really important things that have their own AST classes. + * + * Precedence 15 is for the new construct. + * + * Precedence 14 is for unary operators. + * + * Precedences 12 through 4 are for non-assigning binary operators. + * + * Precedence 3 is for the tertiary conditional. + * + * Precedence 2 is for assignments. + * + * Precedence 1 is for comma operations. + */ +class JsPrecedenceVisitor extends JsVisitor { + + static final int PRECEDENCE_NEW = 15; + + public static int exec(JsExpression expression) { + JsPrecedenceVisitor visitor = new JsPrecedenceVisitor(); + visitor.accept(expression); + if (visitor.answer < 0) { + throw new RuntimeException("Precedence must be >= 0!"); + } + return visitor.answer; + } + + private int answer = -1; + + private JsPrecedenceVisitor() { + } + + @Override + public boolean visit(JsArrayAccess x, JsContext ctx) { + answer = 16; + return false; + } + + @Override + public boolean visit(JsArrayLiteral x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsBinaryOperation x, JsContext ctx) { + answer = x.getOperator().getPrecedence(); + return false; + } + + @Override + public boolean visit(JsBlock x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsBooleanLiteral x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsBreak x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsCase x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsCatch x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsConditional x, JsContext ctx) { + answer = 3; + return false; + } + + @Override + public boolean visit(JsContinue x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsDebugger x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsDefault x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsDoWhile x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsEmpty x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsExprStmt x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsFor x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsForIn x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsFunction x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsIf x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsInvocation x, JsContext ctx) { + answer = 16; + return false; + } + + @Override + public boolean visit(JsLabel x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsNameRef x, JsContext ctx) { + if (x.isLeaf()) { + answer = 17; // primary + } else { + answer = 16; // property access + } + return false; + } + + @Override + public boolean visit(JsNew x, JsContext ctx) { + answer = PRECEDENCE_NEW; + return false; + } + + @Override + public boolean visit(JsNullLiteral x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsNumberLiteral x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsObjectLiteral x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsParameter x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsPostfixOperation x, JsContext ctx) { + answer = x.getOperator().getPrecedence(); + return false; + } + + @Override + public boolean visit(JsPrefixOperation x, JsContext ctx) { + answer = x.getOperator().getPrecedence(); + return false; + } + + @Override + public boolean visit(JsProgram x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsPropertyInitializer x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsRegExp x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsReturn x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsStringLiteral x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsSwitch x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsThisRef x, JsContext ctx) { + answer = 17; // primary + return false; + } + + @Override + public boolean visit(JsThrow x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsTry x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsVar x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsVars x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } + + @Override + public boolean visit(JsWhile x, JsContext ctx) { + throw new RuntimeException("Only expressions have precedence."); + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsPrettyNamer.java b/src/com/google/dart/compiler/backend/js/JsPrettyNamer.java new file mode 100644 index 00000000000..2c61e01f6b3 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsPrettyNamer.java @@ -0,0 +1,122 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.JsName; +import com.google.dart.compiler.backend.js.ast.JsProgram; +import com.google.dart.compiler.backend.js.ast.JsRootScope; +import com.google.dart.compiler.backend.js.ast.JsScope; + +import java.util.*; + +/** + * A namer that uses short, readable idents to maximize reability. + */ +public class JsPrettyNamer implements JsNamer { + + public JsPrettyNamer() { + this.program = null; + } + + @Override + public void exec(JsProgram program) { + new JsPrettyNamer(program).execImpl(); + } + + /** + * Communicates to a parent scope all the idents used by all child scopes. + */ + private Set childIdents = null; + + private final JsProgram program; + + /** + * A map containing the next integer to try as an identifier suffix for a + * given JsScope. + */ + private IdentityHashMap> startIdentForScope = + new IdentityHashMap>(); + + protected JsPrettyNamer(JsProgram program) { + this.program = program; + } + + private void execImpl() { + visit(program.getRootScope()); + } + + private boolean isLegal(JsScope scope, Set childIdents, String newIdent) { + if (JsReservedIdentifiers.isKeyword(newIdent)) { + return false; + } + if (childIdents.contains(newIdent)) { + // one of my children already claimed this ident + return false; + } + /* + * Never obfuscate a name into an identifier that conflicts with an existing + * unobfuscatable name! It's okay if it conflicts with an existing + * obfuscatable name; that name will get obfuscated out of the way. + */ + return (scope.findExistingUnobfuscatableName(newIdent) == null); + } + + private void visit(JsScope scope) { + HashMap startIdent = startIdentForScope.get(scope); + if (startIdent == null) { + startIdent = new HashMap(); + startIdentForScope.put(scope, startIdent); + } + + // Save off the childIdents which is currently being computed for my parent. + Set myChildIdents = childIdents; + + /* + * Visit my children first. Reset childIdents so that my children will get a + * clean slate: I do not communicate to my children. + */ + childIdents = new HashSet(); + List children = scope.getChildren(); + for (Iterator it = children.iterator(); it.hasNext();) { + visit(it.next()); + } + + JsRootScope rootScope = program.getRootScope(); + if (scope == rootScope) { + return; + } + + // Visit all my idents. + for (Iterator it = scope.getAllNames(); it.hasNext();) { + JsName name = it.next(); + if (!name.isObfuscatable()) { + // Unobfuscatable names become themselves. + name.setShortIdent(name.getIdent()); + continue; + } + + String newIdent = name.getShortIdent(); + if (!isLegal(scope, childIdents, newIdent)) { + String checkIdent; + + // Start searching using a suffix hint stored in the scope. + // We still do a search in case there is a collision with + // a user-provided identifier + Integer s = startIdent.get(newIdent); + int suffix = (s == null) ? 0 : s.intValue(); + do { + checkIdent = newIdent + "_" + suffix++; + } while (!isLegal(scope, childIdents, checkIdent)); + startIdent.put(newIdent, suffix); + name.setShortIdent(checkIdent); + } else { + // nothing to do; the short name is already good + } + childIdents.add(name.getShortIdent()); + } + myChildIdents.addAll(childIdents); + childIdents = myChildIdents; + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.java b/src/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.java new file mode 100644 index 00000000000..f4095c5c822 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.java @@ -0,0 +1,140 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; + +/** + * Determines if a statement at the end of a block requires a semicolon. + * + * For example, the following statements require semicolons:
+ *
    + *
  • if (cond);
  • + *
  • while (cond);
  • + *
+ * + * The following do not require semicolons:
+ *
    + *
  • return 1
  • + *
  • do {} while(true)
  • + *
+ */ +public class JsRequiresSemiVisitor extends JsVisitor { + + public static boolean exec(JsStatement lastStatement) { + JsRequiresSemiVisitor visitor = new JsRequiresSemiVisitor(); + visitor.accept(lastStatement); + return visitor.needsSemicolon; + } + + private boolean needsSemicolon = false; + + private JsRequiresSemiVisitor() { + } + + @Override + public boolean visit(JsBlock x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsBreak x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsDebugger x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsDoWhile x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsEmpty x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsExprStmt x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsFor x, JsContext ctx) { + if (x.getBody() instanceof JsEmpty) { + needsSemicolon = true; + } + return false; + } + + @Override + public boolean visit(JsForIn x, JsContext ctx) { + if (x.getBody() instanceof JsEmpty) { + needsSemicolon = true; + } + return false; + } + + @Override + public boolean visit(JsIf x, JsContext ctx) { + JsStatement thenStmt = x.getThenStmt(); + JsStatement elseStmt = x.getElseStmt(); + JsStatement toCheck = thenStmt; + if (elseStmt != null) { + toCheck = elseStmt; + } + if (toCheck instanceof JsEmpty) { + needsSemicolon = true; + } else { + // Must recurse to determine last statement (possible if-else chain). + accept(toCheck); + } + return false; + } + + @Override + public boolean visit(JsLabel x, JsContext ctx) { + if (x.getStmt() instanceof JsEmpty) { + needsSemicolon = true; + } + return false; + } + + @Override + public boolean visit(JsReturn x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsSwitch x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsThrow x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsTry x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsVars x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsWhile x, JsContext ctx) { + if (x.getBody() instanceof JsEmpty) { + needsSemicolon = true; + } + return false; + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsReservedIdentifiers.java b/src/com/google/dart/compiler/backend/js/JsReservedIdentifiers.java new file mode 100644 index 00000000000..56ae5428a3d --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsReservedIdentifiers.java @@ -0,0 +1,223 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import java.util.HashSet; +import java.util.Set; + +/** + * Determines whether or not a particular string is a JavaScript keyword or not. + */ +public class JsReservedIdentifiers { + + private static Set javaScriptKeywords; + private static Set reservedGlobalSymbols; + private static Set reservedPropertySymbols; + + static { + javaScriptKeywords = new HashSet(); + reservedGlobalSymbols = new HashSet(); + reservedPropertySymbols = new HashSet(); + initJavaScriptKeywords(); + initReservedGlobalSymbols(); + initReservedPropertySymbols(); + } + + public static boolean isKeyword(String s) { + return javaScriptKeywords.contains(s); + } + + private static void initJavaScriptKeywords() { + String[] keywords = new String[] { + // These are current keywords + "break", "delete", "function", "return", "typeof", "case", "do", "if", "switch", "var", + "catch", "else", "in", "this", "void", "continue", "false", "instanceof", "throw", + "while", "debugger", "finally", "new", "true", "with", "default", "for", + "null", "try", + + // These are future keywords + "abstract", "double", "goto", "native", "static", "boolean", "enum", "implements", + "package", "super", "byte", "export", "import", "private", "synchronized", "char", + "extends", "int", "protected", "throws", "class", "final", "interface", "public", + "transient", "const", "float", "long", "short", "volatile" + }; + + for (int i = 0; i < keywords.length; i++) { + javaScriptKeywords.add(keywords[i]); + } + } + + /** + * @return a set containing all known reserved global identifiers. This set must not be modified. + */ + public static Set getReservedGlobalSymbols() { + return reservedGlobalSymbols; + } + + /** + * Returns true if the string s can not be used as a global identifier. The check includes + * JavaScript keywords (as they must not be used either). + * @param s + * @return true if the given String must not be used as a global identifier. + */ + public static boolean isReservedGlobalSymbol(String s) { + return isKeyword(s) || reservedGlobalSymbols.contains(s); + } + + private static void initReservedGlobalSymbols() { + // Section references are from Ecma-262 + // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf) + String[] commonBuiltins = new String[] { + // 15.1.1 Value Properties of the Global Object + "NaN", "Infinity", "undefined", + + // 15.1.2 Function Properties of the Global Object + "eval", "parseInt", "parseFloat", "isNan", "isFinite", + + // 15.1.3 URI Handling Function Properties + "decodeURI", "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + + // 15.1.4 Constructor Properties of the Global Object + "Object", "Function", "Array", "String", "Boolean", "Number", "Date", + "RegExp", "Error", "EvalError", "RangeError", "ReferenceError", + "SyntaxError", "TypeError", "URIError", + + // 15.1.5 Other Properties of the Global Object + "Math", + + // 10.1.6 Activation Object + "arguments", + + // B.2 Additional Properties (non-normative) + "escape", "unescape", + + // Window props (https://developer.mozilla.org/en/DOM/window) + "applicationCache", "closed", "Components", "content", "controllers", + "crypto", "defaultStatus", "dialogArguments", "directories", + "document", "frameElement", "frames", "fullScreen", "globalStorage", + "history", "innerHeight", "innerWidth", "length", + "location", "locationbar", "localStorage", "menubar", + "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPixel", + "name", "navigator", "opener", "outerHeight", "outerWidth", + "pageXOffset", "pageYOffset", "parent", "personalbar", "pkcs11", + "returnValue", "screen", "scrollbars", "scrollMaxX", "scrollMaxY", + "self", "sessionStorage", "sidebar", "status", "statusbar", "toolbar", + "top", "window", + + // Window methods (https://developer.mozilla.org/en/DOM/window) + "alert", "addEventListener", "atob", "back", "blur", "btoa", + "captureEvents", "clearInterval", "clearTimeout", "close", "confirm", + "disableExternalCapture", "dispatchEvent", "dump", + "enableExternalCapture", "escape", "find", "focus", "forward", + "GeckoActiveXObject", "getAttention", "getAttentionWithCycleCount", + "getComputedStyle", "getSelection", "home", "maximize", "minimize", + "moveBy", "moveTo", "open", "openDialog", "postMessage", "print", + "prompt", "QueryInterface", "releaseEvents", "removeEventListener", + "resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", + "scrollByLines", "scrollByPages", "scrollTo", "setInterval", + "setResizeable", "setTimeout", "showModalDialog", "sizeToContent", + "stop", "uuescape", "updateCommands", "XPCNativeWrapper", + "XPCSafeJSOjbectWrapper", + + // Mozilla Window event handlers, same cite + "onabort", "onbeforeunload", "onchange", "onclick", "onclose", + "oncontextmenu", "ondragdrop", "onerror", "onfocus", "onhashchange", + "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", + "onmousemove", "onmouseout", "onmouseover", "onmouseup", + "onmozorientation", "onpaint", "onreset", "onresize", "onscroll", + "onselect", "onsubmit", "onunload", + + // Safari Web Content Guide + // http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/SafariWebContent.pdf + // WebKit Window member data, from WebKit DOM Reference + // (http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/WebKitDOMRef/DOMWindow_idl/Classes/DOMWindow/index.html) + // TODO(fredsa) Many, many more functions and member data to add + "ontouchcancel", "ontouchend", "ontouchmove", "ontouchstart", + "ongesturestart", "ongesturechange", "ongestureend", + + // extra window methods + "uneval", + + // keywords https://developer.mozilla.org/en/New_in_JavaScript_1.7, + // https://developer.mozilla.org/en/New_in_JavaScript_1.8.1 + "getPrototypeOf", "let", "yield", + + // "future reserved words" + "abstract", "int", "short", "boolean", "interface", "static", "byte", + "long", "char", "final", "native", "synchronized", "float", "package", + "throws", "goto", "private", "transient", "implements", "protected", + "volatile", "double", "public", + + // IE methods + // (http://msdn.microsoft.com/en-us/library/ms535873(VS.85).aspx#) + "attachEvent", "clientInformation", "clipboardData", "createPopup", + "dialogHeight", "dialogLeft", "dialogTop", "dialogWidth", + "onafterprint", "onbeforedeactivate", "onbeforeprint", + "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", + + // Common browser-defined identifiers not defined in ECMAScript + "event", "external", "Debug", "Enumerator", "Global", "Image", + "ActiveXObject", "VBArray", "Components", + + // Functions commonly defined on Object + "toString", "getClass", "constructor", "prototype", "valueOf", + + // Client-side JavaScript identifiers, which are needed for linkers + // that don't ensure GWT's window != $wnd, document != $doc, etc. + // Taken from the Rhino book, pg 715 + "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", + "CanvasPattern", "CanvasRenderingContext2D", "CDATASection", + "CharacterData", "Comment", "CSS2Properties", "CSSRule", + "CSSStyleSheet", "Document", "DocumentFragment", "DocumentType", + "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", + "ExternalInterface", "FlashPlayer", "Form", "Frame", "History", + "HTMLCollection", "HTMLDocument", "HTMLElement", "IFrame", "Image", + "Input", "JSObject", "KeyEvent", "Link", "Location", "MimeType", + "MouseEvent", "Navigator", "Node", "NodeList", "Option", "Plugin", + "ProcessingInstruction", "Range", "RangeException", "Screen", "Select", + "Table", "TableCell", "TableRow", "TableSelection", "Text", "TextArea", + "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", + "XPathException", "XPathResult", "XSLTProcessor", + + // These keywords trigger the loading of the java-plugin. For the + // next-generation plugin, this results in starting a new Java process. + "java", "Packages", "netscape", "sun", "JavaObject", "JavaClass", + "JavaArray", "JavaMember", + + // GWT-defined identifiers + "$wnd", "$doc", "$entry", "$moduleName", "$moduleBase", "$gwt_version", "$sessionId", + + // Identifiers used by JsStackEmulator; later set to obfuscatable + "$stack", "$stackDepth", "$location", + + // TODO: prove why this is necessary or remove it + "call" + }; + for (int i = 0; i < commonBuiltins.length; i++) { + reservedGlobalSymbols.add(commonBuiltins[i]); + } + } + + /** + * Returns true if the given string can not be used as property symbol. The check excludes + * keywords as JavaScript allow keywords as properties. + * @param s + * @return true if the given string must not be used as a property. + */ + public static boolean isReservedPropertySymbol(String s) { + return reservedPropertySymbols.contains(s); + } + + private static void initReservedPropertySymbols() { + // TODO(floitsch): fill in reserved property symbols. + reservedPropertySymbols.add("__PROTO__"); + reservedPropertySymbols.add("prototype"); + } + + private JsReservedIdentifiers() { + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java b/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java new file mode 100644 index 00000000000..943183ca94a --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java @@ -0,0 +1,39 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.JsBlock; +import com.google.dart.compiler.backend.js.ast.JsContext; +import com.google.dart.compiler.backend.js.ast.JsProgram; +import com.google.dart.compiler.backend.js.ast.JsProgramFragment; +import com.google.dart.compiler.util.*; + +/** + * Generates JavaScript source from an AST. + */ +public class JsSourceGenerationVisitor extends JsToStringGenerationVisitor { + + public JsSourceGenerationVisitor(TextOutput out) { + super(out); + } + + @Override + public boolean visit(JsProgram x, JsContext ctx) { + // Descend naturally. + return true; + } + + @Override + public boolean visit(JsProgramFragment x, JsContext ctx) { + // Descend naturally. + return true; + } + + @Override + public boolean visit(JsBlock x, JsContext ctx) { + printJsBlock(x, false, true); + return false; + } +} diff --git a/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java b/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java new file mode 100644 index 00000000000..b94d128895e --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java @@ -0,0 +1,1332 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.backend.js.ast.JsVars.JsVar; +import com.google.dart.compiler.util.TextOutput; + +import java.util.*; +import java.util.regex.Pattern; + +//import com.google.debugging.sourcemap.FilePosition; + +/** + * Produces text output from a JavaScript AST. + */ +public class JsToStringGenerationVisitor extends JsVisitor { + + private static final char[] CHARS_BREAK = "break".toCharArray(); + private static final char[] CHARS_CASE = "case".toCharArray(); + private static final char[] CHARS_CATCH = "catch".toCharArray(); + private static final char[] CHARS_CONTINUE = "continue".toCharArray(); + private static final char[] CHARS_DEBUGGER = "debugger".toCharArray(); + private static final char[] CHARS_DEFAULT = "default".toCharArray(); + private static final char[] CHARS_DO = "do".toCharArray(); + private static final char[] CHARS_ELSE = "else".toCharArray(); + private static final char[] CHARS_FALSE = "false".toCharArray(); + private static final char[] CHARS_FINALLY = "finally".toCharArray(); + private static final char[] CHARS_FOR = "for".toCharArray(); + private static final char[] CHARS_FUNCTION = "function".toCharArray(); + private static final char[] CHARS_IF = "if".toCharArray(); + private static final char[] CHARS_IN = "in".toCharArray(); + private static final char[] CHARS_NEW = "new".toCharArray(); + private static final char[] CHARS_NULL = "null".toCharArray(); + private static final char[] CHARS_RETURN = "return".toCharArray(); + private static final char[] CHARS_SWITCH = "switch".toCharArray(); + private static final char[] CHARS_THIS = "this".toCharArray(); + private static final char[] CHARS_THROW = "throw".toCharArray(); + private static final char[] CHARS_TRUE = "true".toCharArray(); + private static final char[] CHARS_TRY = "try".toCharArray(); + private static final char[] CHARS_VAR = "var".toCharArray(); + private static final char[] CHARS_WHILE = "while".toCharArray(); + private static final char[] HEX_DIGITS = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + /** + * How many lines of code to print inside of a JsBlock when printing terse. + */ + private static final int JSBLOCK_LINES_TO_PRINT = 3; + + /** + * A variable name is valid if it contains only letters, numbers, _, $ and + * does not begin with a number. There are actually other valid variable + * names, such as ones that contain escaped Unicode characters, but we + * surround those names with quotes in property initializers to be safe. + */ + private static final Pattern VALID_NAME_PATTERN = Pattern.compile("[a-zA-Z_$][\\w$]*"); + + public static String javaScriptString(String value) { + return javaScriptString(value, false); + } + + /** + * Generate JavaScript code that evaluates to the supplied string. Adapted + * from + * . The difference is that we quote with either " or ' depending on + * which one is used less inside the string. + */ + public static String javaScriptString(String value, boolean forceDoubleQuote) { + char[] chars = value.toCharArray(); + final int n = chars.length; + int quoteCount = 0; + int aposCount = 0; + for (int i = 0; i < n; ++i) { + switch (chars[i]) { + case '"': + ++quoteCount; + break; + case '\'': + ++aposCount; + break; + } + } + + StringBuffer result = new StringBuffer(value.length() + 16); + + char quoteChar = (quoteCount < aposCount || forceDoubleQuote) ? '"' : '\''; + result.append(quoteChar); + + for (int i = 0; i < n; ++i) { + char c = chars[i]; + + if (' ' <= c && c <= '~' && c != quoteChar && c != '\\') { + // an ordinary print character (like C isprint()) + result.append(c); + continue; + } + + int escape = -1; + switch (c) { + case '\b': + escape = 'b'; + break; + case '\f': + escape = 'f'; + break; + case '\n': + escape = 'n'; + break; + case '\r': + escape = 'r'; + break; + case '\t': + escape = 't'; + break; + case '"': + escape = '"'; + break; // only reach here if == quoteChar + case '\'': + escape = '\''; + break; // only reach here if == quoteChar + case '\\': + escape = '\\'; + break; + } + + if (escape >= 0) { + // an \escaped sort of character + result.append('\\'); + result.append((char) escape); + } else { + /* + * Emit characters from 0 to 31 that don't have a single character + * escape sequence in octal where possible. This saves one or two + * characters compared to the hexadecimal format '\xXX'. + * + * These short octal sequences may only be used at the end of the string + * or where the following character is a non-digit. Otherwise, the + * following character would be incorrectly interpreted as belonging to + * the sequence. + */ + if (c < ' ' && (i == n - 1 || chars[i + 1] < '0' || chars[i + 1] > '9')) { + result.append('\\'); + if (c > 0x7) { + result.append((char) ('0' + (0x7 & (c >> 3)))); + } + result.append((char) ('0' + (0x7 & c))); + } else { + int hexSize; + if (c < 256) { + // 2-digit hex + result.append("\\x"); + hexSize = 2; + } else { + // Unicode. + result.append("\\u"); + hexSize = 4; + } + // append hexadecimal form of ch left-padded with 0 + for (int shift = (hexSize - 1) * 4; shift >= 0; shift -= 4) { + int digit = 0xf & (c >> shift); + result.append(HEX_DIGITS[digit]); + } + } + } + } + result.append(quoteChar); + escapeClosingTags(result); + String resultString = result.toString(); + return resultString; + } + + /** + * Escapes any closing XML tags embedded in str, which could + * potentially cause a parse failure in a browser, for example, embedding a + * closing <script> tag. + * + * @param str an unescaped literal; May be null + */ + private static void escapeClosingTags(StringBuffer str) { + if (str == null) { + return; + } + + int index = 0; + + while ((index = str.indexOf(" globalBlocks = new HashSet(); + private final TextOutput p; + private ArrayList statementEnds = new ArrayList(); + private ArrayList statementStarts = new ArrayList(); + private boolean buildMappings; + //private List mappings = Lists.newArrayList(); + + public JsToStringGenerationVisitor(TextOutput out) { + this.p = out; + } + + /** + * @param generate Whether to translate the source map. + */ + public void generateSourceMap(boolean generate) { + this.buildMappings = generate; + } + +// public void writeSourceMap(Appendable out, String name) throws IOException { +// GenerateSourceMap generator = new GenerateSourceMap(); +// for (SourceMapping m : mappings) { +// generator.addMapping(m.getNode(), m.getStart(), m.getEnd()); +// } +// generator.appendTo(out, name); +// } + + @Override + public void doTraverse(JsVisitable x, JsContext ctx) { + //SourceMapping m = null; + // TODO(johnlenz): filter out uninteresting node types + if (buildMappings) { + // m = new SourceMapping((HasSourceInfo) x, new FilePosition(p.getLine(), p.getColumn())); + // mappings.add(m); + } + + super.doTraverse(x, ctx); + + if (buildMappings) { + // m.setEnd(new FilePosition(p.getLine(), p.getColumn())); + } + } + + @Override + public boolean visit(JsArrayAccess x, JsContext ctx) { + JsExpression arrayExpr = x.getArrayExpr(); + _parenPush(x, arrayExpr, false); + accept(arrayExpr); + _parenPop(x, arrayExpr, false); + _lsquare(); + accept(x.getIndexExpr()); + _rsquare(); + return false; + } + + @Override + public boolean visit(JsArrayLiteral x, JsContext ctx) { + _lsquare(); + boolean sep = false; + for (Object element : x.getExpressions()) { + JsExpression arg = (JsExpression) element; + sep = _sepCommaOptSpace(sep); + _parenPushIfCommaExpr(arg); + accept(arg); + _parenPopIfCommaExpr(arg); + } + _rsquare(); + return false; + } + + @Override + public boolean visit(JsBinaryOperation x, JsContext ctx) { + JsBinaryOperator op = x.getOperator(); + JsExpression arg1 = x.getArg1(); + _parenPush(x, arg1, !op.isLeftAssociative()); + accept(arg1); + if (op.isKeyword()) { + _parenPopOrSpace(x, arg1, !op.isLeftAssociative()); + } else { + _parenPop(x, arg1, !op.isLeftAssociative()); + _spaceOpt(); + } + p.print(op.getSymbol()); + JsExpression arg2 = x.getArg2(); + if (_spaceCalc(op, arg2)) { + _parenPushOrSpace(x, arg2, op.isLeftAssociative()); + } else { + _spaceOpt(); + _parenPush(x, arg2, op.isLeftAssociative()); + } + accept(arg2); + _parenPop(x, arg2, op.isLeftAssociative()); + return false; + } + + @Override + public boolean visit(JsBlock x, JsContext ctx) { + printJsBlock(x, true, true); + return false; + } + + @Override + public boolean visit(JsBooleanLiteral x, JsContext ctx) { + if (x.getValue()) { + _true(); + } else { + _false(); + } + return false; + } + + @Override + public boolean visit(JsBreak x, JsContext ctx) { + _break(); + + JsNameRef label = x.getLabel(); + if (label != null) { + _space(); + _nameRef(label); + } + + return false; + } + + @Override + public boolean visit(JsCase x, JsContext ctx) { + _case(); + _space(); + accept(x.getCaseExpr()); + _colon(); + _newlineOpt(); + + indent(); + for (Object element : x.getStmts()) { + JsStatement stmt = (JsStatement) element; + needSemi = true; + accept(stmt); + if (needSemi) { + _semi(); + } + _newlineOpt(); + } + outdent(); + needSemi = false; + return false; + } + + @Override + public boolean visit(JsCatch x, JsContext ctx) { + _spaceOpt(); + _catch(); + _spaceOpt(); + _lparen(); + _nameDef(x.getParameter().getName()); + + // Optional catch condition. + // + JsExpression catchCond = x.getCondition(); + if (catchCond != null) { + _space(); + _if(); + _space(); + accept(catchCond); + } + + _rparen(); + _spaceOpt(); + accept(x.getBody()); + + return false; + } + + @Override + public boolean visit(JsConditional x, JsContext ctx) { + // Associativity: for the then and else branches, it is safe to insert + // another + // ternary expression, but if the test expression is a ternary, it should + // get parentheses around it. + { + JsExpression testExpression = x.getTestExpression(); + _parenPush(x, testExpression, true); + accept(testExpression); + _parenPop(x, testExpression, true); + } + _questionMark(); + { + JsExpression thenExpression = x.getThenExpression(); + _parenPush(x, thenExpression, false); + accept(thenExpression); + _parenPop(x, thenExpression, false); + } + _colon(); + { + JsExpression elseExpression = x.getElseExpression(); + _parenPush(x, elseExpression, false); + accept(elseExpression); + _parenPop(x, elseExpression, false); + } + return false; + } + + @Override + public boolean visit(JsContinue x, JsContext ctx) { + _continue(); + + JsNameRef label = x.getLabel(); + if (label != null) { + _space(); + _nameRef(label); + } + + return false; + } + + @Override + public boolean visit(JsDebugger x, JsContext ctx) { + _debugger(); + return false; + } + + @Override + public boolean visit(JsDefault x, JsContext ctx) { + _default(); + _colon(); + + indent(); + for (Object element : x.getStmts()) { + JsStatement stmt = (JsStatement) element; + needSemi = true; + accept(stmt); + if (needSemi) { + _semi(); + } + _newlineOpt(); + } + outdent(); + needSemi = false; + return false; + } + + @Override + public boolean visit(JsDoWhile x, JsContext ctx) { + _do(); + _nestedPush(x.getBody(), true); + accept(x.getBody()); + _nestedPop(x.getBody()); + if (needSemi) { + _semi(); + _newlineOpt(); + } else { + _spaceOpt(); + needSemi = true; + } + _while(); + _spaceOpt(); + _lparen(); + accept(x.getCondition()); + _rparen(); + return false; + } + + @Override + public boolean visit(JsEmpty x, JsContext ctx) { + return false; + } + + @Override + public boolean visit(JsExprStmt x, JsContext ctx) { + boolean surroundWithParentheses = JsFirstExpressionVisitor.exec(x); + if (surroundWithParentheses) { + _lparen(); + } + JsExpression expr = x.getExpression(); + accept(expr); + if (surroundWithParentheses) { + _rparen(); + } + return false; + } + + @Override + public boolean visit(JsFor x, JsContext ctx) { + _for(); + _spaceOpt(); + _lparen(); + + // The init expressions or var decl. + // + if (x.getInitExpr() != null) { + accept(x.getInitExpr()); + } else if (x.getInitVars() != null) { + accept(x.getInitVars()); + } + + _semi(); + + // The loop test. + // + if (x.getCondition() != null) { + _spaceOpt(); + accept(x.getCondition()); + } + + _semi(); + + // The incr expression. + // + if (x.getIncrExpr() != null) { + _spaceOpt(); + accept(x.getIncrExpr()); + } + + _rparen(); + _nestedPush(x.getBody(), false); + accept(x.getBody()); + _nestedPop(x.getBody()); + return false; + } + + @Override + public boolean visit(JsForIn x, JsContext ctx) { + _for(); + _spaceOpt(); + _lparen(); + + if (x.getIterVarName() != null) { + _var(); + _space(); + _nameDef(x.getIterVarName()); + + if (x.getIterExpr() != null) { + _spaceOpt(); + _assignment(); + _spaceOpt(); + accept(x.getIterExpr()); + } + } else { + // Just a name ref. + // + accept(x.getIterExpr()); + } + + _space(); + _in(); + _space(); + accept(x.getObjExpr()); + + _rparen(); + _nestedPush(x.getBody(), false); + accept(x.getBody()); + _nestedPop(x.getBody()); + return false; + } + + // function foo(a, b) { + // stmts... + // } + // + @Override + public boolean visit(JsFunction x, JsContext ctx) { + _function(); + + // Functions can be anonymous. + // + if (x.getName() != null) { + _space(); + _nameOf(x); + } + + _lparen(); + boolean sep = false; + for (Object element : x.getParameters()) { + JsParameter param = (JsParameter) element; + sep = _sepCommaOptSpace(sep); + accept(param); + } + _rparen(); + + accept(x.getBody()); + needSemi = true; + return false; + } + + @Override + public boolean visit(JsIf x, JsContext ctx) { + _if(); + _spaceOpt(); + _lparen(); + accept(x.getIfExpr()); + _rparen(); + JsStatement thenStmt = x.getThenStmt(); + _nestedPush(thenStmt, false); + accept(thenStmt); + _nestedPop(thenStmt); + JsStatement elseStmt = x.getElseStmt(); + if (elseStmt != null) { + if (needSemi) { + _semi(); + _newlineOpt(); + } else { + _spaceOpt(); + needSemi = true; + } + _else(); + boolean elseIf = elseStmt instanceof JsIf; + if (!elseIf) { + _nestedPush(elseStmt, true); + } else { + _space(); + } + accept(elseStmt); + if (!elseIf) { + _nestedPop(elseStmt); + } + } + return false; + } + + @Override + public boolean visit(JsInvocation x, JsContext ctx) { + JsExpression qualifier = x.getQualifier(); + _parenPush(x, qualifier, false); + accept(qualifier); + _parenPop(x, qualifier, false); + + _lparen(); + boolean sep = false; + for (Object element : x.getArguments()) { + JsExpression arg = (JsExpression) element; + sep = _sepCommaOptSpace(sep); + _parenPushIfCommaExpr(arg); + accept(arg); + _parenPopIfCommaExpr(arg); + } + _rparen(); + return false; + } + + @Override + public boolean visit(JsLabel x, JsContext ctx) { + _nameOf(x); + _colon(); + _spaceOpt(); + accept(x.getStmt()); + return false; + } + + @Override + public boolean visit(JsNameRef x, JsContext ctx) { + JsExpression q = x.getQualifier(); + if (q != null) { + _parenPush(x, q, false); + if (q instanceof JsNumberLiteral) { + /** + * Fix for Issue #3796. "42.foo" is not allowed, but "(42).foo" is. + */ + _lparen(); + } + accept(q); + if (q instanceof JsNumberLiteral) { + _rparen(); + } + _parenPop(x, q, false); + _dot(); + } + _nameRef(x); + return false; + } + + @Override + public boolean visit(JsNew x, JsContext ctx) { + _new(); + _space(); + + JsExpression ctorExpr = x.getConstructorExpression(); + boolean needsParens = JsConstructExpressionVisitor.exec(ctorExpr); + if (needsParens) { + _lparen(); + } + accept(ctorExpr); + if (needsParens) { + _rparen(); + } + + /* + * If a constructor call has no arguments, it may simply be replaced with + * "new Constructor" with no parentheses. + */ + List args = x.getArguments(); + if (args.size() > 0) { + _lparen(); + boolean sep = false; + for (JsExpression arg : args) { + sep = _sepCommaOptSpace(sep); + _parenPushIfCommaExpr(arg); + accept(arg); + _parenPopIfCommaExpr(arg); + } + _rparen(); + } + + return false; + } + + @Override + public boolean visit(JsNullLiteral x, JsContext ctx) { + _null(); + return false; + } + + @Override + public boolean visit(JsNumberLiteral x, JsContext ctx) { + double dvalue = x.getValue(); + long lvalue = (long) dvalue; + if (lvalue == dvalue) { + p.print(Long.toString(lvalue)); + } else { + p.print(Double.toString(dvalue)); + } + return false; + } + + @Override + public boolean visit(JsObjectLiteral x, JsContext ctx) { + _lbrace(); + boolean sep = false; + for (Object element : x.getPropertyInitializers()) { + sep = _sepCommaOptSpace(sep); + JsPropertyInitializer propInit = (JsPropertyInitializer) element; + printLabel : { + JsExpression labelExpr = propInit.getLabelExpr(); + // labels can be either string, integral, or decimal literals + if (labelExpr instanceof JsStringLiteral) { + String propName = ((JsStringLiteral) labelExpr).getValue(); + if (VALID_NAME_PATTERN.matcher(propName).matches() + && !JsReservedIdentifiers.isKeyword(propName)) { + p.print(propName); + break printLabel; + } + } + accept(labelExpr); + } + _colon(); + JsExpression valueExpr = propInit.getValueExpr(); + _parenPushIfCommaExpr(valueExpr); + accept(valueExpr); + _parenPopIfCommaExpr(valueExpr); + } + _rbrace(); + return false; + } + + @Override + public boolean visit(JsParameter x, JsContext ctx) { + _nameOf(x); + return false; + } + + @Override + public boolean visit(JsPostfixOperation x, JsContext ctx) { + JsUnaryOperator op = x.getOperator(); + JsExpression arg = x.getArg(); + // unary operators always associate correctly (I think) + _parenPush(x, arg, false); + accept(arg); + _parenPop(x, arg, false); + p.print(op.getSymbol()); + return false; + } + + @Override + public boolean visit(JsPrefixOperation x, JsContext ctx) { + JsUnaryOperator op = x.getOperator(); + p.print(op.getSymbol()); + JsExpression arg = x.getArg(); + if (_spaceCalc(op, arg)) { + _space(); + } + // unary operators always associate correctly (I think) + _parenPush(x, arg, false); + accept(arg); + _parenPop(x, arg, false); + return false; + } + + @Override + public boolean visit(JsProgram x, JsContext ctx) { + p.print(""); + return false; + } + + @Override + public boolean visit(JsProgramFragment x, JsContext ctx) { + p.print(""); + return false; + } + + @Override + public boolean visit(JsPropertyInitializer x, JsContext ctx) { + // Since there are separators, we actually print the property init + // in visit(JsObjectLiteral). + // + return false; + } + + @Override + public boolean visit(JsRegExp x, JsContext ctx) { + _slash(); + p.print(x.getPattern()); + _slash(); + String flags = x.getFlags(); + if (flags != null) { + p.print(flags); + } + return false; + } + + @Override + public boolean visit(JsReturn x, JsContext ctx) { + _return(); + JsExpression expr = x.getExpr(); + if (expr != null) { + _space(); + accept(expr); + } + return false; + } + + @Override + public boolean visit(JsStringLiteral x, JsContext ctx) { + printStringLiteral(x.getValue()); + return false; + } + + @Override + public boolean visit(JsSwitch x, JsContext ctx) { + _switch(); + _spaceOpt(); + _lparen(); + accept(x.getExpr()); + _rparen(); + _spaceOpt(); + _blockOpen(); + acceptList(x.getCases()); + _blockClose(); + return false; + } + + @Override + public boolean visit(JsThisRef x, JsContext ctx) { + _this(); + return false; + } + + @Override + public boolean visit(JsThrow x, JsContext ctx) { + _throw(); + _space(); + accept(x.getExpr()); + return false; + } + + @Override + public boolean visit(JsTry x, JsContext ctx) { + _try(); + _spaceOpt(); + accept(x.getTryBlock()); + + acceptList(x.getCatches()); + + JsBlock finallyBlock = x.getFinallyBlock(); + if (finallyBlock != null) { + _spaceOpt(); + _finally(); + _spaceOpt(); + accept(finallyBlock); + } + + return false; + } + + @Override + public boolean visit(JsVar x, JsContext ctx) { + _nameOf(x); + JsExpression initExpr = x.getInitExpr(); + if (initExpr != null) { + _spaceOpt(); + _assignment(); + _spaceOpt(); + _parenPushIfCommaExpr(initExpr); + accept(initExpr); + _parenPopIfCommaExpr(initExpr); + } + return false; + } + + @Override + public boolean visit(JsVars x, JsContext ctx) { + _var(); + _space(); + boolean sep = false; + for (JsVar var : x) { + sep = _sepCommaOptSpace(sep); + accept(var); + } + return false; + } + + @Override + public boolean visit(JsWhile x, JsContext ctx) { + _while(); + _spaceOpt(); + _lparen(); + accept(x.getCondition()); + _rparen(); + _nestedPush(x.getBody(), false); + accept(x.getBody()); + _nestedPop(x.getBody()); + return false; + } + + // CHECKSTYLE_NAMING_OFF + protected void _newline() { + p.newline(); + } + + protected void _newlineOpt() { + p.newlineOpt(); + } + + protected void printJsBlock(JsBlock x, boolean truncate, boolean finalNewline) { + boolean needBraces = !x.isGlobalBlock(); + + if (needBraces) { + // Open braces. + // + _blockOpen(); + } + + int count = 0; + for (Iterator iter = x.getStatements().iterator(); iter.hasNext(); ++count) { + boolean isGlobal = x.isGlobalBlock() || globalBlocks.contains(x); + + if (truncate && count > JSBLOCK_LINES_TO_PRINT) { + p.print("[...]"); + _newlineOpt(); + break; + } + JsStatement stmt = iter.next(); + needSemi = true; + boolean shouldRecordPositions = isGlobal && !(stmt instanceof JsBlock); + boolean stmtIsGlobalBlock = false; + if (isGlobal) { + if (stmt instanceof JsBlock) { + // A block inside a global block is still considered global + stmtIsGlobalBlock = true; + globalBlocks.add((JsBlock) stmt); + } + } + if (shouldRecordPositions) { + statementStarts.add(p.getPosition()); + } + accept(stmt); + if (stmtIsGlobalBlock) { + globalBlocks.remove(stmt); + } + if (needSemi) { + /* + * Special treatment of function decls: If they are the only item in a + * statement (i.e. not part of an assignment operation), just give them + * a newline instead of a semi. + */ + boolean functionStmt = + stmt instanceof JsExprStmt && ((JsExprStmt) stmt).getExpression() instanceof JsFunction; + /* + * Special treatment of the last statement in a block: only a few + * statements at the end of a block require semicolons. + */ + boolean lastStatement = !iter.hasNext() && needBraces && !JsRequiresSemiVisitor.exec(stmt); + if (functionStmt) { + if (lastStatement) { + _newlineOpt(); + } else { + _newline(); + } + } else { + if (lastStatement) { + _semiOpt(); + } else { + _semi(); + } + _newlineOpt(); + } + } + if (shouldRecordPositions) { + assert (statementStarts.size() == statementEnds.size() + 1); + statementEnds.add(p.getPosition()); + } + } + + if (needBraces) { + // _blockClose() modified + p.indentOut(); + p.print('}'); + if (finalNewline) { + _newlineOpt(); + } + } + needSemi = false; + } + + private void _assignment() { + p.print('='); + } + + private void _blockClose() { + p.indentOut(); + p.print('}'); + _newlineOpt(); + } + + private void _blockOpen() { + p.print('{'); + p.indentIn(); + _newlineOpt(); + } + + private void _break() { + p.print(CHARS_BREAK); + } + + private void _case() { + p.print(CHARS_CASE); + } + + private void _catch() { + p.print(CHARS_CATCH); + } + + private void _colon() { + p.print(':'); + } + + private void _continue() { + p.print(CHARS_CONTINUE); + } + + private void _debugger() { + p.print(CHARS_DEBUGGER); + } + + private void _default() { + p.print(CHARS_DEFAULT); + } + + private void _do() { + p.print(CHARS_DO); + } + + private void _dot() { + p.print('.'); + } + + private void _else() { + p.print(CHARS_ELSE); + } + + private void _false() { + p.print(CHARS_FALSE); + } + + private void _finally() { + p.print(CHARS_FINALLY); + } + + private void _for() { + p.print(CHARS_FOR); + } + + private void _function() { + p.print(CHARS_FUNCTION); + } + + private void _if() { + p.print(CHARS_IF); + } + + private void _in() { + p.print(CHARS_IN); + } + + private void _lbrace() { + p.print('{'); + } + + private void _lparen() { + p.print('('); + } + + private void _lsquare() { + p.print('['); + } + + private void _nameDef(JsName name) { + p.print(name.getShortIdent()); + } + + private void _nameOf(HasName hasName) { + _nameDef(hasName.getName()); + } + + private void _nameRef(JsNameRef nameRef) { + p.print(nameRef.getShortIdent()); + } + + private boolean _nestedPop(JsStatement statement) { + boolean pop = !(statement instanceof JsBlock); + if (pop) { + p.indentOut(); + } + return pop; + } + + private boolean _nestedPush(JsStatement statement, boolean needSpace) { + boolean push = !(statement instanceof JsBlock); + if (push) { + if (needSpace) { + _space(); + } + p.indentIn(); + _newlineOpt(); + } else { + _spaceOpt(); + } + return push; + } + + private void _new() { + p.print(CHARS_NEW); + } + + private void _null() { + p.print(CHARS_NULL); + } + + private boolean _parenCalc(JsExpression parent, JsExpression child, boolean wrongAssoc) { + int parentPrec = JsPrecedenceVisitor.exec(parent); + int childPrec = JsPrecedenceVisitor.exec(child); + return (parentPrec > childPrec || (parentPrec == childPrec && wrongAssoc)); + } + + private boolean _parenPop(JsExpression parent, JsExpression child, boolean wrongAssoc) { + boolean doPop = _parenCalc(parent, child, wrongAssoc); + if (doPop) { + _rparen(); + } + return doPop; + } + + private boolean _parenPopIfCommaExpr(JsExpression x) { + boolean doPop = + x instanceof JsBinaryOperation + && ((JsBinaryOperation) x).getOperator() == JsBinaryOperator.COMMA; + if (doPop) { + _rparen(); + } + return doPop; + } + + private boolean _parenPopOrSpace(JsExpression parent, JsExpression child, boolean wrongAssoc) { + boolean doPop = _parenCalc(parent, child, wrongAssoc); + if (doPop) { + _rparen(); + } else { + _space(); + } + return doPop; + } + + private boolean _parenPush(JsExpression parent, JsExpression child, boolean wrongAssoc) { + boolean doPush = _parenCalc(parent, child, wrongAssoc); + if (doPush) { + _lparen(); + } + return doPush; + } + + private boolean _parenPushIfCommaExpr(JsExpression x) { + boolean doPush = + x instanceof JsBinaryOperation + && ((JsBinaryOperation) x).getOperator() == JsBinaryOperator.COMMA; + if (doPush) { + _lparen(); + } + return doPush; + } + + private boolean _parenPushOrSpace(JsExpression parent, JsExpression child, boolean wrongAssoc) { + boolean doPush = _parenCalc(parent, child, wrongAssoc); + if (doPush) { + _lparen(); + } else { + _space(); + } + return doPush; + } + + private void _questionMark() { + p.print('?'); + } + + private void _rbrace() { + p.print('}'); + } + + private void _return() { + p.print(CHARS_RETURN); + } + + private void _rparen() { + p.print(')'); + } + + private void _rsquare() { + p.print(']'); + } + + private void _semi() { + p.print(';'); + } + + private void _semiOpt() { + p.printOpt(';'); + } + + private boolean _sepCommaOptSpace(boolean sep) { + if (sep) { + p.print(','); + _spaceOpt(); + } + return true; + } + + private void _slash() { + p.print('/'); + } + + private void _space() { + p.print(' '); + } + + /** + * Decide whether, if op is printed followed by arg, + * there needs to be a space between the operator and expression. + * + * @return true if a space needs to be printed + */ + private boolean _spaceCalc(JsOperator op, JsExpression arg) { + if (op.isKeyword()) { + return true; + } + if (arg instanceof JsBinaryOperation) { + JsBinaryOperation binary = (JsBinaryOperation) arg; + /* + * If the binary operation has a higher precedence than op, then it won't + * be parenthesized, so check the first argument of the binary operation. + */ + if (binary.getOperator().getPrecedence() > op.getPrecedence()) { + return _spaceCalc(op, binary.getArg1()); + } + return false; + } + if (arg instanceof JsPrefixOperation) { + JsOperator op2 = ((JsPrefixOperation) arg).getOperator(); + return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) + && (op2 == JsUnaryOperator.DEC || op2 == JsUnaryOperator.NEG) + || (op == JsBinaryOperator.ADD && op2 == JsUnaryOperator.INC); + } + if (arg instanceof JsNumberLiteral) { + JsNumberLiteral literal = (JsNumberLiteral) arg; + return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) && (literal.getValue() < 0); + } + return false; + } + + private void _spaceOpt() { + p.printOpt(' '); + } + + private void _switch() { + p.print(CHARS_SWITCH); + } + + private void _this() { + p.print(CHARS_THIS); + } + + private void _throw() { + p.print(CHARS_THROW); + } + + private void _true() { + p.print(CHARS_TRUE); + } + + private void _try() { + p.print(CHARS_TRY); + } + + private void _var() { + p.print(CHARS_VAR); + } + + private void _while() { + p.print(CHARS_WHILE); + } + + // CHECKSTYLE_NAMING_ON + + private void indent() { + p.indentIn(); + } + + private void outdent() { + p.indentOut(); + } + + private void printStringLiteral(String value) { + String resultString = javaScriptString(value); + p.print(resultString); + } +} diff --git a/src/com/google/dart/compiler/backend/js/UncheckedJsParserException.java b/src/com/google/dart/compiler/backend/js/UncheckedJsParserException.java new file mode 100644 index 00000000000..c2db8120537 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/UncheckedJsParserException.java @@ -0,0 +1,21 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js; + +/** + * An unchecked wrapper exception to interop with Rhino. + */ +class UncheckedJsParserException extends RuntimeException { + + private final JsParserException parserException; + + public UncheckedJsParserException(JsParserException parserException) { + this.parserException = parserException; + } + + public JsParserException getParserException() { + return parserException; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/CanBooleanEval.java b/src/com/google/dart/compiler/backend/js/ast/CanBooleanEval.java new file mode 100644 index 00000000000..8f4364d94f2 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/CanBooleanEval.java @@ -0,0 +1,15 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * An interface that describes the boolean evaluation of an expression. + */ +public interface CanBooleanEval { + + boolean isBooleanFalse(); + + boolean isBooleanTrue(); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/HasArguments.java b/src/com/google/dart/compiler/backend/js/ast/HasArguments.java new file mode 100644 index 00000000000..5a47c567606 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/HasArguments.java @@ -0,0 +1,14 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.List; + +/** + * Implemented by JavaScript objects that accept arguments. + */ +public interface HasArguments { + List getArguments(); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/HasCondition.java b/src/com/google/dart/compiler/backend/js/ast/HasCondition.java new file mode 100644 index 00000000000..082f4e15eb3 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/HasCondition.java @@ -0,0 +1,15 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Implemented by JavaScript objects with conditional execution. + */ +public interface HasCondition { + + JsExpression getCondition(); + + void setCondition(JsExpression condition); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/HasName.java b/src/com/google/dart/compiler/backend/js/ast/HasName.java new file mode 100644 index 00000000000..8daed3769f4 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/HasName.java @@ -0,0 +1,12 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Implemented by JavaScript objects that have a name. + */ +public interface HasName { + JsName getName(); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsArrayAccess.java b/src/com/google/dart/compiler/backend/js/ast/JsArrayAccess.java new file mode 100644 index 00000000000..46df5108086 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsArrayAccess.java @@ -0,0 +1,68 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a javascript expression for array access. + */ +public final class JsArrayAccess extends JsExpression { + + private JsExpression arrayExpr; + private JsExpression indexExpr; + + public JsArrayAccess() { + super(); + } + + public JsArrayAccess(JsExpression arrayExpr, JsExpression indexExpr) { + this.arrayExpr = arrayExpr; + this.indexExpr = indexExpr; + } + + public JsExpression getArrayExpr() { + return arrayExpr; + } + + public JsExpression getIndexExpr() { + return indexExpr; + } + + @Override + public boolean hasSideEffects() { + return arrayExpr.hasSideEffects() || indexExpr.hasSideEffects(); + } + + @Override + public boolean isDefinitelyNotNull() { + return false; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + public void setArrayExpr(JsExpression arrayExpr) { + this.arrayExpr = arrayExpr; + } + + public void setIndexExpr(JsExpression indexExpr) { + this.indexExpr = indexExpr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + arrayExpr = v.accept(arrayExpr); + indexExpr = v.accept(indexExpr); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.ARRAY_ACCESS; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.java new file mode 100644 index 00000000000..8cb9f7e6d52 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.java @@ -0,0 +1,67 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a JavaScript expression for array literals. + */ +public final class JsArrayLiteral extends JsLiteral { + + private final List exprs = new ArrayList(); + + public JsArrayLiteral() { + super(); + } + + public List getExpressions() { + return exprs; + } + + @Override + public boolean hasSideEffects() { + for (JsExpression expr : exprs) { + if (expr.hasSideEffects()) { + return true; + } + } + return false; + } + + @Override + public boolean isBooleanFalse() { + return false; + } + + @Override + public boolean isBooleanTrue() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + v.acceptWithInsertRemove(exprs); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.ARRAY; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.java b/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.java new file mode 100644 index 00000000000..b09d50c1d05 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.java @@ -0,0 +1,107 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript binary operation. + */ +public final class JsBinaryOperation extends JsExpression { + + private JsExpression arg1; + private JsExpression arg2; + private final JsBinaryOperator op; + + public JsBinaryOperation(JsBinaryOperator op) { + this(op, null, null); + } + + public JsBinaryOperation(JsBinaryOperator op, JsExpression arg1, JsExpression arg2) { + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + } + + public JsExpression getArg1() { + return arg1; + } + + public JsExpression getArg2() { + return arg2; + } + + public JsBinaryOperator getOperator() { + return op; + } + + @Override + public boolean hasSideEffects() { + return op.isAssignment() || arg1.hasSideEffects() || arg2.hasSideEffects(); + } + + @Override + public boolean isDefinitelyNotNull() { + // Precarious coding, but none of these can have null results. + if (op.getPrecedence() > 5) { + return true; + } + if (op == JsBinaryOperator.OR) { + if (arg1 instanceof CanBooleanEval) { + if (((CanBooleanEval) arg1).isBooleanTrue()) { + assert arg1.isDefinitelyNotNull(); + return true; + } + } + } + // AND and OR can return nulls + if (op.isAssignment()) { + if (op == JsBinaryOperator.ASG) { + return arg2.isDefinitelyNotNull(); + } else { + // All other ASG's are math ops. + return true; + } + } + + if (op == JsBinaryOperator.COMMA) { + return arg2.isDefinitelyNotNull(); + } + + return false; + } + + @Override + public boolean isDefinitelyNull() { + if (op == JsBinaryOperator.AND) { + return arg1.isDefinitelyNull(); + } + return false; + } + + public void setArg1(JsExpression arg1) { + this.arg1 = arg1; + } + + public void setArg2(JsExpression arg2) { + this.arg2 = arg2; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (op.isAssignment()) { + arg1 = v.acceptLvalue(arg1); + } else { + arg1 = v.accept(arg1); + } + arg2 = v.accept(arg2); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.BINARY_OP; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.java b/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.java new file mode 100644 index 00000000000..b54647f3a46 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.java @@ -0,0 +1,120 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents the operator in a JavaScript binary operation. + */ +public enum JsBinaryOperator implements JsOperator { + + /* + * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition + * (page 57) + * + * + * Precedence 15 is for really important things that have their own AST + * classes. + * + * Precedence 14 is for unary operators. + */ + + MUL("*", 13, LEFT | INFIX), DIV("/", 13, LEFT | INFIX), MOD("%", 13, LEFT + | INFIX), + + ADD("+", 12, LEFT | INFIX), SUB("-", 12, LEFT | INFIX), + + SHL("<<", 11, LEFT | INFIX), SHR(">>", 11, LEFT | INFIX), SHRU(">>>", 11, + LEFT | INFIX), + + LT("<", 10, LEFT | INFIX), LTE("<=", 10, LEFT | INFIX), GT(">", 10, LEFT + | INFIX), GTE(">=", 10, LEFT | INFIX), INSTANCEOF("instanceof", 10, LEFT + | INFIX), INOP("in", 10, LEFT | INFIX), + + EQ("==", 9, LEFT | INFIX), NEQ("!=", 9, LEFT | INFIX), REF_EQ("===", 9, LEFT + | INFIX), REF_NEQ("!==", 9, LEFT | INFIX), + + BIT_AND("&", 8, LEFT | INFIX), + + BIT_XOR("^", 7, LEFT | INFIX), + + BIT_OR("|", 6, LEFT | INFIX), + + AND("&&", 5, LEFT | INFIX), + + OR("||", 4, LEFT | INFIX), + + // Precedence 3 is for the condition operator. + + // These assignment operators are right-associative. + ASG("=", 2, INFIX), ASG_ADD("+=", 2, INFIX), ASG_SUB("-=", 2, INFIX), ASG_MUL( + "*=", 2, INFIX), ASG_DIV("/=", 2, INFIX), ASG_MOD("%=", 2, INFIX), ASG_SHL( + "<<=", 2, INFIX), ASG_SHR(">>=", 2, INFIX), ASG_SHRU(">>>=", 2, INFIX), ASG_BIT_AND( + "&=", 2, INFIX), ASG_BIT_OR("|=", 2, INFIX), ASG_BIT_XOR("^=", 2, INFIX), + + COMMA(",", 1, LEFT | INFIX); + + private final int mask; + private final int precedence; + private final String symbol; + + private JsBinaryOperator(String symbol, int precedence, int mask) { + this.symbol = symbol; + this.precedence = precedence; + this.mask = mask; + } + + @Override + public int getPrecedence() { + return precedence; + } + + @Override + public String getSymbol() { + return symbol; + } + + public boolean isAssignment() { + /* + * Beware, flaky! Maybe I should have added Yet Another Field to + * BinaryOperator? + */ + return (getPrecedence() == ASG.getPrecedence()); + } + + @Override + public boolean isKeyword() { + return this == INSTANCEOF || this == INOP; + } + + @Override + public boolean isLeftAssociative() { + return (mask & LEFT) != 0; + } + + @Override + public boolean isPrecedenceLessThan(JsOperator other) { + return precedence < other.getPrecedence(); + } + + @Override + public boolean isValidInfix() { + return (mask & INFIX) != 0; + } + + @Override + public boolean isValidPostfix() { + return (mask & POSTFIX) != 0; + } + + @Override + public boolean isValidPrefix() { + return (mask & PREFIX) != 0; + } + + @Override + public String toString() { + return symbol; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsBlock.java b/src/com/google/dart/compiler/backend/js/ast/JsBlock.java new file mode 100644 index 00000000000..3d927a2bf7d --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsBlock.java @@ -0,0 +1,49 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a JavaScript block statement. + */ +public class JsBlock extends JsStatement { + + private final List stmts = new ArrayList(); + + public JsBlock() { + } + + public JsBlock(JsStatement stmt) { + stmts.add(stmt); + } + + public List getStatements() { + return stmts; + } + + public void addStatement(JsStatement statement) { + assert statement != null; + stmts.add(statement); + } + + public boolean isGlobalBlock() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + v.acceptWithInsertRemove(stmts); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.BLOCK; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.java new file mode 100644 index 00000000000..12238ddbb02 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.java @@ -0,0 +1,53 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript literal boolean expression. + */ +public final class JsBooleanLiteral extends JsValueLiteral { + + private final boolean value; + + // Should be interned by JsProgram + JsBooleanLiteral(boolean value) { + this.value = value; + } + + public boolean getValue() { + return value; + } + + @Override + public boolean isBooleanFalse() { + return value == false; + } + + @Override + public boolean isBooleanTrue() { + return value == true; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.BOOLEAN; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsBreak.java b/src/com/google/dart/compiler/backend/js/ast/JsBreak.java new file mode 100644 index 00000000000..363f294df78 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsBreak.java @@ -0,0 +1,46 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents the JavaScript break statement. + */ +public final class JsBreak extends JsStatement { + + private final JsNameRef label; + + public JsBreak() { + this(null); + } + + public JsBreak(JsNameRef label) { + super(); + this.label = label; + } + + public JsNameRef getLabel() { + return label; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (label != null) { + v.accept(label); + } + } + v.endVisit(this, ctx); + } + + @Override + public boolean unconditionalControlBreak() { + return true; + } + + @Override + public NodeKind getKind() { + return NodeKind.BREAK; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsCase.java b/src/com/google/dart/compiler/backend/js/ast/JsCase.java new file mode 100644 index 00000000000..43d2fc41230 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsCase.java @@ -0,0 +1,39 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents the JavaScript case statement. + */ +public final class JsCase extends JsSwitchMember { + + private JsExpression caseExpr; + + public JsCase() { + super(); + } + + public JsExpression getCaseExpr() { + return caseExpr; + } + + public void setCaseExpr(JsExpression caseExpr) { + this.caseExpr = caseExpr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + caseExpr = v.accept(caseExpr); + v.acceptWithInsertRemove(stmts); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.CASE; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsCatch.java b/src/com/google/dart/compiler/backend/js/ast/JsCatch.java new file mode 100644 index 00000000000..f992545b944 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsCatch.java @@ -0,0 +1,66 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript catch clause. + */ +public class JsCatch extends JsNode implements HasCondition { + + protected final JsCatchScope scope; + private JsBlock body; + private JsExpression condition; + private JsParameter param; + + public JsCatch(JsScope parent, String ident) { + super(); + assert (parent != null); + scope = new JsCatchScope(parent, ident); + param = new JsParameter(scope.findExistingName(ident)); + } + + public JsBlock getBody() { + return body; + } + + @Override + public JsExpression getCondition() { + return condition; + } + + public JsParameter getParameter() { + return param; + } + + public JsScope getScope() { + return scope; + } + + public void setBody(JsBlock body) { + this.body = body; + } + + @Override + public void setCondition(JsExpression condition) { + this.condition = condition; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + param = v.accept(param); + if (condition != null) { + condition = v.accept(condition); + } + body = v.accept(body); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.CATCH; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java b/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java new file mode 100644 index 00000000000..6c9ce22a0e8 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java @@ -0,0 +1,75 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * A special scope used only for catch blocks. It only holds a single symbol: + * the catch argument's name. + */ +public class JsCatchScope extends JsScope { + + private final JsName name; + + public JsCatchScope(JsScope parent, String ident) { + super(parent, "Catch scope"); + this.name = new JsName(this, ident, ident, ident); + } + + @Override + public JsName declareName(String ident) { + // Declare into parent scope! + return getParent().declareName(ident); + } + + @Override + public JsName declareName(String ident, String shortIdent) { + // Declare into parent scope! + return getParent().declareName(ident, shortIdent); + } + + @Override + public Iterator getAllNames() { + return new Iterator() { + private boolean didIterate = false; + + @Override + public boolean hasNext() { + return !didIterate; + } + + @Override + public JsName next() { + if (didIterate) { + throw new NoSuchElementException(); + } + didIterate = true; + return name; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + }; + } + + @Override + protected JsName doCreateName(String ident, String shortIdent, String originalName) { + throw new UnsupportedOperationException("Cannot create a name in a catch scope"); + } + + @Override + protected JsName findExistingNameNoRecurse(String ident) { + if (name.getIdent().equals(ident)) { + return name; + } else { + return null; + } + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsConditional.java b/src/com/google/dart/compiler/backend/js/ast/JsConditional.java new file mode 100644 index 00000000000..b1171bac2c0 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsConditional.java @@ -0,0 +1,78 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript conditional expression. + */ +public final class JsConditional extends JsExpression { + + private JsExpression elseExpr; + private JsExpression testExpr; + private JsExpression thenExpr; + + public JsConditional() { + } + + public JsConditional(JsExpression testExpr, JsExpression thenExpr, JsExpression elseExpr) { + this.testExpr = testExpr; + this.thenExpr = thenExpr; + this.elseExpr = elseExpr; + } + + public JsExpression getElseExpression() { + return elseExpr; + } + + public JsExpression getTestExpression() { + return testExpr; + } + + public JsExpression getThenExpression() { + return thenExpr; + } + + @Override + public boolean hasSideEffects() { + return testExpr.hasSideEffects() || thenExpr.hasSideEffects() || elseExpr.hasSideEffects(); + } + + @Override + public boolean isDefinitelyNotNull() { + return thenExpr.isDefinitelyNotNull() && elseExpr.isDefinitelyNotNull(); + } + + @Override + public boolean isDefinitelyNull() { + return thenExpr.isDefinitelyNull() && elseExpr.isDefinitelyNull(); + } + + public void setElseExpression(JsExpression elseExpr) { + this.elseExpr = elseExpr; + } + + public void setTestExpression(JsExpression testExpr) { + this.testExpr = testExpr; + } + + public void setThenExpression(JsExpression thenExpr) { + this.thenExpr = thenExpr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + testExpr = v.accept(testExpr); + thenExpr = v.accept(thenExpr); + elseExpr = v.accept(elseExpr); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.CONDITIONAL; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsContext.java b/src/com/google/dart/compiler/backend/js/ast/JsContext.java new file mode 100644 index 00000000000..ddb170052d3 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsContext.java @@ -0,0 +1,27 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * The context in which a JsNode visitation occurs. This represents the set of + * possible operations a JsVisitor subclass can perform on the currently visited + * node. + */ +public interface JsContext { + + boolean canInsert(); + + boolean canRemove(); + + void insertAfter(JsVisitable node); + + void insertBefore(JsVisitable node); + + boolean isLvalue(); + + void removeMe(); + + void replaceMe(JsVisitable node); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsContinue.java b/src/com/google/dart/compiler/backend/js/ast/JsContinue.java new file mode 100644 index 00000000000..d761815fe76 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsContinue.java @@ -0,0 +1,46 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents the JavaScript continue statement. + */ +public final class JsContinue extends JsStatement { + + private final JsNameRef label; + + public JsContinue() { + this(null); + } + + public JsContinue(JsNameRef label) { + super(); + this.label = label; + } + + public JsNameRef getLabel() { + return label; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (label != null) { + v.accept(label); + } + } + v.endVisit(this, ctx); + } + + @Override + public boolean unconditionalControlBreak() { + return true; + } + + @Override + public NodeKind getKind() { + return NodeKind.CONTINUE; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsDebugger.java b/src/com/google/dart/compiler/backend/js/ast/JsDebugger.java new file mode 100644 index 00000000000..34cfae43f48 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsDebugger.java @@ -0,0 +1,25 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript debugger statement. + */ +public class JsDebugger extends JsStatement { + + public JsDebugger() { + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.DEBUGGER; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsDefault.java b/src/com/google/dart/compiler/backend/js/ast/JsDefault.java new file mode 100644 index 00000000000..a76987a8e5d --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsDefault.java @@ -0,0 +1,28 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents the default option in a JavaScript swtich statement. + */ +public final class JsDefault extends JsSwitchMember { + + public JsDefault() { + super(); + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + v.acceptWithInsertRemove(stmts); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.DEFAULT; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsDoWhile.java b/src/com/google/dart/compiler/backend/js/ast/JsDoWhile.java new file mode 100644 index 00000000000..1dd4a47e8d4 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsDoWhile.java @@ -0,0 +1,54 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript do..while statement. + */ +public class JsDoWhile extends JsStatement { + + private JsStatement body; + private JsExpression condition; + + public JsDoWhile() { + super(); + } + + public JsDoWhile(JsExpression condition, JsStatement body) { + super(); + this.condition = condition; + this.body = body; + } + + public JsStatement getBody() { + return body; + } + + public JsExpression getCondition() { + return condition; + } + + public void setBody(JsStatement body) { + this.body = body; + } + + public void setCondition(JsExpression condition) { + this.condition = condition; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + body = v.accept(body); + condition = v.accept(condition); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.DO; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsEmpty.java b/src/com/google/dart/compiler/backend/js/ast/JsEmpty.java new file mode 100644 index 00000000000..c2ac99e3ac0 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsEmpty.java @@ -0,0 +1,26 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents an empty statement in JavaScript. + */ +public class JsEmpty extends JsStatement { + + // Interned by JsProgram + JsEmpty() { + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.EMPTY; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsExprStmt.java b/src/com/google/dart/compiler/backend/js/ast/JsExprStmt.java new file mode 100644 index 00000000000..5b9fc1218c3 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsExprStmt.java @@ -0,0 +1,36 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript expression statement. + */ +public final class JsExprStmt extends JsStatement { + + private JsExpression expr; + + public JsExprStmt(JsExpression expr) { + super(); + this.expr = expr; + this.setSourceInfo(expr); + } + + public JsExpression getExpression() { + return expr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + expr = v.accept(expr); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.EXPR_STMT; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsExpression.java b/src/com/google/dart/compiler/backend/js/ast/JsExpression.java new file mode 100644 index 00000000000..43545ec98dc --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsExpression.java @@ -0,0 +1,52 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.common.SourceInfo; + +/** + * An abstract base class for all JavaScript expressions. + */ +public abstract class JsExpression extends JsNode { + + protected JsExpression() { + } + + /** + * Determines whether the expression can cause side effects. + */ + public abstract boolean hasSideEffects(); + + /** + * True if the target expression is definitely not null. + */ + public abstract boolean isDefinitelyNotNull(); + + /** + * True if the target expression is definitely null. + */ + public abstract boolean isDefinitelyNull(); + + /** + * Determines whether or not this expression is a leaf, such as a + * {@link JsNameRef}, {@link JsBooleanLiteral}, and so on. Leaf expressions + * never need to be parenthesized. + */ + public boolean isLeaf() { + // Conservatively say that it isn't a leaf. + // Individual subclasses can speak for themselves if they are a leaf. + return false; + } + + public JsExprStmt makeStmt() { + return new JsExprStmt(this); + } + + @Override + public JsExpression setSourceRef(SourceInfo info) { + super.setSourceRef(info); + return this; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsFor.java b/src/com/google/dart/compiler/backend/js/ast/JsFor.java new file mode 100644 index 00000000000..b980d4be1a2 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsFor.java @@ -0,0 +1,105 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.common.SourceInfo; + +/** + * A for statement. If specified at all, the initializer part is + * either a declaration of one or more variables, in which case + * {@link #getInitVars()} is used, or an expression, in which case + * {@link #getInitExpr()} is used. In the latter case, the comma operator is + * often used to create a compound expression. + * + *

+ * Note that any of the parts of the for loop header can be + * null, although the body will never be null. + */ +public class JsFor extends JsStatement { + + private JsStatement body; + private JsExpression condition; + private JsExpression incrExpr; + private JsExpression initExpr; + private JsVars initVars; + + public JsFor() { + super(); + } + + public JsStatement getBody() { + return body; + } + + public JsExpression getCondition() { + return condition; + } + + public JsExpression getIncrExpr() { + return incrExpr; + } + + public JsExpression getInitExpr() { + return initExpr; + } + + public JsVars getInitVars() { + return initVars; + } + + public void setBody(JsStatement body) { + this.body = body; + } + + public void setCondition(JsExpression condition) { + this.condition = condition; + } + + public void setIncrExpr(JsExpression incrExpr) { + this.incrExpr = incrExpr; + } + + public void setInitExpr(JsExpression initExpr) { + this.initExpr = initExpr; + } + + public void setInitVars(JsVars initVars) { + this.initVars = initVars; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + assert (!(initExpr != null && initVars != null)); + + if (initExpr != null) { + initExpr = v.accept(initExpr); + } else if (initVars != null) { + initVars = v.accept(initVars); + } + + if (condition != null) { + condition = v.accept(condition); + } + + if (incrExpr != null) { + incrExpr = v.accept(incrExpr); + } + body = v.accept(body); + } + v.endVisit(this, ctx); + } + + @Override + public JsFor setSourceRef(SourceInfo info) { + super.setSourceRef(info); + return this; + } + + @Override + public NodeKind getKind() { + return NodeKind.FOR; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsForIn.java b/src/com/google/dart/compiler/backend/js/ast/JsForIn.java new file mode 100644 index 00000000000..646e349885c --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsForIn.java @@ -0,0 +1,71 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript for..in statement. + */ +public class JsForIn extends JsStatement { + + private JsStatement body; + private JsExpression iterExpr; + private JsExpression objExpr; + + // Optional: the name of a new iterator variable to introduce + private final JsName iterVarName; + + public JsForIn() { + this(null); + } + + public JsForIn(JsName iterVarName) { + this.iterVarName = iterVarName; + } + + public JsStatement getBody() { + return body; + } + + public JsExpression getIterExpr() { + return iterExpr; + } + + public JsName getIterVarName() { + return iterVarName; + } + + public JsExpression getObjExpr() { + return objExpr; + } + + public void setBody(JsStatement body) { + this.body = body; + } + + public void setIterExpr(JsExpression iterExpr) { + this.iterExpr = iterExpr; + } + + public void setObjExpr(JsExpression objExpr) { + this.objExpr = objExpr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (iterExpr != null) { + iterExpr = v.acceptLvalue(iterExpr); + } + objExpr = v.accept(objExpr); + body = v.accept(body); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.FOR_IN; + } +} \ No newline at end of file diff --git a/src/com/google/dart/compiler/backend/js/ast/JsFunction.java b/src/com/google/dart/compiler/backend/js/ast/JsFunction.java new file mode 100644 index 00000000000..4563ca58bec --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsFunction.java @@ -0,0 +1,224 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.common.SourceInfo; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a JavaScript function expression. + */ +public final class JsFunction extends JsLiteral implements HasName { + + private static void trace(String title, String code) { + System.out.println("---------------------------"); + System.out.println(title + ":"); + System.out.println("---------------------------"); + System.out.println(code); + } + + protected JsBlock body; + protected final List params = new ArrayList(); + protected final JsScope scope; + private boolean artificiallyRescued; + private boolean executeOnce; + private boolean fromDart; + private JsFunction impliedExecute; + private JsName name; + private boolean trace = false; + private boolean traceFirst = true; + private boolean hoisted = false; + private boolean constructor = false; + + /** + * Creates an anonymous function. + */ + public JsFunction(JsScope parent) { + this(parent, null, false); + } + + /** + * Creates a function that is not derived from Dart source. + */ + public JsFunction(JsScope parent, JsName name) { + this(parent, name, false); + } + + /** + * Creates a named function, possibly derived from Dart source. + */ + public JsFunction(JsScope parent, JsName name, boolean fromDart) { + assert (parent != null); + this.fromDart = fromDart; + setName(name); + String scopeName = (name == null) ? "" : name.getIdent(); + scopeName = "function " + scopeName; + this.scope = new JsScope(parent, scopeName); + } + + public JsBlock getBody() { + return body; + } + + /** + * If true, this indicates that only the first invocation of the function will + * have any effects. Subsequent invocations may be considered to be no-op + * calls whose return value is ignored. + */ + public boolean getExecuteOnce() { + return executeOnce; + } + + public JsFunction getImpliedExecute() { + return impliedExecute; + } + + @Override + public JsName getName() { + return name; + } + + public void setParameters(List params) { + this.params.clear(); + this.params.addAll(params); + } + + public List getParameters() { + return params; + } + + public JsScope getScope() { + return scope; + } + + @Override + public boolean hasSideEffects() { + // If there's a name, the name is assigned to. + return name != null; + } + + public boolean isArtificiallyRescued() { + return artificiallyRescued; + } + + @Override + public boolean isBooleanFalse() { + return false; + } + + @Override + public boolean isBooleanTrue() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + public boolean isFromDart() { + return fromDart; + } + + public void setArtificiallyRescued(boolean rescued) { + this.artificiallyRescued = rescued; + } + + public void setBody(JsBlock body) { + this.body = body; + } + + public void setExecuteOnce(boolean executeOnce) { + this.executeOnce = executeOnce; + } + + public void setFromDart(boolean fromDart) { + this.fromDart = fromDart; + } + + public void setImpliedExecute(JsFunction impliedExecute) { + this.impliedExecute = impliedExecute; + } + + public void setName(JsName name) { + this.name = name; + if (name != null) { + if (isFromDart()) { + name.setStaticRef(this); + } + } + } + + public void setTrace() { + this.trace = true; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + String before = null; + if (trace && v instanceof JsModVisitor) { + before = this.toSource(); + if (traceFirst) { + traceFirst = false; + trace("SCRIPT INITIAL", before); + } + } + if (v.visit(this, ctx)) { + v.acceptWithInsertRemove(params); + body = v.accept(body); + } + v.endVisit(this, ctx); + if (trace && v instanceof JsModVisitor) { + String after = this.toSource(); + if (!after.equals(before)) { + String title = v.getClass().getSimpleName(); + trace(title, after); + } + } + } + + public void setHoisted() { + hoisted = true; + } + + /** Whether the function has been hoisted */ + public boolean isHoisted() { + return hoisted; + } + + /** + * Rebase the function to a new scope. + * @param newScopeParent The scope to add the function to. + */ + public void rebaseScope(JsScope newScopeParent) { + this.scope.rebase(newScopeParent); + } + + @Override + public JsFunction setSourceRef(SourceInfo info) { + super.setSourceRef(info); + return this; + } + + public boolean isConstructor() { + return this.constructor; + } + + public boolean setIsConstructor(boolean constructor) { + return this.constructor = constructor; + } + + @Override + public NodeKind getKind() { + return NodeKind.FUNCTION; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.java b/src/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.java new file mode 100644 index 00000000000..9a14004e14c --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.java @@ -0,0 +1,19 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represnts a JavaScript block in the global scope. + */ +public class JsGlobalBlock extends JsBlock { + + public JsGlobalBlock() { + } + + @Override + public boolean isGlobalBlock() { + return true; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsIf.java b/src/com/google/dart/compiler/backend/js/ast/JsIf.java new file mode 100644 index 00000000000..478538235ab --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsIf.java @@ -0,0 +1,65 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript if statement. + */ +public final class JsIf extends JsStatement { + + private JsExpression ifExpr; + private JsStatement thenStmt; + private JsStatement elseStmt; + + public JsIf() { + } + + public JsIf(JsExpression ifExpr, JsStatement thenStmt, JsStatement elseStmt) { + this.ifExpr = ifExpr; + this.thenStmt = thenStmt; + this.elseStmt = elseStmt; + } + + public JsStatement getElseStmt() { + return elseStmt; + } + + public JsExpression getIfExpr() { + return ifExpr; + } + + public JsStatement getThenStmt() { + return thenStmt; + } + + public void setElseStmt(JsStatement elseStmt) { + this.elseStmt = elseStmt; + } + + public void setIfExpr(JsExpression ifExpr) { + this.ifExpr = ifExpr; + } + + public void setThenStmt(JsStatement thenStmt) { + this.thenStmt = thenStmt; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + ifExpr = v.accept(ifExpr); + thenStmt = v.accept(thenStmt); + if (elseStmt != null) { + elseStmt = v.accept(elseStmt); + } + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.IF; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java b/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java new file mode 100644 index 00000000000..beb10a1eeed --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java @@ -0,0 +1,62 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents a JavaScript invocation. + */ +public final class JsInvocation extends JsExpression implements HasArguments { + + private final List args = new ArrayList(); + private JsExpression qualifier; + + public JsInvocation() { + } + + @Override + public List getArguments() { + return args; + } + + public JsExpression getQualifier() { + return qualifier; + } + + @Override + public boolean hasSideEffects() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + return false; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + public void setQualifier(JsExpression qualifier) { + this.qualifier = qualifier; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + qualifier = v.accept(qualifier); + v.acceptList(args); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.INVOKE; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsLabel.java b/src/com/google/dart/compiler/backend/js/ast/JsLabel.java new file mode 100644 index 00000000000..7d026c3a6de --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsLabel.java @@ -0,0 +1,45 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript label statement. + */ +public class JsLabel extends JsStatement implements HasName { + + private final JsName label; + + private JsStatement stmt; + + public JsLabel(JsName label) { + this.label = label; + } + + @Override + public JsName getName() { + return label; + } + + public JsStatement getStmt() { + return stmt; + } + + public void setStmt(JsStatement stmt) { + this.stmt = stmt; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + stmt = v.accept(stmt); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.LABEL; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsLiteral.java new file mode 100644 index 00000000000..c87ae0c8af1 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsLiteral.java @@ -0,0 +1,14 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript string literal expression. + */ +public abstract class JsLiteral extends JsExpression implements CanBooleanEval { + + protected JsLiteral() { + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsModVisitor.java b/src/com/google/dart/compiler/backend/js/ast/JsModVisitor.java new file mode 100644 index 00000000000..ef6e75ce994 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsModVisitor.java @@ -0,0 +1,189 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.util.Hack; + +import java.util.List; + +/** + * A visitor for iterating through and modifying an AST. + */ +public class JsModVisitor extends JsVisitor { + + private class ListContext implements JsContext { + + private List collection; + private int index; + private boolean removed; + private boolean replaced; + + @Override + public boolean canInsert() { + return true; + } + + @Override + public boolean canRemove() { + return true; + } + + @Override + public void insertAfter(JsVisitable node) { + checkRemoved(); + collection.add(index + 1, Hack.cast(node)); + didChange = true; + } + + @Override + public void insertBefore(JsVisitable node) { + checkRemoved(); + collection.add(index++, Hack.cast(node)); + didChange = true; + } + + @Override + public boolean isLvalue() { + return false; + } + + @Override + public void removeMe() { + checkState(); + collection.remove(index--); + didChange = removed = true; + } + + @Override + public void replaceMe(JsVisitable node) { + checkState(); + checkReplacement(collection.get(index), node); + collection.set(index, Hack.cast(node)); + didChange = replaced = true; + } + + protected void traverse(List collection) { + this.collection = collection; + for (index = 0; index < collection.size(); ++index) { + removed = replaced = false; + doTraverse(collection.get(index), this); + } + } + + private void checkRemoved() { + if (removed) { + throw new RuntimeException("Node was already removed"); + } + } + + private void checkState() { + checkRemoved(); + if (replaced) { + throw new RuntimeException("Node was already replaced"); + } + } + } + + private class LvalueContext extends NodeContext { + @Override + public boolean isLvalue() { + return true; + } + } + + private class NodeContext implements JsContext { + private T node; + private boolean replaced; + + @Override + public boolean canInsert() { + return false; + } + + @Override + public boolean canRemove() { + return false; + } + + @Override + public void insertAfter(JsVisitable node) { + throw new UnsupportedOperationException(); + } + + @Override + public void insertBefore(JsVisitable node) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isLvalue() { + return false; + } + + @Override + public void removeMe() { + throw new UnsupportedOperationException(); + } + + @Override + public void replaceMe(JsVisitable node) { + if (replaced) { + throw new RuntimeException("Node was already replaced"); + } + checkReplacement(this.node, node); + this.node = Hack.cast(node); + didChange = replaced = true; + } + + protected T traverse(T node) { + this.node = node; + replaced = false; + doTraverse(node, this); + return this.node; + } + } + + protected static void checkReplacement(T origNode, T newNode) { + if (newNode == null) { + throw new RuntimeException("Cannot replace with null"); + } + if (newNode == origNode) { + throw new RuntimeException("The replacement is the same as the original"); + } + } + + protected boolean didChange = false; + + @Override + public boolean didChange() { + return didChange; + } + + @Override + protected T doAccept(T node) { + return new NodeContext().traverse(node); + } + + @Override + protected void doAcceptList(List collection) { + NodeContext ctx = new NodeContext(); + for (int i = 0, c = collection.size(); i < c; ++i) { + ctx.traverse(collection.get(i)); + if (ctx.replaced) { + collection.set(i, ctx.node); + } + } + } + + @Override + protected JsExpression doAcceptLvalue(JsExpression expr) { + return new LvalueContext().traverse(expr); + } + + @Override + protected void doAcceptWithInsertRemove(List collection) { + new ListContext().traverse(collection); + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsName.java b/src/com/google/dart/compiler/backend/js/ast/JsName.java new file mode 100644 index 00000000000..2997bcfb546 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsName.java @@ -0,0 +1,102 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.io.Serializable; + +/** + * An abstract base class for named JavaScript objects. + */ +public class JsName implements Serializable { + private final JsScope enclosing; + private final String ident; + private boolean isObfuscatable; + private String shortIdent; + private String originalName; + + /** + * A back-reference to the JsNode that the JsName refers to. + */ + private JsNode staticRef; + + /** + * @param ident the unmangled ident to use for this name + */ + public JsName(JsScope enclosing, String ident, String shortIdent, String originalName) { + this.enclosing = enclosing; + this.ident = ident; + this.shortIdent = shortIdent; + if (originalName != null) { + this.originalName = originalName; + } + this.isObfuscatable = true; + } + + public JsScope getEnclosing() { + return enclosing; + } + + public String getIdent() { + return ident; + } + + public String getShortIdent() { + return shortIdent; + } + + public String getOriginalName() { + return originalName; + } + + public JsNode getStaticRef() { + return staticRef; + } + + public boolean isObfuscatable() { + return isObfuscatable; + } + + public JsNameRef makeRef() { + return new JsNameRef(this); + } + + public void setObfuscatable(boolean isObfuscatable) { + this.isObfuscatable = isObfuscatable; + } + + public void setShortIdent(String shortIdent) { + this.shortIdent = shortIdent; + } + + /** + * Should never be called except on immutable stuff. + */ + public void setStaticRef(JsNode node) { + this.staticRef = node; + } + + @Override + public String toString() { + return ident; + } + + @Override + public int hashCode() { + return ident.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof JsName)) { + return false; + } + JsName other = (JsName) obj; + return ident.equals(other.ident) && enclosing == other.enclosing; + } + +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java b/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java new file mode 100644 index 00000000000..dc26c8fa61a --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java @@ -0,0 +1,113 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript expression that references a name. + */ +public final class JsNameRef extends JsExpression implements CanBooleanEval, HasName { + + private String ident; + private JsName name; + private JsExpression qualifier; + + public JsNameRef(JsName name) { + this.name = name; + } + + public JsNameRef(String ident) { + this.ident = ident; + } + + public String getIdent() { + return (name == null) ? ident : name.getIdent(); + } + + @Override + public JsName getName() { + return name; + } + + public JsExpression getQualifier() { + return qualifier; + } + + public String getShortIdent() { + return (name == null) ? ident : name.getShortIdent(); + } + + @Override + public boolean hasSideEffects() { + if (qualifier == null) { + return false; + } + if (!qualifier.isDefinitelyNotNull()) { + // Could trigger NPE. + return true; + } + return qualifier.hasSideEffects(); + } + + @Override + public boolean isBooleanFalse() { + return isDefinitelyNull(); + } + + @Override + public boolean isBooleanTrue() { + return false; + } + + @Override + public boolean isDefinitelyNotNull() { + // TODO: look for single-assignment of stuff from Java? + return false; + } + + @Override + public boolean isDefinitelyNull() { + if (name != null) { + return (name.getEnclosing().getProgram().getUndefinedLiteral().getName() == name); + } + return false; + } + + @Override + public boolean isLeaf() { + if (qualifier == null) { + return true; + } else { + return false; + } + } + + public boolean isResolved() { + return name != null; + } + + public void resolve(JsName name) { + this.name = name; + this.ident = null; + } + + public void setQualifier(JsExpression qualifier) { + this.qualifier = qualifier; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (qualifier != null) { + qualifier = v.accept(qualifier); + } + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.NAME_REF; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsNew.java b/src/com/google/dart/compiler/backend/js/ast/JsNew.java new file mode 100644 index 00000000000..19b6f5d6c90 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsNew.java @@ -0,0 +1,61 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents the JavaScript new expression. + */ +public final class JsNew extends JsExpression implements HasArguments { + + private final List args = new ArrayList(); + private JsExpression ctorExpr; + + public JsNew(JsExpression ctorExpr) { + this.ctorExpr = ctorExpr; + } + + @Override + public List getArguments() { + return args; + } + + public JsExpression getConstructorExpression() { + return ctorExpr; + } + + @Override + public boolean hasSideEffects() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + // Sadly, in JS it can be! + // TODO: analysis could probably determine most instances cannot be null. + return false; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + ctorExpr = v.accept(ctorExpr); + v.acceptList(args); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.NEW; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsNode.java b/src/com/google/dart/compiler/backend/js/ast/JsNode.java new file mode 100644 index 00000000000..0d4b7aaa714 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsNode.java @@ -0,0 +1,50 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.backend.js.JsSourceGenerationVisitor; +import com.google.dart.compiler.backend.js.JsToStringGenerationVisitor; +import com.google.dart.compiler.common.AbstractNode; +import com.google.dart.compiler.common.SourceInfo; +import com.google.dart.compiler.util.DefaultTextOutput; + +/** + * Base class for all JS AST elements. + */ +public abstract class JsNode extends AbstractNode implements JsVisitable { + + protected JsNode() { + } + + // Causes source generation to delegate to the one visitor + public final String toSource() { + DefaultTextOutput out = new DefaultTextOutput(false); + JsSourceGenerationVisitor v = new JsSourceGenerationVisitor(out); + v.accept(this); + return out.toString(); + } + + // Causes source generation to delegate to the one visitor + @Override + public final String toString() { + DefaultTextOutput out = new DefaultTextOutput(false); + JsToStringGenerationVisitor v = new JsToStringGenerationVisitor(out); + v.accept(this); + return out.toString(); + } + + @Override + public SourceInfo getSourceInfo() { + return this; + } + + public JsNode setSourceRef(SourceInfo info) { + if (info != null) { + this.setSourceInfo(info); + } + return this; + } + + public abstract NodeKind getKind(); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsNullLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsNullLiteral.java new file mode 100644 index 00000000000..506b2e3f330 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsNullLiteral.java @@ -0,0 +1,46 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript null literal. + */ +public final class JsNullLiteral extends JsValueLiteral { + + // Should only be instantiated in JsProgram + JsNullLiteral() { + } + + @Override + public boolean isBooleanFalse() { + return true; + } + + @Override + public boolean isBooleanTrue() { + return false; + } + + @Override + public boolean isDefinitelyNotNull() { + return false; + } + + @Override + public boolean isDefinitelyNull() { + return true; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.NULL; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.java new file mode 100644 index 00000000000..726c6b0ed27 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.java @@ -0,0 +1,53 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Represents a JavaScript literal decimal expression. + */ +public final class JsNumberLiteral extends JsValueLiteral { + + private final double value; + + // Should be interned by JsProgram + JsNumberLiteral(double value) { + this.value = value; + } + + public double getValue() { + return value; + } + + @Override + public boolean isBooleanFalse() { + return value == 0.0; + } + + @Override + public boolean isBooleanTrue() { + return value != 0.0; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.NUMBER; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java new file mode 100644 index 00000000000..4f70265624b --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java @@ -0,0 +1,66 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * A JavaScript object literal. + */ +public final class JsObjectLiteral extends JsLiteral { + + private final List props = new ArrayList(); + + public JsObjectLiteral() { + } + + public List getPropertyInitializers() { + return props; + } + + @Override + public boolean hasSideEffects() { + for (JsPropertyInitializer prop : props) { + if (prop.hasSideEffects()) { + return true; + } + } + return false; + } + + @Override + public boolean isBooleanFalse() { + return false; + } + + @Override + public boolean isBooleanTrue() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + v.acceptWithInsertRemove(props); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.OBJECT; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsOperator.java b/src/com/google/dart/compiler/backend/js/ast/JsOperator.java new file mode 100644 index 00000000000..e4440cbe9ab --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsOperator.java @@ -0,0 +1,32 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript operator. + */ +public interface JsOperator { + + int INFIX = 0x02; + int LEFT = 0x01; + int POSTFIX = 0x04; + int PREFIX = 0x08; + + int getPrecedence(); + + String getSymbol(); + + boolean isKeyword(); + + boolean isLeftAssociative(); + + boolean isPrecedenceLessThan(JsOperator other); + + boolean isValidInfix(); + + boolean isValidPostfix(); + + boolean isValidPrefix(); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsParameter.java b/src/com/google/dart/compiler/backend/js/ast/JsParameter.java new file mode 100644 index 00000000000..17581ce4084 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsParameter.java @@ -0,0 +1,34 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript parameter. + */ +public final class JsParameter extends JsNode implements HasName { + + private final JsName name; + + public JsParameter(JsName name) { + this.name = name; + name.setStaticRef(this); + } + + @Override + public JsName getName() { + return name; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.PARAMETER; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.java b/src/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.java new file mode 100644 index 00000000000..a33536f6c0d --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.java @@ -0,0 +1,42 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript postfix operation. + */ +public final class JsPostfixOperation extends JsUnaryOperation { + + public JsPostfixOperation(JsUnaryOperator op) { + this(op, null); + } + + public JsPostfixOperation(JsUnaryOperator op, JsExpression arg) { + super(op, arg); + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + super.traverse(v, ctx); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.POSTFIX_OP; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.java b/src/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.java new file mode 100644 index 00000000000..8ce12c7bacd --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.java @@ -0,0 +1,69 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript prefix operation. + */ +public final class JsPrefixOperation extends JsUnaryOperation implements CanBooleanEval { + + public JsPrefixOperation(JsUnaryOperator op) { + this(op, null); + } + + public JsPrefixOperation(JsUnaryOperator op, JsExpression arg) { + super(op, arg); + } + + @Override + public boolean isBooleanFalse() { + if (getOperator() == JsUnaryOperator.VOID) { + return true; + } + if (getOperator() == JsUnaryOperator.NOT && getArg() instanceof CanBooleanEval) { + CanBooleanEval eval = (CanBooleanEval) getArg(); + return eval.isBooleanTrue(); + } + return false; + } + + @Override + public boolean isBooleanTrue() { + if (getOperator() == JsUnaryOperator.NOT && getArg() instanceof CanBooleanEval) { + CanBooleanEval eval = (CanBooleanEval) getArg(); + return eval.isBooleanFalse(); + } + if (getOperator() == JsUnaryOperator.TYPEOF) { + return true; + } + return false; + } + + @Override + public boolean isDefinitelyNotNull() { + if (getOperator() == JsUnaryOperator.TYPEOF) { + return true; + } + return getOperator() != JsUnaryOperator.VOID; + } + + @Override + public boolean isDefinitelyNull() { + return getOperator() == JsUnaryOperator.VOID; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + super.traverse(v, ctx); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.PREFIX_OP; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsProgram.java b/src/com/google/dart/compiler/backend/js/ast/JsProgram.java new file mode 100644 index 00000000000..1d2c902d27a --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsProgram.java @@ -0,0 +1,172 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.HashMap; +import java.util.Map; + +/** + * A JavaScript program. + */ +public final class JsProgram extends JsNode { + + private final JsStatement debuggerStmt; + private final JsEmpty emptyStmt; + private final JsBooleanLiteral falseLiteral; + private JsProgramFragment[] fragments; + private final Map indexedFunctions = new HashMap(); + private final JsNullLiteral nullLiteral; + private final Map numberLiteralMap = + new HashMap(); + private final JsScope objectScope; + private final JsRootScope rootScope; + private final Map stringLiteralMap = + new HashMap(); + private final JsScope topScope; + private final JsBooleanLiteral trueLiteral; + + /** + * Constructs a JavaScript program object. + */ + public JsProgram(String unitId) { + rootScope = new JsRootScope(this); + topScope = new JsScope(rootScope, "Global", unitId); + objectScope = new JsScope(rootScope, "Object"); + setFragmentCount(1); + + debuggerStmt = new JsDebugger(); + emptyStmt = new JsEmpty(); + falseLiteral = new JsBooleanLiteral(false); + nullLiteral = new JsNullLiteral(); + trueLiteral = new JsBooleanLiteral(true); + } + + public JsBooleanLiteral getBooleanLiteral(boolean truth) { + if (truth) { + return getTrueLiteral(); + } + return getFalseLiteral(); + } + + /** + * Gets the {@link JsStatement} to use whenever parsed source include a + * debugger statement. + */ + public JsStatement getDebuggerStmt() { + return debuggerStmt; + } + + public JsEmpty getEmptyStmt() { + return emptyStmt; + } + + public JsBooleanLiteral getFalseLiteral() { + return falseLiteral; + } + + public JsBlock getFragmentBlock(int fragment) { + if (fragment < 0 || fragment >= fragments.length) { + throw new IllegalArgumentException("Invalid fragment: " + fragment); + } + return fragments[fragment].getGlobalBlock(); + } + + public int getFragmentCount() { + return this.fragments.length; + } + + /** + * Gets the one and only global block. + */ + public JsBlock getGlobalBlock() { + return getFragmentBlock(0); + } + + public JsFunction getIndexedFunction(String name) { + return indexedFunctions.get(name); + } + + public JsNullLiteral getNullLiteral() { + return nullLiteral; + } + + public JsNumberLiteral getNumberLiteral(double value) { + JsNumberLiteral lit = numberLiteralMap.get(value); + if (lit == null) { + lit = new JsNumberLiteral(value); + numberLiteralMap.put(value, lit); + } + + return lit; + } + + public JsScope getObjectScope() { + return objectScope; + } + + /** + * Gets the quasi-mythical root scope. This is not the same as the top scope; + * all unresolvable identifiers wind up here, because they are considered + * external to the program. + */ + public JsRootScope getRootScope() { + return rootScope; + } + + /** + * Gets the top level scope. This is the scope of all the statements in the + * main program. + */ + public JsScope getScope() { + return topScope; + } + + /** + * Creates or retrieves a JsStringLiteral from an interned object pool. + */ + public JsStringLiteral getStringLiteral(String value) { + JsStringLiteral lit = stringLiteralMap.get(value); + if (lit == null) { + lit = new JsStringLiteral(value); + stringLiteralMap.put(value, lit); + } + return lit; + } + + public JsBooleanLiteral getTrueLiteral() { + return trueLiteral; + } + + public JsNameRef getUndefinedLiteral() { + return new JsNameRef("$Dart$Null"); + } + + public void setFragmentCount(int fragments) { + this.fragments = new JsProgramFragment[fragments]; + for (int i = 0; i < fragments; i++) { + this.fragments[i] = new JsProgramFragment(); + } + } + + public void setIndexedFunctions(Map indexedFunctions) { + this.indexedFunctions.clear(); + this.indexedFunctions.putAll(indexedFunctions); + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + for (JsProgramFragment fragment : fragments) { + v.accept(fragment); + } + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.PROGRAM; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java b/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java new file mode 100644 index 00000000000..3c6859e2150 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java @@ -0,0 +1,34 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * One independently loadable fragment of a {@link JsProgram}. + */ +public class JsProgramFragment extends JsNode { + + private final JsGlobalBlock globalBlock; + + public JsProgramFragment() { + this.globalBlock = new JsGlobalBlock(); + } + + public JsBlock getGlobalBlock() { + return globalBlock; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + v.accept(globalBlock); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.PROGRAM_FRAGMENT; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.java b/src/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.java new file mode 100644 index 00000000000..d68d8d01af4 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.java @@ -0,0 +1,56 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Used in object literals to specify property values by name. + */ +public class JsPropertyInitializer extends JsNode { + + private JsExpression labelExpr; + private JsExpression valueExpr; + + public JsPropertyInitializer() { + } + + public JsPropertyInitializer(JsExpression labelExpr, JsExpression valueExpr) { + this.labelExpr = labelExpr; + this.valueExpr = valueExpr; + } + + public JsExpression getLabelExpr() { + return labelExpr; + } + + public JsExpression getValueExpr() { + return valueExpr; + } + + public boolean hasSideEffects() { + return labelExpr.hasSideEffects() || valueExpr.hasSideEffects(); + } + + public void setLabelExpr(JsExpression labelExpr) { + this.labelExpr = labelExpr; + } + + public void setValueExpr(JsExpression valueExpr) { + this.valueExpr = valueExpr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + labelExpr = v.accept(labelExpr); + valueExpr = v.accept(valueExpr); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.PROPERTY_INIT; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsRegExp.java b/src/com/google/dart/compiler/backend/js/ast/JsRegExp.java new file mode 100644 index 00000000000..158c7a5e092 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsRegExp.java @@ -0,0 +1,64 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript regular expression. + */ +public final class JsRegExp extends JsValueLiteral { + + private String flags; + private String pattern; + + public JsRegExp() { + } + + public String getFlags() { + return flags; + } + + public String getPattern() { + return pattern; + } + + @Override + public boolean isBooleanFalse() { + return false; + } + + @Override + public boolean isBooleanTrue() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + public void setFlags(String suffix) { + this.flags = suffix; + } + + public void setPattern(String re) { + this.pattern = re; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.REGEXP; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsReturn.java b/src/com/google/dart/compiler/backend/js/ast/JsReturn.java new file mode 100644 index 00000000000..16d90e4b353 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsReturn.java @@ -0,0 +1,48 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript return statement. + */ +public final class JsReturn extends JsStatement { + + private JsExpression expr; + + public JsReturn() { + } + + public JsReturn(JsExpression expr) { + this.expr = expr; + } + + public JsExpression getExpr() { + return expr; + } + + public void setExpr(JsExpression expr) { + this.expr = expr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (expr != null) { + expr = v.accept(expr); + } + } + v.endVisit(this, ctx); + } + + @Override + public boolean unconditionalControlBreak() { + return true; + } + + @Override + public NodeKind getKind() { + return NodeKind.RETURN; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsRootScope.java b/src/com/google/dart/compiler/backend/js/ast/JsRootScope.java new file mode 100644 index 00000000000..25c50b2c9ad --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsRootScope.java @@ -0,0 +1,50 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.backend.js.JsReservedIdentifiers; + +/** + * The root scope is the parent of every scope. All identifiers in this scope + * are not obfuscatable. This scope is prefilled with reserved global + * JavaScript symbols. + */ +public final class JsRootScope extends JsScope { + + private final JsProgram program; + + public JsRootScope(JsProgram program) { + super("Root"); + this.program = program; + } + + @Override + public JsProgram getProgram() { + return program; + } + + @Override + protected JsName doCreateName(String ident, String shortIdent, String originalName) { + JsName name = super.doCreateName(ident, shortIdent, originalName); + name.setObfuscatable(false); + return name; + } + + @Override + protected JsName findExistingNameNoRecurse(String ident) { + JsName name = super.findExistingNameNoRecurse(ident); + if (name == null) { + if (JsReservedIdentifiers.getReservedGlobalSymbols().contains(ident)) { + /* + * Lazily add JsNames for reserved identifiers. Since a JsName for a reserved global symbol + * must report a legitimate enclosing scope, we can't simply have a shared set of symbol + * names. + */ + name = doCreateName(ident, ident, ident); + } + } + return name; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsScope.java b/src/com/google/dart/compiler/backend/js/ast/JsScope.java new file mode 100644 index 00000000000..178f85e51f6 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsScope.java @@ -0,0 +1,298 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.util.Lists; +import com.google.dart.compiler.util.Maps; + +import java.io.Serializable; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * A scope is a factory for creating and allocating + * {@link com.google.dart.compiler.backend.js.ast.JsName}s. A JavaScript AST is + * built in terms of abstract name objects without worrying about obfuscation, + * keyword/identifier blacklisting, and so on. + * + *

+ * + * Scopes are associated with + * {@link com.google.dart.compiler.backend.js.ast.JsFunction}s, but the two are + * not equivalent. Functions have scopes, but a scope does not + * necessarily have an associated Function. Examples of this include the + * {@link com.google.dart.compiler.backend.js.ast.JsRootScope} and synthetic + * scopes that might be created by a client. + * + *

+ * + * Scopes can have parents to provide constraints when allocating actual + * identifiers for names. Specifically, names in child scopes are chosen such + * that they do not conflict with names in their parent scopes. The ultimate + * parent is usually the global scope (see + * {@link com.google.dart.compiler.backend.js.ast.JsProgram#getRootScope()}), + * but parentless scopes are useful for managing names that are always accessed + * with a qualifier and could therefore never be confused with the global scope + * hierarchy. + */ +public class JsScope implements Serializable { + + private List children = Collections.emptyList(); + private final String description; + private Map names = Collections.emptyMap(); + private JsScope parent; + protected int tempIndex = 0; + private final String scopeId; + + /* + * Create a scope with parent. + */ + public JsScope(JsScope parent, String description) { + this(parent, description, null); + } + + /** + * Create a scope with parent. + */ + public JsScope(JsScope parent, String description, String scopeId) { + assert (parent != null); + this.scopeId = scopeId; + this.description = description; + this.parent = parent; + parent.children = Lists.add(parent.children, this); + } + + /** + * Rebase the function to a new scope. + * @param newParent The scope to add the function to. + */ + public void rebase(JsScope newParent) { + detachFromParent(); + parent = newParent; + parent.children = Lists.add(parent.children, this); + } + + /** + * Rebase the function's children to a new scope. + * @param newParent + */ + public void rebaseChildScopes(JsScope newParent) { + if (newParent == this) { + return; + } + parent.children = Lists.addAll(parent.children, children); + for (JsScope child : children) { + child.parent = newParent; + } + children = Collections.emptyList(); + } + + /** + * Subclasses can detach and become parentless. + */ + protected void detachFromParent() { + JsScope oldParent = parent; + + oldParent.children = Lists.remove( + parent.children, oldParent.children.indexOf(this)); + + parent = null; + } + + /** + * Subclasses can be parentless. + */ + protected JsScope(String description) { + this.description = description; + this.parent = null; + this.scopeId = null; + } + + /** + * Gets a name object associated with the specified ident in this scope, + * creating it if necessary.
+ * If the JsName does not exist yet, a new JsName is created. The ident, + * short name, and original name of the newly created JsName are equal to + * the given ident. + * + * @param ident An identifier that is unique within this scope. + */ + public JsName declareName(String ident) { + JsName name = findExistingNameNoRecurse(ident); + if (name != null) { + return name; + } + return doCreateName(ident, ident, ident); + } + + /** + * Creates a new variable with an unique ident in this scope. + * The generated JsName is guaranteed to have an identifier (but not short + * name) that does not clash with any existing variables in the scope. + * Future declarations of variables might however clash with the temporary + * (unless they use this function). + */ + public JsName declareFreshName(String shortName) { + String ident = shortName; + int counter = 0; + while (findExistingNameNoRecurse(ident) != null) { + ident = shortName + "_" + counter++; + } + return doCreateName(ident, shortName, shortName); + } + + String getNextTempName() { + // TODO(ngeoffray): Decide on a convention for temporary variables + // introduced by the compiler. + return "tmp$" + (scopeId != null ? scopeId + "$" : "") + tempIndex++; + } + + /** + * Creates a temporary variable with an unique name in this scope. + * The generated temporary is guaranteed to have an identifier (but not short + * name) that does not clash with any existing variables in the scope. + * Future declarations of variables might however clash with the temporary. + */ + public JsName declareTemporary() { + return declareFreshName(getNextTempName()); + } + + /** + * Gets a name object associated with the specified ident in this scope, + * creating it if necessary.
+ * If the JsName does not exist yet, a new JsName is created with the given + * ident, short name and original name. + * + * @param ident An identifier that is unique within this scope. + * @param shortIdent A "pretty" name that does not have to be unique. + * @throws IllegalArgumentException if ident already exists in this scope but + * the requested short name does not match the existing short name. + */ + public JsName declareName(String ident, String shortIdent) { + return declareName(ident, shortIdent, ident); + } + + /** + * Gets a name object associated with the specified ident in this scope, + * creating it if necessary.
+ * If the JsName does not exist yet, a new JsName is created. The original + * name stored in the JsName is equal to the (unmangled) specified originalName. + * + * @param ident An identifier that is unique within this scope. + * @param shortIdent A "pretty" name that does not have to be unique. + * @param originalName The original name in the source. + * @throws IllegalArgumentException if ident already exists in this scope but + * the requested short name does not match the existing short name, + * or the original name does not match the existing original name. + */ + public JsName declareName(String ident, String shortIdent, String originalName) { + JsName name = findExistingNameNoRecurse(ident); + if (name != null) { + if (!name.getShortIdent().equals(shortIdent) + || !nullableEquals(name.getOriginalName(), originalName)) { + throw new IllegalArgumentException("Requested short name " + shortIdent + + " conflicts with preexisting short name " + name.getShortIdent() + " for identifier " + + ident); + } + return name; + } + return doCreateName(ident, shortIdent, originalName); + } + + boolean nullableEquals(String s1, String s2) { + return (s1 == null) ? (s2 == null) : s1.equals(s2); + } + + /** + * Attempts to find the name object for the specified ident, searching in this + * scope, and if not found, in the parent scopes. + * + * @return null if the identifier has no associated name + */ + public final JsName findExistingName(String ident) { + JsName name = findExistingNameNoRecurse(ident); + if (name == null && parent != null) { + return parent.findExistingName(ident); + } + return name; + } + + /** + * Attempts to find an unobfuscatable name object for the specified ident, + * searching in this scope, and if not found, in the parent scopes. + * + * @return null if the identifier has no associated name + */ + public final JsName findExistingUnobfuscatableName(String ident) { + JsName name = findExistingNameNoRecurse(ident); + if (name != null && name.isObfuscatable()) { + name = null; + } + if (name == null && parent != null) { + return parent.findExistingUnobfuscatableName(ident); + } + return name; + } + + /** + * Returns an iterator for all the names defined by this scope. + */ + public Iterator getAllNames() { + return names.values().iterator(); + } + + /** + * Returns a list of this scope's child scopes. + */ + public final List getChildren() { + return children; + } + + /** + * Returns the parent scope of this scope, or null if this is the + * root scope. + */ + public final JsScope getParent() { + return parent; + } + + /** + * Returns the associated program. + */ + public JsProgram getProgram() { + assert (parent != null) : "Subclasses must override getProgram() if they do not set a parent"; + return parent.getProgram(); + } + + @Override + public final String toString() { + if (parent != null) { + return description + "->" + parent; + } else { + return description; + } + } + + /** + * Creates a new name in this scope. + */ + protected JsName doCreateName(String ident, String shortIdent, String originalName) { + JsName name = new JsName(this, ident, shortIdent, originalName); + names = Maps.putOrdered(names, ident, name); + return name; + } + + /** + * Attempts to find the name object for the specified ident, searching in this + * scope only. + * + * @return null if the identifier has no associated name + */ + protected JsName findExistingNameNoRecurse(String ident) { + return names.get(ident); + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsStatement.java b/src/com/google/dart/compiler/backend/js/ast/JsStatement.java new file mode 100644 index 00000000000..82d37ca1185 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsStatement.java @@ -0,0 +1,22 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Abstract base class for JavaScript statement objects. + */ +public abstract class JsStatement extends JsNode { + + protected JsStatement() { + } + + /** + * Returns true if this statement definitely causes an abrupt change in flow + * control. + */ + public boolean unconditionalControlBreak() { + return false; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsStringLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsStringLiteral.java new file mode 100644 index 00000000000..77e60c9b89a --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsStringLiteral.java @@ -0,0 +1,53 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript string literal expression. + */ +public final class JsStringLiteral extends JsValueLiteral { + + private final String value; + + // These only get created by JsProgram so that they can be interned. + JsStringLiteral(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public boolean isBooleanFalse() { + return value.length() == 0; + } + + @Override + public boolean isBooleanTrue() { + return value.length() != 0; + } + + @Override + public boolean isDefinitelyNotNull() { + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.STRING; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsSwitch.java b/src/com/google/dart/compiler/backend/js/ast/JsSwitch.java new file mode 100644 index 00000000000..5a49624af42 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsSwitch.java @@ -0,0 +1,47 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * A JavaScript switch statement. + */ +public class JsSwitch extends JsStatement { + + private final List cases = new ArrayList(); + private JsExpression expr; + + public JsSwitch() { + super(); + } + + public List getCases() { + return cases; + } + + public JsExpression getExpr() { + return expr; + } + + public void setExpr(JsExpression expr) { + this.expr = expr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + expr = v.accept(expr); + v.acceptWithInsertRemove(cases); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.SWITCH; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsSwitchMember.java b/src/com/google/dart/compiler/backend/js/ast/JsSwitchMember.java new file mode 100644 index 00000000000..0a748f60078 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsSwitchMember.java @@ -0,0 +1,24 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * A member/case in a JavaScript switch object. + */ +public abstract class JsSwitchMember extends JsNode { + + protected final List stmts = new ArrayList(); + + protected JsSwitchMember() { + super(); + } + + public List getStmts() { + return stmts; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsThisRef.java b/src/com/google/dart/compiler/backend/js/ast/JsThisRef.java new file mode 100644 index 00000000000..9adb6459488 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsThisRef.java @@ -0,0 +1,51 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript this reference. + */ +public final class JsThisRef extends JsValueLiteral { + + public JsThisRef() { + super(); + } + + @Override + public boolean isBooleanFalse() { + return false; + } + + @Override + public boolean isBooleanTrue() { + return true; + } + + @Override + public boolean isDefinitelyNotNull() { + /* + * You'd think that you could get a null this via function.call/apply, but + * in fact you can't: they just make this be the window object instead. So + * it really can't ever be null. + */ + return true; + } + + @Override + public boolean isDefinitelyNull() { + return false; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + v.visit(this, ctx); + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.THIS; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsThrow.java b/src/com/google/dart/compiler/backend/js/ast/JsThrow.java new file mode 100644 index 00000000000..4616418fb6b --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsThrow.java @@ -0,0 +1,48 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript throw statement. + */ +public class JsThrow extends JsStatement { + + private JsExpression expr; + + public JsThrow() { + super(); + } + + public JsThrow(JsExpression expr) { + super(); + this.expr = expr; + } + + public JsExpression getExpr() { + return expr; + } + + public void setExpr(JsExpression expr) { + this.expr = expr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + expr = v.accept(expr); + } + v.endVisit(this, ctx); + } + + @Override + public boolean unconditionalControlBreak() { + return true; + } + + @Override + public NodeKind getKind() { + return NodeKind.THROW; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsTry.java b/src/com/google/dart/compiler/backend/js/ast/JsTry.java new file mode 100644 index 00000000000..61357bcd406 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsTry.java @@ -0,0 +1,59 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import java.util.ArrayList; +import java.util.List; + +/** + * A JavaScript try statement. + */ +public class JsTry extends JsStatement { + + private final List catches = new ArrayList(); + private JsBlock finallyBlock; + private JsBlock tryBlock; + + public JsTry() { + super(); + } + + public List getCatches() { + return catches; + } + + public JsBlock getFinallyBlock() { + return finallyBlock; + } + + public JsBlock getTryBlock() { + return tryBlock; + } + + public void setFinallyBlock(JsBlock block) { + this.finallyBlock = block; + } + + public void setTryBlock(JsBlock block) { + tryBlock = block; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + tryBlock = v.accept(tryBlock); + v.acceptWithInsertRemove(catches); + if (finallyBlock != null) { + finallyBlock = v.accept(finallyBlock); + } + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.TRY; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.java b/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.java new file mode 100644 index 00000000000..00f103f35c9 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.java @@ -0,0 +1,53 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript prefix or postfix operation. + */ +public abstract class JsUnaryOperation extends JsExpression { + + private JsExpression arg; + + private final JsUnaryOperator op; + + public JsUnaryOperation(JsUnaryOperator op) { + this(op, null); + } + + public JsUnaryOperation(JsUnaryOperator op, JsExpression arg) { + super(); + this.op = op; + this.arg = arg; + } + + public JsExpression getArg() { + return arg; + } + + public JsUnaryOperator getOperator() { + return op; + } + + @Override + public final boolean hasSideEffects() { + return op.isModifying() || arg.hasSideEffects(); + } + + public void setArg(JsExpression arg) { + this.arg = arg; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (op.isModifying()) { + // The delete operator is practically like an assignment of undefined, so + // for practical purposes we're treating it as an lvalue. + arg = v.acceptLvalue(arg); + } else { + arg = v.accept(arg); + } + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java b/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java new file mode 100644 index 00000000000..2b854d8313e --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java @@ -0,0 +1,78 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript unary operator. + */ +public enum JsUnaryOperator implements JsOperator { + + /* + * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition + * (page 57) + */ + BIT_NOT("~", 14, PREFIX), DEC("--", 14, POSTFIX | PREFIX), DELETE("delete", 14, PREFIX), INC( + "++", 14, POSTFIX | PREFIX), NEG("-", 14, PREFIX), POS("+", 14, PREFIX), + NOT("!", 14, PREFIX), TYPEOF("typeof", 14, PREFIX), VOID("void", 14, PREFIX); + + private final int mask; + private final int precedence; + private final String symbol; + + private JsUnaryOperator(String symbol, int precedence, int mask) { + this.symbol = symbol; + this.precedence = precedence; + this.mask = mask; + } + + @Override + public int getPrecedence() { + return precedence; + } + + @Override + public String getSymbol() { + return symbol; + } + + @Override + public boolean isKeyword() { + return this == DELETE || this == TYPEOF || this == VOID; + } + + @Override + public boolean isLeftAssociative() { + return (mask & LEFT) != 0; + } + + public boolean isModifying() { + return this == DEC || this == INC || this == DELETE; + } + + @Override + public boolean isPrecedenceLessThan(JsOperator other) { + return precedence < other.getPrecedence(); + } + + @Override + public boolean isValidInfix() { + return (mask & INFIX) != 0; + } + + @Override + public boolean isValidPostfix() { + return (mask & POSTFIX) != 0; + } + + @Override + public boolean isValidPrefix() { + return (mask & PREFIX) != 0; + } + + @Override + public String toString() { + return symbol; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsValueLiteral.java b/src/com/google/dart/compiler/backend/js/ast/JsValueLiteral.java new file mode 100644 index 00000000000..f23ab5dbce4 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsValueLiteral.java @@ -0,0 +1,24 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript string literal expression. + */ +public abstract class JsValueLiteral extends JsLiteral { + + protected JsValueLiteral() { + } + + @Override + public final boolean hasSideEffects() { + return false; + } + + @Override + public final boolean isLeaf() { + return true; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsVars.java b/src/com/google/dart/compiler/backend/js/ast/JsVars.java new file mode 100644 index 00000000000..aaf629259aa --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsVars.java @@ -0,0 +1,109 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.common.SourceInfo; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * A JavaScript var statement. + */ +public class JsVars extends JsStatement implements Iterable { + + /** + * A var declared using the JavaScript var statement. + */ + public static class JsVar extends JsNode implements HasName { + + private final JsName name; + private JsExpression initExpr; + + public JsVar(JsName name) { + this.name = name; + } + + public JsVar(JsName name, JsExpression initExpr) { + this.name = name; + this.initExpr = initExpr; + } + + public JsExpression getInitExpr() { + return initExpr; + } + + @Override + public JsName getName() { + return name; + } + + public void setInitExpr(JsExpression initExpr) { + this.initExpr = initExpr; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + if (initExpr != null) { + initExpr = v.accept(initExpr); + } + } + v.endVisit(this, ctx); + } + + @Override + public JsVar setSourceRef(SourceInfo info) { + super.setSourceRef(info); + return this; + } + + @Override + public NodeKind getKind() { + return NodeKind.VAR; + } + } + + private final List vars = new ArrayList(); + + public JsVars() { + } + + public void add(JsVar var) { + vars.add(var); + } + + public int getNumVars() { + return vars.size(); + } + + public void insert(JsVar var) { + vars.add(var); + } + + public boolean isEmpty() { + return vars.isEmpty(); + } + + // Iterator returns JsVar objects + @Override + public Iterator iterator() { + return vars.iterator(); + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + v.acceptWithInsertRemove(vars); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.VARS; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsVisitable.java b/src/com/google/dart/compiler/backend/js/ast/JsVisitable.java new file mode 100644 index 00000000000..626648af8ae --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsVisitable.java @@ -0,0 +1,19 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * Abstracts the idea that a class can be traversed. + */ +public interface JsVisitable { + + /** + * Causes this object to have the visitor visit itself and its children. + * + * @param visitor the visitor that should traverse this node + * @param ctx the context of an existing traversal + */ + void traverse(JsVisitor visitor, JsContext ctx); +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java b/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java new file mode 100644 index 00000000000..a3417a02817 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java @@ -0,0 +1,432 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +import com.google.dart.compiler.backend.js.ast.JsVars.JsVar; + +import java.util.List; + +/** + * Implemented by nodes that will visit child nodes. + */ +@SuppressWarnings("unused") +public class JsVisitor { + + protected static final JsContext LVALUE_CONTEXT = new JsContext() { + + @Override + public boolean canInsert() { + return false; + } + + @Override + public boolean canRemove() { + return false; + } + + @Override + public void insertAfter(JsVisitable node) { + throw new UnsupportedOperationException(); + } + + @Override + public void insertBefore(JsVisitable node) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isLvalue() { + return true; + } + + @Override + public void removeMe() { + throw new UnsupportedOperationException(); + } + + @Override + public void replaceMe(JsVisitable node) { + throw new UnsupportedOperationException(); + } + }; + + protected static final JsContext UNMODIFIABLE_CONTEXT = new JsContext() { + + @Override + public boolean canInsert() { + return false; + } + + @Override + public boolean canRemove() { + return false; + } + + @Override + public void insertAfter(JsVisitable node) { + throw new UnsupportedOperationException(); + } + + @Override + public void insertBefore(JsVisitable node) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isLvalue() { + return false; + } + + @Override + public void removeMe() { + throw new UnsupportedOperationException(); + } + + @Override + public void replaceMe(JsVisitable node) { + throw new UnsupportedOperationException(); + } + }; + + public final T accept(T node) { + return this.doAccept(node); + } + + public final void acceptList(List collection) { + doAcceptList(collection); + } + + public JsExpression acceptLvalue(JsExpression expr) { + return doAcceptLvalue(expr); + } + + public final void acceptWithInsertRemove(List collection) { + doAcceptWithInsertRemove(collection); + } + + public boolean didChange() { + throw new UnsupportedOperationException(); + } + + public void endVisit(JsArrayAccess x, JsContext ctx) { + } + + public void endVisit(JsArrayLiteral x, JsContext ctx) { + } + + public void endVisit(JsBinaryOperation x, JsContext ctx) { + } + + public void endVisit(JsBlock x, JsContext ctx) { + } + + public void endVisit(JsBooleanLiteral x, JsContext ctx) { + } + + public void endVisit(JsBreak x, JsContext ctx) { + } + + public void endVisit(JsCase x, JsContext ctx) { + } + + public void endVisit(JsCatch x, JsContext ctx) { + } + + public void endVisit(JsConditional x, JsContext ctx) { + } + + public void endVisit(JsContinue x, JsContext ctx) { + } + + public void endVisit(JsDebugger x, JsContext ctx) { + } + + public void endVisit(JsDefault x, JsContext ctx) { + } + + public void endVisit(JsDoWhile x, JsContext ctx) { + } + + public void endVisit(JsEmpty x, JsContext ctx) { + } + + public void endVisit(JsExprStmt x, JsContext ctx) { + } + + public void endVisit(JsFor x, JsContext ctx) { + } + + public void endVisit(JsForIn x, JsContext ctx) { + } + + public void endVisit(JsFunction x, JsContext ctx) { + } + + public void endVisit(JsIf x, JsContext ctx) { + } + + public void endVisit(JsInvocation x, JsContext ctx) { + } + + public void endVisit(JsLabel x, JsContext ctx) { + } + + public void endVisit(JsNameRef x, JsContext ctx) { + } + + public void endVisit(JsNew x, JsContext ctx) { + } + + public void endVisit(JsNullLiteral x, JsContext ctx) { + } + + public void endVisit(JsNumberLiteral x, JsContext ctx) { + } + + public void endVisit(JsObjectLiteral x, JsContext ctx) { + } + + public void endVisit(JsParameter x, JsContext ctx) { + } + + public void endVisit(JsPostfixOperation x, JsContext ctx) { + } + + public void endVisit(JsPrefixOperation x, JsContext ctx) { + } + + public void endVisit(JsProgram x, JsContext ctx) { + } + + public void endVisit(JsProgramFragment x, JsContext ctx) { + } + + public void endVisit(JsPropertyInitializer x, JsContext ctx) { + } + + public void endVisit(JsRegExp x, JsContext ctx) { + } + + public void endVisit(JsReturn x, JsContext ctx) { + } + + public void endVisit(JsStringLiteral x, JsContext ctx) { + } + + public void endVisit(JsSwitch x, JsContext ctx) { + } + + public void endVisit(JsThisRef x, JsContext ctx) { + } + + public void endVisit(JsThrow x, JsContext ctx) { + } + + public void endVisit(JsTry x, JsContext ctx) { + } + + public void endVisit(JsVar x, JsContext ctx) { + } + + public void endVisit(JsVars x, JsContext ctx) { + } + + public void endVisit(JsWhile x, JsContext ctx) { + } + + public boolean visit(JsArrayAccess x, JsContext ctx) { + return true; + } + + public boolean visit(JsArrayLiteral x, JsContext ctx) { + return true; + } + + public boolean visit(JsBinaryOperation x, JsContext ctx) { + return true; + } + + public boolean visit(JsBlock x, JsContext ctx) { + return true; + } + + public boolean visit(JsBooleanLiteral x, JsContext ctx) { + return true; + } + + public boolean visit(JsBreak x, JsContext ctx) { + return true; + } + + public boolean visit(JsCase x, JsContext ctx) { + return true; + } + + public boolean visit(JsCatch x, JsContext ctx) { + return true; + } + + public boolean visit(JsConditional x, JsContext ctx) { + return true; + } + + public boolean visit(JsContinue x, JsContext ctx) { + return true; + } + + public boolean visit(JsDebugger x, JsContext ctx) { + return true; + } + + public boolean visit(JsDefault x, JsContext ctx) { + return true; + } + + public boolean visit(JsDoWhile x, JsContext ctx) { + return true; + } + + public boolean visit(JsEmpty x, JsContext ctx) { + return true; + } + + public boolean visit(JsExprStmt x, JsContext ctx) { + return true; + } + + public boolean visit(JsFor x, JsContext ctx) { + return true; + } + + public boolean visit(JsForIn x, JsContext ctx) { + return true; + } + + public boolean visit(JsFunction x, JsContext ctx) { + return true; + } + + public boolean visit(JsIf x, JsContext ctx) { + return true; + } + + public boolean visit(JsInvocation x, JsContext ctx) { + return true; + } + + public boolean visit(JsLabel x, JsContext ctx) { + return true; + } + + public boolean visit(JsNameRef x, JsContext ctx) { + return true; + } + + public boolean visit(JsNew x, JsContext ctx) { + return true; + } + + public boolean visit(JsNullLiteral x, JsContext ctx) { + return true; + } + + public boolean visit(JsNumberLiteral x, JsContext ctx) { + return true; + } + + public boolean visit(JsObjectLiteral x, JsContext ctx) { + return true; + } + + public boolean visit(JsParameter x, JsContext ctx) { + return true; + } + + public boolean visit(JsPostfixOperation x, JsContext ctx) { + return true; + } + + public boolean visit(JsPrefixOperation x, JsContext ctx) { + return true; + } + + public boolean visit(JsProgram x, JsContext ctx) { + return true; + } + + public boolean visit(JsProgramFragment x, JsContext ctx) { + return true; + } + + public boolean visit(JsPropertyInitializer x, JsContext ctx) { + return true; + } + + public boolean visit(JsRegExp x, JsContext ctx) { + return true; + } + + public boolean visit(JsReturn x, JsContext ctx) { + return true; + } + + public boolean visit(JsStringLiteral x, JsContext ctx) { + return true; + } + + public boolean visit(JsSwitch x, JsContext ctx) { + return true; + } + + public boolean visit(JsThisRef x, JsContext ctx) { + return true; + } + + public boolean visit(JsThrow x, JsContext ctx) { + return true; + } + + public boolean visit(JsTry x, JsContext ctx) { + return true; + } + + public boolean visit(JsVar x, JsContext ctx) { + return true; + } + + public boolean visit(JsVars x, JsContext ctx) { + return true; + } + + public boolean visit(JsWhile x, JsContext ctx) { + return true; + } + + protected T doAccept(T node) { + doTraverse(node, UNMODIFIABLE_CONTEXT); + return node; + } + + protected void doAcceptList(List collection) { + for (T node : collection) { + doTraverse(node, UNMODIFIABLE_CONTEXT); + } + } + + protected JsExpression doAcceptLvalue(JsExpression expr) { + doTraverse(expr, LVALUE_CONTEXT); + return expr; + } + + protected void doAcceptWithInsertRemove(List collection) { + for (T node : collection) { + doTraverse(node, UNMODIFIABLE_CONTEXT); + } + } + + protected void doTraverse(JsVisitable node, JsContext ctx) { + node.traverse(this, ctx); + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/JsWhile.java b/src/com/google/dart/compiler/backend/js/ast/JsWhile.java new file mode 100644 index 00000000000..c40203bc1f1 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/JsWhile.java @@ -0,0 +1,52 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +/** + * A JavaScript while statement. + */ +public class JsWhile extends JsStatement { + + private JsStatement body; + private JsExpression condition; + + public JsWhile() { + } + + public JsWhile(JsExpression condition, JsStatement body) { + this.condition = condition; + this.body = body; + } + + public JsStatement getBody() { + return body; + } + + public JsExpression getCondition() { + return condition; + } + + public void setBody(JsStatement body) { + this.body = body; + } + + public void setCondition(JsExpression condition) { + this.condition = condition; + } + + @Override + public void traverse(JsVisitor v, JsContext ctx) { + if (v.visit(this, ctx)) { + condition = v.accept(condition); + body = v.accept(body); + } + v.endVisit(this, ctx); + } + + @Override + public NodeKind getKind() { + return NodeKind.WHILE; + } +} diff --git a/src/com/google/dart/compiler/backend/js/ast/NodeKind.java b/src/com/google/dart/compiler/backend/js/ast/NodeKind.java new file mode 100644 index 00000000000..614e4bb3bd9 --- /dev/null +++ b/src/com/google/dart/compiler/backend/js/ast/NodeKind.java @@ -0,0 +1,50 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.backend.js.ast; + +public enum NodeKind { + ARRAY_ACCESS, + ARRAY, + BINARY_OP, + BLOCK, + BOOLEAN, + BREAK, + CASE, + CATCH, + CONDITIONAL, + CONTINUE, + DEBUGGER, + DEFAULT, + DO, + EMPTY, + EXPR_STMT, + FOR, + FOR_IN, + FUNCTION, + IF, + INVOKE, + LABEL, + NAME_REF, + NEW, + NULL, + NUMBER, + OBJECT, + PARAMETER, + POSTFIX_OP, + PREFIX_OP, + PROGRAM, + PROGRAM_FRAGMENT, + PROPERTY_INIT, + REGEXP, + RETURN, + STRING, + SWITCH, + THIS, + THROW, + TRY, + VARS, + VAR, + WHILE +} diff --git a/src/com/google/dart/compiler/common/AbstractNode.java b/src/com/google/dart/compiler/common/AbstractNode.java new file mode 100644 index 00000000000..5b70197dd13 --- /dev/null +++ b/src/com/google/dart/compiler/common/AbstractNode.java @@ -0,0 +1,81 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.common; + +import com.google.dart.compiler.Source; + +/** + * Abstract base class for nodes that carry source information. + */ +public class AbstractNode implements SourceInfo, HasSourceInfo { + + // TODO(johnlenz): All this source location data is wasteful. + // Move it into a com.google.dart.compiler.backend.common object, that can be shared between the ASTs + // or something. + protected Source source = null; + protected int sourceLine = -1; + protected int sourceColumn = -1; + protected int sourceStart = -1; + protected int sourceLength = -1; + + @Override + public Source getSource() { + return source; + } + + @Override + public int getSourceLine() { + return sourceLine; + } + + @Override + public int getSourceColumn() { + return sourceColumn; + } + + @Override + public int getSourceStart() { + return sourceStart; + } + + @Override + public int getSourceLength() { + return sourceLength; + } + + @Override + public SourceInfo getSourceInfo() { + return this; + } + + @Override + public void setSourceInfo(SourceInfo info) { + source = info.getSource(); + sourceStart = info.getSourceStart(); + sourceLength = info.getSourceLength(); + sourceLine = info.getSourceLine(); + sourceColumn = info.getSourceColumn(); + } + + @Override + public final void setSourceLocation( + Source source, int line, int column, int startPosition, int length) { + assert (startPosition != -1 && length >= 0 + || startPosition == -1 && length == 0); + this.source = source; + this.sourceLine = line; + this.sourceColumn = column; + this.sourceStart = startPosition; + this.sourceLength = length; + } + + public final void setSourceRange(int startPosition, int length) { + assert (startPosition != -1 && length >= 0 + || startPosition == -1 && length == 0); + this.sourceStart = startPosition; + this.sourceLength = length; + } + +} diff --git a/src/com/google/dart/compiler/common/HasSourceInfo.java b/src/com/google/dart/compiler/common/HasSourceInfo.java new file mode 100644 index 00000000000..bda3da94996 --- /dev/null +++ b/src/com/google/dart/compiler/common/HasSourceInfo.java @@ -0,0 +1,55 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.common; + +import com.google.dart.compiler.Source; + +/** + * Abstract view of a class that has source info. + */ +public interface HasSourceInfo { + + /** + * Return the source info associated with this object. + */ + SourceInfo getSourceInfo(); + + /** + * Set the source info associated with this object. May only be called once. + * @param info + */ + void setSourceInfo(SourceInfo info); + + /** + * Sets the source range of the original source file where the source fragment + * corresponding to this node was found. + * + *

+ * Each node in the subtree (other than the contrived nodes) carries source + * range(s) information relating back to positions in the given source (the + * given source itself is not remembered with the AST). The source range + * usually begins at the first character of the first token corresponding to + * the node; leading whitespace and comments are not included. The + * source range usually extends through the last character of the last token + * corresponding to the node; trailing whitespace and comments are not + * included. There are a handful of exceptions (including the various body + * declarations). Source ranges nest properly: the source range for a child is + * always within the source range of its parent, and the source ranges of + * sibling nodes never overlap. + * + * @param source the associated source + * @param line the 1-based line index, or -1, if no source + * location is available + * @param column the 1-based column index, or -1, if no source + * location is available + * @param startPosition a 0-based character index, or -1, if no + * source location is available + * @param length a (possibly 0) length, or -1, if no source + * location is available + * @see SourceInfo#getSourceStart() + * @see SourceInfo#getSourceLength() + */ + void setSourceLocation(Source source, int line, int column, int startPosition, int length); +} diff --git a/src/com/google/dart/compiler/common/Name.java b/src/com/google/dart/compiler/common/Name.java new file mode 100644 index 00000000000..1d345c1d05e --- /dev/null +++ b/src/com/google/dart/compiler/common/Name.java @@ -0,0 +1,125 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.common; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.io.Serializable; +import java.io.Writer; +import java.nio.charset.Charset; + +/** + * Instead of Strings, we use Names to abstract the underlying representation. + * + *

    + *
  • Names are globally unique and use identity for equality.
  • + *
  • Names are interned, so all references to the same name use the same + * bytes.
  • + *
+ * TODO(scottb): use byte[] instead of char[] when the parser is rewritten + * to parse byte[]. + */ +public final class Name implements Serializable { + + /** + * The encoding this class uses when converting between chars and bytes. + */ + public static final Charset CHARSET = Charset.forName("UTF-8"); + + private static final NameFactory factory = new NameFactory(); + + private static final long serialVersionUID = 0L; + + /** + * Return the Name corresponding to the data. An internal reference to + * data is kept for efficiency, do NOT mutate data after calling + * this method. + */ + public static Name of(char[] data) { + return factory.of(data); + } + + /** + * Return the Name corresponding to the data. An internal copy of the data is + * made. + */ + public static Name of(char[] data, int offset, int length) { + return factory.of(data, offset, length); + } + + static int computeHashCode(char[] data, int offset, int length) { + // Effective Java Item 9. + int result = 89; + for (int i = offset, end = offset + length; i < end; ++i) { + result *= 31; + result += data[i]; + } + return result; + } + + final char[] data; + + private final transient int hashCode; + + Name(char[] data, int hashCode) { + this.data = data; + this.hashCode = hashCode; + } + + /** + * Always compares based on identity. + */ + @Override + public boolean equals(Object obj) { + return this == obj; + } + + /** + * Returns the hashCode of the underlying data. + */ + @Override + public int hashCode() { + return hashCode; + } + + /** + * Constructs a String to represent the internal data. + */ + @Override + public String toString() { + return String.valueOf(data); + } + + /** + * Write my data into a {@link java.io.OutputStream} using the encoding specified in + * {@link #CHARSET}. + */ + public void writeBytesTo(OutputStream out) throws IOException { + // TODO(scottb): avoid allocating the String. + out.write(new String(data).getBytes(CHARSET)); + } + + /** + * Write my character data into a {@link java.io.PrintStream}. + */ + public void writeCharsTo(PrintStream out) { + out.print(data); + } + + /** + * Write my character data into a {@link java.io.Writer}. + */ + public void writeCharsTo(Writer writer) throws IOException { + writer.write(data); + } + + /** + * Replace with the canonical instance. + */ + private Object readResolve() { + return Name.of(data); + } +} diff --git a/src/com/google/dart/compiler/common/NameFactory.java b/src/com/google/dart/compiler/common/NameFactory.java new file mode 100644 index 00000000000..d305f290bf9 --- /dev/null +++ b/src/com/google/dart/compiler/common/NameFactory.java @@ -0,0 +1,226 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.common; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.MapMaker; + +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import java.util.Arrays; +import java.util.concurrent.ConcurrentMap; + +/** + * Manages the life cycle, uniqueness, and object identity invariants of + * {@link Name}. + */ +final class NameFactory { + /* + * TODO: does this actually save memory in practice? For each interned Name, + * we use: + * + * 1) The data array (n bytes). + * + * 2) The Name object (2 fields) + * + * 3) The RealKey (1 field + 4 fields from Reference). + * + * 4) ConcurrentMap.Entry (4 fields) + * + * Of course, a Map is really much heavier than we need, all we really need is + * a Set where you can retrieve an object already in the Set. A bare linear + * probe hash table of RealKey would let us get rid of the Entry object. + */ + + /** + * The whole point of this class is to cheaply create a light-weight key that + * doesn't need to make its own copy of the data. This object is constructed + * with equality semantics to {com.google.dart.compiler.backend.common.NameFactory.RealKey}, for doing cheap map lookups. + */ + private static final class FakeKey { + private final char[] data; + private final int hashCode; + private final int length; + private final int offset; + + public FakeKey(char[] data, int hashCode) { + this(data, 0, data.length, hashCode); + } + + public FakeKey(char[] data, int offset, int length, int hashCode) { + this.data = data; + this.offset = offset; + this.length = length; + this.hashCode = hashCode; + } + + @Override + public boolean equals(Object obj) { + /* + * NOTE: this ONLY WORKS for comparisons to RealKey. But that's all we + * need since we only store real keys in the map. + */ + Name name = ((RealKey) obj).get(); + if (name == null) { + return false; + } + return equalsName(name); + } + + public boolean equalsName(Name name) { + if (this.length != name.data.length) { + return false; + } + int itMine = this.offset; + int itTheirs = 0; + int endMine = this.offset + this.length; + while (itMine < endMine) { + if (this.data[itMine++] != name.data[itTheirs++]) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public String toString() { + return "FakeKey(" + String.valueOf(data, offset, length) + ")"; + } + } + + /** + * Adapted from {@link com.google.common.collect.Interners#newWeakInterner()}. + */ + private static final class RealKey extends WeakReference { + /** + * Must store the hashCode locally so we can be removed from + * {com.google.dart.compiler.backend.common.NameFactory#map} after our referent is cleared. + */ + private final int hashCode; + + public RealKey(Name name, ReferenceQueue queue) { + super(name, queue); + hashCode = name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj instanceof FakeKey) { + Name referent = get(); + if (referent == null) { + return false; + } + return ((FakeKey) obj).equalsName(referent); + } + if (obj instanceof RealKey) { + Name referent = get(); + if (referent == null) { + return false; + } + Name otherReferent = ((RealKey) obj).get(); + if (otherReferent == null) { + return false; + } + return Arrays.equals(referent.data, otherReferent.data); + } + return false; + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public String toString() { + Name referent = get(); + return "RealKey(" + referent + ")"; + } + } + + private final ConcurrentMap map = new MapMaker().makeMap(); + private final ReferenceQueue queue = new ReferenceQueue(); + + /** + * Return the Name corresponding to the data. An internal reference to + * data may be kept. + */ + public Name of(char[] data) { + cleanUp(); + int hashCode = Name.computeHashCode(data, 0, data.length); + FakeKey fakeKey = new FakeKey(data, hashCode); + Name result = get(fakeKey); + if (result == null) { + result = put(new Name(data, hashCode)); + } + return result; + } + + /** + * Return the Name corresponding to the data. An internal copy of the data is + * made. + */ + public Name of(char[] data, int offset, int length) { + cleanUp(); + int hashCode = Name.computeHashCode(data, offset, length); + FakeKey fakeKey = new FakeKey(data, offset, length, hashCode); + Name result = get(fakeKey); + if (result == null) { + char[] copy = new char[length]; + System.arraycopy(data, offset, copy, 0, length); + result = put(new Name(copy, hashCode)); + } + return result; + } + + @VisibleForTesting + void cleanUp() { + RealKey item; + while ((item = (RealKey) queue.poll()) != null) { + map.remove(item); + } + } + + @VisibleForTesting + WeakReference getRefFor(Name name) { + return map.get(new FakeKey(name.data, name.hashCode())); + } + + @VisibleForTesting + int numEntries() { + return map.size(); + } + + private Name get(FakeKey fakeKey) { + RealKey realKey = map.get(fakeKey); + if (realKey != null) { + return realKey.get(); + } + return null; + } + + private Name put(Name name) { + RealKey realKey = new RealKey(name, queue); + while (true) { + RealKey sneakyRef = map.putIfAbsent(realKey, realKey); + if (sneakyRef == null) { + return name; + } else { + Name canonical = sneakyRef.get(); + if (canonical != null) { + return canonical; + } + } + } + } +} diff --git a/src/com/google/dart/compiler/common/SourceInfo.java b/src/com/google/dart/compiler/common/SourceInfo.java new file mode 100644 index 00000000000..bb212e9c1bd --- /dev/null +++ b/src/com/google/dart/compiler/common/SourceInfo.java @@ -0,0 +1,58 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.common; +import com.google.dart.compiler.Source; + +import java.io.Serializable; + +/** + * Tracks file and line information for AST nodes. + */ +public interface SourceInfo extends Serializable { + + /** + * The source code provider. + */ + Source getSource(); + + /** + * @return A 1-based line number into the original source file indicating + * where the source fragment begins. + */ + int getSourceLine(); + + /** + * @return A 1-based column number into the original source file indicating + * where the source fragment begins. + */ + int getSourceColumn(); + + /** + * Returns the character index into the original source file indicating + * where the source fragment corresponding to this node begins. + * + *

+ * The parser supplies useful well-defined source ranges to the nodes it creates. + * + * @return the 0-based character index, or -1 + * if no source startPosition information is recorded for this node + * @see #getSourceLength() + * @see HasSourceInfo#setSourceLocation(Source, int, int, int, int) + */ + int getSourceStart(); + + /** + * Returns the length in characters of the original source file indicating + * where the source fragment corresponding to this node ends. + *

+ * The parser supplies useful well-defined source ranges to the nodes it creates. + * + * @return a (possibly 0) length, or 0 + * if no source source position information is recorded for this node + * @see #getSourceStart() + * @see HasSourceInfo#setSourceLocation(Source, int, int, int, int) + */ + int getSourceLength(); +} diff --git a/src/com/google/dart/compiler/util/AbstractTextOutput.java b/src/com/google/dart/compiler/util/AbstractTextOutput.java new file mode 100644 index 00000000000..9c8d2b1cd16 --- /dev/null +++ b/src/com/google/dart/compiler/util/AbstractTextOutput.java @@ -0,0 +1,132 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +import java.io.PrintWriter; +import java.util.Arrays; + +/** + * An abstract base type to build TextOutput implementations. + */ +public abstract class AbstractTextOutput implements TextOutput { + private final boolean compact; + private int identLevel = 0; + private int indentGranularity = 2; + private char[][] indents = new char[][] {new char[0]}; + private boolean justNewlined; + private PrintWriter out; + private int position = 0; + private int line = 0; + private int column = 0; + + protected AbstractTextOutput(boolean compact) { + this.compact = compact; + } + + public int getPosition() { + return position; + } + + public int getLine() { + return line; + } + + public int getColumn() { + return column; + } + + public void indentIn() { + ++identLevel; + if (identLevel >= indents.length) { + // Cache a new level of indentation string. + // + char[] newIndentLevel = new char[identLevel * indentGranularity]; + Arrays.fill(newIndentLevel, ' '); + char[][] newIndents = new char[indents.length + 1][]; + System.arraycopy(indents, 0, newIndents, 0, indents.length); + newIndents[identLevel] = newIndentLevel; + indents = newIndents; + } + } + + public void indentOut() { + --identLevel; + } + + public void newline() { + out.print('\n'); + position++; + line++; + column = 0; + justNewlined = true; + } + + public void newlineOpt() { + if (!compact) { + newline(); + } + } + + public void print(char c) { + maybeIndent(); + out.print(c); + position++; + column++; + justNewlined = false; + } + + public void print(char[] s) { + maybeIndent(); + printAndCount(s); + justNewlined = false; + } + + public void print(String s) { + maybeIndent(); + printAndCount(s.toCharArray()); + justNewlined = false; + } + + // Why don't the "Opt" methods update "justNewLined"? + public void printOpt(char c) { + if (!compact) { + maybeIndent(); + out.print(c); + position += 1; + column++; + } + } + + public void printOpt(char[] s) { + if (!compact) { + maybeIndent(); + printAndCount(s); + } + } + + public void printOpt(String s) { + if (!compact) { + maybeIndent(); + printAndCount(s.toCharArray()); + } + } + + protected void setPrintWriter(PrintWriter out) { + this.out = out; + } + + private void maybeIndent() { + if (justNewlined && !compact) { + printAndCount(indents[identLevel]); + justNewlined = false; + } + } + + private void printAndCount(char[] chars) { + position += chars.length; + column += chars.length; + out.print(chars); + } +} diff --git a/src/com/google/dart/compiler/util/AstUtil.java b/src/com/google/dart/compiler/util/AstUtil.java new file mode 100644 index 00000000000..ff67441c763 --- /dev/null +++ b/src/com/google/dart/compiler/util/AstUtil.java @@ -0,0 +1,248 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +import com.google.dart.compiler.InternalCompilerException; +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.backend.js.ast.JsVars.JsVar; +import com.google.dart.compiler.common.SourceInfo; +import com.sun.org.apache.xpath.internal.functions.Function; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author johnlenz@google.com (John Lenz) + */ +public class AstUtil { + + public static JsInvocation newInvocation( + JsExpression target, JsExpression... params) { + JsInvocation invoke = new JsInvocation(); + invoke.setQualifier(target); + for (JsExpression expr : params) { + invoke.getArguments().add(expr); + } + return invoke; + } + + public static JsNameRef newQualifiedNameRef(String name) { + JsNameRef node = null; + int endPos = -1; + int startPos = 0; + do { + endPos = name.indexOf('.', startPos); + String part = (endPos == -1 + ? name.substring(startPos) + : name.substring(startPos, endPos)); + node = newNameRef(node, part); + startPos = endPos + 1; + } while (endPos != -1); + + return node; + } + + public static JsNameRef newNameRef(JsExpression qualifier, String prop) { + JsNameRef nameRef = new JsNameRef(prop); + if (qualifier != null) { + nameRef.setQualifier(qualifier); + } + return nameRef; + } + + public static JsNameRef nameref(SourceInfo info, JsName qualifier, JsName prop) { + JsNameRef nameRef = new JsNameRef(prop); + if (qualifier != null) { + nameRef.setQualifier(qualifier.makeRef()); + } + nameRef.setSourceRef(info); + return nameRef; + } + + public static JsNameRef newNameRef(JsExpression qualifier, JsName prop) { + JsNameRef nameRef = new JsNameRef(prop); + if (qualifier != null) { + nameRef.setQualifier(qualifier); + } + return nameRef; + } + + public static JsNameRef newPrototypeNameRef(JsExpression qualifier) { + return newNameRef(qualifier, "prototype"); + } + + public static JsArrayAccess newArrayAccess(JsExpression target, JsExpression key) { + JsArrayAccess arr = new JsArrayAccess(); + arr.setArrayExpr(target); + arr.setIndexExpr(key); + return arr; + } + + public static JsBlock newBlock(JsStatement... stmts) { + JsBlock jsBlock = new JsBlock(); + for (JsStatement stmt : stmts) { + jsBlock.getStatements().add(stmt); + } + return jsBlock; + } + + /** + * Returns a sequence of expressions (using the binary sequence operator). + * + * @param exprs - expressions to add to sequence + * @return a sequence of expressions. + */ + public static JsBinaryOperation newSequence(JsExpression... exprs) { + if (exprs.length < 2) { + throw new InternalCompilerException("newSequence expects at least two arguments"); + } + JsExpression result = exprs[exprs.length - 1]; + for (int i = exprs.length - 2; i >= 0; i--) { + result = new JsBinaryOperation(JsBinaryOperator.COMMA, exprs[i], result); + } + return (JsBinaryOperation) result; + } + + // Ensure a valid LHS + public static JsBinaryOperation newAssignment( + JsNameRef nameRef, JsExpression expr) { + return new JsBinaryOperation(JsBinaryOperator.ASG, nameRef, expr); + } + + public static JsBinaryOperation newAssignment( + JsArrayAccess target, JsExpression expr) { + return new JsBinaryOperation(JsBinaryOperator.ASG, target, expr); + } + + public static JsVars newVar(SourceInfo info, JsName name, JsExpression expr) { + JsVar var = new JsVar(name).setSourceRef(info); + var.setInitExpr(expr); + JsVars vars = new JsVars(); + vars.add(var); + return vars; + } + + public static JsVars newVar(JsName name, JsExpression expr) { + JsVar var = new JsVar(name); + if (expr != null) { + var.setInitExpr(expr); + } + JsVars vars = new JsVars(); + vars.add(var); + return vars; + } + + public static JsSwitch newSwitch( + JsExpression expr, JsSwitchMember... cases) { + JsSwitch jsSwitch = new JsSwitch(); + jsSwitch.setExpr(expr); + for (JsSwitchMember jsCase : cases) { + jsSwitch.getCases().add(jsCase); + } + return jsSwitch; + } + + public static JsCase newCase(JsExpression expr, JsStatement... stmts) { + JsCase jsCase = new JsCase(); + jsCase.setCaseExpr(expr); + for (JsStatement stmt : stmts) { + jsCase.getStmts().add(stmt); + } + return jsCase; + } + + public static JsDefault newDefaultCase(JsStatement... stmts) { + JsDefault jsCase = new JsDefault(); + for (JsStatement stmt : stmts) { + jsCase.getStmts().add(stmt); + } + return jsCase; + } + + public static JsFunction newFunction( + JsScope scope, JsName name, List params, JsBlock body) { + JsFunction fn = new JsFunction(scope); + if (name != null) { + fn.setName(name); + } + if (params != null) { + for (JsParameter param : params) { + fn.getParameters().add(param); + } + } + fn.setBody(body); + return fn; + } + + public static JsStatement convertToStatement(JsNode jsNode) { + if (jsNode instanceof JsExpression) { + return new JsExprStmt((JsExpression) jsNode); + } + if (jsNode instanceof JsStatement) { + return (JsStatement) jsNode; + } + throw new RuntimeException("Cannot convert JsNode to JsStatement: Unexpected node"); + } + + public static JsBlock convertToBlock(JsNode jsNode) { + if (jsNode instanceof JsBlock) { + return (JsBlock)jsNode; + } + JsStatement jsStatement = convertToStatement(jsNode); + return new JsBlock(jsStatement); + } + + public static JsExpression convertToExpression(JsNode jsNode) { + if (jsNode instanceof JsExpression) { + return (JsExpression)jsNode; + } + throw new RuntimeException("Cannot convert JsNode to JsExpression: Unexpected node"); + } + + public static JsInvocation call(SourceInfo src, JsExpression target, JsExpression... params) { + return (JsInvocation) newInvocation(target, params).setSourceRef(src); + } + + public static JsBinaryOperation comma(SourceInfo src, JsExpression op1, JsExpression op2) { + return (JsBinaryOperation) new JsBinaryOperation(JsBinaryOperator.COMMA, op1, op2) + .setSourceRef(src); + } + + public static JsNameRef nameref(SourceInfo src, String name) { + return (JsNameRef) new JsNameRef(name).setSourceRef(src); + } + + public static JsNameRef nameref(SourceInfo src, JsName qualifier, String prop) { + return AstUtil.nameref(src, qualifier.makeRef().setSourceRef(src), prop); + } + + public static JsNameRef nameref(SourceInfo src, JsExpression qualifier, String prop) { + return (JsNameRef) newNameRef(qualifier, prop).setSourceRef(src); + } + + public static JsExpression assign(SourceInfo src, JsNameRef op1, JsExpression op2) { + return newAssignment(op1, op2).setSourceRef(src); + } + + public static JsExpression neq(SourceInfo src, JsExpression op1, JsExpression op2) { + return new JsBinaryOperation(JsBinaryOperator.NEQ, op1, op2).setSourceRef(src); + } + + public static JsExpression not(SourceInfo src, JsExpression op1) { + return new JsPrefixOperation(JsUnaryOperator.NOT, op1).setSourceRef(src); + } + + public static JsExpression preinc(SourceInfo src, JsExpression op1) { + return new JsPrefixOperation(JsUnaryOperator.INC, op1).setSourceRef(src); + } + + public static JsExpression and(SourceInfo src, JsExpression op1, JsExpression op2) { + return new JsBinaryOperation(JsBinaryOperator.AND, op1, op2).setSourceRef(src); + } + + public static JsExpression in(SourceInfo src, JsExpression propName, JsExpression obj) { + return new JsBinaryOperation(JsBinaryOperator.INOP, propName, obj).setSourceRef(src); + } +} diff --git a/src/com/google/dart/compiler/util/DefaultTextOutput.java b/src/com/google/dart/compiler/util/DefaultTextOutput.java new file mode 100644 index 00000000000..2a064ff87fd --- /dev/null +++ b/src/com/google/dart/compiler/util/DefaultTextOutput.java @@ -0,0 +1,32 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * Adapts {@link TextOutput} to an internal text buffer. + */ +public class DefaultTextOutput extends AbstractTextOutput { + + private final StringWriter sw = new StringWriter(); + private final PrintWriter out; + + public DefaultTextOutput(boolean compact) { + super(compact); + setPrintWriter(out = new PrintWriter(sw)); + } + + @Override + public String toString() { + out.flush(); + if (sw != null) { + return sw.toString(); + } else { + return super.toString(); + } + } +} diff --git a/src/com/google/dart/compiler/util/Hack.java b/src/com/google/dart/compiler/util/Hack.java new file mode 100644 index 00000000000..642f416394f --- /dev/null +++ b/src/com/google/dart/compiler/util/Hack.java @@ -0,0 +1,16 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +/** + * Utility to hack around untypable (or yet to be) code. + */ +public class Hack { + public static T cast(Object o) { + @SuppressWarnings("unchecked") + T t = (T) o; + return t; + } +} diff --git a/src/com/google/dart/compiler/util/Lists.java b/src/com/google/dart/compiler/util/Lists.java new file mode 100644 index 00000000000..5d7f6ddc545 --- /dev/null +++ b/src/com/google/dart/compiler/util/Lists.java @@ -0,0 +1,296 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * Utility methods for operating on memory-efficient lists. All lists of size 0 + * or 1 are assumed to be immutable. All lists of size greater than 1 are + * assumed to be mutable. + */ +public class Lists { + + private static final Class MULTI_LIST_CLASS = ArrayList.class; + private static final Class SINGLETON_LIST_CLASS = Collections.singletonList(null).getClass(); + + public static List add(List list, int index, T toAdd) { + switch (list.size()) { + case 0: + // Empty -> Singleton + if (index != 0) { + throw newIndexOutOfBounds(list, index); + } + return Collections.singletonList(toAdd); + case 1: { + // Singleton -> ArrayList + List result = new ArrayList(2); + switch (index) { + case 0: + result.add(toAdd); + result.add(list.get(0)); + return result; + case 1: + result.add(list.get(0)); + result.add(toAdd); + return result; + default: + throw newIndexOutOfBounds(list, index); + } + } + default: + // ArrayList + list.add(index, toAdd); + return list; + } + } + + public static List add(List list, T toAdd) { + switch (list.size()) { + case 0: + // Empty -> Singleton + return Collections.singletonList(toAdd); + case 1: { + // Singleton -> ArrayList + List result = new ArrayList(2); + result.add(list.get(0)); + result.add(toAdd); + return result; + } + default: + // ArrayList + list.add(toAdd); + return list; + } + } + + public static List addAll(List list, int index, List toAdd) { + switch (toAdd.size()) { + case 0: + // No-op. + return list; + case 1: + // Add one element. + return add(list, index, toAdd.get(0)); + default: + // True list merge, result >= 2. + switch (list.size()) { + case 0: + if (index != 0) { + throw newIndexOutOfBounds(list, index); + } + return new ArrayList(toAdd); + case 1: { + List result = new ArrayList(1 + toAdd.size()); + switch (index) { + case 0: + result.addAll(toAdd); + result.add(list.get(0)); + return result; + case 1: + result.add(list.get(0)); + result.addAll(toAdd); + return result; + default: + throw newIndexOutOfBounds(list, index); + } + } + default: + list.addAll(index, toAdd); + return list; + } + } + } + + public static List addAll(List list, List toAdd) { + switch (toAdd.size()) { + case 0: + // No-op. + return list; + case 1: + // Add one element. + return add(list, toAdd.get(0)); + default: + // True list merge, result >= 2. + switch (list.size()) { + case 0: + return new ArrayList(toAdd); + case 1: { + List result = new ArrayList(1 + toAdd.size()); + result.add(list.get(0)); + result.addAll(toAdd); + return result; + } + default: + list.addAll(toAdd); + return list; + } + } + } + + public static List addAll(List list, T... toAdd) { + switch (toAdd.length) { + case 0: + // No-op. + return list; + case 1: + // Add one element. + return add(list, toAdd[0]); + default: + // True list merge, result >= 2. + switch (list.size()) { + case 0: + return new ArrayList(Arrays.asList(toAdd)); + case 1: { + List result = new ArrayList(1 + toAdd.length); + result.add(list.get(0)); + result.addAll(Arrays.asList(toAdd)); + return result; + } + default: + list.addAll(Arrays.asList(toAdd)); + return list; + } + } + } + + public static List create() { + return Collections.emptyList(); + } + + public static List create(Collection collection) { + switch (collection.size()) { + case 0: + return create(); + default: + return new ArrayList(collection); + } + } + + public static List create(List list) { + switch (list.size()) { + case 0: + return create(); + case 1: + return create(list.get(0)); + default: + return new ArrayList(list); + } + } + + public static List create(T item) { + return Collections.singletonList(item); + } + + public static List create(T... items) { + switch (items.length) { + case 0: + return create(); + case 1: + return create(items[0]); + default: + return new ArrayList(Arrays.asList(items)); + } + } + + public static List normalize(List list) { + switch (list.size()) { + case 0: + return create(); + case 1: { + if (list.getClass() == SINGLETON_LIST_CLASS) { + return list; + } + return create(list.get(0)); + } + default: + if (list.getClass() == MULTI_LIST_CLASS) { + return list; + } + return new ArrayList(list); + } + } + + public static List normalizeUnmodifiable(List list) { + if (list.size() < 2) { + return normalize(list); + } else { + List copy = new ArrayList(list.size()); + Collections.copy(copy, list); + return copy; + } + } + + public static List remove(List list, int toRemove) { + switch (list.size()) { + case 0: + // Empty + throw newIndexOutOfBounds(list, toRemove); + case 1: + // Singleton -> Empty + if (toRemove == 0) { + return Collections.emptyList(); + } else { + throw newIndexOutOfBounds(list, toRemove); + } + case 2: + // ArrayList -> Singleton + switch (toRemove) { + case 0: + return Collections.singletonList(list.get(1)); + case 1: + return Collections.singletonList(list.get(0)); + default: + throw newIndexOutOfBounds(list, toRemove); + } + default: + // ArrayList + list.remove(toRemove); + return list; + } + } + + public static List set(List list, int index, T e) { + switch (list.size()) { + case 0: + // Empty + throw newIndexOutOfBounds(list, index); + case 1: + // Singleton + if (index == 0) { + return Collections.singletonList(e); + } else { + throw newIndexOutOfBounds(list, index); + } + default: + // ArrayList + list.set(index, e); + return list; + } + } + + public static > List sort(List list) { + if (list.size() > 1) { + Collections.sort(list); + } + return list; + } + + public static List sort(List list, Comparator sort) { + if (list.size() > 1) { + Collections.sort(list, sort); + } + return list; + } + + private static IndexOutOfBoundsException newIndexOutOfBounds(List list, int index) { + return new IndexOutOfBoundsException("Index: " + index + ", Size: " + list.size()); + } +} diff --git a/src/com/google/dart/compiler/util/Maps.java b/src/com/google/dart/compiler/util/Maps.java new file mode 100644 index 00000000000..89ea29fdd2a --- /dev/null +++ b/src/com/google/dart/compiler/util/Maps.java @@ -0,0 +1,160 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.LinkedHashMap; + +/** + * Utility methods for operating on memory-efficient maps. All maps of size 0 or + * 1 are assumed to be immutable. All maps of size greater than 1 are assumed to + * be mutable. + */ +public class Maps { + + private static final Class MULTI_MAP_CLASS = HashMap.class; + private static final Class SINGLETON_MAP_CLASS = + Collections.singletonMap(null, null).getClass(); + + public static Map create() { + return Collections.emptyMap(); + } + + public static Map create(K key, V value) { + return Collections.singletonMap(key, value); + } + + public static Map normalize(Map map) { + switch (map.size()) { + case 0: + return create(); + case 1: { + if (map.getClass() == SINGLETON_MAP_CLASS) { + return map; + } + K key = map.keySet().iterator().next(); + return create(key, map.get(key)); + } + default: + if (map.getClass() == MULTI_MAP_CLASS) { + return map; + } + return new HashMap(map); + } + } + + public static Map normalizeUnmodifiable(Map map) { + if (map.size() < 2) { + return normalize(map); + } else { + // TODO: implement an UnmodifiableHashMap? + return Collections.unmodifiableMap(normalize(map)); + } + } + + public static Map put(Map map, K key, V value) { + switch (map.size()) { + case 0: + // Empty -> Singleton + return Collections.singletonMap(key, value); + case 1: { + if (map.containsKey(key)) { + return create(key, value); + } + // Singleton -> HashMap + Map result = new HashMap(); + result.put(map.keySet().iterator().next(), map.values().iterator().next()); + result.put(key, value); + return result; + } + default: + // HashMap + map.put(key, value); + return map; + } + } + + public static Map putAll(Map map, Map toAdd) { + switch (toAdd.size()) { + case 0: + // No-op. + return map; + case 1: { + // Add one element. + K key = toAdd.keySet().iterator().next(); + return put(map, key, toAdd.get(key)); + } + default: + // True list merge, result >= 2. + switch (map.size()) { + case 0: + return new HashMap(toAdd); + case 1: { + HashMap result = new HashMap(); + K key = map.keySet().iterator().next(); + result.put(key, map.get(key)); + result.putAll(toAdd); + return result; + } + default: + map.putAll(toAdd); + return map; + } + } + } + + /** + * A variation of the put method which uses a LinkedHashMap. + */ + public static Map putOrdered(Map map, K key, V value) { + switch (map.size()) { + case 0: + // Empty -> Singleton + return Collections.singletonMap(key, value); + case 1: { + if (map.containsKey(key)) { + return create(key, value); + } + // Singleton -> LinkedHashMap + Map result = new LinkedHashMap(); + result.put(map.keySet().iterator().next(), map.values().iterator().next()); + result.put(key, value); + return result; + } + default: + // LinkedHashMap + map.put(key, value); + return map; + } + } + + public static Map remove(Map map, K key) { + switch (map.size()) { + case 0: + // Empty + return map; + case 1: + // Singleton -> Empty + if (map.containsKey(key)) { + return create(); + } + return map; + case 2: + // HashMap -> Singleton + if (map.containsKey(key)) { + map.remove(key); + key = map.keySet().iterator().next(); + return create(key, map.get(key)); + } + return map; + default: + // IdentityHashMap + map.remove(key); + return map; + } + } +} diff --git a/src/com/google/dart/compiler/util/Paths.java b/src/com/google/dart/compiler/util/Paths.java new file mode 100644 index 00000000000..cdda910ccb1 --- /dev/null +++ b/src/com/google/dart/compiler/util/Paths.java @@ -0,0 +1,100 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +import java.io.File; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +/** + * Utility methods for obtaining relative paths from files and translating + * relative paths into files. + */ +public class Paths { + + /** + * Answer the relative path from baseFile to relFile + * + * @param baseFile the base file (not null) from which the + * desired path starts + * @param relFile the file referenced by the desired relative path (not + * null) + * @return a relative path (not null) + */ + public static String relativePathFor(File baseFile, File relFile) { + String baseFilePath = baseFile.getPath().replace(File.separatorChar, '/'); + String relFilePath = relFile.getPath().replace(File.separatorChar, '/'); + int baseFilePathLen = baseFilePath.length(); + int relFilePathLen = relFilePath.length(); + + // Find the com.google.dart.compiler.backend.common path elements + int index = 0; + while (index < baseFilePathLen - 1 && index < relFilePathLen - 1) { + if (baseFilePath.charAt(index) != relFilePath.charAt(index)) { + break; + } + index++; + } + while (index >= 0 + && (baseFilePath.charAt(index) != '/' || relFilePath.charAt(index) != '/')) { + index--; + } + int commonStart = index; + + // Build a path up from the base file + StringBuilder relPath = new StringBuilder(baseFilePathLen + relFilePathLen + - commonStart * 2); + index = commonStart + 1; + while (true) { + index = baseFilePath.indexOf('/', index); + if (index == -1) { + break; + } + relPath.append("../"); + index++; + } + relPath.append(relFilePath.substring(commonStart + 1)); + return relPath.toString(); + } + + /** + * Answer the file relative to the specified file + * + * @param baseFile the base file (not null) + * @param relPath the path to the desired file relative to baseFile + * @return the file (not null) + */ + public static File relativePathToFile(File baseFile, String relPath) { + if (relPath.startsWith("/")) { + return new File(relPath); + } + File parentFile = baseFile.getParentFile(); + String name; + if (parentFile == null) { + name = "."; + } else { + name = parentFile.getPath().replace(File.separatorChar, '/'); + } + name = URI.create(name + "/" + relPath).normalize().getPath(); + return new File(name); + } + + /** + * Given a collection of paths, return a collection of files + * + * @param a collection of paths to various files (not null, + * contains no nulls) + * @return a collection of files (not null, contains no + * nulls) + */ + public static List toFiles(List filePaths) { + List files = new ArrayList(); + for (String path : filePaths) { + files.add(new File(path)); + } + return files; + } +} diff --git a/src/com/google/dart/compiler/util/TextOutput.java b/src/com/google/dart/compiler/util/TextOutput.java new file mode 100644 index 00000000000..99a465b1532 --- /dev/null +++ b/src/com/google/dart/compiler/util/TextOutput.java @@ -0,0 +1,37 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.google.dart.compiler.util; + +/** + * Interface used for printing text output. + */ +public interface TextOutput { + + int getPosition(); + + int getLine(); + + int getColumn(); + + void indentIn(); + + void indentOut(); + + void newline(); + + void newlineOpt(); + + void print(char c); + + void print(char[] s); + + void print(String s); + + void printOpt(char c); + + void printOpt(char[] s); + + void printOpt(String s); +} diff --git a/src/org/jetbrains/k2js/K2JSTranslator.java b/src/org/jetbrains/k2js/K2JSTranslator.java new file mode 100644 index 00000000000..e6cb99e31c4 --- /dev/null +++ b/src/org/jetbrains/k2js/K2JSTranslator.java @@ -0,0 +1,159 @@ +package org.jetbrains.k2js; + +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import com.google.dart.compiler.backend.js.ast.JsProgram; +import com.intellij.core.JavaCoreEnvironment; +import com.intellij.openapi.Disposable; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiManager; +import com.sampullara.cli.Argument; +import org.jetbrains.jet.JetCoreEnvironment; +import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory; +import org.jetbrains.jet.lang.diagnostics.Diagnostic; +import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils; +import org.jetbrains.jet.lang.diagnostics.DiagnosticWithTextRange; +import org.jetbrains.jet.lang.diagnostics.Severity; +import org.jetbrains.jet.lang.psi.JetFile; +import org.jetbrains.jet.lang.psi.JetNamespace; +import org.jetbrains.jet.lang.resolve.AnalyzingUtils; +import org.jetbrains.jet.lang.resolve.BindingContext; +import org.jetbrains.jet.lang.resolve.java.JavaDefaultImports; +import org.jetbrains.k2js.translate.GenerationState; +import org.jetbrains.k2js.generate.CodeGenerator; + +import java.io.File; +import java.util.Collection; +import java.util.List; + +/** + * @author Pavel.Talanov + */ + +public class K2JSTranslator { + public static class Arguments { + @Argument(value = "output", description = "output directory") + public String outputDir; + @Argument(value = "src", description = "source file or directory") + public String src; + } + + public static void main(String[] args) { + System.setProperty("java.awt.headless", "true"); + Arguments arguments = new Arguments(); + arguments.src = "C:\\Dev\\Projects\\k2js\\test_files\\test.kt"; + + Disposable root = new Disposable() { + @Override + public void dispose() { + } + }; + + JetCoreEnvironment environment = new JetCoreEnvironment(root); + + File rtJar = initJdk(); + if (rtJar == null) return; + environment.addToClasspath(rtJar); + + VirtualFile vFile = environment.getLocalFileSystem().findFileByPath(arguments.src); + if (vFile == null) { + System.out.print("File/directory not found: " + arguments.src); + return; + } + + Project project = environment.getProject(); + GenerationState generationState = new GenerationState(project, false); + List namespaces = Lists.newArrayList(); + if(vFile.isDirectory()) { + File dir = new File(vFile.getPath()); + addFiles(environment, project, namespaces, dir); + } + else { + PsiFile psiFile = PsiManager.getInstance(project).findFile(vFile); + if (psiFile instanceof JetFile) { + namespaces.add(((JetFile) psiFile).getRootNamespace()); + } + else { + System.out.print("Not a Kotlin file: " + vFile.getPath()); + return; + } + } + + BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS) + .analyzeNamespaces(project, namespaces, JetControlFlowDataTraceFactory.EMPTY); + + ErrorCollector errorCollector = new ErrorCollector(bindingContext); + errorCollector.report(); + + if (!errorCollector.hasErrors) { + // Translate generated psi + CodeGenerator generator = new CodeGenerator(); + JsProgram program = generationState.compileCorrectNamespaces(bindingContext, namespaces); + generator.generate(program); + } + + } + + private static class ErrorCollector { + Multimap maps = LinkedHashMultimap.create(); + + boolean hasErrors; + + public ErrorCollector(BindingContext bindingContext) { + for (Diagnostic diagnostic : bindingContext.getDiagnostics()) { + report(diagnostic); + } + } + + private void report(Diagnostic diagnostic) { + hasErrors |= diagnostic.getSeverity() == Severity.ERROR; + if(diagnostic instanceof DiagnosticWithTextRange) { + DiagnosticWithTextRange diagnosticWithTextRange = (DiagnosticWithTextRange) diagnostic; + maps.put(diagnosticWithTextRange.getPsiFile(), diagnosticWithTextRange); + } + else { + System.out.println(diagnostic.getSeverity().toString() + ": " + diagnostic.getMessage()); + } + } + + void report() { + if(!maps.isEmpty()) { + for (PsiFile psiFile : maps.keySet()) { + System.out.println(psiFile.getVirtualFile().getPath()); + Collection diagnosticWithTextRanges = maps.get(psiFile); + for (DiagnosticWithTextRange diagnosticWithTextRange : diagnosticWithTextRanges) { + String position = DiagnosticUtils.formatPosition(diagnosticWithTextRange); + System.out.println("\t" + diagnosticWithTextRange.getSeverity().toString() + ": " + position + " " + diagnosticWithTextRange.getMessage()); + } + } + } + } + } + + private static void addFiles(JavaCoreEnvironment environment, Project project, List namespaces, File dir) { + for(File file : dir.listFiles()) { + if(!file.isDirectory()) { + VirtualFile virtualFile = environment.getLocalFileSystem().findFileByPath(file.getAbsolutePath()); + PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile); + if (psiFile instanceof JetFile) { + namespaces.add(((JetFile) psiFile).getRootNamespace()); + } + } + else { + addFiles(environment, project, namespaces, file); + } + } + } + + private static File initJdk() { + // TODO detect jar + File rtJar = new File("C:\\Program Files\\Java\\jdk1.6.0_29\\jre\\lib\\rt.jar"); + assert rtJar != null; + return rtJar; + } + +} + diff --git a/src/org/jetbrains/k2js/generate/CodeGenerator.java b/src/org/jetbrains/k2js/generate/CodeGenerator.java new file mode 100644 index 00000000000..b65520b8ba9 --- /dev/null +++ b/src/org/jetbrains/k2js/generate/CodeGenerator.java @@ -0,0 +1,25 @@ +package org.jetbrains.k2js.generate; + +import com.google.dart.compiler.backend.js.JsSourceGenerationVisitor; +import com.google.dart.compiler.backend.js.ast.JsProgram; +import com.google.dart.compiler.util.DefaultTextOutput; +import com.google.dart.compiler.util.TextOutput; + +/** + * @author Pavel.Talanov + */ +public final class CodeGenerator { + + private final TextOutput output = new DefaultTextOutput(false); + + public CodeGenerator() { + + } + + public void generate(JsProgram program) { + JsSourceGenerationVisitor sourceGenerator = + new JsSourceGenerationVisitor(output); + program.traverse(sourceGenerator, null); + System.out.println(output.toString()); + } +} diff --git a/src/org/jetbrains/k2js/translate/AbstractTranslator.java b/src/org/jetbrains/k2js/translate/AbstractTranslator.java new file mode 100644 index 00000000000..366fa993276 --- /dev/null +++ b/src/org/jetbrains/k2js/translate/AbstractTranslator.java @@ -0,0 +1,52 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.JsBlock; +import com.google.dart.compiler.backend.js.ast.JsName; +import com.google.dart.compiler.backend.js.ast.JsProgram; +import com.google.dart.compiler.backend.js.ast.JsScope; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.resolve.BindingContext; + +/** + * @author Talanov Pavel + */ +public abstract class AbstractTranslator { + + private final TranslationContext context; + + public AbstractTranslator(TranslationContext context) { + assert context != null; + this.context = context; + } + + @NotNull + protected JsProgram program() { + return context.program(); + } + + @NotNull + protected TranslationContext translationContext() { + return context; + } + + @NotNull + protected BindingContext bindingContext() { + return context.bindingContext(); + } + + @NotNull + protected JsName getJSName(String jetName) { + //TODO dummy implemetation + return new JsName(program().getScope(), jetName, jetName, jetName); + } + + @NotNull + protected JsScope scope() { + return context.scope(); + } + + @NotNull + protected JsBlock block() { + return context.block(); + } +} diff --git a/src/org/jetbrains/k2js/translate/ContextType.java b/src/org/jetbrains/k2js/translate/ContextType.java new file mode 100644 index 00000000000..d9a5463db6d --- /dev/null +++ b/src/org/jetbrains/k2js/translate/ContextType.java @@ -0,0 +1,26 @@ +package org.jetbrains.k2js.translate; + +import com.sun.org.apache.bcel.internal.generic.NEW; + +/** + * @author Talanov Pavel + */ +public enum ContextType { + CLASS_DECLARATION { + public DeclarationTranslator.State getDeclarationTranslatorState(DeclarationTranslator translator) { + throw new UnsupportedOperationException("Not impelemented"); + } + }, + FUNCTION_BODY { + public DeclarationTranslator.State getDeclarationTranslatorState(DeclarationTranslator translator) { + return translator.new FunctionVariableDeclaration(); + }; + }, + NAMESPACE_BODY { + public DeclarationTranslator.State getDeclarationTranslatorState(DeclarationTranslator translator) { + return translator.new NamespacePropertyDeclaration(); + }; + }; + + public abstract DeclarationTranslator.State getDeclarationTranslatorState(DeclarationTranslator translator); +} diff --git a/src/org/jetbrains/k2js/translate/DeclarationTranslator.java b/src/org/jetbrains/k2js/translate/DeclarationTranslator.java new file mode 100644 index 00000000000..18d87820c5b --- /dev/null +++ b/src/org/jetbrains/k2js/translate/DeclarationTranslator.java @@ -0,0 +1,96 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.util.AstUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.lang.psi.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Talanov Pavel + */ +public class DeclarationTranslator extends AbstractTranslator { + + private final State state; + + public DeclarationTranslator(TranslationContext context) { + super(context); + state = context.type().getDeclarationTranslatorState(this); + } + + @NotNull + JsStatement translateDeclaration(JetDeclaration declaration) { + if (declaration instanceof JetProperty) { + return (translateProperty((JetProperty) declaration)); + } + if (declaration instanceof JetNamedFunction) { + return AstUtil.convertToStatement((new FunctionTranslator(translationContext())) + .translateFunction((JetNamedFunction) declaration)); + } + else if (declaration instanceof JetClassOrObject) { + //classCodegen.translate(context, (JetClassOrObject) declaration); + } + else if (declaration instanceof JetNamespace) { + // JetNamespace childNamespace = (JetNamespace) declaration; + // state.forNamespace(childNamespace).translate(childNamespace); + } + throw new RuntimeException("Unexpected declaration " + declaration.toString()); + } + + @NotNull + public JsStatement translateProperty(JetProperty declaration) { + return state.translateProperty(declaration); + } + + @Nullable + private JsExpression translateInitializer(JetProperty declaration) { + JsExpression jsInitExpression = null; + JetExpression initializer = declaration.getInitializer(); + if (initializer != null) { + // TODO hack alert + jsInitExpression = (JsExpression) + (new ExpressionTranslator(translationContext())).translate(initializer); + } + return jsInitExpression; + } + + public abstract class State { + public abstract JsStatement translateProperty(JetProperty declaration); + } + + public final class FunctionVariableDeclaration extends State { + @NotNull + public JsStatement translateProperty(JetProperty declaration) { + String propertyName = declaration.getName(); + JsName jsPropertyName = getJSName(propertyName); + JsExpression jsInitExpression = translateInitializer(declaration); + return AstUtil.newVar(jsPropertyName, jsInitExpression); + } + + } + + public final class NamespacePropertyDeclaration extends State { + @NotNull + public JsStatement translateProperty(JetProperty declaration) { + String propertyName = declaration.getName(); + JsNameRef jsPropertyNameReference = translationContext().getQualifiedReference(getJSName(propertyName)); + JsExpression jsInitExpression = translateInitializer(declaration); + JsExpression result; + if (jsInitExpression != null) { + result = AstUtil.newAssignment(jsPropertyNameReference, jsInitExpression); + } + else { + result = jsPropertyNameReference; + } + return AstUtil.convertToStatement(result); + } + } + + + +} diff --git a/src/org/jetbrains/k2js/translate/ExpressionTranslator.java b/src/org/jetbrains/k2js/translate/ExpressionTranslator.java new file mode 100644 index 00000000000..062048d8ce9 --- /dev/null +++ b/src/org/jetbrains/k2js/translate/ExpressionTranslator.java @@ -0,0 +1,102 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.util.AstUtil; +import groovyjarjarantlr.collections.AST; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.psi.*; +import org.jetbrains.jet.lang.resolve.BindingContext; +import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; +import org.jetbrains.jet.lexer.JetToken; + +import java.util.List; + +/** + * Talanov Pavel + */ +class ExpressionTranslator extends AbstractTranslator { + + public ExpressionTranslator(TranslationContext context) { + super(context); + } + + @NotNull + public JsNode translate(JetExpression jetExpression) { + assert jetExpression != null; + if (jetExpression instanceof JetConstantExpression) { + return translateConstantExpression((JetConstantExpression) jetExpression); + } + if (jetExpression instanceof JetReturnExpression) { + return translateReturn((JetReturnExpression) jetExpression); + } + if (jetExpression instanceof JetBlockExpression) { + return translateBlock((JetBlockExpression) jetExpression); + } + if (jetExpression instanceof JetBinaryExpression) { + return translateBinaryExpression((JetBinaryExpression)jetExpression); + } + if (jetExpression instanceof JetParenthesizedExpression) { + return translate(((JetParenthesizedExpression)(jetExpression)).getExpression()); + } + if (jetExpression instanceof JetProperty) { + DeclarationTranslator declarationTranslator = new DeclarationTranslator(translationContext()); + return declarationTranslator.translateProperty((JetProperty)jetExpression); + } + if (jetExpression instanceof JetSimpleNameExpression) { + return translateSimpleNameExpression((JetSimpleNameExpression)jetExpression); + } + throw new RuntimeException("Unexpected expression encountered:" + jetExpression.toString()); + } + + private JsNameRef translateSimpleNameExpression(JetSimpleNameExpression jetSimpleNameExpression) { + String referencedName = jetSimpleNameExpression.getReferencedName(); + return new JsNameRef(getJSName(referencedName)); + } + + @NotNull + private JsExpression translateConstantExpression(JetConstantExpression expression) { + JsExpression result = null; + Object value; + CompileTimeConstant compileTimeValue = bindingContext().get(BindingContext.COMPILE_TIME_VALUE, expression); + assert compileTimeValue != null; + value = compileTimeValue.getValue(); + if (value instanceof Integer) { + result = program().getNumberLiteral((Integer) value); + } + assert result != null; + return result; + } + + @NotNull + private JsReturn translateReturn(JetReturnExpression jetReturnExpression) { + JsExpression jsExpression = (JsExpression) translate(jetReturnExpression.getReturnedExpression()); + JsReturn jsReturnExpression = new JsReturn(jsExpression); + return jsReturnExpression; + } + + @NotNull + private JsBlock translateBlock(JetBlockExpression jetBlock) { + List jetElements = jetBlock.getStatements(); + JsBlock jsBlock = new JsBlock(); + ExpressionTranslator expressionTranslator = + new ExpressionTranslator(translationContext().newBlock(jsBlock)); + for (JetElement jetElement : jetElements) { + //TODO hack alert + JetExpression jetExpression = (JetExpression) jetElement; + JsNode jsNode = expressionTranslator.translate(jetExpression); + jsBlock.addStatement(AstUtil.convertToStatement(jsNode)); + } + return jsBlock; + } + + private JsBinaryOperation translateBinaryExpression(JetBinaryExpression jetBinaryExpression) { + JsExpression left = AstUtil.convertToExpression(translate(jetBinaryExpression.getLeft())); + JsExpression right = AstUtil.convertToExpression(translate(jetBinaryExpression.getRight())); + //TODO cast dangerous? + JetToken jetOperationToken = (JetToken)jetBinaryExpression.getOperationToken(); + JsBinaryOperation jsBinaryOperation = + new JsBinaryOperation(OperationTranslator.getBinaryOperator(jetOperationToken), left, right); + return jsBinaryOperation; + } + +} diff --git a/src/org/jetbrains/k2js/translate/FunctionTranslator.java b/src/org/jetbrains/k2js/translate/FunctionTranslator.java new file mode 100644 index 00000000000..5599098a130 --- /dev/null +++ b/src/org/jetbrains/k2js/translate/FunctionTranslator.java @@ -0,0 +1,50 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.JsFunction; +import com.google.dart.compiler.backend.js.ast.JsNode; +import com.google.dart.compiler.backend.js.ast.JsParameter; +import com.google.dart.compiler.backend.js.ast.JsScope; +import com.google.dart.compiler.util.AstUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.psi.JetExpression; +import org.jetbrains.jet.lang.psi.JetNamedFunction; +import org.jetbrains.jet.lang.psi.JetParameter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Talanov Pavel + */ +public class FunctionTranslator extends AbstractTranslator { + + public FunctionTranslator(TranslationContext context) { + super(context); + } + + @NotNull + public JsFunction translateFunction(JetNamedFunction jetFunction) { + String name = jetFunction.getName(); + JetExpression jetBodyExpression = jetFunction.getBodyExpression(); + JsFunction result = new JsFunction(scope(), getJSName(name)); + JsNode jsBody = (new ExpressionTranslator(functionBodyContext(result.getScope()))) + .translate(jetBodyExpression); + List jsParameters = translateParameters(jetFunction.getValueParameters()); + result.setParameters(jsParameters); + result.setBody(AstUtil.convertToBlock(jsBody)); + return result; + } + + private TranslationContext functionBodyContext(JsScope functionScope) { + return translationContext().newType(ContextType.FUNCTION_BODY).newScope(functionScope); + } + + @NotNull + private List translateParameters(List jetParameters) { + List jsParameters = new ArrayList(); + for (JetParameter jetParameter : jetParameters) { + jsParameters.add(new JsParameter(getJSName(jetParameter.getName()))); + } + return jsParameters; + } +} diff --git a/src/org/jetbrains/k2js/translate/GenerationState.java b/src/org/jetbrains/k2js/translate/GenerationState.java new file mode 100644 index 00000000000..5628f8dcca4 --- /dev/null +++ b/src/org/jetbrains/k2js/translate/GenerationState.java @@ -0,0 +1,63 @@ +/* + * @author max + */ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.JsProgram; +import com.intellij.openapi.project.Project; +import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory; +import org.jetbrains.jet.lang.psi.JetFile; +import org.jetbrains.jet.lang.psi.JetNamespace; +import org.jetbrains.jet.lang.resolve.AnalyzingUtils; +import org.jetbrains.jet.lang.resolve.BindingContext; +import org.jetbrains.jet.lang.resolve.java.JavaDefaultImports; +import org.jetbrains.jet.lang.types.JetStandardLibrary; + +import java.util.Collections; +import java.util.List; + +public class GenerationState { + private final Project project; + + + private BindingContext currentContext; + private final JetStandardLibrary standardLibrary; + + public GenerationState(Project project, boolean text) { + this.project = project; + this.standardLibrary = JetStandardLibrary.getJetStandardLibrary(project); + } + + public Project getProject() { + return project; + } + + + public BindingContext getContext() { + return currentContext; + } + + private void setContext(BindingContext context) { + this.currentContext = context; + } + + public JetStandardLibrary getStandardLibrary() { + return standardLibrary; + } + + public void compile(JetFile psiFile) { + final JetNamespace namespace = psiFile.getRootNamespace(); + final BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS).analyzeNamespace(namespace, JetControlFlowDataTraceFactory.EMPTY); + AnalyzingUtils.throwExceptionOnErrors(bindingContext); + compileCorrectNamespaces(bindingContext, Collections.singletonList(namespace)); + } + + public JsProgram compileCorrectNamespaces(BindingContext bindingContext, List namespaces) { + this.currentContext = bindingContext; + //TODO hardcoded + JsProgram result = new JsProgram("main"); + (new NamespaceTranslator(TranslationContext.rootContext(result, bindingContext), namespaces.get(0))).generateAst(); + return result; + } + +} diff --git a/src/org/jetbrains/k2js/translate/NamespaceTranslator.java b/src/org/jetbrains/k2js/translate/NamespaceTranslator.java new file mode 100644 index 00000000000..296a4c939f8 --- /dev/null +++ b/src/org/jetbrains/k2js/translate/NamespaceTranslator.java @@ -0,0 +1,53 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.util.AstUtil; +import org.jaxen.expr.Expr; +import org.jetbrains.jet.lang.psi.*; + +import java.beans.Expression; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Pavel.Talanov + */ +public class NamespaceTranslator extends AbstractTranslator { + + private final JetNamespace namespace; + + NamespaceTranslator(TranslationContext context, JetNamespace namespace) { + super(context); + this.namespace = namespace; + } + + JsProgram generateAst() { + translate(namespace); + return program(); + } + + public JsBlock translate(JetNamespace namespace) { + // TODO write namespace change logic + JsBlock block = program().getFragmentBlock(0); + JsFunction dummyFunc = newNamespace(namespace.getName()); + JsBlock namespaceBlock = new JsBlock(); + dummyFunc.setBody(namespaceBlock); + TranslationContext newContext = translationContext() + .newBlock(namespaceBlock).newScope(dummyFunc.getScope()).newNamespace(new JsNameRef(getJSName(namespace.getName()))); + DeclarationTranslator declarationTranslator = new DeclarationTranslator(newContext); + for (JetDeclaration declaration : namespace.getDeclarations()) { + namespaceBlock.addStatement(declarationTranslator.translateDeclaration(declaration)); + } + return block; + } + + public JsFunction newNamespace(String namespaceId) { + JsFunction result = new JsFunction(scope()); + List params = new ArrayList(); + params.add(new JsParameter(getJSName(namespaceId))); + result.setParameters(params); + JsExpression invocationParam = new JsNameRef(namespaceId); + block().addStatement(AstUtil.convertToStatement(AstUtil.newInvocation((result), invocationParam))); + return result; + } +} diff --git a/src/org/jetbrains/k2js/translate/OperationTranslator.java b/src/org/jetbrains/k2js/translate/OperationTranslator.java new file mode 100644 index 00000000000..95cfcce59d8 --- /dev/null +++ b/src/org/jetbrains/k2js/translate/OperationTranslator.java @@ -0,0 +1,36 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; +import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; +import com.google.dart.compiler.backend.js.ast.JsOperator; +import org.jetbrains.jet.lexer.JetToken; +import org.jetbrains.jet.lexer.JetTokens; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Talanov Pavel + */ +public final class OperationTranslator { + + + private static Map map = new HashMap(); + static { + map.put(JetTokens.PLUS, JsBinaryOperator.ADD); + map.put(JetTokens.MINUS, JsBinaryOperator.SUB); + map.put(JetTokens.MUL, JsBinaryOperator.MUL); + map.put(JetTokens.DIV, JsBinaryOperator.DIV); + } + + public static JsBinaryOperator getBinaryOperator(JetToken token) { + assert JetTokens.OPERATIONS.contains(token) : "Token should represent a binary operation!"; + JsOperator result = map.get(token); + if (result instanceof JsBinaryOperator) { + return (JsBinaryOperator)result; + } + throw new AssertionError("Invalid map"); + } + + +} diff --git a/src/org/jetbrains/k2js/translate/TranslationContext.java b/src/org/jetbrains/k2js/translate/TranslationContext.java new file mode 100644 index 00000000000..e6f1e492bef --- /dev/null +++ b/src/org/jetbrains/k2js/translate/TranslationContext.java @@ -0,0 +1,102 @@ +package org.jetbrains.k2js.translate; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.util.AstUtil; +import com.sun.xml.internal.ws.wsdl.writer.document.Binding; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.resolve.BindingContext; + +/** + * @author Talanov Pavel + */ +public class TranslationContext { + + private final JsBlock currentBlock; + private final JsNameRef currentNamespace; + private final JsProgram program; + private final BindingContext context; + private final JsScope enclosingScope; + private final ContextType type; + + + private TranslationContext(JsNameRef namespace, JsBlock block, JsProgram program, + BindingContext bindingContext, JsScope enclosingScope, ContextType type) { + assert block != null; + assert program != null; + assert bindingContext != null; + assert enclosingScope != null; + assert type != null; + this.currentBlock = block; + this.currentNamespace = namespace; + this.program = program; + this.context = bindingContext; + this.enclosingScope = enclosingScope; + this.type = type; + } + + @NotNull + public static TranslationContext rootContext(JsProgram program, BindingContext bindingContext) { + return new TranslationContext(null, program.getFragmentBlock(0), + program, bindingContext, program.getRootScope(), ContextType.NAMESPACE_BODY); + } + + //TODO implement correct factories + @NotNull + public TranslationContext newNamespace(JsNameRef newNamespace) { + return new TranslationContext(newNamespace, currentBlock, program, + context, enclosingScope, type); + } + + @NotNull + public TranslationContext newBlock(JsBlock newBlock) { + return new TranslationContext(currentNamespace, newBlock, program, + context, enclosingScope, type); + } + + @NotNull + public TranslationContext newScope(JsScope newScope) { + return new TranslationContext(currentNamespace, currentBlock, program, + context, newScope, type); + } + + @NotNull + public TranslationContext newType(ContextType newType) { + return new TranslationContext(currentNamespace, currentBlock, program, + context, enclosingScope, newType); + } + + @NotNull + public JsNameRef getQualifiedReference(JsName name) { + if (currentNamespace != null) { + return AstUtil.newNameRef(currentNamespace, name); + } + return new JsNameRef(name); + } + + @NotNull + public BindingContext bindingContext() { + return context; + } + + @NotNull + public JsProgram program() { + return program; + } + + @NotNull + JsScope scope() { + return enclosingScope; + } + + @NotNull + JsBlock block() { + return currentBlock; + } + + @NotNull + ContextType type() { + return type; + } + + +} diff --git a/test/com/google/dart/compiler/backend/js/Test.java b/test/com/google/dart/compiler/backend/js/Test.java new file mode 100644 index 00000000000..8e55a7b6671 --- /dev/null +++ b/test/com/google/dart/compiler/backend/js/Test.java @@ -0,0 +1,23 @@ +package com.google.dart.compiler.backend.js; + +import com.google.dart.compiler.backend.js.ast.*; +import com.google.dart.compiler.util.DefaultTextOutput; +import com.google.dart.compiler.util.TextOutput; + +public class Test { + + public static void main(String[] args) { + JsProgram program = new JsProgram("test"); + JsNumberLiteral number = program.getNumberLiteral(2443.3); + //JsGlobalBlock globalBlock = new JsGlobalBlock(number); + TextOutput output = new DefaultTextOutput(false); + JsNameRef varStatement = new JsNameRef("variable"); + JsBinaryOperation plus = new JsBinaryOperation(JsBinaryOperator.ADD, number, number); + JsBinaryOperation assign = new JsBinaryOperation(JsBinaryOperator.ASG, varStatement, plus); + + JsSourceGenerationVisitor sourceGenerator = + new JsSourceGenerationVisitor(output); + sourceGenerator.visit(assign, null); + System.out.println(output.toString()); + } +} diff --git a/test_files/test.kt b/test_files/test.kt new file mode 100644 index 00000000000..94629a58670 --- /dev/null +++ b/test_files/test.kt @@ -0,0 +1,19 @@ +namespace foo + +var a : Int = 2 +val b : Int = 235456 +var c : Int = 1324 +var myFavouriteName : Int = 1245 + +fun main() : Int { + return 5 +} + +fun eval(x : Int, y : String) : Int { + return (1456 - 34) * 5 +} + +fun olol(abab : Int) : Int { + var a : Int = 5 + return a +}