// Parse test: exercise all productions in my grammar class ParseTest { public static void main(String[] a){ { System.out.println(0); System.out.println(1); } } } class EmptyClass { } class VarClass { int i; int[] a; boolean b; EmptyClass c; } class MethodClass { public int aMethod() { return 0; } public int[] aMethod2(int i) { return new int[i]; } public EmptyClass aMethod3(int i, boolean b, int[] a, EmptyClass c) { return c; } } class InheritedClass extends EmptyClass { int aMember; public int aMethod(int value) { // All possible var decls int i; int[] a; boolean b; EmptyClass c; // All possible statement types a = new int[value]; a[i] = value; if (b) System.out.println(0); else {} while (i < 10) i = i+1; // All possible expression types, one at a time i = value; b = true; b = false; b = (i < 10 && i < 20 && !b); a = new int[value]; i = 1 + 2 - 3; i = i * i; i = a.length; i = c.method().method(1).method(1,2)[0]; c = new EmptyClass(); c = this; return i+1; } // Test precedence and associativity public int TestExp() { boolean b; EmptyClass c; b = !false && 1*1 + 1 + 1 - 2*2 - 2 < 1 + c.method()[0] && true; return 0; } }