/** A valid JSR-14 Java program, which illustrates some corner-cases in * the 'smart lexer' lookahead implementation of the grammar. It should * compile correctly using a JSR-14 javac, as well as parse correctly * (no syntax errors) using the java15.cup grammar in this package. */ public class Test15 { Test15(T t) { } int a = 1, b = 2; C c1 = new C(), c2 = new C(), c3 = new C(); C cc2 = c2; C cc3 = c3; boolean d = a < b, e = a < b; int f[] = new int[5]; boolean g = a < f[1]; boolean h = ( a < f[1] ); Object i0 = (A) cc3; Object i = ( A < B[] > ) cc3; Object j = ( A < B > ) cc2; Object k = ( A < A < B[] > >) null; Object kk= ( A < A < B[] >>) null; Test15.H hh = null; { Test15.H hhh = null; for (boolean l=a m = c1; if (m instanceof C) a=a; for (boolean n = m instanceof C, o = a; cc3 instanceof C; n = m instanceof C, o = a) b=b; for (;m instanceof C;) a=a; if (a < b >> 1) ; Object o1 = new A>(), o2 = new A>>(), o3 = new A>>>(); // new, "explicit parameter" version of method invocation. A aa = Test15.>foo(); /* although the spec says this should work: A aa_ = >foo(); * Neal Gafter has assured me that this is a bug in the spec. * Type arguments are only valid after a dot. */ // "explicit parameters" with constructor invocations. new K("xh"); // prototype 2.2 chokes on this. this.new K("xh"); } static class A { T t; } static class B { } static class C extends A { } static class D { } static class E> { } static interface F { } // wildcard bounds. static class G { A a; A> b; } class H { } static class I extends A { } static class J extends A { } class K { K(T t) { Test15.foo(); } } static T foo() { return null; } }